fix(medusa-js): Pass undefined instead of empty object to avoid empty payload (#1900)
This commit is contained in:
committed by
GitHub
parent
8c283ac3b0
commit
aa4bf795b2
@@ -15,7 +15,8 @@ class AddressesResource extends BaseResource {
|
||||
*/
|
||||
addAddress(
|
||||
payload: StorePostCustomersCustomerAddressesReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<StoreCustomersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCustomersRes> {
|
||||
const path = `/store/customers/me/addresses`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -26,9 +27,12 @@ class AddressesResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreCustomersRes>}
|
||||
*/
|
||||
deleteAddress(address_id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreCustomersRes> {
|
||||
deleteAddress(
|
||||
address_id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCustomersRes> {
|
||||
const path = `/store/customers/me/addresses/${address_id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -41,7 +45,8 @@ class AddressesResource extends BaseResource {
|
||||
updateAddress(
|
||||
address_id: string,
|
||||
payload: StorePostCustomersCustomerAddressesAddressReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<StoreCustomersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCustomersRes> {
|
||||
const path = `/store/customers/me/addresses/${address_id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
@@ -9,9 +9,11 @@ class AdminAuthResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<AdminAuthRes>}
|
||||
*/
|
||||
getSession(customHeaders: Record<string, any> = {}): ResponsePromise<AdminAuthRes> {
|
||||
getSession(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminAuthRes> {
|
||||
const path = `/admin/auth`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -19,9 +21,11 @@ class AdminAuthResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<void>}
|
||||
*/
|
||||
deleteSession(customHeaders: Record<string, any> = {}): ResponsePromise<void> {
|
||||
deleteSession(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<void> {
|
||||
const path = `/admin/auth`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,7 +34,10 @@ class AdminAuthResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<AdminAuthRes>}
|
||||
*/
|
||||
createSession(payload: AdminPostAuthReq, customHeaders: Record<string, any> = {}): ResponsePromise<AdminAuthRes> {
|
||||
createSession(
|
||||
payload: AdminPostAuthReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminAuthRes> {
|
||||
const path = `/admin/auth`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ class AdminBatchJobsResource extends BaseResource {
|
||||
path = `/admin/batch-jobs?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
cancel(
|
||||
@@ -37,7 +37,7 @@ class AdminBatchJobsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminBatchJobRes> {
|
||||
const path = `/admin/batch-jobs/${batchJobId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
confirm(
|
||||
@@ -45,7 +45,7 @@ class AdminBatchJobsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminBatchJobRes> {
|
||||
const path = `/admin/batch-jobs/${batchJobId}/confirm`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
retrieve(
|
||||
@@ -53,7 +53,7 @@ class AdminBatchJobsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminBatchJobRes> {
|
||||
const path = `/admin/batch-jobs/${batchJobId}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,12 @@ class AdminCollectionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns Deleted response
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminCollectionsDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminCollectionsDeleteRes> {
|
||||
const path = `/admin/collections/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,9 +61,12 @@ class AdminCollectionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the collection with the given id
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminCollectionsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminCollectionsRes> {
|
||||
const path = `/admin/collections/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +86,7 @@ class AdminCollectionsResource extends BaseResource {
|
||||
path = `/admin/collections?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
path += `?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
/**
|
||||
* Updates a customer group
|
||||
@@ -79,7 +79,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminCustomerGroupsDeleteRes> {
|
||||
const path = `/admin/customer-groups/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,7 +99,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
path = `/admin/customer-groups?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,7 +153,7 @@ class AdminCustomerGroupsResource extends BaseResource {
|
||||
path += `?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ class AdminCustomersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminCustomersRes> {
|
||||
const path = `/admin/customers/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,7 +67,7 @@ class AdminCustomersResource extends BaseResource {
|
||||
path = `/admin/customers?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/${id}/regions/${regionId}`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsDeleteRes> {
|
||||
const path = `/admin/discounts/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +85,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/${id}/dynamic-codes/${code}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,7 +96,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/code/${code}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -124,7 +124,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
path = `/admin/discounts?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,7 +136,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsRes> {
|
||||
const path = `/admin/discounts/${id}/regions/${regionId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,7 +187,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDiscountsDeleteRes> {
|
||||
const path = `/admin/discounts/${discountId}/conditions/${conditionId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -206,7 +206,7 @@ class AdminDiscountsResource extends BaseResource {
|
||||
path = `/admin/discounts/${discountId}/conditions/${conditionId}?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,8 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
*/
|
||||
create(
|
||||
payload: AdminPostDraftOrdersDraftOrderReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -29,7 +30,8 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
addLineItem(
|
||||
id: string,
|
||||
payload: AdminPostDraftOrdersDraftOrderLineItemsReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders/${id}/line-items`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -37,9 +39,12 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
/**
|
||||
* @description Delete draft order
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersDeleteRes> {
|
||||
const path = `/admin/draft-orders/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -48,17 +53,21 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
removeLineItem(
|
||||
id: string,
|
||||
itemId: string,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders/${id}/line-items/${itemId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Retrieves a draft order
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +75,8 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
*/
|
||||
list(
|
||||
query?: AdminGetDraftOrdersParams,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersListRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersListRes> {
|
||||
let path = `/admin/draft-orders`
|
||||
|
||||
if (query) {
|
||||
@@ -74,7 +84,7 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
path = `/admin/draft-orders?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,7 +95,7 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPostDraftOrdersDraftOrderRegisterPaymentRes> {
|
||||
const path = `/admin/draft-orders/${id}/pay`
|
||||
return this.client.request("POST", path, {})
|
||||
return this.client.request("POST", path, undefined)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,7 +104,8 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
update(
|
||||
id: string,
|
||||
payload: AdminPostDraftOrdersDraftOrderReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders/${id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -106,7 +117,8 @@ class AdminDraftOrdersResource extends BaseResource {
|
||||
id: string,
|
||||
itemId: string,
|
||||
payload: AdminPostDraftOrdersDraftOrderLineItemsItemReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminDraftOrdersRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDraftOrdersRes> {
|
||||
const path = `/admin/draft-orders/${id}/line-items/${itemId}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
@@ -14,7 +14,10 @@ class AdminGiftCardsResource extends BaseResource {
|
||||
/**
|
||||
* @description Creates a gift card
|
||||
*/
|
||||
create(payload: AdminPostGiftCardsReq, customHeaders: Record<string, any> = {}): ResponsePromise<AdminGiftCardsRes> {
|
||||
create(
|
||||
payload: AdminPostGiftCardsReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGiftCardsRes> {
|
||||
const path = `/admin/gift-cards`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -25,7 +28,8 @@ class AdminGiftCardsResource extends BaseResource {
|
||||
update(
|
||||
id: string,
|
||||
payload: AdminPostGiftCardsGiftCardReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminGiftCardsRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGiftCardsRes> {
|
||||
const path = `/admin/gift-cards/${id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -33,17 +37,23 @@ class AdminGiftCardsResource extends BaseResource {
|
||||
/**
|
||||
* @description Deletes a gift card
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminGiftCardsDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGiftCardsDeleteRes> {
|
||||
const path = `/admin/gift-cards/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description Deletes a gift card
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminGiftCardsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGiftCardsRes> {
|
||||
const path = `/admin/gift-cards/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -51,7 +61,8 @@ class AdminGiftCardsResource extends BaseResource {
|
||||
*/
|
||||
list(
|
||||
query?: AdminGetGiftCardsParams,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminGiftCardsListRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGiftCardsListRes> {
|
||||
let path = `/admin/gift-cards/`
|
||||
|
||||
if (query) {
|
||||
@@ -59,7 +70,7 @@ class AdminGiftCardsResource extends BaseResource {
|
||||
path = `/admin/gift-cards?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,29 +7,40 @@ import { AdminPostInvitesPayload, ResponsePromise } from "../.."
|
||||
import BaseResource from "../base"
|
||||
|
||||
class AdminInvitesResource extends BaseResource {
|
||||
accept(payload: AdminPostInvitesInviteAcceptReq, customHeaders: Record<string, any> = {}): ResponsePromise {
|
||||
accept(
|
||||
payload: AdminPostInvitesInviteAcceptReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise {
|
||||
const path = `/admin/invites/accept`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
create(payload: AdminPostInvitesPayload, customHeaders: Record<string, any> = {}): ResponsePromise {
|
||||
create(
|
||||
payload: AdminPostInvitesPayload,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise {
|
||||
const path = `/admin/invites`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminInviteDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminInviteDeleteRes> {
|
||||
const path = `/admin/invites/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<AdminListInvitesRes> {
|
||||
list(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminListInvitesRes> {
|
||||
const path = `/admin/invites`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
resend(id: string, customHeaders: Record<string, any> = {}): ResponsePromise {
|
||||
const path = `/admin/invites/${id}`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,10 @@ import { ResponsePromise } from "../../typings"
|
||||
import BaseResource from "../base"
|
||||
|
||||
class AdminNotesResource extends BaseResource {
|
||||
create(payload: AdminPostNotesReq, customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotesRes> {
|
||||
create(
|
||||
payload: AdminPostNotesReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotesRes> {
|
||||
const path = `/admin/notes`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -19,22 +22,32 @@ class AdminNotesResource extends BaseResource {
|
||||
update(
|
||||
id: string,
|
||||
payload: AdminPostNotesNoteReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotesRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotesRes> {
|
||||
const path = `/admin/notes/${id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotesDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotesDeleteRes> {
|
||||
const path = `/admin/notes/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotesRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotesRes> {
|
||||
const path = `/admin/notes/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(query?: AdminGetNotesParams, customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotesListRes> {
|
||||
list(
|
||||
query?: AdminGetNotesParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotesListRes> {
|
||||
let path = `/admin/notes/`
|
||||
|
||||
if (query) {
|
||||
@@ -42,7 +55,7 @@ class AdminNotesResource extends BaseResource {
|
||||
path = `/admin/notes?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ import BaseResource from "../base"
|
||||
class AdminNotificationsResource extends BaseResource {
|
||||
list(
|
||||
query?: AdminGetNotificationsParams,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotificationsListRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotificationsListRes> {
|
||||
let path = `/admin/notifications`
|
||||
|
||||
if (query) {
|
||||
@@ -19,13 +20,14 @@ class AdminNotificationsResource extends BaseResource {
|
||||
path = `/admin/notifications?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
resend(
|
||||
id: string,
|
||||
payload: AdminPostNotificationsNotificationResendReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminNotificationsRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminNotificationsRes> {
|
||||
const path = `/admin/notifications/${id}/resend`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(
|
||||
@@ -58,7 +58,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
path = `/admin/orders?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
complete(
|
||||
@@ -66,7 +66,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/complete`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
capturePayment(
|
||||
@@ -74,7 +74,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/capture`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
refundPayment(
|
||||
@@ -101,7 +101,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/fulfillments/${fulfillmentId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
cancelSwapFulfillment(
|
||||
@@ -111,7 +111,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/swaps/${swapId}/fulfillments/${fulfillmentId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
cancelClaimFulfillment(
|
||||
@@ -121,7 +121,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/claims/${claimId}/fulfillments/${fulfillmentId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
createShipment(
|
||||
@@ -147,7 +147,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
addShippingMethod(
|
||||
@@ -164,7 +164,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/archive`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
createSwap(
|
||||
@@ -182,7 +182,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/swaps/${swapId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
fulfillSwap(
|
||||
@@ -211,7 +211,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/swaps/${swapId}/process-payment`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
createClaim(
|
||||
@@ -229,7 +229,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/claims/${claimId}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
updateClaim(
|
||||
@@ -268,7 +268,7 @@ class AdminOrdersResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminOrdersRes> {
|
||||
const path = `/admin/orders/${id}/metadata/${key}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPriceListDeleteRes> {
|
||||
const path = `/admin/price-lists/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
retrieve(
|
||||
@@ -45,7 +45,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPriceListRes> {
|
||||
const path = `/admin/price-lists/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(
|
||||
@@ -59,7 +59,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
path = `/admin/price-lists?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
listProducts(
|
||||
@@ -74,7 +74,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
path = `/admin/price-lists/${id}/products?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
addPrices(
|
||||
@@ -101,7 +101,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPriceListDeleteBatchRes> {
|
||||
const path = `/admin/price-lists/${priceListId}/products/${productId}/prices`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
deleteVariantPrices(
|
||||
@@ -110,7 +110,7 @@ class AdminPriceListResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPriceListDeleteBatchRes> {
|
||||
const path = `/admin/price-lists/${priceListId}/variants/${variantId}/prices`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class AdminProductsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsRes> {
|
||||
const path = `/admin/products/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
update(
|
||||
@@ -50,7 +50,7 @@ class AdminProductsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsDeleteRes> {
|
||||
const path = `/admin/products/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(
|
||||
@@ -64,21 +64,21 @@ class AdminProductsResource extends BaseResource {
|
||||
path = `/admin/products?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
listTypes(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsListTypesRes> {
|
||||
const path = `/admin/products/types`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
listTags(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsListTagsRes> {
|
||||
const path = `/admin/products/tag-usage`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
setMetadata(
|
||||
@@ -115,7 +115,7 @@ class AdminProductsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsDeleteVariantRes> {
|
||||
const path = `/admin/products/${id}/variants/${variantId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
addOption(
|
||||
@@ -143,7 +143,7 @@ class AdminProductsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminProductsDeleteOptionRes> {
|
||||
const path = `/admin/products/${id}/options/${optionId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,10 @@ class AdminRegionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns created region.
|
||||
*/
|
||||
create(payload: AdminPostRegionsReq, customHeaders: Record<string, any> = {}): ResponsePromise<AdminRegionsRes> {
|
||||
create(
|
||||
payload: AdminPostRegionsReq,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -49,9 +52,12 @@ class AdminRegionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns Deleted response
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminRegionsDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsDeleteRes> {
|
||||
const path = `/admin/regions/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,9 +66,12 @@ class AdminRegionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the region with the given id
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminRegionsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,7 +80,10 @@ class AdminRegionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns a list of regions matching the query.
|
||||
*/
|
||||
list(query?: AdminGetRegionsParams, customHeaders: Record<string, any> = {}): ResponsePromise<AdminRegionsListRes> {
|
||||
list(
|
||||
query?: AdminGetRegionsParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsListRes> {
|
||||
let path = `/admin/regions`
|
||||
|
||||
if (query) {
|
||||
@@ -79,7 +91,7 @@ class AdminRegionsResource extends BaseResource {
|
||||
path = `/admin/regions?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,9 +117,13 @@ class AdminRegionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns updated region
|
||||
*/
|
||||
deleteMetadata(id: string, key: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminRegionsRes> {
|
||||
deleteMetadata(
|
||||
id: string,
|
||||
key: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions/${id}/metadata/${key}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +155,7 @@ class AdminRegionsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions/${id}/countries/${country_code}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,7 +187,7 @@ class AdminRegionsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions/${id}/fulfillment-providers/${provider_id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,7 +201,7 @@ class AdminRegionsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminGetRegionsRegionFulfillmentOptionsRes> {
|
||||
const path = `/admin/regions/${id}/fulfillment-options`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -217,7 +233,7 @@ class AdminRegionsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminRegionsRes> {
|
||||
const path = `/admin/regions/${id}/payment-providers/${provider_id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,9 +45,12 @@ class AdminReturnReasonsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns Deleted response
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminReturnReasonsDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminReturnReasonsDeleteRes> {
|
||||
const path = `/admin/return-reasons/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,9 +59,12 @@ class AdminReturnReasonsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the return reason with the given id
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminReturnReasonsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminReturnReasonsRes> {
|
||||
const path = `/admin/return-reasons/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,10 +72,12 @@ class AdminReturnReasonsResource extends BaseResource {
|
||||
* @returns a list of return reasons matching the query.
|
||||
* @param customHeaders
|
||||
*/
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<AdminReturnReasonsListRes> {
|
||||
list(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminReturnReasonsListRes> {
|
||||
const path = `/admin/return-reasons`
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,12 @@ class AdminReturnsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the order for which the return was canceled
|
||||
*/
|
||||
cancel(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminReturnsCancelRes> {
|
||||
cancel(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminReturnsCancelRes> {
|
||||
const path = `/admin/returns/${id}/cancel`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,7 +46,10 @@ class AdminReturnsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns a list of returns matching the query
|
||||
*/
|
||||
list(query?: AdminGetReturnsParams, customHeaders: Record<string, any> = {}): ResponsePromise<AdminReturnsListRes> {
|
||||
list(
|
||||
query?: AdminGetReturnsParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminReturnsListRes> {
|
||||
let path = `/admin/returns/`
|
||||
|
||||
if (query) {
|
||||
@@ -51,7 +57,7 @@ class AdminReturnsResource extends BaseResource {
|
||||
path = `/admin/returns?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ class AdminSalesChannelsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminSalesChannelsRes> {
|
||||
const path = `/admin/sales-channels/${salesChannelId}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/* *
|
||||
@@ -72,7 +72,7 @@ class AdminSalesChannelsResource extends BaseResource {
|
||||
path += `?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ class AdminSalesChannelsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminSalesChannelsDeleteRes> {
|
||||
const path = `/admin/sales-channels/${salesChannelId}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -47,9 +47,12 @@ class AdminShippingOptionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns deleted response
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingOptionsDeleteRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingOptionsDeleteRes> {
|
||||
const path = `/admin/shipping-options/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,9 +61,12 @@ class AdminShippingOptionsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the shipping option with the given id
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingOptionsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingOptionsRes> {
|
||||
const path = `/admin/shipping-options/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +86,7 @@ class AdminShippingOptionsResource extends BaseResource {
|
||||
path = `/admin/shipping-options?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,8 @@ import BaseResource from "../base"
|
||||
class AdminShippingProfilesResource extends BaseResource {
|
||||
create(
|
||||
payload: AdminPostShippingProfilesReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingProfilesRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingProfilesRes> {
|
||||
const path = `/admin/shipping-profiles/`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -19,24 +20,33 @@ class AdminShippingProfilesResource extends BaseResource {
|
||||
update(
|
||||
id: string,
|
||||
payload: AdminPostShippingProfilesProfileReq,
|
||||
customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingProfilesRes> {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingProfilesRes> {
|
||||
const path = `/admin/shipping-profiles/${id}`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminDeleteShippingProfileRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDeleteShippingProfileRes> {
|
||||
const path = `/admin/shipping-profiles/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingProfilesRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingProfilesRes> {
|
||||
const path = `/admin/shipping-profiles/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<AdminShippingProfilesListRes> {
|
||||
list(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminShippingProfilesListRes> {
|
||||
const path = `/admin/shipping-profiles/`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class AdminStoresResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminStoresRes> {
|
||||
const path = `/admin/store/${currency_code}`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -47,7 +47,7 @@ class AdminStoresResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminStoresRes> {
|
||||
const path = `/admin/store/currencies/${currency_code}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ class AdminStoresResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminStoresRes> {
|
||||
const path = `/admin/store/`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,7 +69,7 @@ class AdminStoresResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminPaymentProvidersList> {
|
||||
const path = `/admin/store/payment-providers`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ class AdminStoresResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminTaxProvidersList> {
|
||||
const path = `/admin/store/tax-providers`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,18 @@ import { ResponsePromise } from "../../typings"
|
||||
import BaseResource from "../base"
|
||||
|
||||
class AdminSwapsResource extends BaseResource {
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminSwapsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminSwapsRes> {
|
||||
const path = `/admin/swaps/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(query?: AdminGetSwapsParams, customHeaders: Record<string, any> = {}): ResponsePromise<AdminSwapsListRes> {
|
||||
list(
|
||||
query?: AdminGetSwapsParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminSwapsListRes> {
|
||||
let path = `/admin/swaps/`
|
||||
|
||||
if (query) {
|
||||
@@ -21,7 +27,7 @@ class AdminSwapsResource extends BaseResource {
|
||||
path = `/admin/swaps?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class AdminTaxRatesResource extends BaseResource {
|
||||
path = `/admin/tax-rates/${id}?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
list(
|
||||
@@ -47,7 +47,7 @@ class AdminTaxRatesResource extends BaseResource {
|
||||
path = `/admin/tax-rates?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
create(
|
||||
@@ -182,7 +182,7 @@ class AdminTaxRatesResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminTaxRatesDeleteRes> {
|
||||
const path = `/admin/tax-rates/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,12 @@ class AdminUsersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns the user
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminUserRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminUserRes> {
|
||||
const path = `/admin/users/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -58,7 +61,10 @@ class AdminUsersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns created user
|
||||
*/
|
||||
create(payload: AdminCreateUserPayload, customHeaders: Record<string, any> = {}): ResponsePromise<AdminUserRes> {
|
||||
create(
|
||||
payload: AdminCreateUserPayload,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminUserRes> {
|
||||
const path = `/admin/users`
|
||||
return this.client.request("POST", path, payload, {}, customHeaders)
|
||||
}
|
||||
@@ -85,18 +91,23 @@ class AdminUsersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @returns delete response
|
||||
*/
|
||||
delete(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<AdminDeleteUserRes> {
|
||||
delete(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminDeleteUserRes> {
|
||||
const path = `/admin/users/${id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
* @description lists all users
|
||||
* @returns a list of all users
|
||||
*/
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<AdminUsersListRes> {
|
||||
list(
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminUsersListRes> {
|
||||
const path = `/admin/users`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,10 @@ import { ResponsePromise } from "../.."
|
||||
import BaseResource from "../base"
|
||||
|
||||
class AdminVariantsResource extends BaseResource {
|
||||
list(query?: AdminGetVariantsParams, customHeaders: Record<string, any> = {}): ResponsePromise<AdminVariantsListRes> {
|
||||
list(
|
||||
query?: AdminGetVariantsParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<AdminVariantsListRes> {
|
||||
let path = `/admin/variants`
|
||||
|
||||
if (query) {
|
||||
@@ -12,7 +15,7 @@ class AdminVariantsResource extends BaseResource {
|
||||
path = `/admin/variants?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class AuthResource extends BaseResource {
|
||||
*/
|
||||
getSession(customHeaders: Record<string, any> = {}): ResponsePromise<StoreAuthRes> {
|
||||
const path = `/store/auth`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ class AuthResource extends BaseResource {
|
||||
*/
|
||||
exists(email: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreGetAuthEmailRes> {
|
||||
const path = `/store/auth/${email}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCompleteCartRes> {
|
||||
const path = `/store/carts/${cart_id}/complete`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,7 +76,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}/payment-sessions`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -92,7 +92,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}/discounts/${code}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}/payment-sessions/${provider_id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}/payment-sessions/${provider_id}/refresh`
|
||||
return this.client.request("POST", path, {}, {}, customHeaders)
|
||||
return this.client.request("POST", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@ class CartsResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,7 @@ class CollectionsResource extends BaseResource {
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreCollectionsRes> {
|
||||
const path = `/store/collections/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ class CollectionsResource extends BaseResource {
|
||||
path = `/store/collections?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class CustomerResource extends BaseResource {
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreCustomersRes> {
|
||||
const path = `/store/customers/me`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +73,7 @@ class CustomerResource extends BaseResource {
|
||||
path += `?${query}`
|
||||
}
|
||||
}
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,7 @@ class GiftCardsResource extends BaseResource {
|
||||
*/
|
||||
retrieve(code: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreGiftCardsRes> {
|
||||
const path = `/store/gift-cards/${code}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class LineItemsResource extends BaseResource {
|
||||
*/
|
||||
delete(cart_id: string, line_id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreCartsRes> {
|
||||
const path = `/store/carts/${cart_id}/line-items/${line_id}`
|
||||
return this.client.request("DELETE", path, {}, {}, customHeaders)
|
||||
return this.client.request("DELETE", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,12 @@ class OrdersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreOrdersRes>}
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreOrdersRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreOrdersRes> {
|
||||
const path = `/store/orders/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,9 +24,12 @@ class OrdersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreOrdersRes>}
|
||||
*/
|
||||
retrieveByCartId(cart_id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreOrdersRes> {
|
||||
retrieveByCartId(
|
||||
cart_id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreOrdersRes> {
|
||||
const path = `/store/orders/cart/${cart_id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +38,10 @@ class OrdersResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreOrdersRes>}
|
||||
*/
|
||||
lookupOrder(payload: StoreGetOrdersParams, customHeaders: Record<string, any> = {}): ResponsePromise<StoreOrdersRes> {
|
||||
lookupOrder(
|
||||
payload: StoreGetOrdersParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreOrdersRes> {
|
||||
let path = `/store/orders?`
|
||||
|
||||
const queryString = qs.stringify(payload)
|
||||
|
||||
@@ -11,7 +11,7 @@ class PaymentMethodsResource extends BaseResource {
|
||||
*/
|
||||
list(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreCustomersListPaymentMethodsRes> {
|
||||
const path = `/store/carts/${id}/payment-methods`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class ProductVariantsResource extends BaseResource {
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreVariantsRes> {
|
||||
const path = `/store/variants/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,9 +19,12 @@ class ProductsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreProductsRes>}
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreProductsRes> {
|
||||
retrieve(
|
||||
id: string,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreProductsRes> {
|
||||
const path = `/store/products/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +47,10 @@ class ProductsResource extends BaseResource {
|
||||
* @param customHeaders
|
||||
* @return {ResponsePromise<StoreProductsListRes>}
|
||||
*/
|
||||
list(query?: StoreGetProductsParams, customHeaders: Record<string, any> = {}): ResponsePromise<StoreProductsListRes> {
|
||||
list(
|
||||
query?: StoreGetProductsParams,
|
||||
customHeaders: Record<string, any> = {}
|
||||
): ResponsePromise<StoreProductsListRes> {
|
||||
let path = `/store/products`
|
||||
|
||||
if (query) {
|
||||
@@ -52,7 +58,7 @@ class ProductsResource extends BaseResource {
|
||||
path = `/store/products?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ class RegionsResource extends BaseResource {
|
||||
*/
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<StoreRegionsListRes> {
|
||||
const path = `/store/regions`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,7 +21,7 @@ class RegionsResource extends BaseResource {
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreRegionsRes> {
|
||||
const path = `/store/regions/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class ReturnReasonsResource extends BaseResource {
|
||||
*/
|
||||
retrieve(id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreReturnReasonsRes> {
|
||||
const path = `/store/return-reasons/${id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -24,7 +24,7 @@ class ReturnReasonsResource extends BaseResource {
|
||||
*/
|
||||
list(customHeaders: Record<string, any> = {}): ResponsePromise<StoreReturnReasonsListRes> {
|
||||
const path = `/store/return-reasons`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class ShippingOptionsResource extends BaseResource {
|
||||
*/
|
||||
listCartOptions(cart_id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreShippingOptionsListRes> {
|
||||
const path = `/store/shipping-options/${cart_id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ class ShippingOptionsResource extends BaseResource {
|
||||
path = `/store/shipping-options?${queryString}`
|
||||
}
|
||||
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ class SwapsResource extends BaseResource {
|
||||
*/
|
||||
retrieveByCartId(cart_id: string, customHeaders: Record<string, any> = {}): ResponsePromise<StoreSwapsRes> {
|
||||
const path = `/store/swaps/${cart_id}`
|
||||
return this.client.request("GET", path, {}, {}, customHeaders)
|
||||
return this.client.request("GET", path, undefined, {}, customHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user