@gradientedge/commercetools-utils 4.11.3 → 4.12.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.
Files changed (44) hide show
  1. package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
  2. package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
  3. package/dist/ge-commercetools-utils-browser.esm.js +1 -1
  4. package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
  5. package/dist/ge-commercetools-utils-node.cjs.js +1 -1
  6. package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
  7. package/dist/ge-commercetools-utils-node.esm.js +1 -1
  8. package/dist/typings/api/CommercetoolsApi.d.ts +1 -1
  9. package/dist/typings/index.d.ts +1 -1
  10. package/dist/typings/models/cart-discount.d.ts +196 -0
  11. package/dist/typings/models/cart.d.ts +597 -0
  12. package/dist/typings/models/category.d.ts +166 -0
  13. package/dist/typings/models/channel.d.ts +103 -0
  14. package/dist/typings/models/common.d.ts +232 -0
  15. package/dist/typings/models/custom-object.d.ts +30 -0
  16. package/dist/typings/models/customer-group.d.ts +58 -0
  17. package/dist/typings/models/customer.d.ts +276 -0
  18. package/dist/typings/models/discount-code.d.ts +116 -0
  19. package/dist/typings/models/error.d.ts +412 -0
  20. package/dist/typings/models/extension.d.ts +78 -0
  21. package/dist/typings/models/graph-ql.d.ts +21 -0
  22. package/dist/typings/models/index.d.ts +33 -0
  23. package/dist/typings/models/inventory.d.ts +82 -0
  24. package/dist/typings/models/me.d.ts +481 -0
  25. package/dist/typings/models/message.d.ts +1823 -0
  26. package/dist/typings/models/order-edit.d.ts +565 -0
  27. package/dist/typings/models/order.d.ts +558 -0
  28. package/dist/typings/models/payment.d.ts +208 -0
  29. package/dist/typings/models/product-discount.d.ts +123 -0
  30. package/dist/typings/models/product-selection.d.ts +106 -0
  31. package/dist/typings/models/product-type.d.ts +216 -0
  32. package/dist/typings/models/product.d.ts +517 -0
  33. package/dist/typings/models/project.d.ts +108 -0
  34. package/dist/typings/models/review.d.ts +115 -0
  35. package/dist/typings/models/scalar-types.d.ts +4 -0
  36. package/dist/typings/models/shipping-method.d.ts +160 -0
  37. package/dist/typings/models/shopping-list.d.ts +217 -0
  38. package/dist/typings/models/state.d.ts +86 -0
  39. package/dist/typings/models/store.d.ts +121 -0
  40. package/dist/typings/models/subscription.d.ts +148 -0
  41. package/dist/typings/models/tax-category.d.ts +87 -0
  42. package/dist/typings/models/type.d.ts +182 -0
  43. package/dist/typings/models/zone.d.ts +65 -0
  44. package/package.json +13 -14
