@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.
- package/README.md +69 -33
- package/lib/api.d.ts +1 -103
- package/lib/client.d.ts +1 -31
- package/lib/client.js +1 -1
- package/lib/commercelayer.d.ts +1 -122
- package/lib/commercelayer.js +1 -1
- package/lib/common.d.ts +1 -4
- package/lib/config.d.ts +1 -11
- package/lib/debug.d.ts +1 -3
- package/lib/debug.js +1 -1
- package/lib/error.d.ts +1 -26
- package/lib/error.js +1 -1
- package/lib/index.d.ts +1 -7
- package/lib/interceptor.d.ts +1 -19
- package/lib/jsonapi.d.ts +1 -5
- package/lib/jsonapi.js +1 -1
- package/lib/model.d.ts +1 -101
- package/lib/query.d.ts +1 -23
- package/lib/query.js +1 -1
- package/lib/resource.d.ts +1 -76
- package/lib/resource.js +1 -1
- package/lib/resources/addresses.d.ts +1 -88
- package/lib/resources/addresses.js +1 -1
- package/lib/resources/adjustments.d.ts +1 -35
- package/lib/resources/adjustments.js +1 -1
- package/lib/resources/adyen_gateways.d.ts +1 -47
- package/lib/resources/adyen_gateways.js +1 -1
- package/lib/resources/adyen_payments.d.ts +1 -44
- package/lib/resources/adyen_payments.js +1 -1
- package/lib/resources/application.d.ts +1 -21
- package/lib/resources/application.js +1 -1
- package/lib/resources/attachments.d.ts +1 -156
- package/lib/resources/attachments.js +1 -1
- package/lib/resources/authorizations.d.ts +1 -57
- package/lib/resources/authorizations.js +1 -1
- package/lib/resources/avalara_accounts.d.ts +1 -52
- package/lib/resources/avalara_accounts.js +1 -1
- package/lib/resources/billing_info_validation_rules.d.ts +1 -32
- package/lib/resources/billing_info_validation_rules.js +1 -1
- package/lib/resources/bing_geocoders.d.ts +1 -35
- package/lib/resources/bing_geocoders.js +1 -1
- package/lib/resources/braintree_gateways.d.ts +1 -56
- package/lib/resources/braintree_gateways.js +1 -1
- package/lib/resources/braintree_payments.d.ts +1 -47
- package/lib/resources/braintree_payments.js +1 -1
- package/lib/resources/bundles.d.ts +1 -74
- package/lib/resources/bundles.js +1 -1
- package/lib/resources/captures.d.ts +1 -48
- package/lib/resources/captures.js +1 -1
- package/lib/resources/carrier_accounts.d.ts +1 -26
- package/lib/resources/carrier_accounts.js +1 -1
- package/lib/resources/checkout_com_gateways.d.ts +1 -45
- package/lib/resources/checkout_com_gateways.js +1 -1
- package/lib/resources/checkout_com_payments.d.ts +1 -50
- package/lib/resources/checkout_com_payments.js +1 -1
- package/lib/resources/coupon_codes_promotion_rules.d.ts +1 -59
- package/lib/resources/coupon_codes_promotion_rules.js +1 -1
- package/lib/resources/coupon_recipients.d.ts +1 -44
- package/lib/resources/coupon_recipients.js +1 -1
- package/lib/resources/coupons.d.ts +1 -45
- package/lib/resources/coupons.js +1 -1
- package/lib/resources/customer_addresses.d.ts +1 -41
- package/lib/resources/customer_addresses.js +1 -1
- package/lib/resources/customer_groups.d.ts +1 -36
- package/lib/resources/customer_groups.js +1 -1
- package/lib/resources/customer_password_resets.d.ts +1 -33
- package/lib/resources/customer_password_resets.js +1 -1
- package/lib/resources/customer_payment_sources.d.ts +1 -70
- package/lib/resources/customer_payment_sources.js +1 -1
- package/lib/resources/customer_subscriptions.d.ts +1 -28
- package/lib/resources/customer_subscriptions.js +1 -1
- package/lib/resources/customers.d.ts +1 -60
- package/lib/resources/customers.js +1 -1
- package/lib/resources/delivery_lead_times.d.ts +1 -51
- package/lib/resources/delivery_lead_times.js +1 -1
- package/lib/resources/event_callbacks.d.ts +1 -24
- package/lib/resources/event_callbacks.js +1 -1
- package/lib/resources/external_gateways.d.ts +1 -49
- package/lib/resources/external_gateways.js +1 -1
- package/lib/resources/external_payments.d.ts +1 -43
- package/lib/resources/external_payments.js +1 -1
- package/lib/resources/external_promotions.d.ts +1 -86
- package/lib/resources/external_promotions.js +1 -1
- package/lib/resources/external_tax_calculators.d.ts +1 -44
- package/lib/resources/external_tax_calculators.js +1 -1
- package/lib/resources/fixed_amount_promotions.d.ts +1 -88
- package/lib/resources/fixed_amount_promotions.js +1 -1
- package/lib/resources/fixed_price_promotions.d.ts +1 -99
- package/lib/resources/fixed_price_promotions.js +1 -1
- package/lib/resources/free_gift_promotions.d.ts +1 -97
- package/lib/resources/free_gift_promotions.js +1 -1
- package/lib/resources/free_shipping_promotions.d.ts +1 -83
- package/lib/resources/free_shipping_promotions.js +1 -1
- package/lib/resources/geocoders.d.ts +1 -24
- package/lib/resources/geocoders.js +1 -1
- package/lib/resources/gift_card_recipients.d.ts +1 -44
- package/lib/resources/gift_card_recipients.js +1 -1
- package/lib/resources/gift_cards.d.ts +1 -82
- package/lib/resources/gift_cards.js +1 -1
- package/lib/resources/google_geocoders.d.ts +1 -35
- package/lib/resources/google_geocoders.js +1 -1
- package/lib/resources/imports.d.ts +1 -40
- package/lib/resources/imports.js +1 -1
- package/lib/resources/in_stock_subscriptions.d.ts +1 -59
- package/lib/resources/in_stock_subscriptions.js +1 -1
- package/lib/resources/inventory_models.d.ts +1 -42
- package/lib/resources/inventory_models.js +1 -1
- package/lib/resources/inventory_return_locations.d.ts +1 -43
- package/lib/resources/inventory_return_locations.js +1 -1
- package/lib/resources/inventory_stock_locations.d.ts +1 -46
- package/lib/resources/inventory_stock_locations.js +1 -1
- package/lib/resources/klarna_gateways.d.ts +1 -44
- package/lib/resources/klarna_gateways.js +1 -1
- package/lib/resources/klarna_payments.d.ts +1 -41
- package/lib/resources/klarna_payments.js +1 -1
- package/lib/resources/line_item_options.d.ts +1 -57
- package/lib/resources/line_item_options.js +1 -1
- package/lib/resources/line_items.d.ts +1 -125
- package/lib/resources/line_items.js +1 -1
- package/lib/resources/manual_gateways.d.ts +1 -33
- package/lib/resources/manual_gateways.js +1 -1
- package/lib/resources/manual_tax_calculators.d.ts +1 -49
- package/lib/resources/manual_tax_calculators.js +1 -1
- package/lib/resources/markets.d.ts +1 -81
- package/lib/resources/markets.js +1 -1
- package/lib/resources/merchants.d.ts +1 -38
- package/lib/resources/merchants.js +1 -1
- package/lib/resources/order_amount_promotion_rules.d.ts +1 -56
- package/lib/resources/order_amount_promotion_rules.js +1 -1
- package/lib/resources/order_copies.d.ts +1 -45
- package/lib/resources/order_copies.js +1 -1
- package/lib/resources/order_subscriptions.d.ts +1 -67
- package/lib/resources/order_subscriptions.js +1 -1
- package/lib/resources/order_validation_rules.d.ts +1 -20
- package/lib/resources/order_validation_rules.js +1 -1
- package/lib/resources/orders.d.ts +1 -271
- package/lib/resources/orders.js +1 -1
- package/lib/resources/organization.d.ts +1 -32
- package/lib/resources/organization.js +1 -1
- package/lib/resources/packages.d.ts +1 -56
- package/lib/resources/packages.js +1 -1
- package/lib/resources/parcel_line_items.d.ts +1 -49
- package/lib/resources/parcel_line_items.js +1 -1
- package/lib/resources/parcels.d.ts +1 -108
- package/lib/resources/parcels.js +1 -1
- package/lib/resources/payment_gateways.d.ts +1 -21
- package/lib/resources/payment_gateways.js +1 -1
- package/lib/resources/payment_methods.d.ts +1 -59
- package/lib/resources/payment_methods.js +1 -1
- package/lib/resources/paypal_gateways.d.ts +1 -39
- package/lib/resources/paypal_gateways.js +1 -1
- package/lib/resources/paypal_payments.d.ts +1 -47
- package/lib/resources/paypal_payments.js +1 -1
- package/lib/resources/percentage_discount_promotions.d.ts +1 -97
- package/lib/resources/percentage_discount_promotions.js +1 -1
- package/lib/resources/price_lists.d.ts +1 -39
- package/lib/resources/price_lists.js +1 -1
- package/lib/resources/prices.d.ts +1 -57
- package/lib/resources/prices.js +1 -1
- package/lib/resources/promotion_rules.d.ts +1 -24
- package/lib/resources/promotion_rules.js +1 -1
- package/lib/resources/promotions.d.ts +1 -41
- package/lib/resources/promotions.js +1 -1
- package/lib/resources/refunds.d.ts +1 -34
- package/lib/resources/refunds.js +1 -1
- package/lib/resources/return_line_items.d.ts +1 -49
- package/lib/resources/return_line_items.js +1 -1
- package/lib/resources/returns.d.ts +1 -72
- package/lib/resources/returns.js +1 -1
- package/lib/resources/shipments.d.ts +1 -89
- package/lib/resources/shipments.js +1 -1
- package/lib/resources/shipping_categories.d.ts +1 -33
- package/lib/resources/shipping_categories.js +1 -1
- package/lib/resources/shipping_methods.d.ts +1 -74
- package/lib/resources/shipping_methods.js +1 -1
- package/lib/resources/shipping_zones.d.ts +1 -48
- package/lib/resources/shipping_zones.js +1 -1
- package/lib/resources/sku_list_items.d.ts +1 -47
- package/lib/resources/sku_list_items.js +1 -1
- package/lib/resources/sku_list_promotion_rules.d.ts +1 -68
- package/lib/resources/sku_list_promotion_rules.js +1 -1
- package/lib/resources/sku_lists.d.ts +1 -49
- package/lib/resources/sku_lists.js +1 -1
- package/lib/resources/sku_options.d.ts +1 -56
- package/lib/resources/sku_options.js +1 -1
- package/lib/resources/skus.d.ts +1 -78
- package/lib/resources/skus.js +1 -1
- package/lib/resources/stock_items.d.ts +1 -49
- package/lib/resources/stock_items.js +1 -1
- package/lib/resources/stock_line_items.d.ts +1 -29
- package/lib/resources/stock_line_items.js +1 -1
- package/lib/resources/stock_locations.d.ts +1 -57
- package/lib/resources/stock_locations.js +1 -1
- package/lib/resources/stock_transfers.d.ts +1 -71
- package/lib/resources/stock_transfers.js +1 -1
- package/lib/resources/stripe_gateways.d.ts +1 -38
- package/lib/resources/stripe_gateways.js +1 -1
- package/lib/resources/stripe_payments.d.ts +1 -42
- package/lib/resources/stripe_payments.js +1 -1
- package/lib/resources/tax_calculators.d.ts +1 -27
- package/lib/resources/tax_calculators.js +1 -1
- package/lib/resources/tax_categories.d.ts +1 -59
- package/lib/resources/tax_categories.js +1 -1
- package/lib/resources/tax_rules.d.ts +1 -69
- package/lib/resources/tax_rules.js +1 -1
- package/lib/resources/taxjar_accounts.d.ts +1 -43
- package/lib/resources/taxjar_accounts.js +1 -1
- package/lib/resources/transactions.d.ts +1 -31
- package/lib/resources/transactions.js +1 -1
- package/lib/resources/voids.d.ts +1 -34
- package/lib/resources/voids.js +1 -1
- package/lib/resources/webhooks.d.ts +1 -42
- package/lib/resources/webhooks.js +1 -1
- package/lib/resources/wire_transfers.d.ts +1 -32
- package/lib/resources/wire_transfers.js +1 -1
- package/lib/static.d.ts +1 -6
- package/lib/static.js +1 -1
- package/lib/util.d.ts +1 -2
- package/package.json +19 -22
@@ -1,32 +1 @@
|
|
1
|
-
import
|
2
|
-
import { QueryParamsList, QueryParamsRetrieve } from '../query';
|
3
|
-
import { Order } from './orders';
|
4
|
-
declare type WireTransferRel = ResourceRel & {
|
5
|
-
type: typeof WireTransfers.TYPE;
|
6
|
-
};
|
7
|
-
declare type OrderRel = ResourceRel & {
|
8
|
-
type: 'orders';
|
9
|
-
};
|
10
|
-
interface WireTransfer extends Resource {
|
11
|
-
order?: Order;
|
12
|
-
}
|
13
|
-
interface WireTransferCreate extends ResourceCreate {
|
14
|
-
order: OrderRel;
|
15
|
-
}
|
16
|
-
interface WireTransferUpdate extends ResourceUpdate {
|
17
|
-
order?: OrderRel;
|
18
|
-
}
|
19
|
-
declare class WireTransfers extends ApiResource {
|
20
|
-
static readonly TYPE: 'wire_transfers';
|
21
|
-
list(params?: QueryParamsList, options?: ResourcesConfig): Promise<ListResponse<WireTransfer>>;
|
22
|
-
create(resource: WireTransferCreate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
|
23
|
-
retrieve(id: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
|
24
|
-
update(resource: WireTransferUpdate, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<WireTransfer>;
|
25
|
-
delete(id: string, options?: ResourcesConfig): Promise<void>;
|
26
|
-
order(wireTransferId: string, params?: QueryParamsRetrieve, options?: ResourcesConfig): Promise<Order>;
|
27
|
-
isWireTransfer(resource: any): resource is WireTransfer;
|
28
|
-
relationship(id: string | ResourceId | null): WireTransferRel;
|
29
|
-
type(): string;
|
30
|
-
}
|
31
|
-
export default WireTransfers;
|
32
|
-
export { WireTransfer, WireTransferCreate, WireTransferUpdate };
|
1
|
+
import{ApiResource,Resource,ResourceCreate,ResourceUpdate,ResourcesConfig,ResourceId,ResourceRel,ListResponse}from'../resource';import type{QueryParamsList,QueryParamsRetrieve}from'../query';import type{Order}from'./orders';declare type WireTransferRel=ResourceRel&{type:typeof WireTransfers.TYPE;};declare type OrderRel=ResourceRel&{type:'orders';};interface WireTransfer extends Resource{order?:Order;}interface WireTransferCreate extends ResourceCreate{order:OrderRel;}interface WireTransferUpdate extends ResourceUpdate{order?:OrderRel;}declare class WireTransfers extends ApiResource{static readonly TYPE:'wire_transfers';list(params?:QueryParamsList,options?:ResourcesConfig):Promise<ListResponse<WireTransfer>>;create(resource:WireTransferCreate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<WireTransfer>;retrieve(id:string,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<WireTransfer>;update(resource:WireTransferUpdate,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<WireTransfer>;delete(id:string,options?:ResourcesConfig):Promise<void>;order(wireTransferId:string|WireTransfer,params?:QueryParamsRetrieve,options?:ResourcesConfig):Promise<Order>;isWireTransfer(resource:any):resource is WireTransfer;relationship(id:string|ResourceId|null):WireTransferRel;type():string;}export default WireTransfers;export{WireTransfer,WireTransferCreate,WireTransferUpdate};
|
@@ -1 +1 @@
|
|
1
|
-
import{ApiResource as
|
1
|
+
import{ApiResource as n}from"../resource";class r extends n{static TYPE="wire_transfers";async list(e,t){return this.resources.list({type:r.TYPE},e,t)}async create(e,t,s){return this.resources.create({...e,type:r.TYPE},t,s)}async retrieve(e,t,s){return this.resources.retrieve({type:r.TYPE,id:e},t,s)}async update(e,t,s){return this.resources.update({...e,type:r.TYPE},t,s)}async delete(e,t){await this.resources.delete({type:r.TYPE,id:e},t)}async order(e,t,s){const i=e.id||e;return this.resources.fetch({type:"orders"},`wire_transfers/${i}/order`,t,s)}isWireTransfer(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;
|
package/lib/static.d.ts
CHANGED
@@ -1,6 +1 @@
|
|
1
|
-
import
|
2
|
-
export declare const CommerceLayerStatic: {
|
3
|
-
resources: () => readonly string[];
|
4
|
-
isSdkError: (error: unknown) => error is SdkError;
|
5
|
-
isApiError: (error: unknown) => error is ApiError;
|
6
|
-
};
|
1
|
+
import{SdkError,ApiError}from'./error';import{CommerceLayerClient,CommerceLayerInitConfig}from'./commercelayer';export declare const CommerceLayerStatic:{resources:()=>readonly string[];isSdkError:(error:unknown)=>error is SdkError;isApiError:(error:unknown)=>error is ApiError;init:(config:CommerceLayerInitConfig)=>CommerceLayerClient;};
|
package/lib/static.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
import*as o from"./api";import{SdkError as
|
1
|
+
import*as o from"./api";import{SdkError as i,ApiError as s}from"./error";import t from"./commercelayer";export const CommerceLayerStatic={resources:()=>o.resourceList,isSdkError:r=>i.isSdkError(r),isApiError:r=>s.isApiError(r),init:r=>t(r)};
|
package/lib/util.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "@commercelayer/sdk",
|
3
|
-
"version": "5.0.0-alpha.
|
3
|
+
"version": "5.0.0-alpha.4",
|
4
|
+
"type": "module",
|
4
5
|
"types": "lib/index.d.ts",
|
5
6
|
"module": "lib/index.js",
|
6
7
|
"scripts": {
|
7
8
|
"lint": "eslint ./src --ext .ts",
|
8
9
|
"lintspec": "eslint ./specs/resources/ --ext .spec.ts",
|
9
10
|
"build": "tsc -b tsconfig.json --verbose",
|
10
|
-
"
|
11
|
+
"clean": "rm -rf ./.nyc_output ./node_modules/.cache ./coverage",
|
12
|
+
"coverage": "jest --coverage",
|
11
13
|
"generate": "ts-node gen/generator.ts",
|
14
|
+
"postbuild": "minimize-js -d lib",
|
12
15
|
"prepare": "npm run build",
|
13
|
-
"
|
14
|
-
"test-local": "ts-node test/spot.ts",
|
15
|
-
"coverage": "jest --coverage",
|
16
|
+
"semantic-release": "semantic-release",
|
16
17
|
"size": "size-limit",
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"semantic-release": "semantic-release"
|
18
|
+
"test": "jest",
|
19
|
+
"test-local": "ts-node test/spot.ts"
|
20
20
|
},
|
21
21
|
"keywords": [
|
22
22
|
"javascript",
|
@@ -36,10 +36,10 @@
|
|
36
36
|
"lib/**/*"
|
37
37
|
],
|
38
38
|
"engines": {
|
39
|
-
"node": ">=
|
39
|
+
"node": ">=16"
|
40
40
|
},
|
41
41
|
"dependencies": {
|
42
|
-
"axios": "^0.
|
42
|
+
"axios": "^0.26.0"
|
43
43
|
},
|
44
44
|
"devDependencies": {
|
45
45
|
"@babel/preset-env": "^7.16.11",
|
@@ -47,13 +47,13 @@
|
|
47
47
|
"@commercelayer/js-auth": "^2.2.9",
|
48
48
|
"@semantic-release/changelog": "^6.0.1",
|
49
49
|
"@semantic-release/git": "^10.0.1",
|
50
|
-
"@size-limit/preset-small-lib": "^
|
50
|
+
"@size-limit/preset-small-lib": "^7.0.8",
|
51
51
|
"@types/debug": "^4.1.7",
|
52
52
|
"@types/jest": "^27.4.0",
|
53
53
|
"@types/lodash": "^4.14.178",
|
54
54
|
"@types/node": "^17.0.17",
|
55
55
|
"@typescript-eslint/eslint-plugin": "^5.7.0",
|
56
|
-
"dotenv": "^
|
56
|
+
"dotenv": "^16.0.0",
|
57
57
|
"eslint": "^8.8.0",
|
58
58
|
"husky": "^7.0.4",
|
59
59
|
"inflector-js": "^1.0.1",
|
@@ -61,21 +61,18 @@
|
|
61
61
|
"json-typescript": "^1.1.2",
|
62
62
|
"jsonapi-typescript": "^0.1.3",
|
63
63
|
"lodash": "^4.17.21",
|
64
|
-
"minimize-js": "^1.
|
64
|
+
"minimize-js": "^1.3.0",
|
65
65
|
"pretty-quick": "^3.1.3",
|
66
66
|
"semantic-release": "^19.0.2",
|
67
|
-
"ts-node": "^10.
|
68
|
-
"typescript": "^4.
|
67
|
+
"ts-node": "^10.6.0",
|
68
|
+
"typescript": "^4.6.2"
|
69
69
|
},
|
70
70
|
"repository": "github:commercelayer/commercelayer-sdk",
|
71
|
+
"bugs": "https://github.com/commercelayer/commercelayer-sdk/issues",
|
71
72
|
"publishConfig": {
|
72
73
|
"access": "public"
|
73
74
|
},
|
74
|
-
"
|
75
|
-
|
76
|
-
|
77
|
-
"limit": "350 kB",
|
78
|
-
"webpack": false
|
79
|
-
}
|
80
|
-
]
|
75
|
+
"resolutions": {
|
76
|
+
"ansi-regex": "5.0.1"
|
77
|
+
}
|
81
78
|
}
|