@gradientedge/commercetools-utils 5.3.1 → 5.5.0
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/dist/ge-commercetools-utils-browser.cjs.js +1 -1
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-node.esm.js +1 -1
- package/dist/typings/models/associate-role.d.ts +79 -0
- package/dist/typings/models/attribute-group.d.ts +68 -0
- package/dist/typings/models/business-unit.d.ts +272 -0
- package/dist/typings/models/cart-discount.d.ts +2 -2
- package/dist/typings/models/cart.d.ts +133 -115
- package/dist/typings/models/channel.d.ts +4 -4
- package/dist/typings/models/common.d.ts +49 -40
- package/dist/typings/models/customer.d.ts +16 -13
- package/dist/typings/models/error.d.ts +451 -18
- package/dist/typings/models/extension.d.ts +7 -3
- package/dist/typings/models/graph-ql.d.ts +3 -1
- package/dist/typings/models/index.d.ts +13 -6
- package/dist/typings/models/me.d.ts +179 -37
- package/dist/typings/models/message.d.ts +849 -20
- package/dist/typings/models/order-edit.d.ts +22 -16
- package/dist/typings/models/order.d.ts +124 -25
- package/dist/typings/models/payment.d.ts +19 -14
- package/dist/typings/models/product-selection.d.ts +39 -6
- package/dist/typings/models/product-type.d.ts +4 -4
- package/dist/typings/models/product.d.ts +13 -5
- package/dist/typings/models/project.d.ts +18 -3
- package/dist/typings/models/quote-request.d.ts +5 -1
- package/dist/typings/models/quote.d.ts +8 -3
- package/dist/typings/models/scalar-types.d.ts +0 -1
- package/dist/typings/models/shipping-method.d.ts +7 -7
- package/dist/typings/models/shopping-list.d.ts +22 -22
- package/dist/typings/models/staged-quote.d.ts +5 -1
- package/dist/typings/models/standalone-price.d.ts +9 -5
- package/dist/typings/models/state.d.ts +2 -2
- package/dist/typings/models/store-country.d.ts +3 -0
- package/dist/typings/models/store.d.ts +16 -1
- package/dist/typings/models/subscription.d.ts +27 -14
- package/dist/typings/models/tax-category.d.ts +6 -2
- package/dist/typings/models/type.d.ts +3 -3
- package/package.json +19 -19
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import { BaseResource, CreatedBy, LastModifiedBy, Reference } from './common';
|
|
2
2
|
import { UserProvidedIdentifiers } from './message';
|
|
3
|
+
export type AwsAuthenticationMode = 'Credentials' | 'IAM' | string;
|
|
3
4
|
export interface ChangeSubscription {
|
|
4
|
-
readonly resourceTypeId:
|
|
5
|
+
readonly resourceTypeId: ChangeSubscriptionResourceTypeId;
|
|
6
|
+
}
|
|
7
|
+
export type ChangeSubscriptionResourceTypeId = 'business-unit' | 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-email-token' | 'customer-group' | 'customer-password-token' | 'discount-code' | 'extension' | 'inventory-entry' | 'key-value-document' | 'order' | 'order-edit' | 'payment' | 'product' | 'product-discount' | 'product-price' | 'product-selection' | 'product-type' | 'quote' | 'quote-request' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'state' | 'store' | 'subscription' | 'tax-category' | 'type' | 'zone' | string;
|
|
8
|
+
export interface CloudEventsPayload {
|
|
9
|
+
readonly specversion: string;
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly type: string;
|
|
12
|
+
readonly source: string;
|
|
13
|
+
readonly subject: string;
|
|
14
|
+
readonly time: string;
|
|
15
|
+
readonly sequence?: string;
|
|
16
|
+
readonly sequencetype?: string;
|
|
17
|
+
readonly dataref?: string;
|
|
18
|
+
readonly data: DeliveryPayload;
|
|
5
19
|
}
|
|
6
20
|
export type DeliveryFormat = CloudEventsFormat | PlatformFormat;
|
|
7
21
|
export interface CloudEventsFormat {
|
|
@@ -9,7 +23,7 @@ export interface CloudEventsFormat {
|
|
|
9
23
|
readonly cloudEventsVersion: string;
|
|
10
24
|
}
|
|
11
25
|
export type DeliveryPayload = MessageDeliveryPayload | ResourceCreatedDeliveryPayload | ResourceDeletedDeliveryPayload | ResourceUpdatedDeliveryPayload;
|
|
12
|
-
export type Destination = AzureEventGridDestination | AzureServiceBusDestination | EventBridgeDestination | GoogleCloudPubSubDestination |
|
|
26
|
+
export type Destination = AzureEventGridDestination | AzureServiceBusDestination | EventBridgeDestination | GoogleCloudPubSubDestination | SnsDestination | SqsDestination;
|
|
13
27
|
export interface AzureEventGridDestination {
|
|
14
28
|
readonly type: 'EventGrid';
|
|
15
29
|
readonly uri: string;
|
|
@@ -29,10 +43,6 @@ export interface GoogleCloudPubSubDestination {
|
|
|
29
43
|
readonly projectId: string;
|
|
30
44
|
readonly topic: string;
|
|
31
45
|
}
|
|
32
|
-
export interface IronMqDestination {
|
|
33
|
-
readonly type: 'IronMQ';
|
|
34
|
-
readonly uri: string;
|
|
35
|
-
}
|
|
36
46
|
export interface MessageDeliveryPayload {
|
|
37
47
|
readonly notificationType: 'Message';
|
|
38
48
|
readonly projectKey: string;
|
|
@@ -44,12 +54,13 @@ export interface MessageDeliveryPayload {
|
|
|
44
54
|
readonly lastModifiedAt: string;
|
|
45
55
|
readonly sequenceNumber: number;
|
|
46
56
|
readonly resourceVersion: number;
|
|
47
|
-
readonly payloadNotIncluded
|
|
57
|
+
readonly payloadNotIncluded?: PayloadNotIncluded;
|
|
48
58
|
}
|
|
49
59
|
export interface MessageSubscription {
|
|
50
|
-
readonly resourceTypeId:
|
|
60
|
+
readonly resourceTypeId: MessageSubscriptionResourceTypeId;
|
|
51
61
|
readonly types?: string[];
|
|
52
62
|
}
|
|
63
|
+
export type MessageSubscriptionResourceTypeId = 'associate-role' | 'business-unit' | 'category' | 'customer' | 'inventory-entry' | 'order' | 'payment' | 'product' | 'product-selection' | 'quote' | 'quote-request' | 'review' | 'staged-quote' | 'standalone-price' | 'store' | string;
|
|
53
64
|
export interface PayloadNotIncluded {
|
|
54
65
|
readonly reason: string;
|
|
55
66
|
readonly payloadType: string;
|
|
@@ -85,16 +96,18 @@ export interface ResourceUpdatedDeliveryPayload {
|
|
|
85
96
|
}
|
|
86
97
|
export interface SnsDestination {
|
|
87
98
|
readonly type: 'SNS';
|
|
88
|
-
readonly accessKey
|
|
89
|
-
readonly accessSecret
|
|
99
|
+
readonly accessKey?: string;
|
|
100
|
+
readonly accessSecret?: string;
|
|
90
101
|
readonly topicArn: string;
|
|
102
|
+
readonly authenticationMode?: AwsAuthenticationMode;
|
|
91
103
|
}
|
|
92
104
|
export interface SqsDestination {
|
|
93
105
|
readonly type: 'SQS';
|
|
94
|
-
readonly accessKey
|
|
95
|
-
readonly accessSecret
|
|
106
|
+
readonly accessKey?: string;
|
|
107
|
+
readonly accessSecret?: string;
|
|
96
108
|
readonly queueUrl: string;
|
|
97
109
|
readonly region: string;
|
|
110
|
+
readonly authenticationMode?: AwsAuthenticationMode;
|
|
98
111
|
}
|
|
99
112
|
export interface Subscription extends BaseResource {
|
|
100
113
|
readonly id: string;
|
|
@@ -117,12 +130,12 @@ export interface SubscriptionDraft {
|
|
|
117
130
|
readonly messages?: MessageSubscription[];
|
|
118
131
|
readonly format?: DeliveryFormat;
|
|
119
132
|
}
|
|
120
|
-
export type SubscriptionHealthStatus = 'ConfigurationError' | 'ConfigurationErrorDeliveryStopped' | 'Healthy' | 'TemporaryError';
|
|
133
|
+
export type SubscriptionHealthStatus = 'ConfigurationError' | 'ConfigurationErrorDeliveryStopped' | 'Healthy' | 'TemporaryError' | string;
|
|
121
134
|
export interface SubscriptionPagedQueryResponse {
|
|
122
135
|
readonly limit: number;
|
|
136
|
+
readonly offset: number;
|
|
123
137
|
readonly count: number;
|
|
124
138
|
readonly total?: number;
|
|
125
|
-
readonly offset: number;
|
|
126
139
|
readonly results: Subscription[];
|
|
127
140
|
}
|
|
128
141
|
export interface SubscriptionUpdate {
|
|
@@ -45,6 +45,7 @@ export interface TaxCategoryUpdate {
|
|
|
45
45
|
export type TaxCategoryUpdateAction = TaxCategoryAddTaxRateAction | TaxCategoryChangeNameAction | TaxCategoryRemoveTaxRateAction | TaxCategoryReplaceTaxRateAction | TaxCategorySetDescriptionAction | TaxCategorySetKeyAction;
|
|
46
46
|
export interface TaxRate {
|
|
47
47
|
readonly id?: string;
|
|
48
|
+
readonly key?: string;
|
|
48
49
|
readonly name: string;
|
|
49
50
|
readonly amount: number;
|
|
50
51
|
readonly includedInPrice: boolean;
|
|
@@ -59,6 +60,7 @@ export interface TaxRateDraft {
|
|
|
59
60
|
readonly country: string;
|
|
60
61
|
readonly state?: string;
|
|
61
62
|
readonly subRates?: SubRate[];
|
|
63
|
+
readonly key?: string;
|
|
62
64
|
}
|
|
63
65
|
export interface TaxCategoryAddTaxRateAction {
|
|
64
66
|
readonly action: 'addTaxRate';
|
|
@@ -70,11 +72,13 @@ export interface TaxCategoryChangeNameAction {
|
|
|
70
72
|
}
|
|
71
73
|
export interface TaxCategoryRemoveTaxRateAction {
|
|
72
74
|
readonly action: 'removeTaxRate';
|
|
73
|
-
readonly taxRateId
|
|
75
|
+
readonly taxRateId?: string;
|
|
76
|
+
readonly taxRateKey?: string;
|
|
74
77
|
}
|
|
75
78
|
export interface TaxCategoryReplaceTaxRateAction {
|
|
76
79
|
readonly action: 'replaceTaxRate';
|
|
77
|
-
readonly taxRateId
|
|
80
|
+
readonly taxRateId?: string;
|
|
81
|
+
readonly taxRateKey?: string;
|
|
78
82
|
readonly taxRate: TaxRateDraft;
|
|
79
83
|
}
|
|
80
84
|
export interface TaxCategorySetDescriptionAction {
|
|
@@ -7,7 +7,7 @@ export interface CustomFieldLocalizedEnumValue {
|
|
|
7
7
|
readonly key: string;
|
|
8
8
|
readonly label: LocalizedString;
|
|
9
9
|
}
|
|
10
|
-
export type CustomFieldReferenceValue = 'cart' | 'category' | 'channel' | 'customer' | 'key-value-document' | 'order' | 'product' | 'product-type' | 'review' | 'shipping-method' | 'state' | 'zone';
|
|
10
|
+
export type CustomFieldReferenceValue = 'cart' | 'category' | 'channel' | 'customer' | 'key-value-document' | 'order' | 'product' | 'product-type' | 'review' | 'shipping-method' | 'state' | 'zone' | string;
|
|
11
11
|
export interface CustomFields {
|
|
12
12
|
readonly type: TypeReference;
|
|
13
13
|
readonly fields: FieldContainer;
|
|
@@ -67,7 +67,7 @@ export interface CustomFieldStringType {
|
|
|
67
67
|
export interface CustomFieldTimeType {
|
|
68
68
|
readonly name: 'Time';
|
|
69
69
|
}
|
|
70
|
-
export type ResourceTypeId = 'address' | 'asset' | 'cart-discount' | 'category' | 'channel' | 'custom-line-item' | 'customer' | 'customer-group' | 'discount-code' | 'inventory-entry' | 'line-item' | 'order' | 'order-delivery' | 'order-edit' | 'order-parcel' | 'order-return-item' | 'payment' | 'payment-interface-interaction' | 'product-price' | 'product-selection' | 'quote' | 'review' | 'shipping-method' | 'shopping-list' | 'shopping-list-text-line-item' | 'store' | 'transaction';
|
|
70
|
+
export type ResourceTypeId = 'address' | 'asset' | 'associate-role' | 'business-unit' | 'cart-discount' | 'category' | 'channel' | 'custom-line-item' | 'customer' | 'customer-group' | 'discount-code' | 'inventory-entry' | 'line-item' | 'order' | 'order-delivery' | 'order-edit' | 'order-parcel' | 'order-return-item' | 'payment' | 'payment-interface-interaction' | 'product-price' | 'product-selection' | 'quote' | 'review' | 'shipping' | 'shipping-method' | 'shopping-list' | 'shopping-list-text-line-item' | 'standalone-price' | 'store' | 'transaction' | string;
|
|
71
71
|
export interface Type extends BaseResource {
|
|
72
72
|
readonly id: string;
|
|
73
73
|
readonly version: number;
|
|
@@ -105,7 +105,7 @@ export interface TypeResourceIdentifier {
|
|
|
105
105
|
readonly id?: string;
|
|
106
106
|
readonly key?: string;
|
|
107
107
|
}
|
|
108
|
-
export type TypeTextInputHint = 'MultiLine' | 'SingleLine';
|
|
108
|
+
export type TypeTextInputHint = 'MultiLine' | 'SingleLine' | string;
|
|
109
109
|
export interface TypeUpdate {
|
|
110
110
|
readonly version: number;
|
|
111
111
|
readonly actions: TypeUpdateAction[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradientedge/commercetools-utils",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "Provide utility classes and functions for interacting with the commercetools API",
|
|
5
5
|
"main": "./dist/ge-commercetools-utils-node.cjs.js",
|
|
6
6
|
"module": "./dist/ge-commercetools-utils-node.esm.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prettify": "prettier --write \"**/*.{ts,js,json,graphql}\"",
|
|
26
26
|
"test": "TZ=UTC jest --passWithNoTests --runInBand",
|
|
27
27
|
"validate": "npm run prettier && npm run lint && npm run test",
|
|
28
|
-
"docs": "typedoc",
|
|
28
|
+
"docs": "typedoc --readme ./README.md",
|
|
29
29
|
"semantic-release": "semantic-release",
|
|
30
30
|
"bundle": "npm run bundle-browser && npm run bundle-node",
|
|
31
31
|
"bundle-browser": "webpack --config=webpack.config.browser.js",
|
|
@@ -55,42 +55,42 @@
|
|
|
55
55
|
},
|
|
56
56
|
"homepage": "https://github.com/gradientedge/commercetools-utils#readme",
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@sinonjs/fake-timers": "10.0
|
|
59
|
-
"@types/jest": "29.5.
|
|
58
|
+
"@sinonjs/fake-timers": "10.3.0",
|
|
59
|
+
"@types/jest": "29.5.2",
|
|
60
60
|
"@types/json-stringify-safe": "5.0.0",
|
|
61
|
-
"@types/lodash": "4.14.
|
|
61
|
+
"@types/lodash": "4.14.195",
|
|
62
62
|
"@types/lodash.clonedeep": "4.5.7",
|
|
63
|
-
"@types/node": "
|
|
63
|
+
"@types/node": "20.3.1",
|
|
64
64
|
"@types/qs": "6.9.7",
|
|
65
65
|
"@types/sinonjs__fake-timers": "8.1.2",
|
|
66
66
|
"@types/traverse": "0.6.32",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
68
|
-
"@typescript-eslint/parser": "5.
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "5.60.0",
|
|
68
|
+
"@typescript-eslint/parser": "5.60.0",
|
|
69
69
|
"codecov": "3.8.3",
|
|
70
70
|
"commitizen": "4.3.0",
|
|
71
71
|
"cz-conventional-changelog": "3.3.0",
|
|
72
|
-
"eslint": "8.
|
|
72
|
+
"eslint": "8.43.0",
|
|
73
73
|
"eslint-config-prettier": "8.8.0",
|
|
74
74
|
"husky": "8.0.3",
|
|
75
75
|
"jest": "29.5.0",
|
|
76
76
|
"jest-matcher-specific-error": "1.0.0",
|
|
77
77
|
"jest-mock": "29.5.0",
|
|
78
|
-
"nock": "13.3.
|
|
79
|
-
"prettier": "2.8.
|
|
80
|
-
"rimraf": "
|
|
81
|
-
"semantic-release": "21.0.
|
|
78
|
+
"nock": "13.3.1",
|
|
79
|
+
"prettier": "2.8.8",
|
|
80
|
+
"rimraf": "5.0.1",
|
|
81
|
+
"semantic-release": "21.0.5",
|
|
82
82
|
"ts-jest": "29.1.0",
|
|
83
83
|
"ts-node": "^10.9.1",
|
|
84
|
-
"typedoc": "0.
|
|
85
|
-
"typescript": "5.
|
|
86
|
-
"webpack": "5.
|
|
87
|
-
"webpack-cli": "5.
|
|
84
|
+
"typedoc": "0.24.8",
|
|
85
|
+
"typescript": "5.1.3",
|
|
86
|
+
"webpack": "5.87.0",
|
|
87
|
+
"webpack-cli": "5.1.4"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
90
|
"@tshttp/status": "^2.0.0",
|
|
91
|
-
"axios": "1.
|
|
91
|
+
"axios": "1.4.0",
|
|
92
92
|
"json-stringify-safe": "5.0.1",
|
|
93
|
-
"qs": "6.11.
|
|
93
|
+
"qs": "6.11.2",
|
|
94
94
|
"traverse": "0.6.7"
|
|
95
95
|
},
|
|
96
96
|
"config": {
|