@@ -0,0 +1,121 @@
1
+ import { ChannelReference, ChannelResourceIdentifier } from './channel';
2
+ import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, ResourceIdentifier } from './common';
3
+ import { ProductSelectionReference, ProductSelectionResourceIdentifier } from './product-selection';
4
+ import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
5
+ export interface ProductSelectionSetting {
6
+ readonly productSelection: ProductSelectionReference;
7
+ readonly active: boolean;
8
+ }
9
+ export interface ProductSelectionSettingDraft {
10
+ readonly productSelection: ProductSelectionResourceIdentifier;
11
+ readonly active?: boolean;
12
+ }
13
+ export interface Store extends BaseResource {
14
+ readonly id: string;
15
+ readonly version: number;
16
+ readonly createdAt: string;
17
+ readonly lastModifiedAt: string;
18
+ readonly lastModifiedBy?: LastModifiedBy;
19
+ readonly createdBy?: CreatedBy;
20
+ readonly key: string;
21
+ readonly name?: LocalizedString;
22
+ readonly languages?: string[];
23
+ readonly distributionChannels: ChannelReference[];
24
+ readonly supplyChannels?: ChannelReference[];
25
+ readonly productSelections?: ProductSelectionSetting[];
26
+ readonly custom?: CustomFields;
27
+ }
28
+ export interface StoreDraft {
29
+ readonly key: string;
30
+ readonly name?: LocalizedString;
31
+ readonly languages?: string[];
32
+ readonly distributionChannels?: ChannelResourceIdentifier[];
33
+ readonly supplyChannels?: ChannelResourceIdentifier[];
34
+ readonly productSelections?: ProductSelectionSettingDraft[];
35
+ readonly custom?: CustomFieldsDraft;
36
+ }
37
+ export interface StoreKeyReference {
38
+ readonly typeId: 'store';
39
+ readonly key: string;
40
+ }
41
+ export interface StorePagedQueryResponse {
42
+ readonly limit: number;
43
+ readonly count: number;
44
+ readonly total?: number;
45
+ readonly offset: number;
46
+ readonly results: Store[];
47
+ }
48
+ export interface StoreReference {
49
+ readonly typeId: 'store';
50
+ readonly id: string;
51
+ readonly obj?: Store;
52
+ }
53
+ export interface StoreResourceIdentifier {
54
+ readonly typeId: 'store';
55
+ readonly id?: string;
56
+ readonly key?: string;
57
+ }
58
+ export interface StoreUpdate {
59
+ readonly version: number;
60
+ readonly actions: StoreUpdateAction[];
61
+ }
62
+ export declare type StoreUpdateAction = StoreAddDistributionChannelAction | StoreAddProductSelectionAction | StoreAddSupplyChannelAction | StoreChangeProductSelectionAction | StoreRemoveDistributionChannelAction | StoreRemoveProductSelectionAction | StoreRemoveSupplyChannelAction | StoreSetCustomFieldAction | StoreSetCustomTypeAction | StoreSetDistributionChannelsAction | StoreSetLanguagesAction | StoreSetNameAction | StoreSetProductSelectionsAction | StoreSetSupplyChannelsAction;
63
+ export interface StoreAddDistributionChannelAction {
64
+ readonly action: 'addDistributionChannel';
65
+ readonly distributionChannel: ChannelResourceIdentifier;
66
+ }
67
+ export interface StoreAddProductSelectionAction {
68
+ readonly action: 'addProductSelection';
69
+ readonly productSelection: ProductSelectionSettingDraft;
70
+ }
71
+ export interface StoreAddSupplyChannelAction {
72
+ readonly action: 'addSupplyChannel';
73
+ readonly supplyChannel?: ChannelResourceIdentifier;
74
+ }
75
+ export interface StoreChangeProductSelectionAction {
76
+ readonly action: 'changeProductSelectionActive';
77
+ readonly productSelection: ResourceIdentifier;
78
+ readonly active?: boolean;
79
+ }
80
+ export interface StoreRemoveDistributionChannelAction {
81
+ readonly action: 'removeDistributionChannel';
82
+ readonly distributionChannel: ChannelResourceIdentifier;
83
+ }
84
+ export interface StoreRemoveProductSelectionAction {
85
+ readonly action: 'removeProductSelection';
86
+ readonly productSelection: ResourceIdentifier;
87
+ }
88
+ export interface StoreRemoveSupplyChannelAction {
89
+ readonly action: 'removeSupplyChannel';
90
+ readonly supplyChannel?: ChannelResourceIdentifier;
91
+ }
92
+ export interface StoreSetCustomFieldAction {
93
+ readonly action: 'setCustomField';
94
+ readonly name: string;
95
+ readonly value?: any;
96
+ }
97
+ export interface StoreSetCustomTypeAction {
98
+ readonly action: 'setCustomType';
99
+ readonly type?: TypeResourceIdentifier;
100
+ readonly fields?: FieldContainer;
101
+ }
102
+ export interface StoreSetDistributionChannelsAction {
103
+ readonly action: 'setDistributionChannels';
104
+ readonly distributionChannels?: ChannelResourceIdentifier[];
105
+ }
106
+ export interface StoreSetLanguagesAction {
107
+ readonly action: 'setLanguages';
108
+ readonly languages?: string[];
109
+ }
110
+ export interface StoreSetNameAction {
111
+ readonly action: 'setName';
112
+ readonly name?: LocalizedString;
113
+ }
114
+ export interface StoreSetProductSelectionsAction {
115
+ readonly action: 'setProductSelections';
116
+ readonly productSelections: ProductSelectionSettingDraft[];
117
+ }
118
+ export interface StoreSetSupplyChannelsAction {
119
+ readonly action: 'setSupplyChannels';
120
+ readonly supplyChannels?: ChannelResourceIdentifier[];
121
+ }
@@ -0,0 +1,148 @@
1
+ import { BaseResource, CreatedBy, LastModifiedBy, Reference } from './common';
2
+ import { UserProvidedIdentifiers } from './message';
3
+ export interface ChangeSubscription {
4
+ readonly resourceTypeId: string;
5
+ }
6
+ export declare type DeliveryFormat = CloudEventsFormat | PlatformFormat;
7
+ export interface CloudEventsFormat {
8
+ readonly type: 'CloudEvents';
9
+ readonly cloudEventsVersion: string;
10
+ }
11
+ export declare type DeliveryPayload = MessageDeliveryPayload | ResourceCreatedDeliveryPayload | ResourceDeletedDeliveryPayload | ResourceUpdatedDeliveryPayload;
12
+ export declare type Destination = AzureEventGridDestination | AzureServiceBusDestination | EventBridgeDestination | GoogleCloudPubSubDestination | IronMqDestination | SnsDestination | SqsDestination;
13
+ export interface AzureEventGridDestination {
14
+ readonly type: 'EventGrid';
15
+ readonly uri: string;
16
+ readonly accessKey: string;
17
+ }
18
+ export interface AzureServiceBusDestination {
19
+ readonly type: 'AzureServiceBus';
20
+ readonly connectionString: string;
21
+ }
22
+ export interface EventBridgeDestination {
23
+ readonly type: 'EventBridge';
24
+ readonly region: string;
25
+ readonly accountId: string;
26
+ }
27
+ export interface GoogleCloudPubSubDestination {
28
+ readonly type: 'GoogleCloudPubSub';
29
+ readonly projectId: string;
30
+ readonly topic: string;
31
+ }
32
+ export interface IronMqDestination {
33
+ readonly type: 'IronMQ';
34
+ readonly uri: string;
35
+ }
36
+ export interface MessageDeliveryPayload {
37
+ readonly notificationType: 'Message';
38
+ readonly projectKey: string;
39
+ readonly resource: Reference;
40
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
41
+ readonly id: string;
42
+ readonly version: number;
43
+ readonly createdAt: string;
44
+ readonly lastModifiedAt: string;
45
+ readonly sequenceNumber: number;
46
+ readonly resourceVersion: number;
47
+ readonly payloadNotIncluded: PayloadNotIncluded;
48
+ }
49
+ export interface MessageSubscription {
50
+ readonly resourceTypeId: string;
51
+ readonly types?: string[];
52
+ }
53
+ export interface PayloadNotIncluded {
54
+ readonly reason: string;
55
+ readonly payloadType: string;
56
+ }
57
+ export interface PlatformFormat {
58
+ readonly type: 'Platform';
59
+ }
60
+ export interface ResourceCreatedDeliveryPayload {
61
+ readonly notificationType: 'ResourceCreated';
62
+ readonly projectKey: string;
63
+ readonly resource: Reference;
64
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
65
+ readonly version: number;
66
+ readonly modifiedAt: string;
67
+ }
68
+ export interface ResourceDeletedDeliveryPayload {
69
+ readonly notificationType: 'ResourceDeleted';
70
+ readonly projectKey: string;
71
+ readonly resource: Reference;
72
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
73
+ readonly version: number;
74
+ readonly modifiedAt: string;
75
+ readonly dataErasure?: boolean;
76
+ }
77
+ export interface ResourceUpdatedDeliveryPayload {
78
+ readonly notificationType: 'ResourceUpdated';
79
+ readonly projectKey: string;
80
+ readonly resource: Reference;
81
+ readonly resourceUserProvidedIdentifiers?: UserProvidedIdentifiers;
82
+ readonly version: number;
83
+ readonly oldVersion: number;
84
+ readonly modifiedAt: string;
85
+ }
86
+ export interface SnsDestination {
87
+ readonly type: 'SNS';
88
+ readonly accessKey: string;
89
+ readonly accessSecret: string;
90
+ readonly topicArn: string;
91
+ }
92
+ export interface SqsDestination {
93
+ readonly type: 'SQS';
94
+ readonly accessKey: string;
95
+ readonly accessSecret: string;
96
+ readonly queueUrl: string;
97
+ readonly region: string;
98
+ }
99
+ export interface Subscription extends BaseResource {
100
+ readonly id: string;
101
+ readonly version: number;
102
+ readonly createdAt: string;
103
+ readonly lastModifiedAt: string;
104
+ readonly lastModifiedBy?: LastModifiedBy;
105
+ readonly createdBy?: CreatedBy;
106
+ readonly changes: ChangeSubscription[];
107
+ readonly destination: Destination;
108
+ readonly key?: string;
109
+ readonly messages: MessageSubscription[];
110
+ readonly format: DeliveryFormat;
111
+ readonly status: SubscriptionHealthStatus;
112
+ }
113
+ export interface SubscriptionDraft {
114
+ readonly changes?: ChangeSubscription[];
115
+ readonly destination: Destination;
116
+ readonly key?: string;
117
+ readonly messages?: MessageSubscription[];
118
+ readonly format?: DeliveryFormat;
119
+ }
120
+ export declare type SubscriptionHealthStatus = 'ConfigurationError' | 'ConfigurationErrorDeliveryStopped' | 'Healthy' | 'TemporaryError';
121
+ export interface SubscriptionPagedQueryResponse {
122
+ readonly limit: number;
123
+ readonly count: number;
124
+ readonly total?: number;
125
+ readonly offset: number;
126
+ readonly results: Subscription[];
127
+ }
128
+ export interface SubscriptionUpdate {
129
+ readonly version: number;
130
+ readonly actions: SubscriptionUpdateAction[];
131
+ }
132
+ export declare type SubscriptionUpdateAction = SubscriptionChangeDestinationAction | SubscriptionSetChangesAction | SubscriptionSetKeyAction | SubscriptionSetMessagesAction;
133
+ export interface SubscriptionChangeDestinationAction {
134
+ readonly action: 'changeDestination';
135
+ readonly destination: Destination;
136
+ }
137
+ export interface SubscriptionSetChangesAction {
138
+ readonly action: 'setChanges';
139
+ readonly changes?: ChangeSubscription[];
140
+ }
141
+ export interface SubscriptionSetKeyAction {
142
+ readonly action: 'setKey';
143
+ readonly key?: string;
144
+ }
145
+ export interface SubscriptionSetMessagesAction {
146
+ readonly action: 'setMessages';
147
+ readonly messages?: MessageSubscription[];
148
+ }
@@ -0,0 +1,87 @@
1
+ import { BaseResource, CreatedBy, LastModifiedBy } from './common';
2
+ export interface SubRate {
3
+ readonly name: string;
4
+ readonly amount: number;
5
+ }
6
+ export interface TaxCategory extends BaseResource {
7
+ readonly id: string;
8
+ readonly version: number;
9
+ readonly createdAt: string;
10
+ readonly lastModifiedAt: string;
11
+ readonly lastModifiedBy?: LastModifiedBy;
12
+ readonly createdBy?: CreatedBy;
13
+ readonly name: string;
14
+ readonly description?: string;
15
+ readonly rates: TaxRate[];
16
+ readonly key?: string;
17
+ }
18
+ export interface TaxCategoryDraft {
19
+ readonly name: string;
20
+ readonly description?: string;
21
+ readonly rates?: TaxRateDraft[];
22
+ readonly key?: string;
23
+ }
24
+ export interface TaxCategoryPagedQueryResponse {
25
+ readonly limit: number;
26
+ readonly offset: number;
27
+ readonly count: number;
28
+ readonly total?: number;
29
+ readonly results: TaxCategory[];
30
+ }
31
+ export interface TaxCategoryReference {
32
+ readonly typeId: 'tax-category';
33
+ readonly id: string;
34
+ readonly obj?: TaxCategory;
35
+ }
36
+ export interface TaxCategoryResourceIdentifier {
37
+ readonly typeId: 'tax-category';
38
+ readonly id?: string;
39
+ readonly key?: string;
40
+ }
41
+ export interface TaxCategoryUpdate {
42
+ readonly version: number;
43
+ readonly actions: TaxCategoryUpdateAction[];
44
+ }
45
+ export declare type TaxCategoryUpdateAction = TaxCategoryAddTaxRateAction | TaxCategoryChangeNameAction | TaxCategoryRemoveTaxRateAction | TaxCategoryReplaceTaxRateAction | TaxCategorySetDescriptionAction | TaxCategorySetKeyAction;
46
+ export interface TaxRate {
47
+ readonly id?: string;
48
+ readonly name: string;
49
+ readonly amount: number;
50
+ readonly includedInPrice: boolean;
51
+ readonly country: string;
52
+ readonly state?: string;
53
+ readonly subRates?: SubRate[];
54
+ }
55
+ export interface TaxRateDraft {
56
+ readonly name: string;
57
+ readonly amount?: number;
58
+ readonly includedInPrice: boolean;
59
+ readonly country: string;
60
+ readonly state?: string;
61
+ readonly subRates?: SubRate[];
62
+ }
63
+ export interface TaxCategoryAddTaxRateAction {
64
+ readonly action: 'addTaxRate';
65
+ readonly taxRate: TaxRateDraft;
66
+ }
67
+ export interface TaxCategoryChangeNameAction {
68
+ readonly action: 'changeName';
69
+ readonly name: string;
70
+ }
71
+ export interface TaxCategoryRemoveTaxRateAction {
72
+ readonly action: 'removeTaxRate';
73
+ readonly taxRateId: string;
74
+ }
75
+ export interface TaxCategoryReplaceTaxRateAction {
76
+ readonly action: 'replaceTaxRate';
77
+ readonly taxRateId: string;
78
+ readonly taxRate: TaxRateDraft;
79
+ }
80
+ export interface TaxCategorySetDescriptionAction {
81
+ readonly action: 'setDescription';
82
+ readonly description?: string;
83
+ }
84
+ export interface TaxCategorySetKeyAction {
85
+ readonly action: 'setKey';
86
+ readonly key?: string;
87
+ }
@@ -0,0 +1,182 @@
1
+ import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString } from './common';
2
+ export interface CustomFieldEnumValue {
3
+ readonly key: string;
4
+ readonly label: string;
5
+ }
6
+ export interface CustomFieldLocalizedEnumValue {
7
+ readonly key: string;
8
+ readonly label: LocalizedString;
9
+ }
10
+ export declare type CustomFieldReferenceValue = 'cart' | 'category' | 'channel' | 'customer' | 'key-value-document' | 'order' | 'product' | 'product-type' | 'review' | 'shipping-method' | 'state' | 'zone';
11
+ export interface CustomFields {
12
+ readonly type: TypeReference;
13
+ readonly fields: FieldContainer;
14
+ }
15
+ export interface CustomFieldsDraft {
16
+ readonly type: TypeResourceIdentifier;
17
+ readonly fields?: FieldContainer;
18
+ }
19
+ export interface FieldContainer {
20
+ [key: string]: any;
21
+ }
22
+ export interface FieldDefinition {
23
+ readonly type: FieldType;
24
+ readonly name: string;
25
+ readonly label: LocalizedString;
26
+ readonly required: boolean;
27
+ readonly inputHint?: TypeTextInputHint;
28
+ }
29
+ export declare type FieldType = CustomFieldBooleanType | CustomFieldDateTimeType | CustomFieldDateType | CustomFieldEnumType | CustomFieldLocalizedEnumType | CustomFieldLocalizedStringType | CustomFieldMoneyType | CustomFieldNumberType | CustomFieldReferenceType | CustomFieldSetType | CustomFieldStringType | CustomFieldTimeType;
30
+ export interface CustomFieldBooleanType {
31
+ readonly name: 'Boolean';
32
+ }
33
+ export interface CustomFieldDateTimeType {
34
+ readonly name: 'DateTime';
35
+ }
36
+ export interface CustomFieldDateType {
37
+ readonly name: 'Date';
38
+ }
39
+ export interface CustomFieldEnumType {
40
+ readonly name: 'Enum';
41
+ readonly values: CustomFieldEnumValue[];
42
+ }
43
+ export interface CustomFieldLocalizedEnumType {
44
+ readonly name: 'LocalizedEnum';
45
+ readonly values: CustomFieldLocalizedEnumValue[];
46
+ }
47
+ export interface CustomFieldLocalizedStringType {
48
+ readonly name: 'LocalizedString';
49
+ }
50
+ export interface CustomFieldMoneyType {
51
+ readonly name: 'Money';
52
+ }
53
+ export interface CustomFieldNumberType {
54
+ readonly name: 'Number';
55
+ }
56
+ export interface CustomFieldReferenceType {
57
+ readonly name: 'Reference';
58
+ readonly referenceTypeId: CustomFieldReferenceValue;
59
+ }
60
+ export interface CustomFieldSetType {
61
+ readonly name: 'Set';
62
+ readonly elementType: FieldType;
63
+ }
64
+ export interface CustomFieldStringType {
65
+ readonly name: 'String';
66
+ }
67
+ export interface CustomFieldTimeType {
68
+ readonly name: 'Time';
69
+ }
70
+ export declare 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' | 'payment' | 'payment-interface-interaction' | 'product-price' | 'product-selection' | 'review' | 'shipping-method' | 'shopping-list' | 'shopping-list-text-line-item' | 'store' | 'transaction';
71
+ export interface Type extends BaseResource {
72
+ readonly id: string;
73
+ readonly version: number;
74
+ readonly createdAt: string;
75
+ readonly lastModifiedAt: string;
76
+ readonly lastModifiedBy?: LastModifiedBy;
77
+ readonly createdBy?: CreatedBy;
78
+ readonly key: string;
79
+ readonly name: LocalizedString;
80
+ readonly description?: LocalizedString;
81
+ readonly resourceTypeIds: ResourceTypeId[];
82
+ readonly fieldDefinitions: FieldDefinition[];
83
+ }
84
+ export interface TypeDraft {
85
+ readonly key: string;
86
+ readonly name: LocalizedString;
87
+ readonly description?: LocalizedString;
88
+ readonly resourceTypeIds: ResourceTypeId[];
89
+ readonly fieldDefinitions?: FieldDefinition[];
90
+ }
91
+ export interface TypePagedQueryResponse {
92
+ readonly limit: number;
93
+ readonly offset: number;
94
+ readonly count: number;
95
+ readonly total?: number;
96
+ readonly results: Type[];
97
+ }
98
+ export interface TypeReference {
99
+ readonly typeId: 'type';
100
+ readonly id: string;
101
+ readonly obj?: Type;
102
+ }
103
+ export interface TypeResourceIdentifier {
104
+ readonly typeId: 'type';
105
+ readonly id?: string;
106
+ readonly key?: string;
107
+ }
108
+ export declare type TypeTextInputHint = 'MultiLine' | 'SingleLine';
109
+ export interface TypeUpdate {
110
+ readonly version: number;
111
+ readonly actions: TypeUpdateAction[];
112
+ }
113
+ export declare type TypeUpdateAction = TypeAddEnumValueAction | TypeAddFieldDefinitionAction | TypeAddLocalizedEnumValueAction | TypeChangeEnumValueLabelAction | TypeChangeEnumValueOrderAction | TypeChangeFieldDefinitionLabelAction | TypeChangeFieldDefinitionOrderAction | TypeChangeInputHintAction | TypeChangeKeyAction | TypeChangeLabelAction | TypeChangeLocalizedEnumValueLabelAction | TypeChangeLocalizedEnumValueOrderAction | TypeChangeNameAction | TypeRemoveFieldDefinitionAction | TypeSetDescriptionAction;
114
+ export interface TypeAddEnumValueAction {
115
+ readonly action: 'addEnumValue';
116
+ readonly fieldName: string;
117
+ readonly value: CustomFieldEnumValue;
118
+ }
119
+ export interface TypeAddFieldDefinitionAction {
120
+ readonly action: 'addFieldDefinition';
121
+ readonly fieldDefinition: FieldDefinition;
122
+ }
123
+ export interface TypeAddLocalizedEnumValueAction {
124
+ readonly action: 'addLocalizedEnumValue';
125
+ readonly fieldName: string;
126
+ readonly value: CustomFieldLocalizedEnumValue;
127
+ }
128
+ export interface TypeChangeEnumValueLabelAction {
129
+ readonly action: 'changeEnumValueLabel';
130
+ readonly fieldName: string;
131
+ readonly value: CustomFieldEnumValue;
132
+ }
133
+ export interface TypeChangeEnumValueOrderAction {
134
+ readonly action: 'changeEnumValueOrder';
135
+ readonly fieldName: string;
136
+ readonly keys: string[];
137
+ }
138
+ export interface TypeChangeFieldDefinitionLabelAction {
139
+ readonly action: 'changeFieldDefinitionLabel';
140
+ readonly fieldName: string;
141
+ readonly label: LocalizedString;
142
+ }
143
+ export interface TypeChangeFieldDefinitionOrderAction {
144
+ readonly action: 'changeFieldDefinitionOrder';
145
+ readonly fieldNames: string[];
146
+ }
147
+ export interface TypeChangeInputHintAction {
148
+ readonly action: 'changeInputHint';
149
+ readonly fieldName: string;
150
+ readonly inputHint: TypeTextInputHint;
151
+ }
152
+ export interface TypeChangeKeyAction {
153
+ readonly action: 'changeKey';
154
+ readonly key: string;
155
+ }
156
+ export interface TypeChangeLabelAction {
157
+ readonly action: 'changeLabel';
158
+ readonly fieldName: string;
159
+ readonly label: LocalizedString;
160
+ }
161
+ export interface TypeChangeLocalizedEnumValueLabelAction {
162
+ readonly action: 'changeLocalizedEnumValueLabel';
163
+ readonly fieldName: string;
164
+ readonly value: CustomFieldLocalizedEnumValue;
165
+ }
166
+ export interface TypeChangeLocalizedEnumValueOrderAction {
167
+ readonly action: 'changeLocalizedEnumValueOrder';
168
+ readonly fieldName: string;
169
+ readonly keys: string[];
170
+ }
171
+ export interface TypeChangeNameAction {
172
+ readonly action: 'changeName';
173
+ readonly name: LocalizedString;
174
+ }
175
+ export interface TypeRemoveFieldDefinitionAction {
176
+ readonly action: 'removeFieldDefinition';
177
+ readonly fieldName: string;
178
+ }
179
+ export interface TypeSetDescriptionAction {
180
+ readonly action: 'setDescription';
181
+ readonly description?: LocalizedString;
182
+ }
@@ -0,0 +1,65 @@
1
+ import { BaseResource, CreatedBy, LastModifiedBy } from './common';
2
+ export interface Location {
3
+ readonly country: string;
4
+ readonly state?: string;
5
+ }
6
+ export interface Zone extends BaseResource {
7
+ readonly id: string;
8
+ readonly version: number;
9
+ readonly createdAt: string;
10
+ readonly lastModifiedAt: string;
11
+ readonly lastModifiedBy?: LastModifiedBy;
12
+ readonly createdBy?: CreatedBy;
13
+ readonly key?: string;
14
+ readonly name: string;
15
+ readonly description?: string;
16
+ readonly locations: Location[];
17
+ }
18
+ export interface ZoneDraft {
19
+ readonly key?: string;
20
+ readonly name: string;
21
+ readonly description?: string;
22
+ readonly locations?: Location[];
23
+ }
24
+ export interface ZonePagedQueryResponse {
25
+ readonly limit: number;
26
+ readonly offset: number;
27
+ readonly count: number;
28
+ readonly total?: number;
29
+ readonly results: Zone[];
30
+ }
31
+ export interface ZoneReference {
32
+ readonly typeId: 'zone';
33
+ readonly id: string;
34
+ readonly obj?: Zone;
35
+ }
36
+ export interface ZoneResourceIdentifier {
37
+ readonly typeId: 'zone';
38
+ readonly id?: string;
39
+ readonly key?: string;
40
+ }
41
+ export interface ZoneUpdate {
42
+ readonly version: number;
43
+ readonly actions: ZoneUpdateAction[];
44
+ }
45
+ export declare type ZoneUpdateAction = ZoneAddLocationAction | ZoneChangeNameAction | ZoneRemoveLocationAction | ZoneSetDescriptionAction | ZoneSetKeyAction;
46
+ export interface ZoneAddLocationAction {
47
+ readonly action: 'addLocation';
48
+ readonly location: Location;
49
+ }
50
+ export interface ZoneChangeNameAction {
51
+ readonly action: 'changeName';
52
+ readonly name: string;
53
+ }
54
+ export interface ZoneRemoveLocationAction {
55
+ readonly action: 'removeLocation';
56
+ readonly location: Location;
57
+ }
58
+ export interface ZoneSetDescriptionAction {
59
+ readonly action: 'setDescription';
60
+ readonly description?: string;
61
+ }
62
+ export interface ZoneSetKeyAction {
63
+ readonly action: 'setKey';
64
+ readonly key?: string;
65
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/commercetools-utils",
3
- "version": "4.11.3",
3
+ "version": "4.12.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,23 +55,23 @@
55
55
  },
