@commercelayer/sdk 2.1.0-alpha.0 → 2.1.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.
package/lib/api.d.ts CHANGED
@@ -93,12 +93,4 @@ export { default as Voids } from './resources/voids';
93
93
  export { default as Webhooks } from './resources/webhooks';
94
94
  export { default as WireTransfers } from './resources/wire_transfers';
95
95
  export declare type ResourceTypeLock = 'addresses' | 'adjustments' | 'adyen_gateways' | 'adyen_payments' | 'application' | 'attachments' | 'authorizations' | 'avalara_accounts' | 'billing_info_validation_rules' | 'bing_geocoders' | 'braintree_gateways' | 'braintree_payments' | 'bundles' | 'captures' | 'carrier_accounts' | 'checkout_com_gateways' | 'checkout_com_payments' | 'coupon_codes_promotion_rules' | 'coupons' | 'customer_addresses' | 'customer_groups' | 'customer_password_resets' | 'customer_payment_sources' | 'customer_subscriptions' | 'customers' | 'delivery_lead_times' | 'external_gateways' | 'external_payments' | 'external_promotions' | 'external_tax_calculators' | 'fixed_amount_promotions' | 'free_shipping_promotions' | 'geocoders' | 'gift_card_recipients' | 'gift_cards' | 'google_geocoders' | 'imports' | 'in_stock_subscriptions' | 'inventory_models' | 'inventory_return_locations' | 'inventory_stock_locations' | 'line_item_options' | 'line_items' | 'manual_gateways' | 'manual_tax_calculators' | 'markets' | 'merchants' | 'order_amount_promotion_rules' | 'order_copies' | 'order_subscriptions' | 'orders' | 'organization' | 'packages' | 'parcel_line_items' | 'parcels' | 'payment_gateways' | 'payment_methods' | 'paypal_gateways' | 'paypal_payments' | 'percentage_discount_promotions' | 'price_lists' | 'prices' | 'promotion_rules' | 'promotions' | 'refunds' | 'return_line_items' | 'returns' | 'shipments' | 'shipping_categories' | 'shipping_methods' | 'shipping_zones' | 'sku_list_items' | 'sku_list_promotion_rules' | 'sku_lists' | 'sku_options' | 'skus' | 'stock_items' | 'stock_line_items' | 'stock_locations' | 'stock_transfers' | 'stripe_gateways' | 'stripe_payments' | 'tax_calculators' | 'tax_categories' | 'tax_rules' | 'taxjar_accounts' | 'transactions' | 'voids' | 'webhooks' | 'wire_transfers';
