@commercelayer/sdk 5.0.0-alpha.2 → 5.0.0-alpha.5

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 +67 -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 +25 -28
@@ -1,71 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Sku } from './skus';
4
- import { StockLocation } from './stock_locations';
5
- import { Shipment } from './shipments';
6
- import { LineItem } from './line_items';
7
- declare type StockTransferRel = ResourceRel & {
8
- type: typeof StockTransfers.TYPE;
9
- };
10
- declare type SkuRel = ResourceRel & {
11
- type: 'skus';
12
- };
13
- declare type StockLocationRel = ResourceRel & {
14
- type: 'stock_locations';
15
- };
16
- declare type ShipmentRel = ResourceRel & {
17
- type: 'shipments';
18
- };
19
- declare type LineItemRel = ResourceRel & {
20
- type: 'line_items';
21
- };
22
- interface StockTransfer extends Resource {
23
- sku_code?: string;
24
- status?: string;
25
- quantity?: number;
26
- completed_at?: string;
27
- cancelled_at?: string;
28
- sku?: Sku;
29
- origin_stock_location?: StockLocation;
30
- destination_stock_location?: StockLocation;
31
- shipment?: Shipment;
32
- line_item?: LineItem;
33
- }
34
- interface StockTransferCreate extends ResourceCreate {
35
- sku_code?: string;
36
- quantity: number;
37
- sku: SkuRel;
38
- origin_stock_location: StockLocationRel;
39
- destination_stock_location: StockLocationRel;
40
- shipment?: ShipmentRel;
41
- line_item?: LineItemRel;
42
- }
43
- interface StockTransferUpdate extends ResourceUpdate {
44
- sku_code?: string;
45
- _upcoming?: boolean;
46
- _picking?: boolean;
47
- _in_transit?: boolean;
48
- _complete?: boolean;
49
- _cancel?: boolean;
50
- sku?: SkuRel;
51
- origin_stock_location?: StockLocationRel;
52
- destination_stock_location?: StockLocationRel;
53
- }
54
- declare class StockTransfers extends ApiResource {
55
- static readonly TYPE: 'stock_transfers';
56
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StockTransfer>>;
57
- create(resource: StockTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
58
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
59
- update(resource: StockTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockTransfer>;
60
- delete(id: string, options?: ResourcesConfig): Promise<void>;
61
- sku(stockTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
62
- origin_stock_location(stockTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
63
- destination_stock_location(stockTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StockLocation>;
64
- shipment(stockTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Shipment>;
65
- line_item(stockTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<LineItem>;
66
- isStockTransfer(resource: any): resource is StockTransfer;
67
- relationship(id: string | ResourceId | null): StockTransferRel;
68
- type(): string;
69
- }
70
- export default StockTransfers;
71
- export { StockTransfer, StockTransferCreate, StockTransferUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Sku}from'./skus';import type{StockLocation}from'./stock_locations';import type{Shipment}from'./shipments';import type{LineItem}from'./line_items';declare type StockTransferRel=ResourceRel&{type:typeof StockTransfers.TYPE;};declare type SkuRel=ResourceRel&{type:'skus';};declare type StockLocationRel=ResourceRel&{type:'stock_locations';};declare type ShipmentRel=ResourceRel&{type:'shipments';};declare type LineItemRel=ResourceRel&{type:'line_items';};interface StockTransfer extends Resource{sku_code?:string;status?:string;quantity?:number;completed_at?:string;cancelled_at?:string;sku?:Sku;origin_stock_location?:StockLocation;destination_stock_location?:StockLocation;shipment?:Shipment;line_item?:LineItem;}interface StockTransferCreate extends ResourceCreate{sku_code?:string;quantity:number;sku:SkuRel;origin_stock_location:StockLocationRel;destination_stock_location:StockLocationRel;shipment?:ShipmentRel;line_item?:LineItemRel;}interface StockTransferUpdate extends ResourceUpdate{sku_code?:string;_upcoming?:boolean;_picking?:boolean;_in_transit?:boolean;_complete?:boolean;_cancel?:boolean;sku?:SkuRel;origin_stock_location?:StockLocationRel;destination_stock_location?:StockLocationRel;}declare class StockTransfers extends ApiResource{static readonly TYPE:'stock_transfers';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StockTransfer>>;create(resource:StockTransferCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;update(resource:StockTransferUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockTransfer>;delete(id:string,options?:ResourcesConfig):Promise<void>;sku(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;origin_stock_location(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;destination_stock_location(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StockLocation>;shipment(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Shipment>;line_item(stockTransferId:string|StockTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<LineItem>;isStockTransfer(resource:any):resource is StockTransfer;relationship(id:string|ResourceId|null):StockTransferRel;type():string;}export default StockTransfers;export{StockTransfer,StockTransferCreate,StockTransferUpdate};
@@ -1 +1 @@
1
- import{ApiResource as n}from"../resource";class r extends n{async list(t,e){return this.resources.list({type:r.TYPE},t,e)}async create(t,e,s){return this.resources.create({...t,type:r.TYPE},e,s)}async retrieve(t,e,s){return this.resources.retrieve({type:r.TYPE,id:t},e,s)}async update(t,e,s){return this.resources.update({...t,type:r.TYPE},e,s)}async delete(t,e){await this.resources.delete({type:r.TYPE,id:t},e)}async sku(t,e,s){return this.resources.fetch({type:"skus"},`stock_transfers/${t}/sku`,e,s)}async origin_stock_location(t,e,s){return this.resources.fetch({type:"stock_locations"},`stock_transfers/${t}/origin_stock_location`,e,s)}async destination_stock_location(t,e,s){return this.resources.fetch({type:"stock_locations"},`stock_transfers/${t}/destination_stock_location`,e,s)}async shipment(t,e,s){return this.resources.fetch({type:"shipments"},`stock_transfers/${t}/shipment`,e,s)}async line_item(t,e,s){return this.resources.fetch({type:"line_items"},`stock_transfers/${t}/line_item`,e,s)}isStockTransfer(t){return t.type&&t.type===r.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:r.TYPE}:{id:t.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="stock_transfers";export default r;
1
+ import{ApiResource as n}from"../resource";class r extends n{static TYPE="stock_transfers";async list(t,s){return this.resources.list({type:r.TYPE},t,s)}async create(t,s,e){return this.resources.create({...t,type:r.TYPE},s,e)}async retrieve(t,s,e){return this.resources.retrieve({type:r.TYPE,id:t},s,e)}async update(t,s,e){return this.resources.update({...t,type:r.TYPE},s,e)}async delete(t,s){await this.resources.delete({type:r.TYPE,id:t},s)}async sku(t,s,e){const i=t.id||t;return this.resources.fetch({type:"skus"},`stock_transfers/${i}/sku`,s,e)}async origin_stock_location(t,s,e){const i=t.id||t;return this.resources.fetch({type:"stock_locations"},`stock_transfers/${i}/origin_stock_location`,s,e)}async destination_stock_location(t,s,e){const i=t.id||t;return this.resources.fetch({type:"stock_locations"},`stock_transfers/${i}/destination_stock_location`,s,e)}async shipment(t,s,e){const i=t.id||t;return this.resources.fetch({type:"shipments"},`stock_transfers/${i}/shipment`,s,e)}async line_item(t,s,e){const i=t.id||t;return this.resources.fetch({type:"line_items"},`stock_transfers/${i}/line_item`,s,e)}isStockTransfer(t){return t.type&&t.type===r.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:r.TYPE}:{id:t.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
@@ -1,38 +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 { StripePayment } from './stripe_payments';
5
- declare type StripeGatewayRel = ResourceRel & {
6
- type: typeof StripeGateways.TYPE;
7
- };
8
- interface StripeGateway extends Resource {
9
- name?: string;
10
- webhook_endpoint_id?: string;
11
- webhook_endpoint_secret?: string;
12
- webhook_endpoint_url?: string;
13
- payment_methods?: PaymentMethod[];
14
- stripe_payments?: StripePayment[];
15
- }
16
- interface StripeGatewayCreate extends ResourceCreate {
17
- name: string;
18
- login: string;
19
- publishable_key?: string;
20
- }
21
- interface StripeGatewayUpdate extends ResourceUpdate {
22
- name?: string;
23
- }
24
- declare class StripeGateways extends ApiResource {
25
- static readonly TYPE: 'stripe_gateways';
26
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripeGateway>>;
27
- create(resource: StripeGatewayCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
28
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
29
- update(resource: StripeGatewayUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripeGateway>;
30
- delete(id: string, options?: ResourcesConfig): Promise<void>;
31
- payment_methods(stripeGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<PaymentMethod>>;
32
- stripe_payments(stripeGatewayId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
33
- isStripeGateway(resource: any): resource is StripeGateway;
34
- relationship(id: string | ResourceId | null): StripeGatewayRel;
35
- type(): string;
36
- }
37
- export default StripeGateways;
38
- export { StripeGateway, StripeGatewayCreate, StripeGatewayUpdate };
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{StripePayment}from'./stripe_payments';declare type StripeGatewayRel=ResourceRel&{type:typeof StripeGateways.TYPE;};interface StripeGateway extends Resource{name?:string;webhook_endpoint_id?:string;webhook_endpoint_secret?:string;webhook_endpoint_url?:string;payment_methods?:PaymentMethod[];stripe_payments?:StripePayment[];}interface StripeGatewayCreate extends ResourceCreate{name:string;login:string;publishable_key?:string;}interface StripeGatewayUpdate extends ResourceUpdate{name?:string;}declare class StripeGateways extends ApiResource{static readonly TYPE:'stripe_gateways';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StripeGateway>>;create(resource:StripeGatewayCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripeGateway>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripeGateway>;update(resource:StripeGatewayUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripeGateway>;delete(id:string,options?:ResourcesConfig):Promise<void>;payment_methods(stripeGatewayId:string|StripeGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<PaymentMethod>>;stripe_payments(stripeGatewayId:string|StripeGateway,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StripePayment>>;isStripeGateway(resource:any):resource is StripeGateway;relationship(id:string|ResourceId|null):StripeGatewayRel;type():string;}export default StripeGateways;export{StripeGateway,StripeGatewayCreate,StripeGatewayUpdate};
@@ -1 +1 @@
1
- import{ApiResource as p}from"../resource";class s extends p{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 payment_methods(e,t,r){return this.resources.fetch({type:"payment_methods"},`stripe_gateways/${e}/payment_methods`,t,r)}async stripe_payments(e,t,r){return this.resources.fetch({type:"stripe_payments"},`stripe_gateways/${e}/stripe_payments`,t,r)}isStripeGateway(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="stripe_gateways";export default s;
1
+ import{ApiResource as p}from"../resource";class s extends p{static TYPE="stripe_gateways";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 payment_methods(e,t,r){const i=e.id||e;return this.resources.fetch({type:"payment_methods"},`stripe_gateways/${i}/payment_methods`,t,r)}async stripe_payments(e,t,r){const i=e.id||e;return this.resources.fetch({type:"stripe_payments"},`stripe_gateways/${i}/stripe_payments`,t,r)}isStripeGateway(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,42 +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 StripePaymentRel = ResourceRel & {
6
- type: typeof StripePayments.TYPE;
7
- };
8
- declare type OrderRel = ResourceRel & {
9
- type: 'orders';
10
- };
11
- interface StripePayment extends Resource {
12
- client_secret?: string;
13
- publishable_key?: string;
14
- options?: object;
15
- payment_method?: object;
16
- order?: Order;
17
- payment_gateway?: PaymentGateway;
18
- }
19
- interface StripePaymentCreate extends ResourceCreate {
20
- options?: object;
21
- order: OrderRel;
22
- }
23
- interface StripePaymentUpdate extends ResourceUpdate {
24
- options?: object;
25
- _refresh?: boolean;
26
- order?: OrderRel;
27
- }
28
- declare class StripePayments extends ApiResource {
29
- static readonly TYPE: 'stripe_payments';
30
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<StripePayment>>;
31
- create(resource: StripePaymentCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
32
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
33
- update(resource: StripePaymentUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<StripePayment>;
34
- delete(id: string, options?: ResourcesConfig): Promise<void>;
35
- order(stripePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
36
- payment_gateway(stripePaymentId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<PaymentGateway>;
37
- isStripePayment(resource: any): resource is StripePayment;
38
- relationship(id: string | ResourceId | null): StripePaymentRel;
39
- type(): string;
40
- }
41
- export default StripePayments;
42
- export { StripePayment, StripePaymentCreate, StripePaymentUpdate };
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 StripePaymentRel=ResourceRel&{type:typeof StripePayments.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface StripePayment extends Resource{client_secret?:string;publishable_key?:string;options?:object;payment_method?:object;mismatched_amounts?:boolean;intent_amount_cents?:number;intent_amount_float?:number;formatted_intent_amount?:string;order?:Order;payment_gateway?:PaymentGateway;}interface StripePaymentCreate extends ResourceCreate{options?:object;order:OrderRel;}interface StripePaymentUpdate extends ResourceUpdate{options?:object;_refresh?:boolean;order?:OrderRel;}declare class StripePayments extends ApiResource{static readonly TYPE:'stripe_payments';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<StripePayment>>;create(resource:StripePaymentCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;update(resource:StripePaymentUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<StripePayment>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(stripePaymentId:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;payment_gateway(stripePaymentId:string|StripePayment,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<PaymentGateway>;isStripePayment(resource:any):resource is StripePayment;relationship(id:string|ResourceId|null):StripePaymentRel;type():string;}export default StripePayments;export{StripePayment,StripePaymentCreate,StripePaymentUpdate};
@@ -1 +1 @@
1
- import{ApiResource as y}from"../resource";class r extends y{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"},`stripe_payments/${e}/order`,t,s)}async payment_gateway(e,t,s){return this.resources.fetch({type:"payment_gateways"},`stripe_payments/${e}/payment_gateway`,t,s)}isStripePayment(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="stripe_payments";export default r;
1
+ import{ApiResource as i}from"../resource";class r extends i{static TYPE="stripe_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"},`stripe_payments/${a}/order`,t,s)}async payment_gateway(e,t,s){const a=e.id||e;return this.resources.fetch({type:"payment_gateways"},`stripe_payments/${a}/payment_gateway`,t,s)}isStripePayment(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,27 +1 @@
1
- import { ApiResource, Resource, 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
- declare type TaxCalculatorRel = ResourceRel & {
7
- type: typeof TaxCalculators.TYPE;
8
- };
9
- interface TaxCalculator extends Resource {
10
- name?: string;
11
- tax_categories?: TaxCategory[];
12
- markets?: Market[];
13
- attachments?: Attachment[];
14
- }
15
- declare class TaxCalculators extends ApiResource {
16
- static readonly TYPE: 'tax_calculators';
17
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCalculator>>;
18
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCalculator>;
19
- tax_categories(taxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
20
- markets(taxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
21
- attachments(taxCalculatorId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
22
- isTaxCalculator(resource: any): resource is TaxCalculator;
23
- relationship(id: string | ResourceId | null): TaxCalculatorRel;
24
- type(): string;
25
- }
26
- export default TaxCalculators;
27
- export { TaxCalculator };
1
+ import{ApiResource,Resource,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';declare type TaxCalculatorRel=ResourceRel&{type:typeof TaxCalculators.TYPE;};interface TaxCalculator extends Resource{name?:string;tax_categories?:TaxCategory[];markets?:Market[];attachments?:Attachment[];}declare class TaxCalculators extends ApiResource{static readonly TYPE:'tax_calculators';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCalculator>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxCalculator>;tax_categories(taxCalculatorId:string|TaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCategory>>;markets(taxCalculatorId:string|TaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;attachments(taxCalculatorId:string|TaxCalculator,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isTaxCalculator(resource:any):resource is TaxCalculator;relationship(id:string|ResourceId|null):TaxCalculatorRel;type():string;}export default TaxCalculators;export{TaxCalculator};
@@ -1 +1 @@
1
- import{ApiResource as s}from"../resource";class r extends s{async list(t,e){return this.resources.list({type:r.TYPE},t,e)}async retrieve(t,e,a){return this.resources.retrieve({type:r.TYPE,id:t},e,a)}async tax_categories(t,e,a){return this.resources.fetch({type:"tax_categories"},`tax_calculators/${t}/tax_categories`,e,a)}async markets(t,e,a){return this.resources.fetch({type:"markets"},`tax_calculators/${t}/markets`,e,a)}async attachments(t,e,a){return this.resources.fetch({type:"attachments"},`tax_calculators/${t}/attachments`,e,a)}isTaxCalculator(t){return t.type&&t.type===r.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:r.TYPE}:{id:t.id,type:r.TYPE}}type(){return r.TYPE}}r.TYPE="tax_calculators";export default r;
1
+ import{ApiResource as c}from"../resource";class r extends c{static TYPE="tax_calculators";async list(t,e){return this.resources.list({type:r.TYPE},t,e)}async retrieve(t,e,a){return this.resources.retrieve({type:r.TYPE,id:t},e,a)}async tax_categories(t,e,a){const s=t.id||t;return this.resources.fetch({type:"tax_categories"},`tax_calculators/${s}/tax_categories`,e,a)}async markets(t,e,a){const s=t.id||t;return this.resources.fetch({type:"markets"},`tax_calculators/${s}/markets`,e,a)}async attachments(t,e,a){const s=t.id||t;return this.resources.fetch({type:"attachments"},`tax_calculators/${s}/attachments`,e,a)}isTaxCalculator(t){return t.type&&t.type===r.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:r.TYPE}:{id:t.id,type:r.TYPE}}type(){return r.TYPE}}export default r;
@@ -1,59 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Sku } from './skus';
4
- import { AvalaraAccount } from './avalara_accounts';
5
- import { TaxjarAccount } from './taxjar_accounts';
6
- import { ManualTaxCalculator } from './manual_tax_calculators';
7
- import { ExternalTaxCalculator } from './external_tax_calculators';
8
- import { Attachment } from './attachments';
9
- declare type TaxCategoryRel = ResourceRel & {
10
- type: typeof TaxCategories.TYPE;
11
- };
12
- declare type SkuRel = ResourceRel & {
13
- type: 'skus';
14
- };
15
- declare type AvalaraAccountRel = ResourceRel & {
16
- type: 'avalara_accounts';
17
- };
18
- declare type TaxjarAccountRel = ResourceRel & {
19
- type: 'taxjar_accounts';
20
- };
21
- declare type ManualTaxCalculatorRel = ResourceRel & {
22
- type: 'manual_tax_calculators';
23
- };
24
- declare type ExternalTaxCalculatorRel = ResourceRel & {
25
- type: 'external_tax_calculators';
26
- };
27
- interface TaxCategory extends Resource {
28
- code?: string;
29
- sku_code?: string;
30
- sku?: Sku;
31
- tax_calculator?: AvalaraAccount | TaxjarAccount | ManualTaxCalculator | ExternalTaxCalculator;
32
- attachments?: Attachment[];
33
- }
34
- interface TaxCategoryCreate extends ResourceCreate {
35
- code: string;
36
- sku_code?: string;
37
- sku: SkuRel;
38
- tax_calculator: AvalaraAccountRel | TaxjarAccountRel | ManualTaxCalculatorRel | ExternalTaxCalculatorRel;
39
- }
40
- interface TaxCategoryUpdate extends ResourceUpdate {
41
- code?: string;
42
- sku_code?: string;
43
- sku?: SkuRel;
44
- }
45
- declare class TaxCategories extends ApiResource {
46
- static readonly TYPE: 'tax_categories';
47
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
48
- create(resource: TaxCategoryCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCategory>;
49
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCategory>;
50
- update(resource: TaxCategoryUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxCategory>;
51
- delete(id: string, options?: ResourcesConfig): Promise<void>;
52
- sku(taxCategoryId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Sku>;
53
- attachments(taxCategoryId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
54
- isTaxCategory(resource: any): resource is TaxCategory;
55
- relationship(id: string | ResourceId | null): TaxCategoryRel;
56
- type(): string;
57
- }
58
- export default TaxCategories;
59
- export { TaxCategory, TaxCategoryCreate, TaxCategoryUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Sku}from'./skus';import type{AvalaraAccount}from'./avalara_accounts';import type{TaxjarAccount}from'./taxjar_accounts';import type{ManualTaxCalculator}from'./manual_tax_calculators';import type{ExternalTaxCalculator}from'./external_tax_calculators';import type{Attachment}from'./attachments';declare type TaxCategoryRel=ResourceRel&{type:typeof TaxCategories.TYPE;};declare type SkuRel=ResourceRel&{type:'skus';};declare type AvalaraAccountRel=ResourceRel&{type:'avalara_accounts';};declare type TaxjarAccountRel=ResourceRel&{type:'taxjar_accounts';};declare type ManualTaxCalculatorRel=ResourceRel&{type:'manual_tax_calculators';};declare type ExternalTaxCalculatorRel=ResourceRel&{type:'external_tax_calculators';};interface TaxCategory extends Resource{code?:string;sku_code?:string;sku?:Sku;tax_calculator?:AvalaraAccount|TaxjarAccount|ManualTaxCalculator|ExternalTaxCalculator;attachments?:Attachment[];}interface TaxCategoryCreate extends ResourceCreate{code:string;sku_code?:string;sku:SkuRel;tax_calculator:AvalaraAccountRel|TaxjarAccountRel|ManualTaxCalculatorRel|ExternalTaxCalculatorRel;}interface TaxCategoryUpdate extends ResourceUpdate{code?:string;sku_code?:string;sku?:SkuRel;}declare class TaxCategories extends ApiResource{static readonly TYPE:'tax_categories';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCategory>>;create(resource:TaxCategoryCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxCategory>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxCategory>;update(resource:TaxCategoryUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxCategory>;delete(id:string,options?:ResourcesConfig):Promise<void>;sku(taxCategoryId:string|TaxCategory,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Sku>;attachments(taxCategoryId:string|TaxCategory,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isTaxCategory(resource:any):resource is TaxCategory;relationship(id:string|ResourceId|null):TaxCategoryRel;type():string;}export default TaxCategories;export{TaxCategory,TaxCategoryCreate,TaxCategoryUpdate};
@@ -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 sku(e,t,s){return this.resources.fetch({type:"skus"},`tax_categories/${e}/sku`,t,s)}async attachments(e,t,s){return this.resources.fetch({type:"attachments"},`tax_categories/${e}/attachments`,t,s)}isTaxCategory(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="tax_categories";export default r;
1
+ import{ApiResource as c}from"../resource";class s extends c{static TYPE="tax_categories";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 sku(t,e,r){const a=t.id||t;return this.resources.fetch({type:"skus"},`tax_categories/${a}/sku`,e,r)}async attachments(t,e,r){const a=t.id||t;return this.resources.fetch({type:"attachments"},`tax_categories/${a}/attachments`,e,r)}isTaxCategory(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,69 +1 @@
1
- import { ApiResource, Resource, ResourceCreate, ResourceUpdate, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { ManualTaxCalculator } from './manual_tax_calculators';
4
- declare type TaxRuleRel = ResourceRel & {
5
- type: typeof TaxRules.TYPE;
6
- };
7
- declare type ManualTaxCalculatorRel = ResourceRel & {
8
- type: 'manual_tax_calculators';
9
- };
10
- interface TaxRule extends Resource {
11
- name?: string;
12
- tax_rate?: number;
13
- country_code_regex?: string;
14
- not_country_code_regex?: string;
15
- state_code_regex?: string;
16
- not_state_code_regex?: string;
17
- zip_code_regex?: string;
18
- not_zip_code_regex?: string;
19
- freight_taxable?: boolean;
20
- payment_method_taxable?: boolean;
21
- gift_card_taxable?: boolean;
22
- adjustment_taxable?: boolean;
23
- breakdown?: object;
24
- manual_tax_calculator?: ManualTaxCalculator;
25
- }
26
- interface TaxRuleCreate extends ResourceCreate {
27
- name: string;
28
- tax_rate?: number;
29
- country_code_regex?: string;
30
- not_country_code_regex?: string;
31
- state_code_regex?: string;
32
- not_state_code_regex?: string;
33
- zip_code_regex?: string;
34
- not_zip_code_regex?: string;
35
- freight_taxable?: boolean;
36
- payment_method_taxable?: boolean;
37
- gift_card_taxable?: boolean;
38
- adjustment_taxable?: boolean;
39
- manual_tax_calculator: ManualTaxCalculatorRel;
40
- }
41
- interface TaxRuleUpdate extends ResourceUpdate {
42
- name?: string;
43
- tax_rate?: number;
44
- country_code_regex?: string;
45
- not_country_code_regex?: string;
46
- state_code_regex?: string;
47
- not_state_code_regex?: string;
48
- zip_code_regex?: string;
49
- not_zip_code_regex?: string;
50
- freight_taxable?: boolean;
51
- payment_method_taxable?: boolean;
52
- gift_card_taxable?: boolean;
53
- adjustment_taxable?: boolean;
54
- manual_tax_calculator?: ManualTaxCalculatorRel;
55
- }
56
- declare class TaxRules extends ApiResource {
57
- static readonly TYPE: 'tax_rules';
58
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxRule>>;
59
- create(resource: TaxRuleCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
60
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
61
- update(resource: TaxRuleUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxRule>;
62
- delete(id: string, options?: ResourcesConfig): Promise<void>;
63
- manual_tax_calculator(taxRuleId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<ManualTaxCalculator>;
64
- isTaxRule(resource: any): resource is TaxRule;
65
- relationship(id: string | ResourceId | null): TaxRuleRel;
66
- type(): string;
67
- }
68
- export default TaxRules;
69
- export { TaxRule, TaxRuleCreate, TaxRuleUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{ManualTaxCalculator}from'./manual_tax_calculators';declare type TaxRuleRel=ResourceRel&{type:typeof TaxRules.TYPE;};declare type ManualTaxCalculatorRel=ResourceRel&{type:'manual_tax_calculators';};interface TaxRule extends Resource{name?:string;tax_rate?:number;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;freight_taxable?:boolean;payment_method_taxable?:boolean;gift_card_taxable?:boolean;adjustment_taxable?:boolean;breakdown?:object;manual_tax_calculator?:ManualTaxCalculator;}interface TaxRuleCreate extends ResourceCreate{name:string;tax_rate?:number;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;freight_taxable?:boolean;payment_method_taxable?:boolean;gift_card_taxable?:boolean;adjustment_taxable?:boolean;manual_tax_calculator:ManualTaxCalculatorRel;}interface TaxRuleUpdate extends ResourceUpdate{name?:string;tax_rate?:number;country_code_regex?:string;not_country_code_regex?:string;state_code_regex?:string;not_state_code_regex?:string;zip_code_regex?:string;not_zip_code_regex?:string;freight_taxable?:boolean;payment_method_taxable?:boolean;gift_card_taxable?:boolean;adjustment_taxable?:boolean;manual_tax_calculator?:ManualTaxCalculatorRel;}declare class TaxRules extends ApiResource{static readonly TYPE:'tax_rules';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxRule>>;create(resource:TaxRuleCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxRule>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxRule>;update(resource:TaxRuleUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxRule>;delete(id:string,options?:ResourcesConfig):Promise<void>;manual_tax_calculator(taxRuleId:string|TaxRule,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<ManualTaxCalculator>;isTaxRule(resource:any):resource is TaxRule;relationship(id:string|ResourceId|null):TaxRuleRel;type():string;}export default TaxRules;export{TaxRule,TaxRuleCreate,TaxRuleUpdate};
@@ -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 manual_tax_calculator(e,t,s){return this.resources.fetch({type:"manual_tax_calculators"},`tax_rules/${e}/manual_tax_calculator`,t,s)}isTaxRule(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="tax_rules";export default r;
1
+ import{ApiResource as u}from"../resource";class r extends u{static TYPE="tax_rules";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 manual_tax_calculator(e,t,a){const s=e.id||e;return this.resources.fetch({type:"manual_tax_calculators"},`tax_rules/${s}/manual_tax_calculator`,t,a)}isTaxRule(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,43 +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
- declare type TaxjarAccountRel = ResourceRel & {
7
- type: typeof TaxjarAccounts.TYPE;
8
- };
9
- declare type TaxCategoryRel = ResourceRel & {
10
- type: 'tax_categories';
11
- };
12
- interface TaxjarAccount extends Resource {
13
- name?: string;
14
- tax_categories?: TaxCategory[];
15
- markets?: Market[];
16
- attachments?: Attachment[];
17
- }
18
- interface TaxjarAccountCreate extends ResourceCreate {
19
- name: string;
20
- api_key: string;
21
- tax_categories?: TaxCategoryRel[];
22
- }
23
- interface TaxjarAccountUpdate extends ResourceUpdate {
24
- name?: string;
25
- api_key?: string;
26
- tax_categories?: TaxCategoryRel[];
27
- }
28
- declare class TaxjarAccounts extends ApiResource {
29
- static readonly TYPE: 'taxjar_accounts';
30
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxjarAccount>>;
31
- create(resource: TaxjarAccountCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
32
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
33
- update(resource: TaxjarAccountUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<TaxjarAccount>;
34
- delete(id: string, options?: ResourcesConfig): Promise<void>;
35
- tax_categories(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<TaxCategory>>;
36
- markets(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Market>>;
37
- attachments(taxjarAccountId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Attachment>>;
38
- isTaxjarAccount(resource: any): resource is TaxjarAccount;
39
- relationship(id: string | ResourceId | null): TaxjarAccountRel;
40
- type(): string;
41
- }
42
- export default TaxjarAccounts;
43
- export { TaxjarAccount, TaxjarAccountCreate, TaxjarAccountUpdate };
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';declare type TaxjarAccountRel=ResourceRel&{type:typeof TaxjarAccounts.TYPE;};declare type TaxCategoryRel=ResourceRel&{type:'tax_categories';};interface TaxjarAccount extends Resource{name?:string;tax_categories?:TaxCategory[];markets?:Market[];attachments?:Attachment[];}interface TaxjarAccountCreate extends ResourceCreate{name:string;api_key:string;tax_categories?:TaxCategoryRel[];}interface TaxjarAccountUpdate extends ResourceUpdate{name?:string;api_key?:string;tax_categories?:TaxCategoryRel[];}declare class TaxjarAccounts extends ApiResource{static readonly TYPE:'taxjar_accounts';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxjarAccount>>;create(resource:TaxjarAccountCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxjarAccount>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxjarAccount>;update(resource:TaxjarAccountUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<TaxjarAccount>;delete(id:string,options?:ResourcesConfig):Promise<void>;tax_categories(taxjarAccountId:string|TaxjarAccount,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<TaxCategory>>;markets(taxjarAccountId:string|TaxjarAccount,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Market>>;attachments(taxjarAccountId:string|TaxjarAccount,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Attachment>>;isTaxjarAccount(resource:any):resource is TaxjarAccount;relationship(id:string|ResourceId|null):TaxjarAccountRel;type():string;}export default TaxjarAccounts;export{TaxjarAccount,TaxjarAccountCreate,TaxjarAccountUpdate};
@@ -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 tax_categories(e,t,a){return this.resources.fetch({type:"tax_categories"},`taxjar_accounts/${e}/tax_categories`,t,a)}async markets(e,t,a){return this.resources.fetch({type:"markets"},`taxjar_accounts/${e}/markets`,t,a)}async attachments(e,t,a){return this.resources.fetch({type:"attachments"},`taxjar_accounts/${e}/attachments`,t,a)}isTaxjarAccount(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="taxjar_accounts";export default r;
1
+ import{ApiResource as a}from"../resource";class r extends a{static TYPE="taxjar_accounts";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 tax_categories(e,t,s){const c=e.id||e;return this.resources.fetch({type:"tax_categories"},`taxjar_accounts/${c}/tax_categories`,t,s)}async markets(e,t,s){const c=e.id||e;return this.resources.fetch({type:"markets"},`taxjar_accounts/${c}/markets`,t,s)}async attachments(e,t,s){const c=e.id||e;return this.resources.fetch({type:"attachments"},`taxjar_accounts/${c}/attachments`,t,s)}isTaxjarAccount(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,31 +1 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Order } from './orders';
4
- declare type TransactionRel = ResourceRel & {
5
- type: typeof Transactions.TYPE;
6
- };
7
- interface Transaction extends Resource {
8
- number?: string;
9
- currency_code?: string;
10
- amount_cents?: number;
11
- amount_float?: number;
12
- formatted_amount?: string;
13
- succeeded?: boolean;
14
- message?: string;
15
- error_code?: string;
16
- error_detail?: string;
17
- token?: string;
18
- gateway_transaction_id?: string;
19
- order?: Order;
20
- }
21
- declare class Transactions extends ApiResource {
22
- static readonly TYPE: 'transactions';
23
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Transaction>>;
24
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Transaction>;
25
- order(transactionId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
26
- isTransaction(resource: any): resource is Transaction;
27
- relationship(id: string | ResourceId | null): TransactionRel;
28
- type(): string;
29
- }
30
- export default Transactions;
31
- export { Transaction };
1
+ import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';declare type TransactionRel=ResourceRel&{type:typeof Transactions.TYPE;};interface Transaction extends Resource{number?:string;currency_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;succeeded?:boolean;message?:string;error_code?:string;error_detail?:string;token?:string;gateway_transaction_id?:string;order?:Order;}declare class Transactions extends ApiResource{static readonly TYPE:'transactions';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Transaction>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Transaction>;order(transactionId:string|Transaction,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;isTransaction(resource:any):resource is Transaction;relationship(id:string|ResourceId|null):TransactionRel;type():string;}export default Transactions;export{Transaction};
@@ -1 +1 @@
1
- import{ApiResource as i}from"../resource";class e extends i{async list(r,t){return this.resources.list({type:e.TYPE},r,t)}async retrieve(r,t,s){return this.resources.retrieve({type:e.TYPE,id:r},t,s)}async order(r,t,s){return this.resources.fetch({type:"orders"},`transactions/${r}/order`,t,s)}isTransaction(r){return r.type&&r.type===e.TYPE}relationship(r){return r===null||typeof r=="string"?{id:r,type:e.TYPE}:{id:r.id,type:e.TYPE}}type(){return e.TYPE}}e.TYPE="transactions";export default e;
1
+ import{ApiResource as n}from"../resource";class e extends n{static TYPE="transactions";async list(t,r){return this.resources.list({type:e.TYPE},t,r)}async retrieve(t,r,s){return this.resources.retrieve({type:e.TYPE,id:t},r,s)}async order(t,r,s){const i=t.id||t;return this.resources.fetch({type:"orders"},`transactions/${i}/order`,r,s)}isTransaction(t){return t.type&&t.type===e.TYPE}relationship(t){return t===null||typeof t=="string"?{id:t,type:e.TYPE}:{id:t.id,type:e.TYPE}}type(){return e.TYPE}}export default e;
@@ -1,34 +1 @@
1
- import { ApiResource, Resource, ResourcesConfig, ResourceId, ResourceRel, ListResponse } from '../resource';
2
- import { QueryParamsList, QueryParamsRetrieve } from '../query';
3
- import { Order } from './orders';
4
- import { Authorization } from './authorizations';
5
- declare type VoidRel = ResourceRel & {
6
- type: typeof Voids.TYPE;
7
- };
8
- interface Void extends Resource {
9
- number?: string;
10
- currency_code?: string;
11
- amount_cents?: number;
12
- amount_float?: number;
13
- formatted_amount?: string;
14
- succeeded?: boolean;
15
- message?: string;
16
- error_code?: string;
17
- error_detail?: string;
18
- token?: string;
19
- gateway_transaction_id?: string;
20
- order?: Order;
21
- reference_authorization?: Authorization;
22
- }
23
- declare class Voids extends ApiResource {
24
- static readonly TYPE: 'voids';
25
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Void>>;
26
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Void>;
27
- order(voidId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
28
- reference_authorization(voidId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Authorization>;
29
- isVoid(resource: any): resource is Void;
30
- relationship(id: string | ResourceId | null): VoidRel;
31
- type(): string;
32
- }
33
- export default Voids;
34
- export { Void };
1
+ import{ApiResource,Resource,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';import type{Authorization}from'./authorizations';declare type VoidRel=ResourceRel&{type:typeof Voids.TYPE;};interface Void extends Resource{number?:string;currency_code?:string;amount_cents?:number;amount_float?:number;formatted_amount?:string;succeeded?:boolean;message?:string;error_code?:string;error_detail?:string;token?:string;gateway_transaction_id?:string;order?:Order;reference_authorization?:Authorization;}declare class Voids extends ApiResource{static readonly TYPE:'voids';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Void>>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Void>;order(voidId:string|Void,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;reference_authorization(voidId:string|Void,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Authorization>;isVoid(resource:any):resource is Void;relationship(id:string|ResourceId|null):VoidRel;type():string;}export default Voids;export{Void};
@@ -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 retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async order(e,t,s){return this.resources.fetch({type:"orders"},`voids/${e}/order`,t,s)}async reference_authorization(e,t,s){return this.resources.fetch({type:"authorizations"},`voids/${e}/reference_authorization`,t,s)}isVoid(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="voids";export default r;
1
+ import{ApiResource as o}from"../resource";class r extends o{static TYPE="voids";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async order(e,t,s){const i=e.id||e;return this.resources.fetch({type:"orders"},`voids/${i}/order`,t,s)}async reference_authorization(e,t,s){const i=e.id||e;return this.resources.fetch({type:"authorizations"},`voids/${i}/reference_authorization`,t,s)}isVoid(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 { EventCallback } from './event_callbacks';
4
- declare type WebhookRel = ResourceRel & {
5
- type: typeof Webhooks.TYPE;
6
- };
7
- interface Webhook extends Resource {
8
- name?: string;
9
- topic?: string;
10
- callback_url?: string;
11
- include_resources?: string[];
12
- circuit_state?: string;
13
- circuit_failure_count?: number;
14
- last_event_callbacks?: EventCallback[];
15
- }
16
- interface WebhookCreate extends ResourceCreate {
17
- name?: string;
18
- topic: string;
19
- callback_url: string;
20
- include_resources?: string[];
21
- }
22
- interface WebhookUpdate extends ResourceUpdate {
23
- name?: string;
24
- topic?: string;
25
- callback_url?: string;
26
- include_resources?: string[];
27
- _reset_circuit?: boolean;
28
- }
29
- declare class Webhooks extends ApiResource {
30
- static readonly TYPE: 'webhooks';
31
- list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<Webhook>>;
32
- create(resource: WebhookCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
33
- retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
34
- update(resource: WebhookUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Webhook>;
35
- delete(id: string, options?: ResourcesConfig): Promise<void>;
36
- last_event_callbacks(webhookId: string, params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<EventCallback>>;
37
- isWebhook(resource: any): resource is Webhook;
38
- relationship(id: string | ResourceId | null): WebhookRel;
39
- type(): string;
40
- }
41
- export default Webhooks;
42
- export { Webhook, WebhookCreate, WebhookUpdate };
1
+ import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{EventCallback}from'./event_callbacks';declare type WebhookRel=ResourceRel&{type:typeof Webhooks.TYPE;};interface Webhook extends Resource{name?:string;topic?:string;callback_url?:string;include_resources?:string[];circuit_state?:string;circuit_failure_count?:number;last_event_callbacks?:EventCallback[];}interface WebhookCreate extends ResourceCreate{name?:string;topic:string;callback_url:string;include_resources?:string[];}interface WebhookUpdate extends ResourceUpdate{name?:string;topic?:string;callback_url?:string;include_resources?:string[];_reset_circuit?:boolean;}declare class Webhooks extends ApiResource{static readonly TYPE:'webhooks';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<Webhook>>;create(resource:WebhookCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Webhook>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Webhook>;update(resource:WebhookUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Webhook>;delete(id:string,options?:ResourcesConfig):Promise<void>;last_event_callbacks(webhookId:string|Webhook,params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<EventCallback>>;isWebhook(resource:any):resource is Webhook;relationship(id:string|ResourceId|null):WebhookRel;type():string;}export default Webhooks;export{Webhook,WebhookCreate,WebhookUpdate};
@@ -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 last_event_callbacks(e,r,s){return this.resources.fetch({type:"event_callbacks"},`webhooks/${e}/last_event_callbacks`,r,s)}isWebhook(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="webhooks";export default t;
1
+ import{ApiResource as c}from"../resource";class r extends c{static TYPE="webhooks";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 last_event_callbacks(e,t,s){const a=e.id||e;return this.resources.fetch({type:"event_callbacks"},`webhooks/${a}/last_event_callbacks`,t,s)}isWebhook(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;