56
56
  "homepage": "https://github.com/gradientedge/commercetools-utils#readme",
57
57
  "devDependencies": {
58
- "@sinonjs/fake-timers": "^9.1.0",
59
- "@types/jest": "^27.4.0",
58
+ "@sinonjs/fake-timers": "^9.1.1",
59
+ "@types/jest": "^27.4.1",
60
60
  "@types/json-stringify-safe": "^5.0.0",
61
- "@types/lodash": "^4.14.178",
61
+ "@types/lodash": "^4.14.179",
62
62
  "@types/lodash.clonedeep": "^4.5.6",
63
- "@types/node": "17.0.16",
63
+ "@types/node": "17.0.21",
64
64
  "@types/node-fetch": "^3.0.2",
65
65
  "@types/qs": "^6.9.7",
66
66
  "@types/sinonjs__fake-timers": "^8.1.1",
67
67
  "@types/traverse": "^0.6.32",
68
- "@typescript-eslint/eslint-plugin": "^5.11.0",
69
- "@typescript-eslint/parser": "^5.11.0",
68
+ "@typescript-eslint/eslint-plugin": "^5.14.0",
69
+ "@typescript-eslint/parser": "^5.14.0",
70
70
  "codecov": "^3.8.3",
71
71
  "commitizen": "^4.2.4",
72
72
  "cz-conventional-changelog": "^3.3.0",
73
- "eslint": "^8.7.0",
74
- "eslint-config-prettier": "^8.3.0",
73
+ "eslint": "^8.11.0",
74
+ "eslint-config-prettier": "^8.5.0",
75
75
  "husky": "^7.0.4",
76
76
  "jest": "^27.5.1",
77
77
  "jest-matcher-specific-error": "^1.0.0",
@@ -81,15 +81,14 @@
81
81
  "rimraf": "^3.0.2",
82
82
  "semantic-release": "^19.0.2",
83
83
  "ts-jest": "^27.1.3",
84
- "ts-node": "^10.5.0",
85
- "typedoc": "^0.22.11",
86
- "typescript": "~4.5.5",
84
+ "ts-node": "^10.7.0",
85
+ "typedoc": "^0.22.13",
86
+ "typescript": "~4.6.2",
87
87
  "webpack": "^5.70.0",
88
88
  "webpack-cli": "^4.9.2"
89
89
  },
90
90
  "dependencies": {
91
- "@commercetools/platform-sdk": "^2.4.1",
92
- "axios": "^0.25.0",
91
+ "axios": "^0.26.1",
93
92
  "json-stringify-safe": "^5.0.1",
94
93
  "lodash.clonedeep": "^4.5.0",
95
94
  "qs": "^6.10.3",