96
- export declare const resourceList: ResourceTypeLock[];
97
- export declare type ResourceInfo = {
98
- name: string;
99
- type: ResourceTypeLock;
100
- api: string;
101
- };
102
- export declare const resourcMap: {
103
- [res: string]: ResourceInfo;
104
- };
96
+ export declare const resourceList: readonly ["addresses", "adjustments", "adyen_gateways", "adyen_payments", "application", "attachments", "authorizations", "avalara_accounts", "billing_info_validation_rules", "bing_geocoders", "braintree_gateways", "braintree_payments", "bundles", "captures", "carrier_accounts", "checkout_com_gateways", "checkout_com_payments", "coupon_codes_promotion_rules", "coupons", "customer_addresses", "customer_groups", "customer_password_resets", "customer_payment_sources", "customer_subscriptions", "customers", "delivery_lead_times", "external_gateways", "external_payments", "external_promotions", "external_tax_calculators", "fixed_amount_promotions", "free_shipping_promotions", "geocoders", "gift_card_recipients", "gift_cards", "google_geocoders", "imports", "in_stock_subscriptions", "inventory_models", "inventory_return_locations", "inventory_stock_locations", "line_item_options", "line_items", "manual_gateways", "manual_tax_calculators", "markets", "merchants", "order_amount_promotion_rules", "order_copies", "order_subscriptions", "orders", "organization", "packages", "parcel_line_items", "parcels", "payment_gateways", "payment_methods", "paypal_gateways", "paypal_payments", "percentage_discount_promotions", "price_lists", "prices", "promotion_rules", "promotions", "refunds", "return_line_items", "returns", "shipments", "shipping_categories", "shipping_methods", "shipping_zones", "sku_list_items", "sku_list_promotion_rules", "sku_lists", "sku_options", "skus", "stock_items", "stock_line_items", "stock_locations", "stock_transfers", "stripe_gateways", "stripe_payments", "tax_calculators", "tax_categories", "tax_rules", "taxjar_accounts", "transactions", "voids", "webhooks", "wire_transfers"];
@@ -100,7 +100,7 @@ declare class CommerceLayerClient {
100
100
  constructor(config: CommerceLayerInitConfig);
101
101
  get currentOrganization(): string;
102
102
  config(config: CommerceLayerConfig): void;
103
- resources(): api.ResourceTypeLock[];
103
+ resources(): readonly string[];
104
104
  isApiError(error: any): error is ApiError;
105
105
  addRequestInterceptor(onFulfilled?: RequestInterceptor, onRejected?: ErrorInterceptor): number;
106
106
  addResponseInterceptor(onFulfilled?: ResponseInterceptor, onRejected?: ErrorInterceptor): number;
@@ -110,6 +110,6 @@ declare const CommerceLayer: (config: CommerceLayerInitConfig) => CommerceLayerC
110
110
  export default CommerceLayer;
111
111
  export type { CommerceLayerClient, CommerceLayerConfig, CommerceLayerInitConfig };
112
112
  export declare const CommerceLayerStatic: {
113
- resources: () => api.ResourceTypeLock[];
113
+ resources: () => readonly string[];
114
114
  isApiError: (error: any) => error is ApiError;
115
115
  };
@@ -15743,460 +15743,23 @@ var WireTransfers = /*#__PURE__*/function (_ApiResource) {
15743
15743
  WireTransfers.TYPE = 'wire_transfers';
15744
15744
 
15745
15745
  // ##__API_RESOURCES_START__##
15746
- var resourcMap = {
15747
- // ##__API_RESOURCE_MAP_START__##
15748
- addresses: {
15749
- name: 'address',
15750
- type: 'addresses',
15751
- api: 'addresses'
15752
- },
15753
- adjustments: {
15754
- name: 'adjustment',
15755
- type: 'adjustments',
15756
- api: 'adjustments'
15757
- },
15758
- adyen_gateways: {
15759
- name: 'adyen_gateway',
15760
- type: 'adyen_gateways',
15761
- api: 'adyen_gateways'
15762
- },
15763
- adyen_payments: {
15764
- name: 'adyen_payment',
15765
- type: 'adyen_payments',
15766
- api: 'adyen_payments'
15767
- },
15768
- application: {
15769
- name: 'application',
15770
- type: 'application',
15771
- api: 'application'
15772
- },
15773
- attachments: {
15774
- name: 'attachment',
15775
- type: 'attachments',
15776
- api: 'attachments'
15777
- },
15778
- authorizations: {
15779
- name: 'authorization',
15780
- type: 'authorizations',
15781
- api: 'authorizations'
15782
- },
15783
- avalara_accounts: {
15784
- name: 'avalara_account',
15785
- type: 'avalara_accounts',
15786
- api: 'avalara_accounts'
15787
- },
15788
- billing_info_validation_rules: {
15789
- name: 'billing_info_validation_rule',
15790
- type: 'billing_info_validation_rules',
15791
- api: 'billing_info_validation_rules'
15792
- },
15793
- bing_geocoders: {
15794
- name: 'bing_geocoder',
15795
- type: 'bing_geocoders',
15796
- api: 'bing_geocoders'
15797
- },
15798
- braintree_gateways: {
15799
- name: 'braintree_gateway',
15800
- type: 'braintree_gateways',
15801
- api: 'braintree_gateways'
15802
- },
15803
- braintree_payments: {
15804
- name: 'braintree_payment',
15805
- type: 'braintree_payments',
15806
- api: 'braintree_payments'
15807
- },
15808
- bundles: {
15809
- name: 'bundle',
15810
- type: 'bundles',
15811
- api: 'bundles'
15812
- },
15813
- captures: {
15814
- name: 'capture',
15815
- type: 'captures',
15816
- api: 'captures'
15817
- },
15818
- carrier_accounts: {
15819
- name: 'carrier_account',
15820
- type: 'carrier_accounts',
15821
- api: 'carrier_accounts'
15822
- },
15823
- checkout_com_gateways: {
15824
- name: 'checkout_com_gateway',
15825
- type: 'checkout_com_gateways',
15826
- api: 'checkout_com_gateways'
15827
- },
15828
- checkout_com_payments: {
15829
- name: 'checkout_com_payment',
15830
- type: 'checkout_com_payments',
15831
- api: 'checkout_com_payments'
15832
- },
15833
- coupon_codes_promotion_rules: {
15834
- name: 'coupon_codes_promotion_rule',
15835
- type: 'coupon_codes_promotion_rules',
15836
- api: 'coupon_codes_promotion_rules'
15837
- },
15838
- coupons: {
15839
- name: 'coupon',
15840
- type: 'coupons',
15841
- api: 'coupons'
15842
- },
15843
- customer_addresses: {
15844
- name: 'customer_address',
15845
- type: 'customer_addresses',
15846
- api: 'customer_addresses'
15847
- },
15848
- customer_groups: {
15849
- name: 'customer_group',
15850
- type: 'customer_groups',
15851
- api: 'customer_groups'
15852
- },
15853
- customer_password_resets: {
15854
- name: 'customer_password_reset',
15855
- type: 'customer_password_resets',
15856
- api: 'customer_password_resets'
15857
- },
15858
- customer_payment_sources: {
15859
- name: 'customer_payment_source',
15860
- type: 'customer_payment_sources',
15861
- api: 'customer_payment_sources'
15862
- },
15863
- customer_subscriptions: {
15864
- name: 'customer_subscription',
15865
- type: 'customer_subscriptions',
15866
- api: 'customer_subscriptions'
15867
- },
15868
- customers: {
15869
- name: 'customer',
15870
- type: 'customers',
15871
- api: 'customers'
15872
- },
15873
- delivery_lead_times: {
15874
- name: 'delivery_lead_time',
15875
- type: 'delivery_lead_times',
15876
- api: 'delivery_lead_times'
15877
- },
15878
- external_gateways: {
15879
- name: 'external_gateway',
15880
- type: 'external_gateways',
15881
- api: 'external_gateways'
15882
- },
15883
- external_payments: {
15884
- name: 'external_payment',
15885
- type: 'external_payments',
15886
- api: 'external_payments'
15887
- },
15888
- external_promotions: {
15889
- name: 'external_promotion',
15890
- type: 'external_promotions',
15891
- api: 'external_promotions'
15892
- },
15893
- external_tax_calculators: {
15894
- name: 'external_tax_calculator',
15895
- type: 'external_tax_calculators',
15896
- api: 'external_tax_calculators'
15897
- },
15898
- fixed_amount_promotions: {
15899
- name: 'fixed_amount_promotion',
15900
- type: 'fixed_amount_promotions',
15901
- api: 'fixed_amount_promotions'
15902
- },
15903
- free_shipping_promotions: {
15904
- name: 'free_shipping_promotion',
15905
- type: 'free_shipping_promotions',
15906
- api: 'free_shipping_promotions'
15907
- },
15908
- geocoders: {
15909
- name: 'geocoder',
15910
- type: 'geocoders',
15911
- api: 'geocoders'
15912
- },
15913
- gift_card_recipients: {
15914
- name: 'gift_card_recipient',
15915
- type: 'gift_card_recipients',
15916
- api: 'gift_card_recipients'
15917
- },
15918
- gift_cards: {
15919
- name: 'gift_card',
15920
- type: 'gift_cards',
15921
- api: 'gift_cards'
15922
- },
15923
- google_geocoders: {
15924
- name: 'google_geocoder',
15925
- type: 'google_geocoders',
15926
- api: 'google_geocoders'
15927
- },
15928
- imports: {
15929
- name: 'import',
15930
- type: 'imports',
15931
- api: 'imports'
15932
- },
15933
- in_stock_subscriptions: {
15934
- name: 'in_stock_subscription',
15935
- type: 'in_stock_subscriptions',
15936
- api: 'in_stock_subscriptions'
15937
- },
15938
- inventory_models: {
15939
- name: 'inventory_model',
15940
- type: 'inventory_models',
15941
- api: 'inventory_models'
15942
- },
15943
- inventory_return_locations: {
15944
- name: 'inventory_return_location',
15945
- type: 'inventory_return_locations',
15946
- api: 'inventory_return_locations'
15947
- },
15948
- inventory_stock_locations: {
15949
- name: 'inventory_stock_location',
15950
- type: 'inventory_stock_locations',
15951
- api: 'inventory_stock_locations'
15952
- },
15953
- line_item_options: {
15954
- name: 'line_item_option',
15955
- type: 'line_item_options',
15956
- api: 'line_item_options'
15957
- },
15958
- line_items: {
15959
- name: 'line_item',
15960
- type: 'line_items',
15961
- api: 'line_items'
15962
- },
15963
- manual_gateways: {
15964
- name: 'manual_gateway',
15965
- type: 'manual_gateways',
15966
- api: 'manual_gateways'
15967
- },
15968
- manual_tax_calculators: {
15969
- name: 'manual_tax_calculator',
15970
- type: 'manual_tax_calculators',
15971
- api: 'manual_tax_calculators'
15972
- },
15973
- markets: {
15974
- name: 'market',
15975
- type: 'markets',
15976
- api: 'markets'
15977
- },
15978
- merchants: {
15979
- name: 'merchant',
15980
- type: 'merchants',
15981
- api: 'merchants'
15982
- },
15983
- order_amount_promotion_rules: {
15984
- name: 'order_amount_promotion_rule',
15985
- type: 'order_amount_promotion_rules',
15986
- api: 'order_amount_promotion_rules'
15987
- },
15988
- order_copies: {
15989
- name: 'order_copy',
15990
- type: 'order_copies',
15991
- api: 'order_copies'
15992
- },
15993
- order_subscriptions: {
15994
- name: 'order_subscription',
15995
- type: 'order_subscriptions',
15996
- api: 'order_subscriptions'
15997
- },
15998
- orders: {
15999
- name: 'order',
16000
- type: 'orders',
16001
- api: 'orders'
16002
- },
16003
- organization: {
16004
- name: 'organization',
16005
- type: 'organization',
16006
- api: 'organization'
16007
- },
16008
- packages: {
16009
- name: 'package',
16010
- type: 'packages',
16011
- api: 'packages'
16012
- },
16013
- parcel_line_items: {
16014
- name: 'parcel_line_item',
16015
- type: 'parcel_line_items',
16016
- api: 'parcel_line_items'
16017
- },
16018
- parcels: {
16019
- name: 'parcel',
16020
- type: 'parcels',
16021
- api: 'parcels'
16022
- },
16023
- payment_gateways: {
16024
- name: 'payment_gateway',
16025
- type: 'payment_gateways',
16026
- api: 'payment_gateways'
16027
- },
16028
- payment_methods: {
16029
- name: 'payment_method',
16030
- type: 'payment_methods',
16031
- api: 'payment_methods'
16032
- },
16033
- paypal_gateways: {
16034
- name: 'paypal_gateway',
16035
- type: 'paypal_gateways',
16036
- api: 'paypal_gateways'
16037
- },
16038
- paypal_payments: {
16039
- name: 'paypal_payment',
16040
- type: 'paypal_payments',
16041
- api: 'paypal_payments'
16042
- },
16043
- percentage_discount_promotions: {
16044
- name: 'percentage_discount_promotion',
16045
- type: 'percentage_discount_promotions',
16046
- api: 'percentage_discount_promotions'
16047
- },
16048
- price_lists: {
16049
- name: 'price_list',
16050
- type: 'price_lists',
16051
- api: 'price_lists'
16052
- },
16053
- prices: {
16054
- name: 'price',
16055
- type: 'prices',
16056
- api: 'prices'
16057
- },
16058
- promotion_rules: {
16059
- name: 'promotion_rule',
16060
- type: 'promotion_rules',
16061
- api: 'promotion_rules'
16062
- },
16063
- promotions: {
16064
- name: 'promotion',
16065
- type: 'promotions',
16066
- api: 'promotions'
16067
- },
16068
- refunds: {
16069
- name: 'refund',
16070
- type: 'refunds',
16071
- api: 'refunds'
16072
- },
16073
- return_line_items: {
16074
- name: 'return_line_item',
16075
- type: 'return_line_items',
16076
- api: 'return_line_items'
16077
- },
16078
- returns: {
16079
- name: 'return',
16080
- type: 'returns',
16081
- api: 'returns'
16082
- },
16083
- shipments: {
16084
- name: 'shipment',
16085
- type: 'shipments',
16086
- api: 'shipments'
16087
- },
16088
- shipping_categories: {
16089
- name: 'shipping_category',
16090
- type: 'shipping_categories',
16091
- api: 'shipping_categories'
16092
- },
16093
- shipping_methods: {
16094
- name: 'shipping_method',
16095
- type: 'shipping_methods',
16096
- api: 'shipping_methods'
16097
- },
16098
- shipping_zones: {
16099
- name: 'shipping_zone',
16100
- type: 'shipping_zones',
16101
- api: 'shipping_zones'
16102
- },
16103
- sku_list_items: {
16104
- name: 'sku_list_item',
16105
- type: 'sku_list_items',
16106
- api: 'sku_list_items'
16107
- },
16108
- sku_list_promotion_rules: {
16109
- name: 'sku_list_promotion_rule',
16110
- type: 'sku_list_promotion_rules',
16111
- api: 'sku_list_promotion_rules'
16112
- },
16113
- sku_lists: {
16114
- name: 'sku_list',
16115
- type: 'sku_lists',
16116
- api: 'sku_lists'
16117
- },
16118
- sku_options: {
16119
- name: 'sku_option',
16120
- type: 'sku_options',
16121
- api: 'sku_options'
16122
- },
16123
- skus: {
16124
- name: 'sku',
16125
- type: 'skus',
16126
- api: 'skus'
16127
- },
16128
- stock_items: {
16129
- name: 'stock_item',
16130
- type: 'stock_items',
16131
- api: 'stock_items'
16132
- },
16133
- stock_line_items: {
16134
- name: 'stock_line_item',
16135
- type: 'stock_line_items',
16136
- api: 'stock_line_items'
16137
- },
16138
- stock_locations: {
16139
- name: 'stock_location',
16140
- type: 'stock_locations',
16141
- api: 'stock_locations'
16142
- },
16143
- stock_transfers: {
16144
- name: 'stock_transfer',
16145
- type: 'stock_transfers',
16146
- api: 'stock_transfers'
16147
- },
16148
- stripe_gateways: {
16149
- name: 'stripe_gateway',
16150
- type: 'stripe_gateways',
16151
- api: 'stripe_gateways'
16152
- },
16153
- stripe_payments: {
16154
- name: 'stripe_payment',
16155
- type: 'stripe_payments',
16156
- api: 'stripe_payments'
16157
- },
16158
- tax_calculators: {
16159
- name: 'tax_calculator',
16160
- type: 'tax_calculators',
16161
- api: 'tax_calculators'
16162
- },
16163
- tax_categories: {
16164
- name: 'tax_category',
16165
- type: 'tax_categories',
16166
- api: 'tax_categories'
16167
- },
16168
- tax_rules: {
16169
- name: 'tax_rule',
16170
- type: 'tax_rules',
16171
- api: 'tax_rules'
16172
- },
16173
- taxjar_accounts: {
16174
- name: 'taxjar_account',
16175
- type: 'taxjar_accounts',
16176
- api: 'taxjar_accounts'
16177
- },
16178
- transactions: {
16179
- name: 'transaction',
16180
- type: 'transactions',
16181
- api: 'transactions'
16182
- },
16183
- voids: {
16184
- name: 'void',
16185
- type: 'voids',
16186
- api: 'voids'
16187
- },
16188
- webhooks: {
16189
- name: 'webhook',
16190
- type: 'webhooks',
16191
- api: 'webhooks'
16192
- },
16193
- wire_transfers: {
16194
- name: 'wire_transfer',
16195
- type: 'wire_transfers',
16196
- api: 'wire_transfers'
16197
- } // ##__API_RESOURCE_MAP_STOP__##
16198
15746
 
16199
- };
15747
+ var resourceList = [// ##__API_RESOURCE_LIST_START__##
15748
+ 'addresses', 'adjustments', 'adyen_gateways', 'adyen_payments', 'application', 'attachments', 'authorizations', 'avalara_accounts', 'billing_info_validation_rules', 'bing_geocoders', 'braintree_gateways', 'braintree_payments', 'bundles', 'captures', 'carrier_accounts', 'checkout_com_gateways', 'checkout_com_payments', 'coupon_codes_promotion_rules', 'coupons', 'customer_addresses', 'customer_groups', 'customer_password_resets', 'customer_payment_sources', 'customer_subscriptions', 'customers', 'delivery_lead_times', 'external_gateways', 'external_payments', 'external_promotions', 'external_tax_calculators', 'fixed_amount_promotions', 'free_shipping_promotions', 'geocoders', 'gift_card_recipients', 'gift_cards', 'google_geocoders', 'imports', 'in_stock_subscriptions', 'inventory_models', 'inventory_return_locations', 'inventory_stock_locations', 'line_item_options', 'line_items', 'manual_gateways', 'manual_tax_calculators', 'markets', 'merchants', 'order_amount_promotion_rules', 'order_copies', 'order_subscriptions', 'orders', 'organization', 'packages', 'parcel_line_items', 'parcels', 'payment_gateways', 'payment_methods', 'paypal_gateways', 'paypal_payments', 'percentage_discount_promotions', 'price_lists', 'prices', 'promotion_rules', 'promotions', 'refunds', 'return_line_items', 'returns', 'shipments', 'shipping_categories', 'shipping_methods', 'shipping_zones', 'sku_list_items', 'sku_list_promotion_rules', 'sku_lists', 'sku_options', 'skus', 'stock_items', 'stock_line_items', 'stock_locations', 'stock_transfers', 'stripe_gateways', 'stripe_payments', 'tax_calculators', 'tax_categories', 'tax_rules', 'taxjar_accounts', 'transactions', 'voids', 'webhooks', 'wire_transfers' // ##__API_RESOURCE_LIST_STOP__##
15749
+ ];
15750
+ /*
15751
+ type ResourceInfo = {
15752
+ name: string;
15753
+ type: string;
15754
+ api: string;
15755
+ }
15756
+
15757
+
15758
+ export const resourceMap: { [res: string]: ResourceInfo } = {
15759
+ // ##__API_RESOURCE_MAP_START__##
15760
+ // ##__API_RESOURCE_MAP_STOP__##
15761
+ } as const
15762
+ */
16200
15763
 
16201
15764
  var _adapter = /*#__PURE__*/_classPrivateFieldLooseKey("adapter");
16202
15765
 
@@ -16359,9 +15922,11 @@ var CommerceLayerClient = /*#__PURE__*/function () {
16359
15922
  var CommerceLayer = function CommerceLayer(config) {
16360
15923
  return new CommerceLayerClient(config);
16361
15924
  };
15925
+ /* Static functions */
15926
+
16362
15927
  var CommerceLayerStatic = {
16363
15928
  resources: function resources() {
16364
- return Object.keys(resourcMap);
15929
+ return resourceList;
16365
15930
  },
16366
15931
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
16367
15932
  isApiError: function isApiError(error) {