@commercelayer/sdk 5.0.0-alpha.1 → 5.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.md +69 -33
  2. package/lib/api.d.ts +1 -103
  3. package/lib/client.d.ts +1 -31
  4. package/lib/client.js +1 -1
  5. package/lib/commercelayer.d.ts +1 -122
  6. package/lib/commercelayer.js +1 -1
  7. package/lib/common.d.ts +1 -4
  8. package/lib/config.d.ts +1 -11
  9. package/lib/debug.d.ts +1 -3
  10. package/lib/debug.js +1 -1
  11. package/lib/error.d.ts +1 -26
  12. package/lib/error.js +1 -1
  13. package/lib/index.d.ts +1 -7
  14. package/lib/interceptor.d.ts +1 -19
  15. package/lib/jsonapi.d.ts +1 -5
  16. package/lib/jsonapi.js +1 -1
  17. package/lib/model.d.ts +1 -101
  18. package/lib/query.d.ts +1 -23
  19. package/lib/query.js +1 -1
  20. package/lib/resource.d.ts +1 -76
  21. package/lib/resource.js +1 -1
  22. package/lib/resources/addresses.d.ts +1 -88
  23. package/lib/resources/addresses.js +1 -1
  24. package/lib/resources/adjustments.d.ts +1 -35
  25. package/lib/resources/adjustments.js +1 -1
  26. package/lib/resources/adyen_gateways.d.ts +1 -47
  27. package/lib/resources/adyen_gateways.js +1 -1
  28. package/lib/resources/adyen_payments.d.ts +1 -44
  29. package/lib/resources/adyen_payments.js +1 -1
  30. package/lib/resources/application.d.ts +1 -21
  31. package/lib/resources/application.js +1 -1
  32. package/lib/resources/attachments.d.ts +1 -156
  33. package/lib/resources/attachments.js +1 -1
  34. package/lib/resources/authorizations.d.ts +1 -57
  35. package/lib/resources/authorizations.js +1 -1
  36. package/lib/resources/avalara_accounts.d.ts +1 -52
  37. package/lib/resources/avalara_accounts.js +1 -1
  38. package/lib/resources/billing_info_validation_rules.d.ts +1 -32
  39. package/lib/resources/billing_info_validation_rules.js +1 -1
  40. package/lib/resources/bing_geocoders.d.ts +1 -35
  41. package/lib/resources/bing_geocoders.js +1 -1
  42. package/lib/resources/braintree_gateways.d.ts +1 -56
  43. package/lib/resources/braintree_gateways.js +1 -1
  44. package/lib/resources/braintree_payments.d.ts +1 -47
  45. package/lib/resources/braintree_payments.js +1 -1
  46. package/lib/resources/bundles.d.ts +1 -74
  47. package/lib/resources/bundles.js +1 -1
  48. package/lib/resources/captures.d.ts +1 -48
  49. package/lib/resources/captures.js +1 -1
  50. package/lib/resources/carrier_accounts.d.ts +1 -26
  51. package/lib/resources/carrier_accounts.js +1 -1
  52. package/lib/resources/checkout_com_gateways.d.ts +1 -45
  53. package/lib/resources/checkout_com_gateways.js +1 -1
  54. package/lib/resources/checkout_com_payments.d.ts +1 -50
  55. package/lib/resources/checkout_com_payments.js +1 -1
  56. package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -59
  57. package/lib/resources/coupon_codes_promotion_rules.js +1 -1
  58. package/lib/resources/coupon_recipients.d.ts +1 -44
  59. package/lib/resources/coupon_recipients.js +1 -1
  60. package/lib/resources/coupons.d.ts +1 -45
  61. package/lib/resources/coupons.js +1 -1
  62. package/lib/resources/customer_addresses.d.ts +1 -41
  63. package/lib/resources/customer_addresses.js +1 -1
  64. package/lib/resources/customer_groups.d.ts +1 -36
  65. package/lib/resources/customer_groups.js +1 -1
  66. package/lib/resources/customer_password_resets.d.ts +1 -33
  67. package/lib/resources/customer_password_resets.js +1 -1
  68. package/lib/resources/customer_payment_sources.d.ts +1 -70
  69. package/lib/resources/customer_payment_sources.js +1 -1
  70. package/lib/resources/customer_subscriptions.d.ts +1 -28
  71. package/lib/resources/customer_subscriptions.js +1 -1
  72. package/lib/resources/customers.d.ts +1 -60
  73. package/lib/resources/customers.js +1 -1
  74. package/lib/resources/delivery_lead_times.d.ts +1 -51
  75. package/lib/resources/delivery_lead_times.js +1 -1
  76. package/lib/resources/event_callbacks.d.ts +1 -24
  77. package/lib/resources/event_callbacks.js +1 -1
  78. package/lib/resources/external_gateways.d.ts +1 -49
  79. package/lib/resources/external_gateways.js +1 -1
  80. package/lib/resources/external_payments.d.ts +1 -43
  81. package/lib/resources/external_payments.js +1 -1
  82. package/lib/resources/external_promotions.d.ts +1 -86
  83. package/lib/resources/external_promotions.js +1 -1
  84. package/lib/resources/external_tax_calculators.d.ts +1 -44
  85. package/lib/resources/external_tax_calculators.js +1 -1
  86. package/lib/resources/fixed_amount_promotions.d.ts +1 -88
  87. package/lib/resources/fixed_amount_promotions.js +1 -1
  88. package/lib/resources/fixed_price_promotions.d.ts +1 -99
  89. package/lib/resources/fixed_price_promotions.js +1 -1
  90. package/lib/resources/free_gift_promotions.d.ts +1 -97
  91. package/lib/resources/free_gift_promotions.js +1 -1
  92. package/lib/resources/free_shipping_promotions.d.ts +1 -83
  93. package/lib/resources/free_shipping_promotions.js +1 -1
  94. package/lib/resources/geocoders.d.ts +1 -24
  95. package/lib/resources/geocoders.js +1 -1
  96. package/lib/resources/gift_card_recipients.d.ts +1 -44
  97. package/lib/resources/gift_card_recipients.js +1 -1
  98. package/lib/resources/gift_cards.d.ts +1 -82
  99. package/lib/resources/gift_cards.js +1 -1
  100. package/lib/resources/google_geocoders.d.ts +1 -35
  101. package/lib/resources/google_geocoders.js +1 -1
  102. package/lib/resources/imports.d.ts +1 -40
  103. package/lib/resources/imports.js +1 -1
  104. package/lib/resources/in_stock_subscriptions.d.ts +1 -59
  105. package/lib/resources/in_stock_subscriptions.js +1 -1
  106. package/lib/resources/inventory_models.d.ts +1 -42
  107. package/lib/resources/inventory_models.js +1 -1
  108. package/lib/resources/inventory_return_locations.d.ts +1 -43
  109. package/lib/resources/inventory_return_locations.js +1 -1
  110. package/lib/resources/inventory_stock_locations.d.ts +1 -46
  111. package/lib/resources/inventory_stock_locations.js +1 -1
  112. package/lib/resources/klarna_gateways.d.ts +1 -44
  113. package/lib/resources/klarna_gateways.js +1 -1
  114. package/lib/resources/klarna_payments.d.ts +1 -41
  115. package/lib/resources/klarna_payments.js +1 -1
  116. package/lib/resources/line_item_options.d.ts +1 -57
  117. package/lib/resources/line_item_options.js +1 -1
  118. package/lib/resources/line_items.d.ts +1 -125
  119. package/lib/resources/line_items.js +1 -1
  120. package/lib/resources/manual_gateways.d.ts +1 -33
  121. package/lib/resources/manual_gateways.js +1 -1
  122. package/lib/resources/manual_tax_calculators.d.ts +1 -49
  123. package/lib/resources/manual_tax_calculators.js +1 -1
  124. package/lib/resources/markets.d.ts +1 -81
  125. package/lib/resources/markets.js +1 -1
  126. package/lib/resources/merchants.d.ts +1 -38
  127. package/lib/resources/merchants.js +1 -1
  128. package/lib/resources/order_amount_promotion_rules.d.ts +1 -56
  129. package/lib/resources/order_amount_promotion_rules.js +1 -1
  130. package/lib/resources/order_copies.d.ts +1 -45
  131. package/lib/resources/order_copies.js +1 -1
  132. package/lib/resources/order_subscriptions.d.ts +1 -67
  133. package/lib/resources/order_subscriptions.js +1 -1
  134. package/lib/resources/order_validation_rules.d.ts +1 -20
  135. package/lib/resources/order_validation_rules.js +1 -1
  136. package/lib/resources/orders.d.ts +1 -271
  137. package/lib/resources/orders.js +1 -1
  138. package/lib/resources/organization.d.ts +1 -32
  139. package/lib/resources/organization.js +1 -1
  140. package/lib/resources/packages.d.ts +1 -56
  141. package/lib/resources/packages.js +1 -1
  142. package/lib/resources/parcel_line_items.d.ts +1 -49
  143. package/lib/resources/parcel_line_items.js +1 -1
  144. package/lib/resources/parcels.d.ts +1 -108
  145. package/lib/resources/parcels.js +1 -1
  146. package/lib/resources/payment_gateways.d.ts +1 -21
  147. package/lib/resources/payment_gateways.js +1 -1
  148. package/lib/resources/payment_methods.d.ts +1 -59
  149. package/lib/resources/payment_methods.js +1 -1
  150. package/lib/resources/paypal_gateways.d.ts +1 -39
  151. package/lib/resources/paypal_gateways.js +1 -1
  152. package/lib/resources/paypal_payments.d.ts +1 -47
  153. package/lib/resources/paypal_payments.js +1 -1
  154. package/lib/resources/percentage_discount_promotions.d.ts +1 -97
  155. package/lib/resources/percentage_discount_promotions.js +1 -1
  156. package/lib/resources/price_lists.d.ts +1 -39
  157. package/lib/resources/price_lists.js +1 -1
  158. package/lib/resources/prices.d.ts +1 -57
  159. package/lib/resources/prices.js +1 -1
  160. package/lib/resources/promotion_rules.d.ts +1 -24
  161. package/lib/resources/promotion_rules.js +1 -1
  162. package/lib/resources/promotions.d.ts +1 -41
  163. package/lib/resources/promotions.js +1 -1
  164. package/lib/resources/refunds.d.ts +1 -34
  165. package/lib/resources/refunds.js +1 -1
  166. package/lib/resources/return_line_items.d.ts +1 -49
  167. package/lib/resources/return_line_items.js +1 -1
  168. package/lib/resources/returns.d.ts +1 -72
  169. package/lib/resources/returns.js +1 -1
  170. package/lib/resources/shipments.d.ts +1 -89
  171. package/lib/resources/shipments.js +1 -1
  172. package/lib/resources/shipping_categories.d.ts +1 -33
  173. package/lib/resources/shipping_categories.js +1 -1
  174. package/lib/resources/shipping_methods.d.ts +1 -74
  175. package/lib/resources/shipping_methods.js +1 -1
  176. package/lib/resources/shipping_zones.d.ts +1 -48
  177. package/lib/resources/shipping_zones.js +1 -1
  178. package/lib/resources/sku_list_items.d.ts +1 -47
  179. package/lib/resources/sku_list_items.js +1 -1
  180. package/lib/resources/sku_list_promotion_rules.d.ts +1 -68
  181. package/lib/resources/sku_list_promotion_rules.js +1 -1
  182. package/lib/resources/sku_lists.d.ts +1 -49
  183. package/lib/resources/sku_lists.js +1 -1
  184. package/lib/resources/sku_options.d.ts +1 -56
  185. package/lib/resources/sku_options.js +1 -1
  186. package/lib/resources/skus.d.ts +1 -78
  187. package/lib/resources/skus.js +1 -1
  188. package/lib/resources/stock_items.d.ts +1 -49
  189. package/lib/resources/stock_items.js +1 -1
  190. package/lib/resources/stock_line_items.d.ts +1 -29
  191. package/lib/resources/stock_line_items.js +1 -1
  192. package/lib/resources/stock_locations.d.ts +1 -57
  193. package/lib/resources/stock_locations.js +1 -1
  194. package/lib/resources/stock_transfers.d.ts +1 -71
  195. package/lib/resources/stock_transfers.js +1 -1
  196. package/lib/resources/stripe_gateways.d.ts +1 -38
  197. package/lib/resources/stripe_gateways.js +1 -1
  198. package/lib/resources/stripe_payments.d.ts +1 -42
  199. package/lib/resources/stripe_payments.js +1 -1
  200. package/lib/resources/tax_calculators.d.ts +1 -27
  201. package/lib/resources/tax_calculators.js +1 -1
  202. package/lib/resources/tax_categories.d.ts +1 -59
  203. package/lib/resources/tax_categories.js +1 -1
  204. package/lib/resources/tax_rules.d.ts +1 -69
  205. package/lib/resources/tax_rules.js +1 -1
  206. package/lib/resources/taxjar_accounts.d.ts +1 -43
  207. package/lib/resources/taxjar_accounts.js +1 -1
  208. package/lib/resources/transactions.d.ts +1 -31
  209. package/lib/resources/transactions.js +1 -1
  210. package/lib/resources/voids.d.ts +1 -34
  211. package/lib/resources/voids.js +1 -1
  212. package/lib/resources/webhooks.d.ts +1 -42
  213. package/lib/resources/webhooks.js +1 -1
  214. package/lib/resources/wire_transfers.d.ts +1 -32
  215. package/lib/resources/wire_transfers.js +1 -1
  216. package/lib/static.d.ts +1 -6
  217. package/lib/static.js +1 -1
  218. package/lib/util.d.ts +1 -2
  219. package/package.json +19 -22
