@gradientedge/commercetools-utils 4.13.0 → 4.14.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.
@@ -197,6 +197,11 @@ export declare class CommercetoolsApi {
197
197
  queryMyPayments(options: CommonRequestOptions & {
198
198
  accessToken: string;
199
199
  }): Promise<MyPaymentPagedQueryResponse>;
200
+ deleteMyPaymentById(options: CommonRequestOptions & {
201
+ id: string;
202
+ version: number;
203
+ accessToken: string;
204
+ }): Promise<MyPayment>;
200
205
  getMyOrderById(options: CommonStoreEnabledRequestOptions & {
201
206
  id: string;
202
207
  accessToken: string;
@@ -205,14 +205,14 @@ export interface ScopedPrice {
205
205
  export declare type TypedMoney = CentPrecisionMoney | HighPrecisionMoney;
206
206
  export interface CentPrecisionMoney {
207
207
  readonly type: 'centPrecision';
208
- readonly currencyCode: string;
209
208
  readonly centAmount: number;
209
+ readonly currencyCode: string;
210
210
  readonly fractionDigits: number;
211
211
  }
212
212
  export interface HighPrecisionMoney {
213
213
  readonly type: 'highPrecision';
214
- readonly currencyCode: string;
215
214
  readonly centAmount: number;
215
+ readonly currencyCode: string;
216
216
  readonly fractionDigits: number;
217
217
  readonly preciseAmount: number;
218
218
  }
@@ -225,7 +225,7 @@ export interface CentPrecisionMoneyDraft {
225
225
  }
226
226
  export interface HighPrecisionMoneyDraft {
227
227
  readonly type: 'highPrecision';
228
- readonly centAmount: number;
228
+ readonly centAmount?: number;
229
229
  readonly currencyCode: string;
230
230
  readonly fractionDigits?: number;
231
231
  readonly preciseAmount: number;
@@ -31,9 +31,9 @@ export interface ExtensionInput {
31
31
  }
32
32
  export interface ExtensionPagedQueryResponse {
33
33
  readonly limit: number;
34
+ readonly offset: number;
34
35
  readonly count: number;
35
36
  readonly total?: number;
36
- readonly offset: number;
37
37
  readonly results: Extension[];
38
38
  }
39
39
  export declare type ExtensionResourceTypeId = 'cart' | 'customer' | 'order' | 'payment';
@@ -8,6 +8,7 @@ export interface InventoryEntry extends BaseResource {
8
8
  readonly lastModifiedAt: string;
9
9
  readonly lastModifiedBy?: LastModifiedBy;
10
10
  readonly createdBy?: CreatedBy;
11
+ readonly key?: string;
11
12
  readonly sku: string;
12
13
  readonly supplyChannel?: ChannelReference;
13
14
  readonly quantityOnStock: number;
@@ -18,6 +19,7 @@ export interface InventoryEntry extends BaseResource {
18
19
  }
19
20
  export interface InventoryEntryDraft {
20
21
  readonly sku: string;
22
+ readonly key?: string;
21
23
  readonly supplyChannel?: ChannelResourceIdentifier;
22
24
  readonly quantityOnStock: number;
23
25
  readonly restockableInDays?: number;
@@ -38,7 +40,7 @@ export interface InventoryEntryUpdate {
38
40
  readonly version: number;
39
41
  readonly actions: InventoryEntryUpdateAction[];
40
42
  }
41
- export declare type InventoryEntryUpdateAction = InventoryEntryAddQuantityAction | InventoryEntryChangeQuantityAction | InventoryEntryRemoveQuantityAction | InventoryEntrySetCustomFieldAction | InventoryEntrySetCustomTypeAction | InventoryEntrySetExpectedDeliveryAction | InventoryEntrySetRestockableInDaysAction | InventoryEntrySetSupplyChannelAction;
43
+ export declare type InventoryEntryUpdateAction = InventoryEntryAddQuantityAction | InventoryEntryChangeQuantityAction | InventoryEntryRemoveQuantityAction | InventoryEntrySetCustomFieldAction | InventoryEntrySetCustomTypeAction | InventoryEntrySetExpectedDeliveryAction | InventoryEntrySetKeyAction | InventoryEntrySetRestockableInDaysAction | InventoryEntrySetSupplyChannelAction;
42
44
  export interface InventoryPagedQueryResponse {
43
45
  readonly limit: number;
44
46
  readonly count: number;
@@ -72,6 +74,10 @@ export interface InventoryEntrySetExpectedDeliveryAction {
72
74
  readonly action: 'setExpectedDelivery';
73
75
  readonly expectedDelivery?: string;
74
76
  }
77
+ export interface InventoryEntrySetKeyAction {
78
+ readonly action: 'setKey';
79
+ readonly key?: string;
80
+ }
75
81
  export interface InventoryEntrySetRestockableInDaysAction {
76
82
  readonly action: 'setRestockableInDays';
77
83
  readonly restockableInDays?: number;
@@ -43,7 +43,7 @@ export interface MyCustomerDraft {
43
43
  readonly addresses?: BaseAddress[];
44
44
  readonly defaultShippingAddress?: number;
45
45
  readonly defaultBillingAddress?: number;
46
- readonly custom?: CustomFields;
46
+ readonly custom?: CustomFieldsDraft;
47
47
  readonly locale?: string;
48
48
  readonly stores?: StoreResourceIdentifier[];
49
49
  }
@@ -114,7 +114,7 @@ export interface MyTransactionDraft {
114
114
  readonly type: TransactionType;
115
115
  readonly amount: Money;
116
116
  readonly interactionId?: string;
117
- readonly custom?: CustomFields;
117
+ readonly custom?: CustomFieldsDraft;
118
118
  }
119
119
  export interface MyCartAddDiscountCodeAction {
120
120
  readonly action: 'addDiscountCode';
@@ -128,7 +128,7 @@ export interface StagedOrderAddDeliveryAction {
128
128
  readonly items?: DeliveryItem[];
129
129
  readonly address?: BaseAddress;
130
130
  readonly parcels?: ParcelDraft[];
131
- readonly custom?: CustomFields;
131
+ readonly custom?: CustomFieldsDraft;
132
132
  }
133
133
  export interface StagedOrderAddDiscountCodeAction {
134
134
  readonly action: 'addDiscountCode';
@@ -108,6 +108,7 @@ export interface OrderFromCartDraft {
108
108
  readonly shipmentState?: ShipmentState;
109
109
  readonly orderState?: OrderState;
110
110
  readonly state?: StateResourceIdentifier;
111
+ readonly custom?: CustomFieldsDraft;
111
112
  }
112
113
  export interface OrderImportDraft {
113
114
  readonly orderNumber?: string;
@@ -122,9 +123,11 @@ export interface OrderImportDraft {
122
123
  readonly customerGroup?: CustomerGroupResourceIdentifier;
123
124
  readonly country?: string;
124
125
  readonly orderState?: OrderState;
126
+ readonly state?: StateReference;
125
127
  readonly shipmentState?: ShipmentState;
126
128
  readonly paymentState?: PaymentState;
127
129
  readonly shippingInfo?: ShippingInfoImportDraft;
130
+ readonly paymentInfo?: PaymentInfo;
128
131
  readonly completedAt?: string;
129
132
  readonly custom?: CustomFieldsDraft;
130
133
  readonly inventoryMode?: InventoryMode;
@@ -1,3 +1,4 @@
1
+ import { LastModifiedBy } from './common';
1
2
  import { MessagesConfiguration, MessagesConfigurationDraft } from './message';
2
3
  import { CustomFieldLocalizedEnumValue } from './type';
3
4
  export interface CartsConfiguration {
@@ -37,8 +38,8 @@ export interface SearchIndexingConfiguration {
37
38
  export declare type SearchIndexingConfigurationStatus = 'Activated' | 'Deactivated' | 'Indexing';
38
39
  export interface SearchIndexingConfigurationValues {
39
40
  readonly status?: SearchIndexingConfigurationStatus;
40
- readonly lastModifiedAt: string;
41
- readonly lastModifiedBy?: string;
41
+ readonly lastModifiedAt?: string;
42
+ readonly lastModifiedBy?: LastModifiedBy;
42
43
  }
43
44
  export declare type ShippingRateInputType = CartClassificationType | CartScoreType | CartValueType;
44
45
  export interface CartClassificationType {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/commercetools-utils",
3
- "version": "4.13.0",
3
+ "version": "4.14.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",
@@ -55,44 +55,43 @@
55
55
  },
56
56
  "homepage": "https://github.com/gradientedge/commercetools-utils#readme",
57
57
  "devDependencies": {
58
- "@sinonjs/fake-timers": "^9.1.1",
59
- "@types/jest": "^27.4.1",
60
- "@types/json-stringify-safe": "^5.0.0",
61
- "@types/lodash": "^4.14.179",
62
- "@types/lodash.clonedeep": "^4.5.6",
63
- "@types/node": "17.0.21",
64
- "@types/node-fetch": "^3.0.2",
65
- "@types/qs": "^6.9.7",
66
- "@types/sinonjs__fake-timers": "^8.1.1",
67
- "@types/traverse": "^0.6.32",
68
- "@typescript-eslint/eslint-plugin": "^5.14.0",
69
- "@typescript-eslint/parser": "^5.14.0",
70
- "codecov": "^3.8.3",
71
- "commitizen": "^4.2.4",
72
- "cz-conventional-changelog": "^3.3.0",
73
- "eslint": "^8.11.0",
74
- "eslint-config-prettier": "^8.5.0",
75
- "husky": "^7.0.4",
76
- "jest": "^27.5.1",
77
- "jest-matcher-specific-error": "^1.0.0",
78
- "jest-mock": "^27.5.1",
79
- "nock": "^13.2.4",
80
- "prettier": "^2.5.1",
81
- "rimraf": "^3.0.2",
82
- "semantic-release": "^19.0.2",
83
- "ts-jest": "^27.1.3",
84
- "ts-node": "^10.7.0",
85
- "typedoc": "^0.22.13",
86
- "typescript": "~4.6.2",
87
- "webpack": "^5.70.0",
88
- "webpack-cli": "^4.9.2"
58
+ "@sinonjs/fake-timers": "9.1.2",
59
+ "@types/jest": "27.4.1",
60
+ "@types/json-stringify-safe": "5.0.0",
61
+ "@types/lodash": "4.14.181",
62
+ "@types/lodash.clonedeep": "4.5.6",
63
+ "@types/node": "17.0.24",
64
+ "@types/qs": "6.9.7",
65
+ "@types/sinonjs__fake-timers": "8.1.2",
66
+ "@types/traverse": "0.6.32",
67
+ "@typescript-eslint/eslint-plugin": "5.19.0",
68
+ "@typescript-eslint/parser": "5.19.0",
69
+ "codecov": "3.8.3",
70
+ "commitizen": "4.2.4",
71
+ "cz-conventional-changelog": "3.3.0",
72
+ "eslint": "8.13.0",
73
+ "eslint-config-prettier": "8.5.0",
74
+ "husky": "7.0.4",
75
+ "jest": "27.5.1",
76
+ "jest-matcher-specific-error": "1.0.0",
77
+ "jest-mock": "27.5.1",
78
+ "nock": "13.2.4",
79
+ "prettier": "2.6.2",
80
+ "rimraf": "3.0.2",
81
+ "semantic-release": "19.0.2",
82
+ "ts-jest": "27.1.4",
83
+ "ts-node": "10.7.0",
84
+ "typedoc": "0.22.15",
85
+ "typescript": "~4.6.3",
86
+ "webpack": "5.72.0",
87
+ "webpack-cli": "4.9.2"
89
88
  },
90
89
  "dependencies": {
91
- "axios": "^0.26.1",
92
- "json-stringify-safe": "^5.0.1",
93
- "lodash.clonedeep": "^4.5.0",
94
- "qs": "^6.10.3",
95
- "traverse": "^0.6.6"
90
+ "axios": "0.26.1",
91
+ "json-stringify-safe": "5.0.1",
92
+ "lodash.clonedeep": "4.5.0",
93
+ "qs": "6.10.3",
94
+ "traverse": "0.6.6"
96
95
  },
97
96
  "config": {
98
97
  "commitizen": {