@umerx/umerx-blackdog-configurator-client-typescript
Advanced tools
Comparing version 0.0.37 to 0.0.38
@@ -41,16 +41,20 @@ import { Response as ResponseTypes, Symbol as SymbolTypes, Strategy as StrategyTypes, StrategyLog as StrategyLogTypes, StrategyValue as StrategyValueTypes, Order as OrderTypes, Position as PositionTypes, StrategyTemplateSeaDogDiscountScheme as StrategyTemplateSeaDogDiscountSchemeTypes, } from '@umerx/umerx-blackdog-configurator-types-typescript'; | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = SymbolTypes.SymbolGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = SymbolTypes.SymbolGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = SymbolTypes.SymbolPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = SymbolTypes.SymbolPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -74,80 +78,100 @@ } | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTypes.StrategyGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTypes.StrategyGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async putMany(body) { | ||
const response = await axios.put(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPutManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.put(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPutManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async putSingle(params, body) { | ||
const response = await axios.put(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTypes.StrategyPutSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.put(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTypes.StrategyPutSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async patchMany(body) { | ||
const response = await axios.patch(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPatchManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.patch(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTypes.StrategyPatchManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async patchSingle(params, body) { | ||
const response = await axios.patch(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTypes.StrategyPatchSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.patch(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTypes.StrategyPatchSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async deleteMany(query) { | ||
const response = await axios.delete(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTypes.StrategyDeleteManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.delete(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTypes.StrategyDeleteManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async deleteSingle(params) { | ||
const response = await axios.delete(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTypes.StrategyDeleteSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.delete(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTypes.StrategyDeleteSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getAssetsSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}/assets`); | ||
const responseBody = StrategyTypes.StrategyAssetsGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}/assets`); | ||
const responseBody = StrategyTypes.StrategyAssetsGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getAggregateValues(params, query) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}/aggregateValues?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTypes.StrategyAggregateValuesGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}/aggregateValues?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTypes.StrategyAggregateValuesGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -161,24 +185,30 @@ } | ||
async getMany(query) { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyLogTypes.StrategyLogGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyLogTypes.StrategyLogGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyLogTypes.StrategyLogGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyLogTypes.StrategyLogGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyLogTypes.StrategyLogPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyLogTypes.StrategyLogPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -192,24 +222,30 @@ } | ||
async getMany(query) { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyValueTypes.StrategyValueGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyValueTypes.StrategyValueGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyValueTypes.StrategyValueGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyValueTypes.StrategyValueGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyValueTypes.StrategyValuePostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyValueTypes.StrategyValuePostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -223,40 +259,50 @@ } | ||
async getMany(query) { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = OrderTypes.OrderGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = OrderTypes.OrderGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = OrderTypes.OrderGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = OrderTypes.OrderGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = OrderTypes.OrderPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = OrderTypes.OrderPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async fillSingle(params) { | ||
const response = await axios.post(`${this.baseUrl}/${params.id}/fill`); | ||
const responseBody = OrderTypes.OrderFillPostSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}/${params.id}/fill`); | ||
const responseBody = OrderTypes.OrderFillPostSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async cancelSingle(params) { | ||
const response = await axios.post(`${this.baseUrl}/${params.id}/cancel`); | ||
const responseBody = OrderTypes.OrderCancelPostSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}/${params.id}/cancel`); | ||
const responseBody = OrderTypes.OrderCancelPostSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -270,24 +316,30 @@ } | ||
async getMany(query) { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = PositionTypes.PositionGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = PositionTypes.PositionGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = PositionTypes.PositionGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = PositionTypes.PositionGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = PositionTypes.PositionPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = PositionTypes.PositionPostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -301,72 +353,90 @@ } | ||
async getMany(query) { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeGetManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async getSingle(params) { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.get(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeGetSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async postMany(body) { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.post(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePostManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async putMany(body) { | ||
const response = await axios.put(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePutManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.put(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePutManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async putSingle(params, body) { | ||
const response = await axios.put(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePutSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.put(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePutSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async patchMany(body) { | ||
const response = await axios.patch(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePatchManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.patch(`${this.baseUrl}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePatchManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async patchSingle(params, body) { | ||
const response = await axios.patch(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePatchSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.patch(`${this.baseUrl}/${params.id}`, body); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemePatchSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async deleteMany(query) { | ||
const response = await axios.delete(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeDeleteManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.delete(`${this.baseUrl}/?${new URLSearchParams(Object.entries(query)).toString()}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeDeleteManyResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
async deleteSingle(params) { | ||
const response = await axios.delete(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeDeleteSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
return handleResponseErrors(async () => { | ||
const response = await axios.delete(`${this.baseUrl}/${params.id}`); | ||
const responseBody = StrategyTemplateSeaDogDiscountSchemeTypes.StrategyTemplateSeaDogDiscountSchemeDeleteSingleResponseBodyFromRaw(response.data); | ||
if (responseBody.status !== 'success') { | ||
throw new ClientResponseError(responseBody.message, response.status, responseBody); | ||
} | ||
return responseBody; | ||
}); | ||
} | ||
@@ -373,0 +443,0 @@ } |
{ | ||
"name": "@umerx/umerx-blackdog-configurator-client-typescript", | ||
"private": false, | ||
"version": "0.0.37", | ||
"version": "0.0.38", | ||
"main": "build/index.js", | ||
@@ -6,0 +6,0 @@ "types": "build/index.d.ts", |
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
74020
622