gastromemories-api-client
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -1,2 +0,2 @@ | ||
export declare class Client { | ||
export declare class MemoriesClient { | ||
private http; | ||
@@ -8,6 +8,22 @@ private baseUrl; | ||
}); | ||
createMemory(command: CreateMemoryCommand): Promise<string>; | ||
protected processCreateMemory(response: Response): Promise<string>; | ||
getMemoriesWithPagination(pageNumber: number, pageSize: number): Promise<PaginatedListOfMemoryDto>; | ||
protected processGetMemoriesWithPagination(response: Response): Promise<PaginatedListOfMemoryDto>; | ||
getMemoryImageUploadUrl(id: string): Promise<MemoryImageUploadUrlDto>; | ||
protected processGetMemoryImageUploadUrl(response: Response): Promise<MemoryImageUploadUrlDto>; | ||
getMemory(id: string): Promise<MemoryDto>; | ||
protected processGetMemory(response: Response): Promise<MemoryDto>; | ||
} | ||
export declare class TodoItemsClient { | ||
private http; | ||
private baseUrl; | ||
protected jsonParseReviver: ((key: string, value: any) => any) | undefined; | ||
constructor(baseUrl?: string, http?: { | ||
fetch(url: RequestInfo, init?: RequestInit): Promise<Response>; | ||
}); | ||
getTodoItemsWithPagination(listId: number, pageNumber: number, pageSize: number): Promise<PaginatedListOfTodoItemBriefDto>; | ||
protected processGetTodoItemsWithPagination(response: Response): Promise<PaginatedListOfTodoItemBriefDto>; | ||
createTodoItem(command: CreateTodoItemCommand): Promise<number>; | ||
protected processCreateTodoItem(response: Response): Promise<number>; | ||
createTodoItem(command: CreateTodoItemCommand): Promise<string>; | ||
protected processCreateTodoItem(response: Response): Promise<string>; | ||
updateTodoItem(id: number, command: UpdateTodoItemCommand): Promise<void>; | ||
@@ -19,11 +35,67 @@ protected processUpdateTodoItem(response: Response): Promise<void>; | ||
protected processUpdateTodoItemDetail(response: Response): Promise<void>; | ||
getTodoLists(): Promise<TodosVm>; | ||
protected processGetTodoLists(response: Response): Promise<TodosVm>; | ||
createTodoList(command: CreateTodoListCommand): Promise<number>; | ||
protected processCreateTodoList(response: Response): Promise<number>; | ||
updateTodoList(id: number, command: UpdateTodoListCommand): Promise<void>; | ||
protected processUpdateTodoList(response: Response): Promise<void>; | ||
deleteTodoList(id: number): Promise<void>; | ||
protected processDeleteTodoList(response: Response): Promise<void>; | ||
} | ||
export declare class CreateMemoryCommand implements ICreateMemoryCommand { | ||
constructor(data?: ICreateMemoryCommand); | ||
init(_data?: any): void; | ||
static fromJS(data: any): CreateMemoryCommand; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ICreateMemoryCommand { | ||
} | ||
export declare class MemoryImageUploadUrlDto implements IMemoryImageUploadUrlDto { | ||
imageUploadUrl?: string; | ||
constructor(data?: IMemoryImageUploadUrlDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): MemoryImageUploadUrlDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface IMemoryImageUploadUrlDto { | ||
imageUploadUrl?: string; | ||
} | ||
export declare class MemoryDto implements IMemoryDto { | ||
id?: string; | ||
ownerId?: string; | ||
imageUrl?: string | undefined; | ||
userSpecifiedTags?: string[] | undefined; | ||
suggestedTags?: string[] | undefined; | ||
note?: string | undefined; | ||
latitude?: number | undefined; | ||
longitude?: number | undefined; | ||
tastinessScore?: number | undefined; | ||
constructor(data?: IMemoryDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): MemoryDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface IMemoryDto { | ||
id?: string; | ||
ownerId?: string; | ||
imageUrl?: string | undefined; | ||
userSpecifiedTags?: string[] | undefined; | ||
suggestedTags?: string[] | undefined; | ||
note?: string | undefined; | ||
latitude?: number | undefined; | ||
longitude?: number | undefined; | ||
tastinessScore?: number | undefined; | ||
} | ||
export declare class PaginatedListOfMemoryDto implements IPaginatedListOfMemoryDto { | ||
items?: MemoryDto[]; | ||
pageNumber?: number; | ||
totalPages?: number; | ||
totalCount?: number; | ||
hasPreviousPage?: boolean; | ||
hasNextPage?: boolean; | ||
constructor(data?: IPaginatedListOfMemoryDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): PaginatedListOfMemoryDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface IPaginatedListOfMemoryDto { | ||
items?: MemoryDto[]; | ||
pageNumber?: number; | ||
totalPages?: number; | ||
totalCount?: number; | ||
hasPreviousPage?: boolean; | ||
hasNextPage?: boolean; | ||
} | ||
export declare class PaginatedListOfTodoItemBriefDto implements IPaginatedListOfTodoItemBriefDto { | ||
@@ -113,84 +185,2 @@ items?: TodoItemBriefDto[]; | ||
} | ||
export declare class TodosVm implements ITodosVm { | ||
priorityLevels?: LookupDto[]; | ||
lists?: TodoListDto[]; | ||
constructor(data?: ITodosVm); | ||
init(_data?: any): void; | ||
static fromJS(data: any): TodosVm; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ITodosVm { | ||
priorityLevels?: LookupDto[]; | ||
lists?: TodoListDto[]; | ||
} | ||
export declare class LookupDto implements ILookupDto { | ||
id?: number; | ||
title?: string | undefined; | ||
constructor(data?: ILookupDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): LookupDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ILookupDto { | ||
id?: number; | ||
title?: string | undefined; | ||
} | ||
export declare class TodoListDto implements ITodoListDto { | ||
id?: number; | ||
title?: string | undefined; | ||
colour?: string | undefined; | ||
items?: TodoItemDto[]; | ||
constructor(data?: ITodoListDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): TodoListDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ITodoListDto { | ||
id?: number; | ||
title?: string | undefined; | ||
colour?: string | undefined; | ||
items?: TodoItemDto[]; | ||
} | ||
export declare class TodoItemDto implements ITodoItemDto { | ||
id?: number; | ||
listId?: number; | ||
title?: string | undefined; | ||
done?: boolean; | ||
priority?: number; | ||
note?: string | undefined; | ||
constructor(data?: ITodoItemDto); | ||
init(_data?: any): void; | ||
static fromJS(data: any): TodoItemDto; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ITodoItemDto { | ||
id?: number; | ||
listId?: number; | ||
title?: string | undefined; | ||
done?: boolean; | ||
priority?: number; | ||
note?: string | undefined; | ||
} | ||
export declare class CreateTodoListCommand implements ICreateTodoListCommand { | ||
title?: string | undefined; | ||
constructor(data?: ICreateTodoListCommand); | ||
init(_data?: any): void; | ||
static fromJS(data: any): CreateTodoListCommand; | ||
toJSON(data?: any): any; | ||
} | ||
export interface ICreateTodoListCommand { | ||
title?: string | undefined; | ||
} | ||
export declare class UpdateTodoListCommand implements IUpdateTodoListCommand { | ||
id?: number; | ||
title?: string | undefined; | ||
constructor(data?: IUpdateTodoListCommand); | ||
init(_data?: any): void; | ||
static fromJS(data: any): UpdateTodoListCommand; | ||
toJSON(data?: any): any; | ||
} | ||
export interface IUpdateTodoListCommand { | ||
id?: number; | ||
title?: string | undefined; | ||
} | ||
export declare class ApiException extends Error { | ||
@@ -197,0 +187,0 @@ message: string; |
@@ -23,31 +23,22 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ApiException = exports.UpdateTodoListCommand = exports.CreateTodoListCommand = exports.TodoItemDto = exports.TodoListDto = exports.LookupDto = exports.TodosVm = exports.PriorityLevel = exports.UpdateTodoItemDetailCommand = exports.UpdateTodoItemCommand = exports.CreateTodoItemCommand = exports.TodoItemBriefDto = exports.PaginatedListOfTodoItemBriefDto = exports.Client = void 0; | ||
exports.ApiException = exports.PriorityLevel = exports.UpdateTodoItemDetailCommand = exports.UpdateTodoItemCommand = exports.CreateTodoItemCommand = exports.TodoItemBriefDto = exports.PaginatedListOfTodoItemBriefDto = exports.PaginatedListOfMemoryDto = exports.MemoryDto = exports.MemoryImageUploadUrlDto = exports.CreateMemoryCommand = exports.TodoItemsClient = exports.MemoriesClient = void 0; | ||
/* tslint:disable */ | ||
/* eslint-disable */ | ||
// ReSharper disable InconsistentNaming | ||
var Client = /** @class */ (function () { | ||
function Client(baseUrl, http) { | ||
var MemoriesClient = /** @class */ (function () { | ||
function MemoriesClient(baseUrl, http) { | ||
this.jsonParseReviver = undefined; | ||
this.http = http ? http : window; | ||
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : ""; | ||
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "http://localhost:5000"; | ||
} | ||
Client.prototype.getTodoItemsWithPagination = function (listId, pageNumber, pageSize) { | ||
MemoriesClient.prototype.createMemory = function (command) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoItems?"; | ||
if (listId === undefined || listId === null) | ||
throw new Error("The parameter 'listId' must be defined and cannot be null."); | ||
else | ||
url_ += "ListId=" + encodeURIComponent("" + listId) + "&"; | ||
if (pageNumber === undefined || pageNumber === null) | ||
throw new Error("The parameter 'pageNumber' must be defined and cannot be null."); | ||
else | ||
url_ += "PageNumber=" + encodeURIComponent("" + pageNumber) + "&"; | ||
if (pageSize === undefined || pageSize === null) | ||
throw new Error("The parameter 'pageSize' must be defined and cannot be null."); | ||
else | ||
url_ += "PageSize=" + encodeURIComponent("" + pageSize) + "&"; | ||
var url_ = this.baseUrl + "/api/Memories"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
method: "GET", | ||
body: content_, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
@@ -57,6 +48,6 @@ } | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processGetTodoItemsWithPagination(_response); | ||
return _this.processCreateMemory(_response); | ||
}); | ||
}; | ||
Client.prototype.processGetTodoItemsWithPagination = function (response) { | ||
MemoriesClient.prototype.processCreateMemory = function (response) { | ||
var _this = this; | ||
@@ -73,3 +64,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = PaginatedListOfTodoItemBriefDto.fromJS(resultData200); | ||
result200 = resultData200 !== undefined ? resultData200 : null; | ||
return result200; | ||
@@ -85,12 +76,17 @@ }); | ||
}; | ||
Client.prototype.createTodoItem = function (command) { | ||
MemoriesClient.prototype.getMemoriesWithPagination = function (pageNumber, pageSize) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoItems"; | ||
var url_ = this.baseUrl + "/api/Memories?"; | ||
if (pageNumber === undefined || pageNumber === null) | ||
throw new Error("The parameter 'pageNumber' must be defined and cannot be null."); | ||
else | ||
url_ += "PageNumber=" + encodeURIComponent("" + pageNumber) + "&"; | ||
if (pageSize === undefined || pageSize === null) | ||
throw new Error("The parameter 'pageSize' must be defined and cannot be null."); | ||
else | ||
url_ += "PageSize=" + encodeURIComponent("" + pageSize) + "&"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
body: content_, | ||
method: "POST", | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
@@ -100,6 +96,6 @@ } | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processCreateTodoItem(_response); | ||
return _this.processGetMemoriesWithPagination(_response); | ||
}); | ||
}; | ||
Client.prototype.processCreateTodoItem = function (response) { | ||
MemoriesClient.prototype.processGetMemoriesWithPagination = function (response) { | ||
var _this = this; | ||
@@ -116,3 +112,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = resultData200 !== undefined ? resultData200 : null; | ||
result200 = PaginatedListOfMemoryDto.fromJS(resultData200); | ||
return result200; | ||
@@ -128,5 +124,5 @@ }); | ||
}; | ||
Client.prototype.updateTodoItem = function (id, command) { | ||
MemoriesClient.prototype.getMemoryImageUploadUrl = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoItems/{id}"; | ||
var url_ = this.baseUrl + "/api/Memories/{id}/image-upload-url"; | ||
if (id === undefined || id === null) | ||
@@ -136,15 +132,14 @@ throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
body: content_, | ||
method: "PUT", | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processUpdateTodoItem(_response); | ||
return _this.processGetMemoryImageUploadUrl(_response); | ||
}); | ||
}; | ||
Client.prototype.processUpdateTodoItem = function (response) { | ||
MemoriesClient.prototype.processGetMemoryImageUploadUrl = function (response) { | ||
var _this = this; | ||
var status = response.status; | ||
@@ -158,3 +153,6 @@ var _headers = {}; | ||
return response.text().then(function (_responseText) { | ||
return; | ||
var result200 = null; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = MemoryImageUploadUrlDto.fromJS(resultData200); | ||
return result200; | ||
}); | ||
@@ -169,5 +167,5 @@ } | ||
}; | ||
Client.prototype.deleteTodoItem = function (id) { | ||
MemoriesClient.prototype.getMemory = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoItems/{id}"; | ||
var url_ = this.baseUrl + "/api/Memories/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -178,10 +176,13 @@ throw new Error("The parameter 'id' must be defined."); | ||
var options_ = { | ||
method: "DELETE", | ||
headers: {} | ||
method: "GET", | ||
headers: { | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processDeleteTodoItem(_response); | ||
return _this.processGetMemory(_response); | ||
}); | ||
}; | ||
Client.prototype.processDeleteTodoItem = function (response) { | ||
MemoriesClient.prototype.processGetMemory = function (response) { | ||
var _this = this; | ||
var status = response.status; | ||
@@ -195,3 +196,6 @@ var _headers = {}; | ||
return response.text().then(function (_responseText) { | ||
return; | ||
var result200 = null; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = MemoryDto.fromJS(resultData200); | ||
return result200; | ||
}); | ||
@@ -206,22 +210,39 @@ } | ||
}; | ||
Client.prototype.updateTodoItemDetail = function (id, command) { | ||
return MemoriesClient; | ||
}()); | ||
exports.MemoriesClient = MemoriesClient; | ||
var TodoItemsClient = /** @class */ (function () { | ||
function TodoItemsClient(baseUrl, http) { | ||
this.jsonParseReviver = undefined; | ||
this.http = http ? http : window; | ||
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "http://localhost:5000"; | ||
} | ||
TodoItemsClient.prototype.getTodoItemsWithPagination = function (listId, pageNumber, pageSize) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoItems/UpdateDetail/{id}"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
var url_ = this.baseUrl + "/api/TodoItems?"; | ||
if (listId === undefined || listId === null) | ||
throw new Error("The parameter 'listId' must be defined and cannot be null."); | ||
else | ||
url_ += "ListId=" + encodeURIComponent("" + listId) + "&"; | ||
if (pageNumber === undefined || pageNumber === null) | ||
throw new Error("The parameter 'pageNumber' must be defined and cannot be null."); | ||
else | ||
url_ += "PageNumber=" + encodeURIComponent("" + pageNumber) + "&"; | ||
if (pageSize === undefined || pageSize === null) | ||
throw new Error("The parameter 'pageSize' must be defined and cannot be null."); | ||
else | ||
url_ += "PageSize=" + encodeURIComponent("" + pageSize) + "&"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
body: content_, | ||
method: "PUT", | ||
method: "GET", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processUpdateTodoItemDetail(_response); | ||
return _this.processGetTodoItemsWithPagination(_response); | ||
}); | ||
}; | ||
Client.prototype.processUpdateTodoItemDetail = function (response) { | ||
TodoItemsClient.prototype.processGetTodoItemsWithPagination = function (response) { | ||
var _this = this; | ||
var status = response.status; | ||
@@ -235,3 +256,6 @@ var _headers = {}; | ||
return response.text().then(function (_responseText) { | ||
return; | ||
var result200 = null; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = PaginatedListOfTodoItemBriefDto.fromJS(resultData200); | ||
return result200; | ||
}); | ||
@@ -246,9 +270,12 @@ } | ||
}; | ||
Client.prototype.getTodoLists = function () { | ||
TodoItemsClient.prototype.createTodoItem = function (command) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoLists"; | ||
var url_ = this.baseUrl + "/api/TodoItems"; | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
method: "GET", | ||
body: content_, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
@@ -258,6 +285,6 @@ } | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processGetTodoLists(_response); | ||
return _this.processCreateTodoItem(_response); | ||
}); | ||
}; | ||
Client.prototype.processGetTodoLists = function (response) { | ||
TodoItemsClient.prototype.processCreateTodoItem = function (response) { | ||
var _this = this; | ||
@@ -274,3 +301,3 @@ var status = response.status; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = TodosVm.fromJS(resultData200); | ||
result200 = resultData200 !== undefined ? resultData200 : null; | ||
return result200; | ||
@@ -286,5 +313,8 @@ }); | ||
}; | ||
Client.prototype.createTodoList = function (command) { | ||
TodoItemsClient.prototype.updateTodoItem = function (id, command) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoLists"; | ||
var url_ = this.baseUrl + "/api/TodoItems/{id}"; | ||
if (id === undefined || id === null) | ||
throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace("{id}", encodeURIComponent("" + id)); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
@@ -294,14 +324,12 @@ var content_ = JSON.stringify(command); | ||
body: content_, | ||
method: "POST", | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/json", | ||
"Accept": "application/json" | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processCreateTodoList(_response); | ||
return _this.processUpdateTodoItem(_response); | ||
}); | ||
}; | ||
Client.prototype.processCreateTodoList = function (response) { | ||
var _this = this; | ||
TodoItemsClient.prototype.processUpdateTodoItem = function (response) { | ||
var status = response.status; | ||
@@ -315,6 +343,3 @@ var _headers = {}; | ||
return response.text().then(function (_responseText) { | ||
var result200 = null; | ||
var resultData200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver); | ||
result200 = resultData200 !== undefined ? resultData200 : null; | ||
return result200; | ||
return; | ||
}); | ||
@@ -329,5 +354,5 @@ } | ||
}; | ||
Client.prototype.updateTodoList = function (id, command) { | ||
TodoItemsClient.prototype.deleteTodoItem = function (id) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoLists/{id}"; | ||
var url_ = this.baseUrl + "/api/TodoItems/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -337,15 +362,11 @@ throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
body: content_, | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/json", | ||
} | ||
method: "DELETE", | ||
headers: {} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processUpdateTodoList(_response); | ||
return _this.processDeleteTodoItem(_response); | ||
}); | ||
}; | ||
Client.prototype.processUpdateTodoList = function (response) { | ||
TodoItemsClient.prototype.processDeleteTodoItem = function (response) { | ||
var status = response.status; | ||
@@ -369,5 +390,5 @@ var _headers = {}; | ||
}; | ||
Client.prototype.deleteTodoList = function (id) { | ||
TodoItemsClient.prototype.updateTodoItemDetail = function (id, command) { | ||
var _this = this; | ||
var url_ = this.baseUrl + "/api/TodoLists/{id}"; | ||
var url_ = this.baseUrl + "/api/TodoItems/UpdateDetail/{id}"; | ||
if (id === undefined || id === null) | ||
@@ -377,11 +398,15 @@ throw new Error("The parameter 'id' must be defined."); | ||
url_ = url_.replace(/[?&]$/, ""); | ||
var content_ = JSON.stringify(command); | ||
var options_ = { | ||
method: "DELETE", | ||
headers: {} | ||
body: content_, | ||
method: "PUT", | ||
headers: { | ||
"Content-Type": "application/json", | ||
} | ||
}; | ||
return this.http.fetch(url_, options_).then(function (_response) { | ||
return _this.processDeleteTodoList(_response); | ||
return _this.processUpdateTodoItemDetail(_response); | ||
}); | ||
}; | ||
Client.prototype.processDeleteTodoList = function (response) { | ||
TodoItemsClient.prototype.processUpdateTodoItemDetail = function (response) { | ||
var status = response.status; | ||
@@ -405,5 +430,175 @@ var _headers = {}; | ||
}; | ||
return Client; | ||
return TodoItemsClient; | ||
}()); | ||
exports.Client = Client; | ||
exports.TodoItemsClient = TodoItemsClient; | ||
var CreateMemoryCommand = /** @class */ (function () { | ||
function CreateMemoryCommand(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
CreateMemoryCommand.prototype.init = function (_data) { | ||
}; | ||
CreateMemoryCommand.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new CreateMemoryCommand(); | ||
result.init(data); | ||
return result; | ||
}; | ||
CreateMemoryCommand.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
return data; | ||
}; | ||
return CreateMemoryCommand; | ||
}()); | ||
exports.CreateMemoryCommand = CreateMemoryCommand; | ||
var MemoryImageUploadUrlDto = /** @class */ (function () { | ||
function MemoryImageUploadUrlDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
MemoryImageUploadUrlDto.prototype.init = function (_data) { | ||
if (_data) { | ||
this.imageUploadUrl = _data["imageUploadUrl"]; | ||
} | ||
}; | ||
MemoryImageUploadUrlDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new MemoryImageUploadUrlDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
MemoryImageUploadUrlDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["imageUploadUrl"] = this.imageUploadUrl; | ||
return data; | ||
}; | ||
return MemoryImageUploadUrlDto; | ||
}()); | ||
exports.MemoryImageUploadUrlDto = MemoryImageUploadUrlDto; | ||
var MemoryDto = /** @class */ (function () { | ||
function MemoryDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
MemoryDto.prototype.init = function (_data) { | ||
if (_data) { | ||
this.id = _data["id"]; | ||
this.ownerId = _data["ownerId"]; | ||
this.imageUrl = _data["imageUrl"]; | ||
if (Array.isArray(_data["userSpecifiedTags"])) { | ||
this.userSpecifiedTags = []; | ||
for (var _i = 0, _a = _data["userSpecifiedTags"]; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
this.userSpecifiedTags.push(item); | ||
} | ||
} | ||
if (Array.isArray(_data["suggestedTags"])) { | ||
this.suggestedTags = []; | ||
for (var _b = 0, _c = _data["suggestedTags"]; _b < _c.length; _b++) { | ||
var item = _c[_b]; | ||
this.suggestedTags.push(item); | ||
} | ||
} | ||
this.note = _data["note"]; | ||
this.latitude = _data["latitude"]; | ||
this.longitude = _data["longitude"]; | ||
this.tastinessScore = _data["tastinessScore"]; | ||
} | ||
}; | ||
MemoryDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new MemoryDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
MemoryDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["id"] = this.id; | ||
data["ownerId"] = this.ownerId; | ||
data["imageUrl"] = this.imageUrl; | ||
if (Array.isArray(this.userSpecifiedTags)) { | ||
data["userSpecifiedTags"] = []; | ||
for (var _i = 0, _a = this.userSpecifiedTags; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
data["userSpecifiedTags"].push(item); | ||
} | ||
} | ||
if (Array.isArray(this.suggestedTags)) { | ||
data["suggestedTags"] = []; | ||
for (var _b = 0, _c = this.suggestedTags; _b < _c.length; _b++) { | ||
var item = _c[_b]; | ||
data["suggestedTags"].push(item); | ||
} | ||
} | ||
data["note"] = this.note; | ||
data["latitude"] = this.latitude; | ||
data["longitude"] = this.longitude; | ||
data["tastinessScore"] = this.tastinessScore; | ||
return data; | ||
}; | ||
return MemoryDto; | ||
}()); | ||
exports.MemoryDto = MemoryDto; | ||
var PaginatedListOfMemoryDto = /** @class */ (function () { | ||
function PaginatedListOfMemoryDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
PaginatedListOfMemoryDto.prototype.init = function (_data) { | ||
if (_data) { | ||
if (Array.isArray(_data["items"])) { | ||
this.items = []; | ||
for (var _i = 0, _a = _data["items"]; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
this.items.push(MemoryDto.fromJS(item)); | ||
} | ||
} | ||
this.pageNumber = _data["pageNumber"]; | ||
this.totalPages = _data["totalPages"]; | ||
this.totalCount = _data["totalCount"]; | ||
this.hasPreviousPage = _data["hasPreviousPage"]; | ||
this.hasNextPage = _data["hasNextPage"]; | ||
} | ||
}; | ||
PaginatedListOfMemoryDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new PaginatedListOfMemoryDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
PaginatedListOfMemoryDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
if (Array.isArray(this.items)) { | ||
data["items"] = []; | ||
for (var _i = 0, _a = this.items; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
data["items"].push(item.toJSON()); | ||
} | ||
} | ||
data["pageNumber"] = this.pageNumber; | ||
data["totalPages"] = this.totalPages; | ||
data["totalCount"] = this.totalCount; | ||
data["hasPreviousPage"] = this.hasPreviousPage; | ||
data["hasNextPage"] = this.hasNextPage; | ||
return data; | ||
}; | ||
return PaginatedListOfMemoryDto; | ||
}()); | ||
exports.PaginatedListOfMemoryDto = PaginatedListOfMemoryDto; | ||
var PaginatedListOfTodoItemBriefDto = /** @class */ (function () { | ||
@@ -596,228 +791,2 @@ function PaginatedListOfTodoItemBriefDto(data) { | ||
})(PriorityLevel || (exports.PriorityLevel = PriorityLevel = {})); | ||
var TodosVm = /** @class */ (function () { | ||
function TodosVm(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
TodosVm.prototype.init = function (_data) { | ||
if (_data) { | ||
if (Array.isArray(_data["priorityLevels"])) { | ||
this.priorityLevels = []; | ||
for (var _i = 0, _a = _data["priorityLevels"]; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
this.priorityLevels.push(LookupDto.fromJS(item)); | ||
} | ||
} | ||
if (Array.isArray(_data["lists"])) { | ||
this.lists = []; | ||
for (var _b = 0, _c = _data["lists"]; _b < _c.length; _b++) { | ||
var item = _c[_b]; | ||
this.lists.push(TodoListDto.fromJS(item)); | ||
} | ||
} | ||
} | ||
}; | ||
TodosVm.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new TodosVm(); | ||
result.init(data); | ||
return result; | ||
}; | ||
TodosVm.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
if (Array.isArray(this.priorityLevels)) { | ||
data["priorityLevels"] = []; | ||
for (var _i = 0, _a = this.priorityLevels; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
data["priorityLevels"].push(item.toJSON()); | ||
} | ||
} | ||
if (Array.isArray(this.lists)) { | ||
data["lists"] = []; | ||
for (var _b = 0, _c = this.lists; _b < _c.length; _b++) { | ||
var item = _c[_b]; | ||
data["lists"].push(item.toJSON()); | ||
} | ||
} | ||
return data; | ||
}; | ||
return TodosVm; | ||
}()); | ||
exports.TodosVm = TodosVm; | ||
var LookupDto = /** @class */ (function () { | ||
function LookupDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
LookupDto.prototype.init = function (_data) { | ||
if (_data) { | ||
this.id = _data["id"]; | ||
this.title = _data["title"]; | ||
} | ||
}; | ||
LookupDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new LookupDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
LookupDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["id"] = this.id; | ||
data["title"] = this.title; | ||
return data; | ||
}; | ||
return LookupDto; | ||
}()); | ||
exports.LookupDto = LookupDto; | ||
var TodoListDto = /** @class */ (function () { | ||
function TodoListDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
TodoListDto.prototype.init = function (_data) { | ||
if (_data) { | ||
this.id = _data["id"]; | ||
this.title = _data["title"]; | ||
this.colour = _data["colour"]; | ||
if (Array.isArray(_data["items"])) { | ||
this.items = []; | ||
for (var _i = 0, _a = _data["items"]; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
this.items.push(TodoItemDto.fromJS(item)); | ||
} | ||
} | ||
} | ||
}; | ||
TodoListDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new TodoListDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
TodoListDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["id"] = this.id; | ||
data["title"] = this.title; | ||
data["colour"] = this.colour; | ||
if (Array.isArray(this.items)) { | ||
data["items"] = []; | ||
for (var _i = 0, _a = this.items; _i < _a.length; _i++) { | ||
var item = _a[_i]; | ||
data["items"].push(item.toJSON()); | ||
} | ||
} | ||
return data; | ||
}; | ||
return TodoListDto; | ||
}()); | ||
exports.TodoListDto = TodoListDto; | ||
var TodoItemDto = /** @class */ (function () { | ||
function TodoItemDto(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
TodoItemDto.prototype.init = function (_data) { | ||
if (_data) { | ||
this.id = _data["id"]; | ||
this.listId = _data["listId"]; | ||
this.title = _data["title"]; | ||
this.done = _data["done"]; | ||
this.priority = _data["priority"]; | ||
this.note = _data["note"]; | ||
} | ||
}; | ||
TodoItemDto.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new TodoItemDto(); | ||
result.init(data); | ||
return result; | ||
}; | ||
TodoItemDto.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["id"] = this.id; | ||
data["listId"] = this.listId; | ||
data["title"] = this.title; | ||
data["done"] = this.done; | ||
data["priority"] = this.priority; | ||
data["note"] = this.note; | ||
return data; | ||
}; | ||
return TodoItemDto; | ||
}()); | ||
exports.TodoItemDto = TodoItemDto; | ||
var CreateTodoListCommand = /** @class */ (function () { | ||
function CreateTodoListCommand(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
CreateTodoListCommand.prototype.init = function (_data) { | ||
if (_data) { | ||
this.title = _data["title"]; | ||
} | ||
}; | ||
CreateTodoListCommand.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new CreateTodoListCommand(); | ||
result.init(data); | ||
return result; | ||
}; | ||
CreateTodoListCommand.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["title"] = this.title; | ||
return data; | ||
}; | ||
return CreateTodoListCommand; | ||
}()); | ||
exports.CreateTodoListCommand = CreateTodoListCommand; | ||
var UpdateTodoListCommand = /** @class */ (function () { | ||
function UpdateTodoListCommand(data) { | ||
if (data) { | ||
for (var property in data) { | ||
if (data.hasOwnProperty(property)) | ||
this[property] = data[property]; | ||
} | ||
} | ||
} | ||
UpdateTodoListCommand.prototype.init = function (_data) { | ||
if (_data) { | ||
this.id = _data["id"]; | ||
this.title = _data["title"]; | ||
} | ||
}; | ||
UpdateTodoListCommand.fromJS = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
var result = new UpdateTodoListCommand(); | ||
result.init(data); | ||
return result; | ||
}; | ||
UpdateTodoListCommand.prototype.toJSON = function (data) { | ||
data = typeof data === 'object' ? data : {}; | ||
data["id"] = this.id; | ||
data["title"] = this.title; | ||
return data; | ||
}; | ||
return UpdateTodoListCommand; | ||
}()); | ||
exports.UpdateTodoListCommand = UpdateTodoListCommand; | ||
var ApiException = /** @class */ (function (_super) { | ||
@@ -824,0 +793,0 @@ __extends(ApiException, _super); |
{ | ||
"name": "gastromemories-api-client", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"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
69288
5
1766