@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,24 +1 @@
1
- import { ApiResource, Resource, 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 GeocoderRel = ResourceRel & {
6
- type: typeof Geocoders.TYPE;
7
- };
8
- interface Geocoder extends Resource {
9
- name?: string;
10
- addresses?: Address[];
11
- attachments?: Attachment[];
12
- }
13
- declare class Geocoders extends ApiResource {
14
- static readonly TYPE: 'geocoders';
15
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Geocoder>>;
16
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Geocoder>;
17
- addresses(geocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
18
- attachments(geocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
19
- isGeocoder(resource: any): resource is Geocoder;
20
- relationship(id: string | ResourceId | null): GeocoderRel;
21
- type(): string;
22
- }
23
- export default Geocoders;
24
- export { Geocoder };
1
+ import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Address}from'./addresses';import type{Attachment}from'./attachments';declare type GeocoderRel=ResourceRel&{type:typeof Geocoders.TYPE;};interface Geocoder extends Resource{name?:string;addresses?:Address[];attachments?:Attachment[];}declare class Geocoders extends ApiResource{static readonly TYPE:'geocoders';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Geocoder>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Geocoder>;addresses(geocoderId:string|Geocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Address>>;attachments(geocoderId:string|Geocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGeocoder(resource:any):resource is Geocoder;relationship(id:string|ResourceId|null):GeocoderRel;type():string;}export default Geocoders;export{Geocoder};
@@ -1 +1 @@
1
- import{ApiResource as c}from"../resource";class t extends c{async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async addresses(e,r,s){return this.resources.fetch({type:"addresses"},`geocoders/${e}/addresses`,r,s)}async attachments(e,r,s){return this.resources.fetch({type:"attachments"},`geocoders/${e}/attachments`,r,s)}isGeocoder(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="geocoders";export default t;
1
+ import{ApiResource as i}from"../resource";class t extends i{static TYPE="geocoders";async list(e,r){return this.resources.list({type:t.TYPE},e,r)}async retrieve(e,r,s){return this.resources.retrieve({type:t.TYPE,id:e},r,s)}async addresses(e,r,s){const c=e.id||e;return this.resources.fetch({type:"addresses"},`geocoders/${c}/addresses`,r,s)}async attachments(e,r,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`geocoders/${c}/attachments`,r,s)}isGeocoder(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;
@@ -1,44 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Customer } from './customers';
4
- import { Attachment } from './attachments';
5
- declare type GiftCardRecipientRel = ResourceRel & {
6
- type: typeof GiftCardRecipients.TYPE;
7
- };
8
- declare type CustomerRel = ResourceRel & {
9
- type: 'customers';
10
- };
11
- interface GiftCardRecipient extends Resource {
12
- email?: string;
13
- first_name?: string;
14
- last_name?: string;
15
- customer?: Customer;
16
- attachments?: Attachment[];
17
- }
18
- interface GiftCardRecipientCreate extends ResourceCreate {
19
- email: string;
20
- first_name?: string;
21
- last_name?: string;
22
- customer?: CustomerRel;
23
- }
24
- interface GiftCardRecipientUpdate extends ResourceUpdate {
25
- email?: string;
26
- first_name?: string;
27
- last_name?: string;
28
- customer?: CustomerRel;
29
- }
30
- declare class GiftCardRecipients extends ApiResource {
31
- static readonly TYPE: 'gift_card_recipients';
32
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<GiftCardRecipient>>;
33
- create(resource: GiftCardRecipientCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
34
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
35
- update(resource: GiftCardRecipientUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
36
- delete(id: string, options?: ResourcesConfig): Promise<void>;
37
- customer(giftCardRecipientId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
38
- attachments(giftCardRecipientId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
39
- isGiftCardRecipient(resource: any): resource is GiftCardRecipient;
40
- relationship(id: string | ResourceId | null): GiftCardRecipientRel;
41
- type(): string;
42
- }
43
- export default GiftCardRecipients;
44
- export { GiftCardRecipient, GiftCardRecipientCreate, GiftCardRecipientUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Customer}from'./customers';import type{Attachment}from'./attachments';declare type GiftCardRecipientRel=ResourceRel&{type:typeof GiftCardRecipients.TYPE;};declare type CustomerRel=ResourceRel&{type:'customers';};interface GiftCardRecipient extends Resource{email?:string;first_name?:string;last_name?:string;customer?:Customer;attachments?:Attachment[];}interface GiftCardRecipientCreate extends ResourceCreate{email:string;first_name?:string;last_name?:string;customer?:CustomerRel;}interface GiftCardRecipientUpdate extends ResourceUpdate{email?:string;first_name?:string;last_name?:string;customer?:CustomerRel;}declare class GiftCardRecipients extends ApiResource{static readonly TYPE:'gift_card_recipients';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<GiftCardRecipient>>;create(resource:GiftCardRecipientCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;update(resource:GiftCardRecipientUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;delete(id:string,options?:ResourcesConfig):Promise<void>;customer(giftCardRecipientId:string|GiftCardRecipient,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;attachments(giftCardRecipientId:string|GiftCardRecipient,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGiftCardRecipient(resource:any):resource is GiftCardRecipient;relationship(id:string|ResourceId|null):GiftCardRecipientRel;type():string;}export default GiftCardRecipients;export{GiftCardRecipient,GiftCardRecipientCreate,GiftCardRecipientUpdate};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{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 customer(e,t,s){return this.resources.fetch({type:"customers"},`gift_card_recipients/${e}/customer`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`gift_card_recipients/${e}/attachments`,t,s)}isGiftCardRecipient(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="gift_card_recipients";export default r;
1
+ import{ApiResource as c}from"../resource";class r extends c{static TYPE="gift_card_recipients";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 customer(e,t,s){const i=e.id||e;return this.resources.fetch({type:"customers"},`gift_card_recipients/${i}/customer`,t,s)}async attachments(e,t,s){const i=e.id||e;return this.resources.fetch({type:"attachments"},`gift_card_recipients/${i}/attachments`,t,s)}isGiftCardRecipient(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,82 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Market } from './markets';
4
- import { GiftCardRecipient } from './gift_card_recipients';
5
- import { Attachment } from './attachments';
6
- declare type GiftCardRel = ResourceRel & {
7
- type: typeof GiftCards.TYPE;
8
- };
9
- declare type MarketRel = ResourceRel & {
10
- type: 'markets';
11
- };
12
- declare type GiftCardRecipientRel = ResourceRel & {
13
- type: 'gift_card_recipients';
14
- };
15
- interface GiftCard extends Resource {
16
- status?: string;
17
- code?: string;
18
- currency_code?: string;
19
- initial_balance_cents?: number;
20
- initial_balance_float?: number;
21
- formatted_initial_balance?: string;
22
- balance_cents?: number;
23
- balance_float?: number;
24
- formatted_balance?: string;
25
- balance_max_cents?: string;
26
- balance_max_float?: number;
27
- formatted_balance_max?: string;
28
- balance_log?: object[];
29
- single_use?: boolean;
30
- rechargeable?: boolean;
31
- image_url?: string;
32
- expires_at?: string;
33
- recipient_email?: string;
34
- market?: Market;
35
- gift_card_recipient?: GiftCardRecipient;
36
- attachments?: Attachment[];
37
- }
38
- interface GiftCardCreate extends ResourceCreate {
39
- code?: string;
40
- currency_code?: string;
41
- balance_cents: number;
42
- balance_max_cents?: string;
43
- single_use?: boolean;
44
- rechargeable?: boolean;
45
- image_url?: string;
46
- expires_at?: string;
47
- recipient_email?: string;
48
- market?: MarketRel;
49
- gift_card_recipient?: GiftCardRecipientRel;
50
- }
51
- interface GiftCardUpdate extends ResourceUpdate {
52
- currency_code?: string;
53
- balance_cents?: number;
54
- balance_max_cents?: string;
55
- single_use?: boolean;
56
- rechargeable?: boolean;
57
- image_url?: string;
58
- expires_at?: string;
59
- recipient_email?: string;
60
- _purchase?: boolean;
61
- _activate?: boolean;
62
- _deactivate?: boolean;
63
- _balance_change_cents?: number;
64
- market?: MarketRel;
65
- gift_card_recipient?: GiftCardRecipientRel;
66
- }
67
- declare class GiftCards extends ApiResource {
68
- static readonly TYPE: 'gift_cards';
69
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<GiftCard>>;
70
- create(resource: GiftCardCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
71
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
72
- update(resource: GiftCardUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCard>;
73
- delete(id: string, options?: ResourcesConfig): Promise<void>;
74
- market(giftCardId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
75
- gift_card_recipient(giftCardId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GiftCardRecipient>;
76
- attachments(giftCardId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
77
- isGiftCard(resource: any): resource is GiftCard;
78
- relationship(id: string | ResourceId | null): GiftCardRel;
79
- type(): string;
80
- }
81
- export default GiftCards;
82
- export { GiftCard, GiftCardCreate, GiftCardUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{GiftCardRecipient}from'./gift_card_recipients';import type{Attachment}from'./attachments';declare type GiftCardRel=ResourceRel&{type:typeof GiftCards.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type GiftCardRecipientRel=ResourceRel&{type:'gift_card_recipients';};interface GiftCard extends Resource{status?:string;code?:string;currency_code?:string;initial_balance_cents?:number;initial_balance_float?:number;formatted_initial_balance?:string;balance_cents?:number;balance_float?:number;formatted_balance?:string;balance_max_cents?:string;balance_max_float?:number;formatted_balance_max?:string;balance_log?:object[];single_use?:boolean;rechargeable?:boolean;image_url?:string;expires_at?:string;recipient_email?:string;market?:Market;gift_card_recipient?:GiftCardRecipient;attachments?:Attachment[];}interface GiftCardCreate extends ResourceCreate{code?:string;currency_code?:string;balance_cents:number;balance_max_cents?:string;single_use?:boolean;rechargeable?:boolean;image_url?:string;expires_at?:string;recipient_email?:string;market?:MarketRel;gift_card_recipient?:GiftCardRecipientRel;}interface GiftCardUpdate extends ResourceUpdate{currency_code?:string;balance_cents?:number;balance_max_cents?:string;single_use?:boolean;rechargeable?:boolean;image_url?:string;expires_at?:string;recipient_email?:string;_purchase?:boolean;_activate?:boolean;_deactivate?:boolean;_balance_change_cents?:number;market?:MarketRel;gift_card_recipient?:GiftCardRecipientRel;}declare class GiftCards extends ApiResource{static readonly TYPE:'gift_cards';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<GiftCard>>;create(resource:GiftCardCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;update(resource:GiftCardUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCard>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(giftCardId:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;gift_card_recipient(giftCardId:string|GiftCard,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GiftCardRecipient>;attachments(giftCardId:string|GiftCard,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGiftCard(resource:any):resource is GiftCard;relationship(id:string|ResourceId|null):GiftCardRel;type():string;}export default GiftCards;export{GiftCard,GiftCardCreate,GiftCardUpdate};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class r extends i{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 market(e,t,s){return this.resources.fetch({type:"markets"},`gift_cards/${e}/market`,t,s)}async gift_card_recipient(e,t,s){return this.resources.fetch({type:"gift_card_recipients"},`gift_cards/${e}/gift_card_recipient`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`gift_cards/${e}/attachments`,t,s)}isGiftCard(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="gift_cards";export default r;
1
+ import{ApiResource as i}from"../resource";class s extends i{static TYPE="gift_cards";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 market(e,t,r){const c=e.id||e;return this.resources.fetch({type:"markets"},`gift_cards/${c}/market`,t,r)}async gift_card_recipient(e,t,r){const c=e.id||e;return this.resources.fetch({type:"gift_card_recipients"},`gift_cards/${c}/gift_card_recipient`,t,r)}async attachments(e,t,r){const c=e.id||e;return this.resources.fetch({type:"attachments"},`gift_cards/${c}/attachments`,t,r)}isGiftCard(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,35 +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 GoogleGeocoderRel = ResourceRel & {
6
- type: typeof GoogleGeocoders.TYPE;
7
- };
8
- interface GoogleGeocoder extends Resource {
9
- name?: string;
10
- addresses?: Address[];
11
- attachments?: Attachment[];
12
- }
13
- interface GoogleGeocoderCreate extends ResourceCreate {
14
- name: string;
15
- api_key: string;
16
- }
17
- interface GoogleGeocoderUpdate extends ResourceUpdate {
18
- name?: string;
19
- api_key?: string;
20
- }
21
- declare class GoogleGeocoders extends ApiResource {
22
- static readonly TYPE: 'google_geocoders';
23
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<GoogleGeocoder>>;
24
- create(resource: GoogleGeocoderCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GoogleGeocoder>;
25
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GoogleGeocoder>;
26
- update(resource: GoogleGeocoderUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<GoogleGeocoder>;
27
- delete(id: string, options?: ResourcesConfig): Promise<void>;
28
- addresses(googleGeocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Address>>;
29
- attachments(googleGeocoderId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
30
- isGoogleGeocoder(resource: any): resource is GoogleGeocoder;
31
- relationship(id: string | ResourceId | null): GoogleGeocoderRel;
32
- type(): string;
33
- }
34
- export default GoogleGeocoders;
35
- export { GoogleGeocoder, GoogleGeocoderCreate, GoogleGeocoderUpdate };
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 GoogleGeocoderRel=ResourceRel&{type:typeof GoogleGeocoders.TYPE;};interface GoogleGeocoder extends Resource{name?:string;addresses?:Address[];attachments?:Attachment[];}interface GoogleGeocoderCreate extends ResourceCreate{name:string;api_key:string;}interface GoogleGeocoderUpdate extends ResourceUpdate{name?:string;api_key?:string;}declare class GoogleGeocoders extends ApiResource{static readonly TYPE:'google_geocoders';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<GoogleGeocoder>>;create(resource:GoogleGeocoderCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GoogleGeocoder>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GoogleGeocoder>;update(resource:GoogleGeocoderUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<GoogleGeocoder>;delete(id:string,options?:ResourcesConfig):Promise<void>;addresses(googleGeocoderId:string|GoogleGeocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Address>>;attachments(googleGeocoderId:string|GoogleGeocoder,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isGoogleGeocoder(resource:any):resource is GoogleGeocoder;relationship(id:string|ResourceId|null):GoogleGeocoderRel;type():string;}export default GoogleGeocoders;export{GoogleGeocoder,GoogleGeocoderCreate,GoogleGeocoderUpdate};
@@ -1 +1 @@
1
- import{ApiResource as o}from"../resource";class s extends o{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 addresses(e,t,r){return this.resources.fetch({type:"addresses"},`google_geocoders/${e}/addresses`,t,r)}async attachments(e,t,r){return this.resources.fetch({type:"attachments"},`google_geocoders/${e}/attachments`,t,r)}isGoogleGeocoder(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="google_geocoders";export default s;
1
+ import{ApiResource as c}from"../resource";class s extends c{static TYPE="google_geocoders";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 addresses(e,t,r){const o=e.id||e;return this.resources.fetch({type:"addresses"},`google_geocoders/${o}/addresses`,t,r)}async attachments(e,t,r){const o=e.id||e;return this.resources.fetch({type:"attachments"},`google_geocoders/${o}/attachments`,t,r)}isGoogleGeocoder(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,40 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- declare type ImportRel = ResourceRel & {
4
- type: typeof Imports.TYPE;
5
- };
6
- interface Import extends Resource {
7
- resource_type?: string;
8
- parent_resource_id?: string;
9
- status?: string;
10
- started_at?: string;
11
- completed_at?: string;
12
- interrupted_at?: string;
13
- inputs?: object[];
14
- inputs_size?: number;
15
- errors_count?: number;
16
- warnings_count?: number;
17
- destroyed_count?: number;
18
- processed_count?: number;
19
- errors_log?: object;
20
- warnings_log?: object;
21
- cleanup_records?: boolean;
22
- }
23
- interface ImportCreate extends ResourceCreate {
24
- resource_type: string;
25
- parent_resource_id?: string;
26
- inputs: object[];
27
- cleanup_records?: boolean;
28
- }
29
- declare class Imports extends ApiResource {
30
- static readonly TYPE: 'imports';
31
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Import>>;
32
- create(resource: ImportCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Import>;
33
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Import>;
34
- delete(id: string, options?: ResourcesConfig): Promise<void>;
35
- isImport(resource: any): resource is Import;
36
- relationship(id: string | ResourceId | null): ImportRel;
37
- type(): string;
38
- }
39
- export default Imports;
40
- export { Import, ImportCreate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';declare type ImportRel=ResourceRel&{type:typeof Imports.TYPE;};interface Import extends Resource{resource_type?:string;parent_resource_id?:string;status?:string;started_at?:string;completed_at?:string;interrupted_at?:string;inputs?:object[];inputs_size?:number;errors_count?:number;warnings_count?:number;destroyed_count?:number;processed_count?:number;errors_log?:object;warnings_log?:object;cleanup_records?:boolean;}interface ImportCreate extends ResourceCreate{resource_type:string;parent_resource_id?:string;inputs:object[];cleanup_records?:boolean;}declare class Imports extends ApiResource{static readonly TYPE:'imports';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Import>>;create(resource:ImportCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Import>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Import>;delete(id:string,options?:ResourcesConfig):Promise<void>;isImport(resource:any):resource is Import;relationship(id:string|ResourceId|null):ImportRel;type():string;}export default Imports;export{Import,ImportCreate};
@@ -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 delete(e,r){await this.resources.delete({type:t.TYPE,id:e},r)}isImport(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="imports";export default t;
1
+ import{ApiResource as i}from"../resource";class t extends i{static TYPE="imports";async list(e,s){return this.resources.list({type:t.TYPE},e,s)}async create(e,s,r){return this.resources.create({...e,type:t.TYPE},s,r)}async retrieve(e,s,r){return this.resources.retrieve({type:t.TYPE,id:e},s,r)}async delete(e,s){await this.resources.delete({type:t.TYPE,id:e},s)}isImport(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;
@@ -1,59 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Market } from './markets';
4
- import { Customer } from './customers';
5
- import { Sku } from './skus';
6
- declare type InStockSubscriptionRel = ResourceRel & {
7
- type: typeof InStockSubscriptions.TYPE;
8
- };
9
- declare type MarketRel = ResourceRel & {
10
- type: 'markets';
11
- };
12
- declare type CustomerRel = ResourceRel & {
13
- type: 'customers';
14
- };
15
- declare type SkuRel = ResourceRel & {
16
- type: 'skus';
17
- };
18
- interface InStockSubscription extends Resource {
19
- status?: string;
20
- customer_email?: string;
21
- sku_code?: string;
22
- stock_threshold?: number;
23
- market?: Market;
24
- customer?: Customer;
25
- sku?: Sku;
26
- }
27
- interface InStockSubscriptionCreate extends ResourceCreate {
28
- customer_email?: string;
29
- sku_code?: string;
30
- stock_threshold?: number;
31
- market: MarketRel;
32
- customer: CustomerRel;
33
- sku: SkuRel;
34
- }
35
- interface InStockSubscriptionUpdate extends ResourceUpdate {
36
- sku_code?: string;
37
- stock_threshold?: number;
38
- _activate?: boolean;
39
- _deactivate?: boolean;
40
- market?: MarketRel;
41
- customer?: CustomerRel;
42
- sku?: SkuRel;
43
- }
44
- declare class InStockSubscriptions extends ApiResource {
45
- static readonly TYPE: 'in_stock_subscriptions';
46
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InStockSubscription>>;
47
- create(resource: InStockSubscriptionCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
48
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
49
- update(resource: InStockSubscriptionUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InStockSubscription>;
50
- delete(id: string, options?: ResourcesConfig): Promise<void>;
51
- market(inStockSubscriptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Market>;
52
- customer(inStockSubscriptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Customer>;
53
- sku(inStockSubscriptionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
54
- isInStockSubscription(resource: any): resource is InStockSubscription;
55
- relationship(id: string | ResourceId | null): InStockSubscriptionRel;
56
- type(): string;
57
- }
58
- export default InStockSubscriptions;
59
- export { InStockSubscription, InStockSubscriptionCreate, InStockSubscriptionUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Market}from'./markets';import type{Customer}from'./customers';import type{Sku}from'./skus';declare type InStockSubscriptionRel=ResourceRel&{type:typeof InStockSubscriptions.TYPE;};declare type MarketRel=ResourceRel&{type:'markets';};declare type CustomerRel=ResourceRel&{type:'customers';};declare type SkuRel=ResourceRel&{type:'skus';};interface InStockSubscription extends Resource{status?:string;customer_email?:string;sku_code?:string;stock_threshold?:number;market?:Market;customer?:Customer;sku?:Sku;}interface InStockSubscriptionCreate extends ResourceCreate{customer_email?:string;sku_code?:string;stock_threshold?:number;market:MarketRel;customer:CustomerRel;sku:SkuRel;}interface InStockSubscriptionUpdate extends ResourceUpdate{sku_code?:string;stock_threshold?:number;_activate?:boolean;_deactivate?:boolean;market?:MarketRel;customer?:CustomerRel;sku?:SkuRel;}declare class InStockSubscriptions extends ApiResource{static readonly TYPE:'in_stock_subscriptions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InStockSubscription>>;create(resource:InStockSubscriptionCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;update(resource:InStockSubscriptionUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InStockSubscription>;delete(id:string,options?:ResourcesConfig):Promise<void>;market(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Market>;customer(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Customer>;sku(inStockSubscriptionId:string|InStockSubscription,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;isInStockSubscription(resource:any):resource is InStockSubscription;relationship(id:string|ResourceId|null):InStockSubscriptionRel;type():string;}export default InStockSubscriptions;export{InStockSubscription,InStockSubscriptionCreate,InStockSubscriptionUpdate};
@@ -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 market(e,t,r){return this.resources.fetch({type:"markets"},`in_stock_subscriptions/${e}/market`,t,r)}async customer(e,t,r){return this.resources.fetch({type:"customers"},`in_stock_subscriptions/${e}/customer`,t,r)}async sku(e,t,r){return this.resources.fetch({type:"skus"},`in_stock_subscriptions/${e}/sku`,t,r)}isInStockSubscription(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="in_stock_subscriptions";export default s;
1
+ import{ApiResource as c}from"../resource";class r extends c{static TYPE="in_stock_subscriptions";async list(e,s){return this.resources.list({type:r.TYPE},e,s)}async create(e,s,t){return this.resources.create({...e,type:r.TYPE},s,t)}async retrieve(e,s,t){return this.resources.retrieve({type:r.TYPE,id:e},s,t)}async update(e,s,t){return this.resources.update({...e,type:r.TYPE},s,t)}async delete(e,s){await this.resources.delete({type:r.TYPE,id:e},s)}async market(e,s,t){const i=e.id||e;return this.resources.fetch({type:"markets"},`in_stock_subscriptions/${i}/market`,s,t)}async customer(e,s,t){const i=e.id||e;return this.resources.fetch({type:"customers"},`in_stock_subscriptions/${i}/customer`,s,t)}async sku(e,s,t){const i=e.id||e;return this.resources.fetch({type:"skus"},`in_stock_subscriptions/${i}/sku`,s,t)}isInStockSubscription(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,42 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { InventoryStockLocation } from './inventory_stock_locations';
4
- import { InventoryReturnLocation } from './inventory_return_locations';
5
- import { Attachment } from './attachments';
6
- declare type InventoryModelRel = ResourceRel & {
7
- type: typeof InventoryModels.TYPE;
8
- };
9
- interface InventoryModel extends Resource {
10
- name?: string;
11
- strategy?: string;
12
- stock_locations_cutoff?: number;
13
- inventory_stock_locations?: InventoryStockLocation[];
14
- inventory_return_locations?: InventoryReturnLocation[];
15
- attachments?: Attachment[];
16
- }
17
- interface InventoryModelCreate extends ResourceCreate {
18
- name: string;
19
- strategy: string;
20
- stock_locations_cutoff?: number;
21
- }
22
- interface InventoryModelUpdate extends ResourceUpdate {
23
- name?: string;
24
- strategy?: string;
25
- stock_locations_cutoff?: number;
26
- }
27
- declare class InventoryModels extends ApiResource {
28
- static readonly TYPE: 'inventory_models';
29
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryModel>>;
30
- create(resource: InventoryModelCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
31
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
32
- update(resource: InventoryModelUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
33
- delete(id: string, options?: ResourcesConfig): Promise<void>;
34
- inventory_stock_locations(inventoryModelId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
35
- inventory_return_locations(inventoryModelId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
36
- attachments(inventoryModelId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
37
- isInventoryModel(resource: any): resource is InventoryModel;
38
- relationship(id: string | ResourceId | null): InventoryModelRel;
39
- type(): string;
40
- }
41
- export default InventoryModels;
42
- export { InventoryModel, InventoryModelCreate, InventoryModelUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{InventoryStockLocation}from'./inventory_stock_locations';import type{InventoryReturnLocation}from'./inventory_return_locations';import type{Attachment}from'./attachments';declare type InventoryModelRel=ResourceRel&{type:typeof InventoryModels.TYPE;};interface InventoryModel extends Resource{name?:string;strategy?:string;stock_locations_cutoff?:number;inventory_stock_locations?:InventoryStockLocation[];inventory_return_locations?:InventoryReturnLocation[];attachments?:Attachment[];}interface InventoryModelCreate extends ResourceCreate{name:string;strategy:string;stock_locations_cutoff?:number;}interface InventoryModelUpdate extends ResourceUpdate{name?:string;strategy?:string;stock_locations_cutoff?:number;}declare class InventoryModels extends ApiResource{static readonly TYPE:'inventory_models';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryModel>>;create(resource:InventoryModelCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;update(resource:InventoryModelUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;delete(id:string,options?:ResourcesConfig):Promise<void>;inventory_stock_locations(inventoryModelId:string|InventoryModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryStockLocation>>;inventory_return_locations(inventoryModelId:string|InventoryModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryReturnLocation>>;attachments(inventoryModelId:string|InventoryModel,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isInventoryModel(resource:any):resource is InventoryModel;relationship(id:string|ResourceId|null):InventoryModelRel;type():string;}export default InventoryModels;export{InventoryModel,InventoryModelCreate,InventoryModelUpdate};
@@ -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,n){return this.resources.create({...e,type:r.TYPE},t,n)}async retrieve(e,t,n){return this.resources.retrieve({type:r.TYPE,id:e},t,n)}async update(e,t,n){return this.resources.update({...e,type:r.TYPE},t,n)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async inventory_stock_locations(e,t,n){return this.resources.fetch({type:"inventory_stock_locations"},`inventory_models/${e}/inventory_stock_locations`,t,n)}async inventory_return_locations(e,t,n){return this.resources.fetch({type:"inventory_return_locations"},`inventory_models/${e}/inventory_return_locations`,t,n)}async attachments(e,t,n){return this.resources.fetch({type:"attachments"},`inventory_models/${e}/attachments`,t,n)}isInventoryModel(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="inventory_models";export default r;
1
+ import{ApiResource as o}from"../resource";class s extends o{static TYPE="inventory_models";async list(t,e){return this.resources.list({type:s.TYPE},t,e)}async create(t,e,r){return this.resources.create({...t,type:s.TYPE},e,r)}async retrieve(t,e,r){return this.resources.retrieve({type:s.TYPE,id:t},e,r)}async update(t,e,r){return this.resources.update({...t,type:s.TYPE},e,r)}async delete(t,e){await this.resources.delete({type:s.TYPE,id:t},e)}async inventory_stock_locations(t,e,r){const n=t.id||t;return this.resources.fetch({type:"inventory_stock_locations"},`inventory_models/${n}/inventory_stock_locations`,e,r)}async inventory_return_locations(t,e,r){const n=t.id||t;return this.resources.fetch({type:"inventory_return_locations"},`inventory_models/${n}/inventory_return_locations`,e,r)}async attachments(t,e,r){const n=t.id||t;return this.resources.fetch({type:"attachments"},`inventory_models/${n}/attachments`,e,r)}isInventoryModel(t){return t.type&&t.type===s.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:s.TYPE}:{id:t.id,type:s.TYPE}}type(){return s.TYPE}}export default s;
@@ -1,43 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { StockLocation } from './stock_locations';
4
- import { InventoryModel } from './inventory_models';
5
- declare type InventoryReturnLocationRel = ResourceRel & {
6
- type: typeof InventoryReturnLocations.TYPE;
7
- };
8
- declare type StockLocationRel = ResourceRel & {
9
- type: 'stock_locations';
10
- };
11
- declare type InventoryModelRel = ResourceRel & {
12
- type: 'inventory_models';
13
- };
14
- interface InventoryReturnLocation extends Resource {
15
- priority?: number;
16
- stock_location?: StockLocation;
17
- inventory_model?: InventoryModel;
18
- }
19
- interface InventoryReturnLocationCreate extends ResourceCreate {
20
- priority: number;
21
- stock_location: StockLocationRel;
22
- inventory_model: InventoryModelRel;
23
- }
24
- interface InventoryReturnLocationUpdate extends ResourceUpdate {
25
- priority?: number;
26
- stock_location?: StockLocationRel;
27
- inventory_model?: InventoryModelRel;
28
- }
29
- declare class InventoryReturnLocations extends ApiResource {
30
- static readonly TYPE: 'inventory_return_locations';
31
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryReturnLocation>>;
32
- create(resource: InventoryReturnLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryReturnLocation>;
33
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryReturnLocation>;
34
- update(resource: InventoryReturnLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryReturnLocation>;
35
- delete(id: string, options?: ResourcesConfig): Promise<void>;
36
- stock_location(inventoryReturnLocationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
37
- inventory_model(inventoryReturnLocationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
38
- isInventoryReturnLocation(resource: any): resource is InventoryReturnLocation;
39
- relationship(id: string | ResourceId | null): InventoryReturnLocationRel;
40
- type(): string;
41
- }
42
- export default InventoryReturnLocations;
43
- export { InventoryReturnLocation, InventoryReturnLocationCreate, InventoryReturnLocationUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockLocation}from'./stock_locations';import type{InventoryModel}from'./inventory_models';declare type InventoryReturnLocationRel=ResourceRel&{type:typeof InventoryReturnLocations.TYPE;};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};declare type InventoryModelRel=ResourceRel&{type:'inventory_models';};interface InventoryReturnLocation extends Resource{priority?:number;stock_location?:StockLocation;inventory_model?:InventoryModel;}interface InventoryReturnLocationCreate extends ResourceCreate{priority:number;stock_location:StockLocationRel;inventory_model:InventoryModelRel;}interface InventoryReturnLocationUpdate extends ResourceUpdate{priority?:number;stock_location?:StockLocationRel;inventory_model?:InventoryModelRel;}declare class InventoryReturnLocations extends ApiResource{static readonly TYPE:'inventory_return_locations';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryReturnLocation>>;create(resource:InventoryReturnLocationCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryReturnLocation>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryReturnLocation>;update(resource:InventoryReturnLocationUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryReturnLocation>;delete(id:string,options?:ResourcesConfig):Promise<void>;stock_location(inventoryReturnLocationId:string|InventoryReturnLocation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;inventory_model(inventoryReturnLocationId:string|InventoryReturnLocation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;isInventoryReturnLocation(resource:any):resource is InventoryReturnLocation;relationship(id:string|ResourceId|null):InventoryReturnLocationRel;type():string;}export default InventoryReturnLocations;export{InventoryReturnLocation,InventoryReturnLocationCreate,InventoryReturnLocationUpdate};
@@ -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,n){return this.resources.create({...e,type:r.TYPE},t,n)}async retrieve(e,t,n){return this.resources.retrieve({type:r.TYPE,id:e},t,n)}async update(e,t,n){return this.resources.update({...e,type:r.TYPE},t,n)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async stock_location(e,t,n){return this.resources.fetch({type:"stock_locations"},`inventory_return_locations/${e}/stock_location`,t,n)}async inventory_model(e,t,n){return this.resources.fetch({type:"inventory_models"},`inventory_return_locations/${e}/inventory_model`,t,n)}isInventoryReturnLocation(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="inventory_return_locations";export default r;
1
+ import{ApiResource as o}from"../resource";class r extends o{static TYPE="inventory_return_locations";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,n){return this.resources.create({...e,type:r.TYPE},t,n)}async retrieve(e,t,n){return this.resources.retrieve({type:r.TYPE,id:e},t,n)}async update(e,t,n){return this.resources.update({...e,type:r.TYPE},t,n)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async stock_location(e,t,n){const s=e.id||e;return this.resources.fetch({type:"stock_locations"},`inventory_return_locations/${s}/stock_location`,t,n)}async inventory_model(e,t,n){const s=e.id||e;return this.resources.fetch({type:"inventory_models"},`inventory_return_locations/${s}/inventory_model`,t,n)}isInventoryReturnLocation(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,46 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { StockLocation } from './stock_locations';
4
- import { InventoryModel } from './inventory_models';
5
- declare type InventoryStockLocationRel = ResourceRel & {
6
- type: typeof InventoryStockLocations.TYPE;
7
- };
8
- declare type StockLocationRel = ResourceRel & {
9
- type: 'stock_locations';
10
- };
11
- declare type InventoryModelRel = ResourceRel & {
12
- type: 'inventory_models';
13
- };
14
- interface InventoryStockLocation extends Resource {
15
- priority?: number;
16
- on_hold?: boolean;
17
- stock_location?: StockLocation;
18
- inventory_model?: InventoryModel;
19
- }
20
- interface InventoryStockLocationCreate extends ResourceCreate {
21
- priority: number;
22
- on_hold?: boolean;
23
- stock_location: StockLocationRel;
24
- inventory_model: InventoryModelRel;
25
- }
26
- interface InventoryStockLocationUpdate extends ResourceUpdate {
27
- priority?: number;
28
- on_hold?: boolean;
29
- stock_location?: StockLocationRel;
30
- inventory_model?: InventoryModelRel;
31
- }
32
- declare class InventoryStockLocations extends ApiResource {
33
- static readonly TYPE: 'inventory_stock_locations';
34
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<InventoryStockLocation>>;
35
- create(resource: InventoryStockLocationCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryStockLocation>;
36
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryStockLocation>;
37
- update(resource: InventoryStockLocationUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryStockLocation>;
38
- delete(id: string, options?: ResourcesConfig): Promise<void>;
39
- stock_location(inventoryStockLocationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
40
- inventory_model(inventoryStockLocationId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<InventoryModel>;
41
- isInventoryStockLocation(resource: any): resource is InventoryStockLocation;
42
- relationship(id: string | ResourceId | null): InventoryStockLocationRel;
43
- type(): string;
44
- }
45
- export default InventoryStockLocations;
46
- export { InventoryStockLocation, InventoryStockLocationCreate, InventoryStockLocationUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{StockLocation}from'./stock_locations';import type{InventoryModel}from'./inventory_models';declare type InventoryStockLocationRel=ResourceRel&{type:typeof InventoryStockLocations.TYPE;};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};declare type InventoryModelRel=ResourceRel&{type:'inventory_models';};interface InventoryStockLocation extends Resource{priority?:number;on_hold?:boolean;stock_location?:StockLocation;inventory_model?:InventoryModel;}interface InventoryStockLocationCreate extends ResourceCreate{priority:number;on_hold?:boolean;stock_location:StockLocationRel;inventory_model:InventoryModelRel;}interface InventoryStockLocationUpdate extends ResourceUpdate{priority?:number;on_hold?:boolean;stock_location?:StockLocationRel;inventory_model?:InventoryModelRel;}declare class InventoryStockLocations extends ApiResource{static readonly TYPE:'inventory_stock_locations';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<InventoryStockLocation>>;create(resource:InventoryStockLocationCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryStockLocation>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryStockLocation>;update(resource:InventoryStockLocationUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryStockLocation>;delete(id:string,options?:ResourcesConfig):Promise<void>;stock_location(inventoryStockLocationId:string|InventoryStockLocation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;inventory_model(inventoryStockLocationId:string|InventoryStockLocation,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<InventoryModel>;isInventoryStockLocation(resource:any):resource is InventoryStockLocation;relationship(id:string|ResourceId|null):InventoryStockLocationRel;type():string;}export default InventoryStockLocations;export{InventoryStockLocation,InventoryStockLocationCreate,InventoryStockLocationUpdate};
@@ -1 +1 @@
1
- import{ApiResource as n}from"../resource";class r extends n{async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,o){return this.resources.create({...e,type:r.TYPE},t,o)}async retrieve(e,t,o){return this.resources.retrieve({type:r.TYPE,id:e},t,o)}async update(e,t,o){return this.resources.update({...e,type:r.TYPE},t,o)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async stock_location(e,t,o){return this.resources.fetch({type:"stock_locations"},`inventory_stock_locations/${e}/stock_location`,t,o)}async inventory_model(e,t,o){return this.resources.fetch({type:"inventory_models"},`inventory_stock_locations/${e}/inventory_model`,t,o)}isInventoryStockLocation(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="inventory_stock_locations";export default r;
1
+ import{ApiResource as r}from"../resource";class s extends r{static TYPE="inventory_stock_locations";async list(e,t){return this.resources.list({type:s.TYPE},e,t)}async create(e,t,o){return this.resources.create({...e,type:s.TYPE},t,o)}async retrieve(e,t,o){return this.resources.retrieve({type:s.TYPE,id:e},t,o)}async update(e,t,o){return this.resources.update({...e,type:s.TYPE},t,o)}async delete(e,t){await this.resources.delete({type:s.TYPE,id:e},t)}async stock_location(e,t,o){const n=e.id||e;return this.resources.fetch({type:"stock_locations"},`inventory_stock_locations/${n}/stock_location`,t,o)}async inventory_model(e,t,o){const n=e.id||e;return this.resources.fetch({type:"inventory_models"},`inventory_stock_locations/${n}/inventory_model`,t,o)}isInventoryStockLocation(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,44 +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
- import { KlarnaPayment } from './klarna_payments';
5
- declare type KlarnaGatewayRel = ResourceRel & {
6
- type: typeof KlarnaGateways.TYPE;
7
- };
8
- declare type KlarnaPaymentRel = ResourceRel & {
9
- type: 'klarna_payments';
10
- };
11
- interface KlarnaGateway extends Resource {
12
- name?: string;
13
- payment_methods?: PaymentMethod[];
14
- klarna_payments?: KlarnaPayment[];
15
- }
16
- interface KlarnaGatewayCreate extends ResourceCreate {
17
- name: string;
18
- country_code: string;
19
- api_key: string;
20
- api_secret: string;
21
- klarna_payments?: KlarnaPaymentRel[];
22
- }
23
- interface KlarnaGatewayUpdate extends ResourceUpdate {
24
- name?: string;
25
- country_code?: string;
26
- api_key?: string;
27
- api_secret?: string;
28
- klarna_payments?: KlarnaPaymentRel[];
29
- }
30
- declare class KlarnaGateways extends ApiResource {
31
- static readonly TYPE: 'klarna_gateways';
32
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<KlarnaGateway>>;
33
- create(resource: KlarnaGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
34
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
35
- update(resource: KlarnaGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<KlarnaGateway>;
36
- delete(id: string, options?: ResourcesConfig): Promise<void>;
37
- payment_methods(klarnaGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
38
- klarna_payments(klarnaGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<KlarnaPayment>>;
39
- isKlarnaGateway(resource: any): resource is KlarnaGateway;
40
- relationship(id: string | ResourceId | null): KlarnaGatewayRel;
41
- type(): string;
42
- }
43
- export default KlarnaGateways;
44
- export { KlarnaGateway, KlarnaGatewayCreate, KlarnaGatewayUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{PaymentMethod}from'./payment_methods';import type{KlarnaPayment}from'./klarna_payments';declare type KlarnaGatewayRel=ResourceRel&{type:typeof KlarnaGateways.TYPE;};declare type KlarnaPaymentRel=ResourceRel&{type:'klarna_payments';};interface KlarnaGateway extends Resource{name?:string;payment_methods?:PaymentMethod[];klarna_payments?:KlarnaPayment[];}interface KlarnaGatewayCreate extends ResourceCreate{name:string;country_code:string;api_key:string;api_secret:string;klarna_payments?:KlarnaPaymentRel[];}interface KlarnaGatewayUpdate extends ResourceUpdate{name?:string;country_code?:string;api_key?:string;api_secret?:string;klarna_payments?:KlarnaPaymentRel[];}declare class KlarnaGateways extends ApiResource{static readonly TYPE:'klarna_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<KlarnaGateway>>;create(resource:KlarnaGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaGateway>;update(resource:KlarnaGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<KlarnaGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(klarnaGatewayId:string|KlarnaGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;klarna_payments(klarnaGatewayId:string|KlarnaGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<KlarnaPayment>>;isKlarnaGateway(resource:any):resource is KlarnaGateway;relationship(id:string|ResourceId|null):KlarnaGatewayRel;type():string;}export default KlarnaGateways;export{KlarnaGateway,KlarnaGatewayCreate,KlarnaGatewayUpdate};
@@ -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,a){return this.resources.create({...e,type:r.TYPE},t,a)}async retrieve(e,t,a){return this.resources.retrieve({type:r.TYPE,id:e},t,a)}async update(e,t,a){return this.resources.update({...e,type:r.TYPE},t,a)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async payment_methods(e,t,a){return this.resources.fetch({type:"payment_methods"},`klarna_gateways/${e}/payment_methods`,t,a)}async klarna_payments(e,t,a){return this.resources.fetch({type:"klarna_payments"},`klarna_gateways/${e}/klarna_payments`,t,a)}isKlarnaGateway(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_gateways";export default r;
1
+ import{ApiResource as n}from"../resource";class r extends n{static TYPE="klarna_gateways";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,a){return this.resources.create({...e,type:r.TYPE},t,a)}async retrieve(e,t,a){return this.resources.retrieve({type:r.TYPE,id:e},t,a)}async update(e,t,a){return this.resources.update({...e,type:r.TYPE},t,a)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async payment_methods(e,t,a){const s=e.id||e;return this.resources.fetch({type:"payment_methods"},`klarna_gateways/${s}/payment_methods`,t,a)}async klarna_payments(e,t,a){const s=e.id||e;return this.resources.fetch({type:"klarna_payments"},`klarna_gateways/${s}/klarna_payments`,t,a)}isKlarnaGateway(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;