gastromemories-api-client
Advanced tools
Comparing version 1.0.18 to 1.0.19
@@ -10,6 +10,8 @@ export declare class ImagesClient { | ||
protected processCreateImage(response: Response): Promise<string>; | ||
deleteImage(id: string): Promise<void>; | ||
protected processDeleteImage(response: Response): Promise<void>; | ||
getImage(id: string): Promise<ImageDto>; | ||
protected processGetImage(response: Response): Promise<ImageDto>; | ||
createUploadUrlForImage(id: string): Promise<ImageUploadUrlDto>; | ||
protected processCreateUploadUrlForImage(response: Response): Promise<ImageUploadUrlDto>; | ||
getImage(id: string): Promise<ImageDto>; | ||
protected processGetImage(response: Response): Promise<ImageDto>; | ||
} | ||
@@ -27,6 +29,8 @@ export declare class MemoriesClient { | ||
protected processGetMemoriesWithPagination(response: Response): Promise<PaginatedListOfMemoryDto>; | ||
deleteMemory(id: string): Promise<void>; | ||
protected processDeleteMemory(response: Response): Promise<void>; | ||
getMemory(id: string): Promise<MemoryDto>; | ||
protected processGetMemory(response: Response): Promise<MemoryDto>; | ||
getMemoryImageUploadUrl(id: string): Promise<MemoryImageUploadUrlDto>; | ||
protected processGetMemoryImageUploadUrl(response: Response): Promise<MemoryImageUploadUrlDto>; | ||
getMemory(id: string): Promise<MemoryDto>; | ||
protected processGetMemory(response: Response): Promise<MemoryDto>; | ||
} | ||
@@ -33,0 +37,0 @@ export declare class TodoItemsClient { |
@@ -73,5 +73,5 @@ "use strict"; | ||
}; | ||
ImagesClient.prototype.createUploadUrlForImage = function (id) { | ||
ImagesClient.prototype.deleteImage = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Images/{id}/upload-url"; | ||
var url_ = this.baseUrl + "/api/Images/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -82,3 +82,37 @@ throw new Error("The parameter 'id' must be defined."); | ||
var options_ = { | ||
method: "POST", | ||
method: "DELETE", | ||
headers: {} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processDeleteImage(_response); | ||
}); | ||
}; | ||
ImagesClient.prototype.processDeleteImage = function (response) { | ||
var status = response.status; | ||
var _headers = {}; | ||
if (response.headers && response.headers.forEach) { | ||
response.headers.forEach(function (v, k) { return _headers[k] = v; }); | ||
} | ||
; | ||
if (status === 200) { | ||
return response.text().then(function (_responseText) { | ||
return; | ||
}); | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve(null); | ||
}; | ||
ImagesClient.prototype.getImage = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Images/{id}"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var options_ = { | ||
method: "GET", | ||
headers: { | ||
@@ -89,6 +123,6 @@ "Accept": "application/json" | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processCreateUploadUrlForImage(_response); | ||
return _this.processGetImage(_response); | ||
}); | ||
}; | ||
ImagesClient.prototype.processCreateUploadUrlForImage = function (response) { | ||
ImagesClient.prototype.processGetImage = function (response) { | ||
var _this = this; | ||
@@ -105,3 +139,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = ImageUploadUrlDto.fromJS(resultData200); | ||
result200 = ImageDto.fromJS(resultData200); | ||
return result200; | ||
@@ -117,5 +151,5 @@ }); | ||
}; | ||
ImagesClient.prototype.getImage = function (id) { | ||
ImagesClient.prototype.createUploadUrlForImage = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Images/{id}"; | ||
var url_ = this.baseUrl + "/api/Images/{id}/upload-url"; | ||
if (id === undefined || id === null) | ||
@@ -126,3 +160,3 @@ throw new Error("The parameter 'id' must be defined."); | ||
var options_ = { | ||
method: "GET", | ||
method: "POST", | ||
headers: { | ||
@@ -133,6 +167,6 @@ "Accept": "application/json" | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processGetImage(_response); | ||
return _this.processCreateUploadUrlForImage(_response); | ||
}); | ||
}; | ||
ImagesClient.prototype.processGetImage = function (response) { | ||
ImagesClient.prototype.processCreateUploadUrlForImage = function (response) { | ||
var _this = this; | ||
@@ -149,3 +183,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = ImageDto.fromJS(resultData200); | ||
result200 = ImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
@@ -271,5 +305,5 @@ }); | ||
}; | ||
MemoriesClient.prototype.getMemoryImageUploadUrl = function (id) { | ||
MemoriesClient.prototype.deleteMemory = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Memories/{id}/image-upload-url"; | ||
var url_ = this.baseUrl + "/api/Memories/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -280,3 +314,37 @@ throw new Error("The parameter 'id' must be defined."); | ||
var options_ = { | ||
method: "POST", | ||
method: "DELETE", | ||
headers: {} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processDeleteMemory(_response); | ||
}); | ||
}; | ||
MemoriesClient.prototype.processDeleteMemory = function (response) { | ||
var status = response.status; | ||
var _headers = {}; | ||
if (response.headers && response.headers.forEach) { | ||
response.headers.forEach(function (v, k) { return _headers[k] = v; }); | ||
} | ||
; | ||
if (status === 200) { | ||
return response.text().then(function (_responseText) { | ||
return; | ||
}); | ||
} | ||
else if (status !== 200 && status !== 204) { | ||
return response.text().then(function (_responseText) { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve(null); | ||
}; | ||
MemoriesClient.prototype.getMemory = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Memories/{id}"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var options_ = { | ||
method: "GET", | ||
headers: { | ||
@@ -287,6 +355,6 @@ "Accept": "application/json" | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processGetMemoryImageUploadUrl(_response); | ||
return _this.processGetMemory(_response); | ||
}); | ||
}; | ||
MemoriesClient.prototype.processGetMemoryImageUploadUrl = function (response) { | ||
MemoriesClient.prototype.processGetMemory = function (response) { | ||
var _this = this; | ||
@@ -303,3 +371,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = MemoryImageUploadUrlDto.fromJS(resultData200); | ||
result200 = MemoryDto.fromJS(resultData200); | ||
return result200; | ||
@@ -315,5 +383,5 @@ }); | ||
}; | ||
MemoriesClient.prototype.getMemory = function (id) { | ||
MemoriesClient.prototype.getMemoryImageUploadUrl = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/Memories/{id}"; | ||
var url_ = this.baseUrl + "/api/Memories/{id}/image-upload-url"; | ||
if (id === undefined || id === null) | ||
@@ -324,3 +392,3 @@ throw new Error("The parameter 'id' must be defined."); | ||
var options_ = { | ||
method: "GET", | ||
method: "POST", | ||
headers: { | ||
@@ -331,6 +399,6 @@ "Accept": "application/json" | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processGetMemory(_response); | ||
return _this.processGetMemoryImageUploadUrl(_response); | ||
}); | ||
}; | ||
MemoriesClient.prototype.processGetMemory = function (response) { | ||
MemoriesClient.prototype.processGetMemoryImageUploadUrl = function (response) { | ||
var _this = this; | ||
@@ -347,3 +415,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = MemoryDto.fromJS(resultData200); | ||
result200 = MemoryImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
@@ -350,0 +418,0 @@ }); |
110
index.ts
@@ -60,4 +60,4 @@ //---------------------- | ||
createUploadUrlForImage(id: string): Promise<ImageUploadUrlDto> { | ||
let url_ = this.baseUrl + "/api/Images/{id}/upload-url"; | ||
deleteImage(id: string): Promise<void> { | ||
let url_ = this.baseUrl + "/api/Images/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -69,5 +69,4 @@ throw new Error("The parameter 'id' must be defined."); | ||
let options_: RequestInit = { | ||
method: "POST", | ||
method: "DELETE", | ||
headers: { | ||
"Accept": "application/json" | ||
} | ||
@@ -77,7 +76,7 @@ }; | ||
return this.http.fetch(url_, options_).then((_response: Response) => { | ||
return this.processCreateUploadUrlForImage(_response); | ||
return this.processDeleteImage(_response); | ||
}); | ||
} | ||
protected processCreateUploadUrlForImage(response: Response): Promise<ImageUploadUrlDto> { | ||
protected processDeleteImage(response: Response): Promise<void> { | ||
const status = response.status; | ||
@@ -87,6 +86,3 @@ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; | ||
return response.text().then((_responseText) => { | ||
let result200: any = null; | ||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); | ||
result200 = ImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
return; | ||
}); | ||
@@ -98,3 +94,3 @@ } else if (status !== 200 && status !== 204) { | ||
} | ||
return Promise.resolve<ImageUploadUrlDto>(null as any); | ||
return Promise.resolve<void>(null as any); | ||
} | ||
@@ -138,2 +134,39 @@ | ||
} | ||
createUploadUrlForImage(id: string): Promise<ImageUploadUrlDto> { | ||
let url_ = this.baseUrl + "/api/Images/{id}/upload-url"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
let options_: RequestInit = { | ||
method: "POST", | ||
headers: { | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then((_response: Response) => { | ||
return this.processCreateUploadUrlForImage(_response); | ||
}); | ||
} | ||
protected processCreateUploadUrlForImage(response: Response): Promise<ImageUploadUrlDto> { | ||
const status = response.status; | ||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; | ||
if (status === 200) { | ||
return response.text().then((_responseText) => { | ||
let result200: any = null; | ||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); | ||
result200 = ImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
}); | ||
} else if (status !== 200 && status !== 204) { | ||
return response.text().then((_responseText) => { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve<ImageUploadUrlDto>(null as any); | ||
} | ||
} | ||
@@ -248,4 +281,4 @@ | ||
getMemoryImageUploadUrl(id: string): Promise<MemoryImageUploadUrlDto> { | ||
let url_ = this.baseUrl + "/api/Memories/{id}/image-upload-url"; | ||
deleteMemory(id: string): Promise<void> { | ||
let url_ = this.baseUrl + "/api/Memories/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -257,5 +290,4 @@ throw new Error("The parameter 'id' must be defined."); | ||
let options_: RequestInit = { | ||
method: "POST", | ||
method: "DELETE", | ||
headers: { | ||
"Accept": "application/json" | ||
} | ||
@@ -265,7 +297,7 @@ }; | ||
return this.http.fetch(url_, options_).then((_response: Response) => { | ||
return this.processGetMemoryImageUploadUrl(_response); | ||
return this.processDeleteMemory(_response); | ||
}); | ||
} | ||
protected processGetMemoryImageUploadUrl(response: Response): Promise<MemoryImageUploadUrlDto> { | ||
protected processDeleteMemory(response: Response): Promise<void> { | ||
const status = response.status; | ||
@@ -275,6 +307,3 @@ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; | ||
return response.text().then((_responseText) => { | ||
let result200: any = null; | ||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); | ||
result200 = MemoryImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
return; | ||
}); | ||
@@ -286,3 +315,3 @@ } else if (status !== 200 && status !== 204) { | ||
} | ||
return Promise.resolve<MemoryImageUploadUrlDto>(null as any); | ||
return Promise.resolve<void>(null as any); | ||
} | ||
@@ -326,2 +355,39 @@ | ||
} | ||
getMemoryImageUploadUrl(id: string): Promise<MemoryImageUploadUrlDto> { | ||
let url_ = this.baseUrl + "/api/Memories/{id}/image-upload-url"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
let options_: RequestInit = { | ||
method: "POST", | ||
headers: { | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then((_response: Response) => { | ||
return this.processGetMemoryImageUploadUrl(_response); | ||
}); | ||
} | ||
protected processGetMemoryImageUploadUrl(response: Response): Promise<MemoryImageUploadUrlDto> { | ||
const status = response.status; | ||
let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); }; | ||
if (status === 200) { | ||
return response.text().then((_responseText) => { | ||
let result200: any = null; | ||
let resultData200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver); | ||
result200 = MemoryImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
}); | ||
} else if (status !== 200 && status !== 204) { | ||
return response.text().then((_responseText) => { | ||
return throwException("An unexpected server error occurred.", status, _responseText, _headers); | ||
}); | ||
} | ||
return Promise.resolve<MemoryImageUploadUrlDto>(null as any); | ||
} | ||
} | ||
@@ -328,0 +394,0 @@ |
{ | ||
"name": "gastromemories-api-client", | ||
"version": "1.0.18", | ||
"version": "1.0.19", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99065
2518