@@ -1,41 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Order } from './orders';
4
- import { PaymentGateway } from './payment_gateways';
5
- declare type KlarnaPaymentRel = ResourceRel & {
6
- type: typeof KlarnaPayments.TYPE;
7
- };
8
- declare type OrderRel = ResourceRel & {
9
- type: 'orders';
10
- };
11
- interface KlarnaPayment extends Resource {
12
- session_id?: string;
13
- client_token?: string;
14
- payment_methods?: object[];
15
- auth_token?: string;
16
- order?: Order;
17
- payment_gateway?: PaymentGateway;
18
- }
19
- interface KlarnaPaymentCreate extends ResourceCreate {
20
- order: OrderRel;
21
- }
22
- interface KlarnaPaymentUpdate extends ResourceUpdate {
23
- auth_token?: string;
24
- _update?: boolean;
25
- order?: OrderRel;
26
- }
27
- declare class KlarnaPayments extends ApiResource {
28
- static readonly TYPE: 'klarna_payments';
29
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<KlarnaPayment>>;
30
- create(resource: KlarnaPaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
31
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
32
- update(resource: KlarnaPaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaPayment>;
33
- delete(id: string, options?: ResourcesConfig): Promise<void>;
34
- order(klarnaPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
35
- payment_gateway(klarnaPaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
36
- isKlarnaPayment(resource: any): resource is KlarnaPayment;
37
- relationship(id: string | ResourceId | null): KlarnaPaymentRel;
38
- type(): string;
39
- }
40
- export default KlarnaPayments;
41
- export { KlarnaPayment, KlarnaPaymentCreate, KlarnaPaymentUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{PaymentGateway}from'./payment_gateways';declare type KlarnaPaymentRel=ResourceRel&{type:typeof KlarnaPayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface KlarnaPayment extends Resource{session_id?:string;client_token?:string;payment_methods?:object[];auth_token?:string;order?:Order;payment_gateway?:PaymentGateway;}interface KlarnaPaymentCreate extends ResourceCreate{order:OrderRel;}interface KlarnaPaymentUpdate extends ResourceUpdate{auth_token?:string;_update?:boolean;order?:OrderRel;}declare class KlarnaPayments extends ApiResource{static readonly TYPE:'klarna_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<KlarnaPayment>>;create(resource:KlarnaPaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaPayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaPayment>;update(resource:KlarnaPaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaPayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(klarnaPaymentId:string|KlarnaPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(klarnaPaymentId:string|KlarnaPayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;isKlarnaPayment(resource:any):resource is KlarnaPayment;relationship(id:string|ResourceId|null):KlarnaPaymentRel;type():string;}export default KlarnaPayments;export{KlarnaPayment,KlarnaPaymentCreate,KlarnaPaymentUpdate};
@@ -1 +1 @@
1
- import{ApiResource as a}from"../resource";class r extends a{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,s){return this.resources.fetch({type:"orders"},`klarna_payments/${e}/order`,t,s)}async payment_gateway(e,t,s){return this.resources.fetch({type:"payment_gateways"},`klarna_payments/${e}/payment_gateway`,t,s)}isKlarnaPayment(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="klarna_payments";export default r;
1
+ import{ApiResource as n}from"../resource";class r extends n{static TYPE="klarna_payments";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,s){const a=e.id||e;return this.resources.fetch({type:"orders"},`klarna_payments/${a}/order`,t,s)}async payment_gateway(e,t,s){const a=e.id||e;return this.resources.fetch({type:"payment_gateways"},`klarna_payments/${a}/payment_gateway`,t,s)}isKlarnaPayment(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
@@ -1,57 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { LineItem } from './line_items';
4
- import { SkuOption } from './sku_options';
5
- declare type LineItemOptionRel = ResourceRel & {
6
- type: typeof LineItemOptions.TYPE;
7
- };
8
- declare type LineItemRel = ResourceRel & {
9
- type: 'line_items';
10
- };
11
- declare type SkuOptionRel = ResourceRel & {
12
- type: 'sku_options';
13
- };
14
- interface LineItemOption extends Resource {
15
- name?: string;
16
- quantity?: number;
17
- currency_code?: string;
18
- unit_amount_cents?: number;
19
- unit_amount_float?: number;
20
- formatted_unit_amount?: string;
21
- total_amount_cents?: number;
22
- total_amount_float?: number;
23
- formatted_total_amount?: string;
24
- delay_hours?: number;
25
- delay_days?: number;
26
- options?: object;
27
- line_item?: LineItem;
28
- sku_option?: SkuOption;
29
- }
30
- interface LineItemOptionCreate extends ResourceCreate {
31
- name?: string;
32
- quantity: number;
33
- options: object;
34
- line_item: LineItemRel;
35
- sku_option: SkuOptionRel;
36
- }
37
- interface LineItemOptionUpdate extends ResourceUpdate {
38
- name?: string;
39
- quantity?: number;
40
- options?: object;
41
- sku_option?: SkuOptionRel;
42
- }
43
- declare class LineItemOptions extends ApiResource {
44
- static readonly TYPE: 'line_item_options';
45
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
46
- create(resource: LineItemOptionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItemOption>;
47
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItemOption>;
48
- update(resource: LineItemOptionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItemOption>;
49
- delete(id: string, options?: ResourcesConfig): Promise<void>;
50
- line_item(lineItemOptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
51
- sku_option(lineItemOptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<SkuOption>;
52
- isLineItemOption(resource: any): resource is LineItemOption;
53
- relationship(id: string | ResourceId | null): LineItemOptionRel;
54
- type(): string;
55
- }
56
- export default LineItemOptions;
57
- export { LineItemOption, LineItemOptionCreate, LineItemOptionUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{LineItem}from'./line_items';import type{SkuOption}from'./sku_options';declare type LineItemOptionRel=ResourceRel&{type:typeof LineItemOptions.TYPE;};declare type LineItemRel=ResourceRel&{type:'line_items';};declare type SkuOptionRel=ResourceRel&{type:'sku_options';};interface LineItemOption extends Resource{name?:string;quantity?:number;currency_code?:string;unit_amount_cents?:number;unit_amount_float?:number;formatted_unit_amount?:string;total_amount_cents?:number;total_amount_float?:number;formatted_total_amount?:string;delay_hours?:number;delay_days?:number;options?:object;line_item?:LineItem;sku_option?:SkuOption;}interface LineItemOptionCreate extends ResourceCreate{name?:string;quantity:number;options:object;line_item:LineItemRel;sku_option:SkuOptionRel;}interface LineItemOptionUpdate extends ResourceUpdate{name?:string;quantity?:number;options?:object;sku_option?:SkuOptionRel;}declare class LineItemOptions extends ApiResource{static readonly TYPE:'line_item_options';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<LineItemOption>>;create(resource:LineItemOptionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItemOption>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItemOption>;update(resource:LineItemOptionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItemOption>;delete(id:string,options?:ResourcesConfig):Promise<void>;line_item(lineItemOptionId:string|LineItemOption,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;sku_option(lineItemOptionId:string|LineItemOption,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<SkuOption>;isLineItemOption(resource:any):resource is LineItemOption;relationship(id:string|ResourceId|null):LineItemOptionRel;type():string;}export default LineItemOptions;export{LineItemOption,LineItemOptionCreate,LineItemOptionUpdate};
@@ -1 +1 @@
1
- import{ApiResource as s}from"../resource";class r extends s{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,i){return this.resources.create({...e,type:r.TYPE},t,i)}async retrieve(e,t,i){return this.resources.retrieve({type:r.TYPE,id:e},t,i)}async update(e,t,i){return this.resources.update({...e,type:r.TYPE},t,i)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async line_item(e,t,i){return this.resources.fetch({type:"line_items"},`line_item_options/${e}/line_item`,t,i)}async sku_option(e,t,i){return this.resources.fetch({type:"sku_options"},`line_item_options/${e}/sku_option`,t,i)}isLineItemOption(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="line_item_options";export default r;
1
+ import{ApiResource as n}from"../resource";class i extends n{static TYPE="line_item_options";async list(e,t){return this.resources.list({type:i.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:i.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:i.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:i.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:i.TYPE,id:e},t)}async line_item(e,t,r){const s=e.id||e;return this.resources.fetch({type:"line_items"},`line_item_options/${s}/line_item`,t,r)}async sku_option(e,t,r){const s=e.id||e;return this.resources.fetch({type:"sku_options"},`line_item_options/${s}/sku_option`,t,r)}isLineItemOption(e){return e.type&&e.type===i.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:i.TYPE}:{id:e.id,type:i.TYPE}}type(){return i.TYPE}}export default i;
@@ -1,125 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Order } from './orders';
4
- import { Adjustment } from './adjustments';
5
- import { Bundle } from './bundles';
6
- import { ExternalPromotion } from './external_promotions';
7
- import { FixedAmountPromotion } from './fixed_amount_promotions';
8
- import { FreeShippingPromotion } from './free_shipping_promotions';
9
- import { GiftCard } from './gift_cards';
10
- import { PaymentMethod } from './payment_methods';
11
- import { PercentageDiscountPromotion } from './percentage_discount_promotions';
12
- import { Shipment } from './shipments';
13
- import { Sku } from './skus';
14
- import { LineItemOption } from './line_item_options';
15
- import { StockLineItem } from './stock_line_items';
16
- import { StockTransfer } from './stock_transfers';
17
- declare type LineItemRel = ResourceRel & {
18
- type: typeof LineItems.TYPE;
19
- };
20
- declare type OrderRel = ResourceRel & {
21
- type: 'orders';
22
- };
23
- declare type AdjustmentRel = ResourceRel & {
24
- type: 'adjustments';
25
- };
26
- declare type BundleRel = ResourceRel & {
27
- type: 'bundles';
28
- };
29
- declare type ExternalPromotionRel = ResourceRel & {
30
- type: 'external_promotions';
31
- };
32
- declare type FixedAmountPromotionRel = ResourceRel & {
33
- type: 'fixed_amount_promotions';
34
- };
35
- declare type FreeShippingPromotionRel = ResourceRel & {
36
- type: 'free_shipping_promotions';
37
- };
38
- declare type GiftCardRel = ResourceRel & {
39
- type: 'gift_cards';
40
- };
41
- declare type PaymentMethodRel = ResourceRel & {
42
- type: 'payment_methods';
43
- };
44
- declare type PercentageDiscountPromotionRel = ResourceRel & {
45
- type: 'percentage_discount_promotions';
46
- };
47
- declare type ShipmentRel = ResourceRel & {
48
- type: 'shipments';
49
- };
50
- declare type SkuRel = ResourceRel & {
51
- type: 'skus';
52
- };
53
- interface LineItem extends Resource {
54
- sku_code?: string;
55
- bundle_code?: string;
56
- quantity?: number;
57
- currency_code?: string;
58
- unit_amount_cents?: number;
59
- unit_amount_float?: number;
60
- formatted_unit_amount?: string;
61
- options_amount_cents?: number;
62
- options_amount_float?: number;
63
- formatted_options_amount?: string;
64
- discount_cents?: number;
65
- discount_float?: number;
66
- formatted_discount?: string;
67
- total_amount_cents?: number;
68
- total_amount_float?: number;
69
- formatted_total_amount?: string;
70
- tax_amount_cents?: number;
71
- tax_amount_float?: number;
72
- formatted_tax_amount?: string;
73
- name?: string;
74
- image_url?: string;
75
- discount_breakdown?: object;
76
- tax_rate?: number;
77
- tax_breakdown?: object;
78
- item_type?: string;
79
- order?: Order;
80
- item?: Adjustment | Bundle | ExternalPromotion | FixedAmountPromotion | FreeShippingPromotion | GiftCard | PaymentMethod | PercentageDiscountPromotion | Shipment | Sku;
81
- line_item_options?: LineItemOption[];
82
- /**
83
- * @deprecated This field should not be used as it may be removed in the future without notice
84
- */
85
- shipment_line_items?: object[];
86
- stock_line_items?: StockLineItem[];
87
- stock_transfers?: StockTransfer[];
88
- }
89
- interface LineItemCreate extends ResourceCreate {
90
- sku_code?: string;
91
- bundle_code?: string;
92
- quantity: number;
93
- _external_price?: boolean;
94
- _update_quantity?: boolean;
95
- unit_amount_cents?: number;
96
- name?: string;
97
- image_url?: string;
98
- item_type?: string;
99
- order: OrderRel;
100
- item?: AdjustmentRel | BundleRel | ExternalPromotionRel | FixedAmountPromotionRel | FreeShippingPromotionRel | GiftCardRel | PaymentMethodRel | PercentageDiscountPromotionRel | ShipmentRel | SkuRel;
101
- }
102
- interface LineItemUpdate extends ResourceUpdate {
103
- sku_code?: string;
104
- bundle_code?: string;
105
- quantity?: number;
106
- name?: string;
107
- image_url?: string;
108
- }
109
- declare class LineItems extends ApiResource {
110
- static readonly TYPE: 'line_items';
111
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItem>>;
112
- create(resource: LineItemCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
113
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
114
- update(resource: LineItemUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
115
- delete(id: string, options?: ResourcesConfig): Promise<void>;
116
- order(lineItemId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
117
- line_item_options(lineItemId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<LineItemOption>>;
118
- stock_line_items(lineItemId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockLineItem>>;
119
- stock_transfers(lineItemId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
120
- isLineItem(resource: any): resource is LineItem;
121
- relationship(id: string | ResourceId | null): LineItemRel;
122
- type(): string;
123
- }
124
- export default LineItems;
125
- export { LineItem, LineItemCreate, LineItemUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Adjustment}from'./adjustments';import type{Bundle}from'./bundles';import type{ExternalPromotion}from'./external_promotions';import type{FixedAmountPromotion}from'./fixed_amount_promotions';import type{FreeShippingPromotion}from'./free_shipping_promotions';import type{GiftCard}from'./gift_cards';import type{PaymentMethod}from'./payment_methods';import type{PercentageDiscountPromotion}from'./percentage_discount_promotions';import type{Shipment}from'./shipments';import type{Sku}from'./skus';import type{LineItemOption}from'./line_item_options';import type{StockLineItem}from'./stock_line_items';import type{StockTransfer}from'./stock_transfers';declare type LineItemRel=ResourceRel&{type:typeof LineItems.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};declare type AdjustmentRel=ResourceRel&{type:'adjustments';};declare type BundleRel=ResourceRel&{type:'bundles';};declare type ExternalPromotionRel=ResourceRel&{type:'external_promotions';};declare type FixedAmountPromotionRel=ResourceRel&{type:'fixed_amount_promotions';};declare type FreeShippingPromotionRel=ResourceRel&{type:'free_shipping_promotions';};declare type GiftCardRel=ResourceRel&{type:'gift_cards';};declare type PaymentMethodRel=ResourceRel&{type:'payment_methods';};declare type PercentageDiscountPromotionRel=ResourceRel&{type:'percentage_discount_promotions';};declare type ShipmentRel=ResourceRel&{type:'shipments';};declare type SkuRel=ResourceRel&{type:'skus';};interface LineItem extends Resource{sku_code?:string;bundle_code?:string;quantity?:number;currency_code?:string;unit_amount_cents?:number;unit_amount_float?:number;formatted_unit_amount?:string;options_amount_cents?:number;options_amount_float?:number;formatted_options_amount?:string;discount_cents?:number;discount_float?:number;formatted_discount?:string;total_amount_cents?:number;total_amount_float?:number;formatted_total_amount?:string;tax_amount_cents?:number;tax_amount_float?:number;formatted_tax_amount?:string;name?:string;image_url?:string;discount_breakdown?:object;tax_rate?:number;tax_breakdown?:object;item_type?:string;order?:Order;item?:Adjustment|Bundle|ExternalPromotion|FixedAmountPromotion|FreeShippingPromotion|GiftCard|PaymentMethod|PercentageDiscountPromotion|Shipment|Sku;line_item_options?:LineItemOption[];shipment_line_items?:object[];stock_line_items?:StockLineItem[];stock_transfers?:StockTransfer[];}interface LineItemCreate extends ResourceCreate{sku_code?:string;bundle_code?:string;quantity:number;_external_price?:boolean;_update_quantity?:boolean;unit_amount_cents?:number;name?:string;image_url?:string;item_type?:string;order:OrderRel;item?:AdjustmentRel|BundleRel|ExternalPromotionRel|FixedAmountPromotionRel|FreeShippingPromotionRel|GiftCardRel|PaymentMethodRel|PercentageDiscountPromotionRel|ShipmentRel|SkuRel;}interface LineItemUpdate extends ResourceUpdate{sku_code?:string;bundle_code?:string;quantity?:number;name?:string;image_url?:string;}declare class LineItems extends ApiResource{static readonly TYPE:'line_items';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<LineItem>>;create(resource:LineItemCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;update(resource:LineItemUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(lineItemId:string|LineItem,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;line_item_options(lineItemId:string|LineItem,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<LineItemOption>>;stock_line_items(lineItemId:string|LineItem,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockLineItem>>;stock_transfers(lineItemId:string|LineItem,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockTransfer>>;isLineItem(resource:any):resource is LineItem;relationship(id:string|ResourceId|null):LineItemRel;type():string;}export default LineItems;export{LineItem,LineItemCreate,LineItemUpdate};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class s extends i{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:s.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:s.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async order(e,t,r){return this.resources.fetch({type:"orders"},`line_items/${e}/order`,t,r)}async line_item_options(e,t,r){return this.resources.fetch({type:"line_item_options"},`line_items/${e}/line_item_options`,t,r)}async stock_line_items(e,t,r){return this.resources.fetch({type:"stock_line_items"},`line_items/${e}/stock_line_items`,t,r)}async stock_transfers(e,t,r){return this.resources.fetch({type:"stock_transfers"},`line_items/${e}/stock_transfers`,t,r)}isLineItem(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="line_items";export default s;
1
+ import{ApiResource as n}from"../resource";class r extends n{static TYPE="line_items";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,s){const i=e.id||e;return this.resources.fetch({type:"orders"},`line_items/${i}/order`,t,s)}async line_item_options(e,t,s){const i=e.id||e;return this.resources.fetch({type:"line_item_options"},`line_items/${i}/line_item_options`,t,s)}async stock_line_items(e,t,s){const i=e.id||e;return this.resources.fetch({type:"stock_line_items"},`line_items/${i}/stock_line_items`,t,s)}async stock_transfers(e,t,s){const i=e.id||e;return this.resources.fetch({type:"stock_transfers"},`line_items/${i}/stock_transfers`,t,s)}isLineItem(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
@@ -1,33 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { PaymentMethod } from './payment_methods';
4
- declare type ManualGatewayRel = ResourceRel & {
5
- type: typeof ManualGateways.TYPE;
6
- };
7
- interface ManualGateway extends Resource {
8
- name?: string;
9
- require_capture?: boolean;
10
- payment_methods?: PaymentMethod[];
11
- }
12
- interface ManualGatewayCreate extends ResourceCreate {
13
- name: string;
14
- require_capture?: boolean;
15
- }
16
- interface ManualGatewayUpdate extends ResourceUpdate {
17
- name?: string;
18
- require_capture?: boolean;
19
- }
20
- declare class ManualGateways extends ApiResource {
21
- static readonly TYPE: 'manual_gateways';
22
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ManualGateway>>;
23
- create(resource: ManualGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
24
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
25
- update(resource: ManualGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualGateway>;
26
- delete(id: string, options?: ResourcesConfig): Promise<void>;
27
- payment_methods(manualGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
28
- isManualGateway(resource: any): resource is ManualGateway;
29
- relationship(id: string | ResourceId | null): ManualGatewayRel;
30
- type(): string;
31
- }
32
- export default ManualGateways;
33
- export { ManualGateway, ManualGatewayCreate, ManualGatewayUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PaymentMethod}from'./payment_methods';declare type ManualGatewayRel=ResourceRel&{type:typeof ManualGateways.TYPE;};interface ManualGateway extends Resource{name?:string;require_capture?:boolean;payment_methods?:PaymentMethod[];}interface ManualGatewayCreate extends ResourceCreate{name:string;require_capture?:boolean;}interface ManualGatewayUpdate extends ResourceUpdate{name?:string;require_capture?:boolean;}declare class ManualGateways extends ApiResource{static readonly TYPE:'manual_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ManualGateway>>;create(resource:ManualGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualGateway>;update(resource:ManualGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(manualGatewayId:string|ManualGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;isManualGateway(resource:any):resource is ManualGateway;relationship(id:string|ResourceId|null):ManualGatewayRel;type():string;}export default ManualGateways;export{ManualGateway,ManualGatewayCreate,ManualGatewayUpdate};
@@ -1 +1 @@
1
- import{ApiResource as a}from"../resource";class t extends a{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create({...e,type:t.TYPE},r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update({...e,type:t.TYPE},r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}async payment_methods(e,r,s){return this.resources.fetch({type:"payment_methods"},`manual_gateways/${e}/payment_methods`,r,s)}isManualGateway(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="manual_gateways";export default t;
1
+ import{ApiResource as n}from"../resource";class r extends n{static TYPE="manual_gateways";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async payment_methods(e,t,s){const a=e.id||e;return this.resources.fetch({type:"payment_methods"},`manual_gateways/${a}/payment_methods`,t,s)}isManualGateway(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
@@ -1,49 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { TaxCategory } from './tax_categories';
4
- import { Market } from './markets';
5
- import { Attachment } from './attachments';
6
- import { TaxRule } from './tax_rules';
7
- declare type ManualTaxCalculatorRel = ResourceRel & {
8
- type: typeof ManualTaxCalculators.TYPE;
9
- };
10
- declare type TaxCategoryRel = ResourceRel & {
11
- type: 'tax_categories';
12
- };
13
- declare type TaxRuleRel = ResourceRel & {
14
- type: 'tax_rules';
15
- };
16
- interface ManualTaxCalculator extends Resource {
17
- name?: string;
18
- tax_categories?: TaxCategory[];
19
- markets?: Market[];
20
- attachments?: Attachment[];
21
- tax_rules?: TaxRule[];
22
- }
23
- interface ManualTaxCalculatorCreate extends ResourceCreate {
24
- name: string;
25
- tax_categories?: TaxCategoryRel[];
26
- tax_rules?: TaxRuleRel[];
27
- }
28
- interface ManualTaxCalculatorUpdate extends ResourceUpdate {
29
- name?: string;
30
- tax_categories?: TaxCategoryRel[];
31
- tax_rules?: TaxRuleRel[];
32
- }
33
- declare class ManualTaxCalculators extends ApiResource {
34
- static readonly TYPE: 'manual_tax_calculators';
35
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<ManualTaxCalculator>>;
36
- create(resource: ManualTaxCalculatorCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
37
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
38
- update(resource: ManualTaxCalculatorUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
39
- delete(id: string, options?: ResourcesConfig): Promise<void>;
40
- tax_categories(manualTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
41
- markets(manualTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
42
- attachments(manualTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
43
- tax_rules(manualTaxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxRule>>;
44
- isManualTaxCalculator(resource: any): resource is ManualTaxCalculator;
45
- relationship(id: string | ResourceId | null): ManualTaxCalculatorRel;
46
- type(): string;
47
- }
48
- export default ManualTaxCalculators;
49
- export { ManualTaxCalculator, ManualTaxCalculatorCreate, ManualTaxCalculatorUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{TaxCategory}from'./tax_categories';import type{Market}from'./markets';import type{Attachment}from'./attachments';import type{TaxRule}from'./tax_rules';declare type ManualTaxCalculatorRel=ResourceRel&{type:typeof ManualTaxCalculators.TYPE;};declare type TaxCategoryRel=ResourceRel&{type:'tax_categories';};declare type TaxRuleRel=ResourceRel&{type:'tax_rules';};interface ManualTaxCalculator extends Resource{name?:string;tax_categories?:TaxCategory[];markets?:Market[];attachments?:Attachment[];tax_rules?:TaxRule[];}interface ManualTaxCalculatorCreate extends ResourceCreate{name:string;tax_categories?:TaxCategoryRel[];tax_rules?:TaxRuleRel[];}interface ManualTaxCalculatorUpdate extends ResourceUpdate{name?:string;tax_categories?:TaxCategoryRel[];tax_rules?:TaxRuleRel[];}declare class ManualTaxCalculators extends ApiResource{static readonly TYPE:'manual_tax_calculators';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<ManualTaxCalculator>>;create(resource:ManualTaxCalculatorCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualTaxCalculator>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualTaxCalculator>;update(resource:ManualTaxCalculatorUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualTaxCalculator>;delete(id:string,options?:ResourcesConfig):Promise<void>;tax_categories(manualTaxCalculatorId:string|ManualTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCategory>>;markets(manualTaxCalculatorId:string|ManualTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;attachments(manualTaxCalculatorId:string|ManualTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;tax_rules(manualTaxCalculatorId:string|ManualTaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxRule>>;isManualTaxCalculator(resource:any):resource is ManualTaxCalculator;relationship(id:string|ResourceId|null):ManualTaxCalculatorRel;type():string;}export default ManualTaxCalculators;export{ManualTaxCalculator,ManualTaxCalculatorCreate,ManualTaxCalculatorUpdate};
@@ -1 +1 @@
1
- import{ApiResource as r}from"../resource";class s extends r{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,a){return this.resources.create({...e,type:s.TYPE},t,a)}async retrieve(e,t,a){return this.resources.retrieve({type:s.TYPE,id:e},t,a)}async update(e,t,a){return this.resources.update({...e,type:s.TYPE},t,a)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async tax_categories(e,t,a){return this.resources.fetch({type:"tax_categories"},`manual_tax_calculators/${e}/tax_categories`,t,a)}async markets(e,t,a){return this.resources.fetch({type:"markets"},`manual_tax_calculators/${e}/markets`,t,a)}async attachments(e,t,a){return this.resources.fetch({type:"attachments"},`manual_tax_calculators/${e}/attachments`,t,a)}async tax_rules(e,t,a){return this.resources.fetch({type:"tax_rules"},`manual_tax_calculators/${e}/tax_rules`,t,a)}isManualTaxCalculator(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="manual_tax_calculators";export default s;
1
+ import{ApiResource as c}from"../resource";class a extends c{static TYPE="manual_tax_calculators";async list(e,t){return this.resources.list({type:a.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:a.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:a.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:a.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:a.TYPE,id:e},t)}async tax_categories(e,t,r){const s=e.id||e;return this.resources.fetch({type:"tax_categories"},`manual_tax_calculators/${s}/tax_categories`,t,r)}async markets(e,t,r){const s=e.id||e;return this.resources.fetch({type:"markets"},`manual_tax_calculators/${s}/markets`,t,r)}async attachments(e,t,r){const s=e.id||e;return this.resources.fetch({type:"attachments"},`manual_tax_calculators/${s}/attachments`,t,r)}async tax_rules(e,t,r){const s=e.id||e;return this.resources.fetch({type:"tax_rules"},`manual_tax_calculators/${s}/tax_rules`,t,r)}isManualTaxCalculator(e){return e.type&&e.type===a.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:a.TYPE}:{id:e.id,type:a.TYPE}}type(){return a.TYPE}}export default a;
@@ -1,81 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Merchant } from './merchants';
4
- import { PriceList } from './price_lists';
5
- import { InventoryModel } from './inventory_models';
6
- import { TaxCalculator } from './tax_calculators';
7
- import { CustomerGroup } from './customer_groups';
8
- import { Attachment } from './attachments';
9
- declare type MarketRel = ResourceRel & {
10
- type: typeof Markets.TYPE;
11
- };
12
- declare type MerchantRel = ResourceRel & {
13
- type: 'merchants';
14
- };
15
- declare type PriceListRel = ResourceRel & {
16
- type: 'price_lists';
17
- };
18
- declare type InventoryModelRel = ResourceRel & {
19
- type: 'inventory_models';
20
- };
21
- declare type TaxCalculatorRel = ResourceRel & {
22
- type: 'tax_calculators';
23
- };
24
- declare type CustomerGroupRel = ResourceRel & {
25
- type: 'customer_groups';
26
- };
27
- interface Market extends Resource {
28
- number?: number;
29
- name?: string;
30
- facebook_pixel_id?: string;
31
- checkout_url?: string;
32
- external_prices_url?: string;
33
- private?: boolean;
34
- merchant?: Merchant;
35
- price_list?: PriceList;
36
- inventory_model?: InventoryModel;
37
- tax_calculator?: TaxCalculator;
38
- customer_group?: CustomerGroup;
39
- attachments?: Attachment[];
40
- }
41
- interface MarketCreate extends ResourceCreate {
42
- name: string;
43
- facebook_pixel_id?: string;
44
- checkout_url?: string;
45
- external_prices_url?: string;
46
- merchant: MerchantRel;
47
- price_list: PriceListRel;
48
- inventory_model: InventoryModelRel;
49
- tax_calculator?: TaxCalculatorRel;
50
- customer_group?: CustomerGroupRel;
51
- }
52
- interface MarketUpdate extends ResourceUpdate {
53
- name?: string;
54
- facebook_pixel_id?: string;
55
- checkout_url?: string;
56
- external_prices_url?: string;
57
- merchant?: MerchantRel;
58
- price_list?: PriceListRel;
59
- inventory_model?: InventoryModelRel;
60
- tax_calculator?: TaxCalculatorRel;
61
- customer_group?: CustomerGroupRel;
62
- }
63
- declare class Markets extends ApiResource {
64
- static readonly TYPE: 'markets';
65
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
66
- create(resource: MarketCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
67
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
68
- update(resource: MarketUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
69
- delete(id: string, options?: ResourcesConfig): Promise<void>;
70
- merchant(marketId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
71
- price_list(marketId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PriceList>;
72
- inventory_model(marketId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
73
- tax_calculator(marketId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCalculator>;
74
- customer_group(marketId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<CustomerGroup>;
75
- attachments(marketId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
76
- isMarket(resource: any): resource is Market;
77
- relationship(id: string | ResourceId | null): MarketRel;
78
- type(): string;
79
- }
80
- export default Markets;
81
- export { Market, MarketCreate, MarketUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Merchant}from'./merchants';import type{PriceList}from'./price_lists';import type{InventoryModel}from'./inventory_models';import type{TaxCalculator}from'./tax_calculators';import type{CustomerGroup}from'./customer_groups';import type{Attachment}from'./attachments';declare type MarketRel=ResourceRel&{type:typeof Markets.TYPE;};declare type MerchantRel=ResourceRel&{type:'merchants';};declare type PriceListRel=ResourceRel&{type:'price_lists';};declare type InventoryModelRel=ResourceRel&{type:'inventory_models';};declare type TaxCalculatorRel=ResourceRel&{type:'tax_calculators';};declare type CustomerGroupRel=ResourceRel&{type:'customer_groups';};interface Market extends Resource{number?:number;name?:string;facebook_pixel_id?:string;checkout_url?:string;external_prices_url?:string;private?:boolean;merchant?:Merchant;price_list?:PriceList;inventory_model?:InventoryModel;tax_calculator?:TaxCalculator;customer_group?:CustomerGroup;attachments?:Attachment[];}interface MarketCreate extends ResourceCreate{name:string;facebook_pixel_id?:string;checkout_url?:string;external_prices_url?:string;merchant:MerchantRel;price_list:PriceListRel;inventory_model:InventoryModelRel;tax_calculator?:TaxCalculatorRel;customer_group?:CustomerGroupRel;}interface MarketUpdate extends ResourceUpdate{name?:string;facebook_pixel_id?:string;checkout_url?:string;external_prices_url?:string;merchant?:MerchantRel;price_list?:PriceListRel;inventory_model?:InventoryModelRel;tax_calculator?:TaxCalculatorRel;customer_group?:CustomerGroupRel;}declare class Markets extends ApiResource{static readonly TYPE:'markets';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;create(resource:MarketCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;update(resource:MarketUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;delete(id:string,options?:ResourcesConfig):Promise<void>;merchant(marketId:string|Market,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Merchant>;price_list(marketId:string|Market,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PriceList>;inventory_model(marketId:string|Market,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;tax_calculator(marketId:string|Market,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxCalculator>;customer_group(marketId:string|Market,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<CustomerGroup>;attachments(marketId:string|Market,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isMarket(resource:any):resource is Market;relationship(id:string|ResourceId|null):MarketRel;type():string;}export default Markets;export{Market,MarketCreate,MarketUpdate};
@@ -1 +1 @@
1
- import{ApiResource as c}from"../resource";class s extends c{async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:s.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:s.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async merchant(e,t,r){return this.resources.fetch({type:"merchants"},`markets/${e}/merchant`,t,r)}async price_list(e,t,r){return this.resources.fetch({type:"price_lists"},`markets/${e}/price_list`,t,r)}async inventory_model(e,t,r){return this.resources.fetch({type:"inventory_models"},`markets/${e}/inventory_model`,t,r)}async tax_calculator(e,t,r){return this.resources.fetch({type:"tax_calculators"},`markets/${e}/tax_calculator`,t,r)}async customer_group(e,t,r){return this.resources.fetch({type:"customer_groups"},`markets/${e}/customer_group`,t,r)}async attachments(e,t,r){return this.resources.fetch({type:"attachments"},`markets/${e}/attachments`,t,r)}isMarket(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}s.TYPE="markets";export default s;
1
+ import{ApiResource as c}from"../resource";class a extends c{static TYPE="markets";async list(e,t){return this.resources.list({type:a.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:a.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:a.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:a.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:a.TYPE,id:e},t)}async merchant(e,t,r){const s=e.id||e;return this.resources.fetch({type:"merchants"},`markets/${s}/merchant`,t,r)}async price_list(e,t,r){const s=e.id||e;return this.resources.fetch({type:"price_lists"},`markets/${s}/price_list`,t,r)}async inventory_model(e,t,r){const s=e.id||e;return this.resources.fetch({type:"inventory_models"},`markets/${s}/inventory_model`,t,r)}async tax_calculator(e,t,r){const s=e.id||e;return this.resources.fetch({type:"tax_calculators"},`markets/${s}/tax_calculator`,t,r)}async customer_group(e,t,r){const s=e.id||e;return this.resources.fetch({type:"customer_groups"},`markets/${s}/customer_group`,t,r)}async attachments(e,t,r){const s=e.id||e;return this.resources.fetch({type:"attachments"},`markets/${s}/attachments`,t,r)}isMarket(e){return e.type&&e.type===a.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:a.TYPE}:{id:e.id,type:a.TYPE}}type(){return a.TYPE}}export default a;
@@ -1,38 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Address } from './addresses';
4
- import { Attachment } from './attachments';
5
- declare type MerchantRel = ResourceRel & {
6
- type: typeof Merchants.TYPE;
7
- };
8
- declare type AddressRel = ResourceRel & {
9
- type: 'addresses';
10
- };
11
- interface Merchant extends Resource {
12
- name?: string;
13
- address?: Address;
14
- attachments?: Attachment[];
15
- }
16
- interface MerchantCreate extends ResourceCreate {
17
- name: string;
18
- address: AddressRel;
19
- }
20
- interface MerchantUpdate extends ResourceUpdate {
21
- name?: string;
22
- address?: AddressRel;
23
- }
24
- declare class Merchants extends ApiResource {
25
- static readonly TYPE: 'merchants';
26
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Merchant>>;
27
- create(resource: MerchantCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
28
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
29
- update(resource: MerchantUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Merchant>;
30
- delete(id: string, options?: ResourcesConfig): Promise<void>;
31
- address(merchantId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Address>;
32
- attachments(merchantId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
33
- isMerchant(resource: any): resource is Merchant;
34
- relationship(id: string | ResourceId | null): MerchantRel;
35
- type(): string;
36
- }
37
- export default Merchants;
38
- export { Merchant, MerchantCreate, MerchantUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Address}from'./addresses';import type{Attachment}from'./attachments';declare type MerchantRel=ResourceRel&{type:typeof Merchants.TYPE;};declare type AddressRel=ResourceRel&{type:'addresses';};interface Merchant extends Resource{name?:string;address?:Address;attachments?:Attachment[];}interface MerchantCreate extends ResourceCreate{name:string;address:AddressRel;}interface MerchantUpdate extends ResourceUpdate{name?:string;address?:AddressRel;}declare class Merchants extends ApiResource{static readonly TYPE:'merchants';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Merchant>>;create(resource:MerchantCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Merchant>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Merchant>;update(resource:MerchantUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Merchant>;delete(id:string,options?:ResourcesConfig):Promise<void>;address(merchantId:string|Merchant,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Address>;attachments(merchantId:string|Merchant,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isMerchant(resource:any):resource is Merchant;relationship(id:string|ResourceId|null):MerchantRel;type():string;}export default Merchants;export{Merchant,MerchantCreate,MerchantUpdate};
@@ -1 +1 @@
1
- import{ApiResource as a}from"../resource";class r extends a{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async address(e,t,s){return this.resources.fetch({type:"addresses"},`merchants/${e}/address`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`merchants/${e}/attachments`,t,s)}isMerchant(e){return e.type&&e.type===r.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:r.TYPE}:{id:e.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="merchants";export default r;
1
+ import{ApiResource as c}from"../resource";class s extends c{static TYPE="merchants";async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,r){return this.resources.create({...e,type:s.TYPE},t,r)}async retrieve(e,t,r){return this.resources.retrieve({type:s.TYPE,id:e},t,r)}async update(e,t,r){return this.resources.update({...e,type:s.TYPE},t,r)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async address(e,t,r){const a=e.id||e;return this.resources.fetch({type:"addresses"},`merchants/${a}/address`,t,r)}async attachments(e,t,r){const a=e.id||e;return this.resources.fetch({type:"attachments"},`merchants/${a}/attachments`,t,r)}isMerchant(e){return e.type&&e.type===s.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:s.TYPE}:{id:e.id,type:s.TYPE}}type(){return s.TYPE}}export default s;
@@ -1,56 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { PercentageDiscountPromotion } from './percentage_discount_promotions';
4
- import { FreeShippingPromotion } from './free_shipping_promotions';
5
- import { FixedAmountPromotion } from './fixed_amount_promotions';
6
- import { FreeGiftPromotion } from './free_gift_promotions';
7
- import { FixedPricePromotion } from './fixed_price_promotions';
8
- import { ExternalPromotion } from './external_promotions';
9
- declare type OrderAmountPromotionRuleRel = ResourceRel & {
10
- type: typeof OrderAmountPromotionRules.TYPE;
11
- };
12
- declare type PercentageDiscountPromotionRel = ResourceRel & {
13
- type: 'percentage_discount_promotions';
14
- };
15
- declare type FreeShippingPromotionRel = ResourceRel & {
16
- type: 'free_shipping_promotions';
17
- };
18
- declare type FixedAmountPromotionRel = ResourceRel & {
19
- type: 'fixed_amount_promotions';
20
- };
21
- declare type FreeGiftPromotionRel = ResourceRel & {
22
- type: 'free_gift_promotions';
23
- };
24
- declare type FixedPricePromotionRel = ResourceRel & {
25
- type: 'fixed_price_promotions';
26
- };
27
- declare type ExternalPromotionRel = ResourceRel & {
28
- type: 'external_promotions';
29
- };
30
- interface OrderAmountPromotionRule extends Resource {
31
- order_amount_cents?: number;
32
- order_amount_float?: number;
33
- formatted_order_amount?: string;
34
- promotion?: PercentageDiscountPromotion | FreeShippingPromotion | FixedAmountPromotion | FreeGiftPromotion | FixedPricePromotion | ExternalPromotion;
35
- }
36
- interface OrderAmountPromotionRuleCreate extends ResourceCreate {
37
- order_amount_cents?: number;
38
- promotion: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
39
- }
40
- interface OrderAmountPromotionRuleUpdate extends ResourceUpdate {
41
- order_amount_cents?: number;
42
- promotion?: PercentageDiscountPromotionRel | FreeShippingPromotionRel | FixedAmountPromotionRel | FreeGiftPromotionRel | FixedPricePromotionRel | ExternalPromotionRel;
43
- }
44
- declare class OrderAmountPromotionRules extends ApiResource {
45
- static readonly TYPE: 'order_amount_promotion_rules';
46
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<OrderAmountPromotionRule>>;
47
- create(resource: OrderAmountPromotionRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
48
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
49
- update(resource: OrderAmountPromotionRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<OrderAmountPromotionRule>;
50
- delete(id: string, options?: ResourcesConfig): Promise<void>;
51
- isOrderAmountPromotionRule(resource: any): resource is OrderAmountPromotionRule;
52
- relationship(id: string | ResourceId | null): OrderAmountPromotionRuleRel;
53
- type(): string;
54
- }
55
- export default OrderAmountPromotionRules;
56
- export { OrderAmountPromotionRule, OrderAmountPromotionRuleCreate, OrderAmountPromotionRuleUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PercentageDiscountPromotion}from'./percentage_discount_promotions';import type{FreeShippingPromotion}from'./free_shipping_promotions';import type{FixedAmountPromotion}from'./fixed_amount_promotions';import type{FreeGiftPromotion}from'./free_gift_promotions';import type{FixedPricePromotion}from'./fixed_price_promotions';import type{ExternalPromotion}from'./external_promotions';declare type OrderAmountPromotionRuleRel=ResourceRel&{type:typeof OrderAmountPromotionRules.TYPE;};declare type PercentageDiscountPromotionRel=ResourceRel&{type:'percentage_discount_promotions';};declare type FreeShippingPromotionRel=ResourceRel&{type:'free_shipping_promotions';};declare type FixedAmountPromotionRel=ResourceRel&{type:'fixed_amount_promotions';};declare type FreeGiftPromotionRel=ResourceRel&{type:'free_gift_promotions';};declare type FixedPricePromotionRel=ResourceRel&{type:'fixed_price_promotions';};declare type ExternalPromotionRel=ResourceRel&{type:'external_promotions';};interface OrderAmountPromotionRule extends Resource{order_amount_cents?:number;order_amount_float?:number;formatted_order_amount?:string;promotion?:PercentageDiscountPromotion|FreeShippingPromotion|FixedAmountPromotion|FreeGiftPromotion|FixedPricePromotion|ExternalPromotion;}interface OrderAmountPromotionRuleCreate extends ResourceCreate{order_amount_cents?:number;promotion:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;}interface OrderAmountPromotionRuleUpdate extends ResourceUpdate{order_amount_cents?:number;promotion?:PercentageDiscountPromotionRel|FreeShippingPromotionRel|FixedAmountPromotionRel|FreeGiftPromotionRel|FixedPricePromotionRel|ExternalPromotionRel;}declare class OrderAmountPromotionRules extends ApiResource{static readonly TYPE:'order_amount_promotion_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<OrderAmountPromotionRule>>;create(resource:OrderAmountPromotionRuleCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;update(resource:OrderAmountPromotionRuleUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<OrderAmountPromotionRule>;delete(id:string,options?:ResourcesConfig):Promise<void>;isOrderAmountPromotionRule(resource:any):resource is OrderAmountPromotionRule;relationship(id:string|ResourceId|null):OrderAmountPromotionRuleRel;type():string;}export default OrderAmountPromotionRules;export{OrderAmountPromotionRule,OrderAmountPromotionRuleCreate,OrderAmountPromotionRuleUpdate};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class t extends i{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create({...e,type:t.TYPE},r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update({...e,type:t.TYPE},r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isOrderAmountPromotionRule(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}t.TYPE="order_amount_promotion_rules";export default t;
1
+ import{ApiResource as i}from"../resource";class t extends i{static TYPE="order_amount_promotion_rules";async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async create(e,r,s){return this.resources.create({...e,type:t.TYPE},r,s)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async update(e,r,s){return this.resources.update({...e,type:t.TYPE},r,s)}async delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isOrderAmountPromotionRule(e){return e.type&&e.type===t.TYPE}relationship(e){return e===null||typeof e=="string"?{id:e,type:t.TYPE}:{id:e.id,type:t.TYPE}}type(){return t.TYPE}}export default t;