@viu/emporix-sdk 2.21.0 → 2.23.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/CHANGELOG.md +146 -0
- package/dist/availability.cjs +118 -0
- package/dist/availability.cjs.map +1 -1
- package/dist/availability.d.cts +178 -2
- package/dist/availability.d.ts +178 -2
- package/dist/availability.js +1 -1
- package/dist/cart.cjs +215 -9
- package/dist/cart.cjs.map +1 -1
- package/dist/cart.d.cts +281 -3
- package/dist/cart.d.ts +281 -3
- package/dist/cart.js +1 -1
- package/dist/category.cjs +220 -2
- package/dist/category.cjs.map +1 -1
- package/dist/category.d.cts +408 -1
- package/dist/category.d.ts +408 -1
- package/dist/category.js +1 -1
- package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
- package/dist/chunk-27NLS646.js.map +1 -0
- package/dist/{chunk-PYLWZZC4.js → chunk-6PJFOX3A.js} +126 -2
- package/dist/chunk-6PJFOX3A.js.map +1 -0
- package/dist/chunk-HWVFF6B2.js +378 -0
- package/dist/chunk-HWVFF6B2.js.map +1 -0
- package/dist/chunk-LQFRJSVT.js +224 -0
- package/dist/chunk-LQFRJSVT.js.map +1 -0
- package/dist/chunk-P7G4LOOV.js +264 -0
- package/dist/chunk-P7G4LOOV.js.map +1 -0
- package/dist/{chunk-HBEQEIT6.js → chunk-PRN3T6TY.js} +63 -3
- package/dist/chunk-PRN3T6TY.js.map +1 -0
- package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
- package/dist/chunk-QQMLN76U.js.map +1 -0
- package/dist/chunk-UNW6SFSB.js +363 -0
- package/dist/chunk-UNW6SFSB.js.map +1 -0
- package/dist/chunk-V3275BA7.js +181 -0
- package/dist/chunk-V3275BA7.js.map +1 -0
- package/dist/chunk-W2KBVWJ2.js +323 -0
- package/dist/chunk-W2KBVWJ2.js.map +1 -0
- package/dist/chunk-YVZ6GOLE.js +399 -0
- package/dist/chunk-YVZ6GOLE.js.map +1 -0
- package/dist/chunk-ZOFGDNSX.js +305 -0
- package/dist/chunk-ZOFGDNSX.js.map +1 -0
- package/dist/companies.cjs +25 -0
- package/dist/companies.cjs.map +1 -1
- package/dist/companies.d.cts +14 -0
- package/dist/companies.d.ts +14 -0
- package/dist/companies.js +1 -1
- package/dist/contacts.cjs +8 -0
- package/dist/contacts.cjs.map +1 -1
- package/dist/contacts.d.cts +2 -0
- package/dist/contacts.d.ts +2 -0
- package/dist/contacts.js +1 -1
- package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
- package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
- package/dist/customer-groups.cjs +200 -17
- package/dist/customer-groups.cjs.map +1 -1
- package/dist/customer-groups.d.cts +2 -110
- package/dist/customer-groups.d.ts +2 -110
- package/dist/customer-groups.js +1 -1
- package/dist/customer.cjs +61 -1
- package/dist/customer.cjs.map +1 -1
- package/dist/customer.d.cts +48 -1
- package/dist/customer.d.ts +48 -1
- package/dist/customer.js +1 -1
- package/dist/index.cjs +2566 -554
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +455 -12
- package/dist/index.d.ts +455 -12
- package/dist/index.js +687 -342
- package/dist/index.js.map +1 -1
- package/dist/orders.cjs +160 -2
- package/dist/orders.cjs.map +1 -1
- package/dist/orders.d.cts +221 -1
- package/dist/orders.d.ts +221 -1
- package/dist/orders.js +1 -1
- package/dist/payment.cjs +124 -0
- package/dist/payment.cjs.map +1 -1
- package/dist/payment.d.cts +335 -1
- package/dist/payment.d.ts +335 -1
- package/dist/payment.js +1 -1
- package/dist/price.cjs +197 -0
- package/dist/price.cjs.map +1 -1
- package/dist/price.d.cts +577 -1
- package/dist/price.d.ts +577 -1
- package/dist/price.js +1 -1
- package/dist/product.cjs +190 -0
- package/dist/product.cjs.map +1 -1
- package/dist/product.d.cts +503 -1
- package/dist/product.d.ts +503 -1
- package/dist/product.js +1 -1
- package/dist/segment.cjs +179 -0
- package/dist/segment.cjs.map +1 -1
- package/dist/segment.d.cts +181 -1
- package/dist/segment.d.ts +181 -1
- package/dist/segment.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-36T4YPQJ.js +0 -106
- package/dist/chunk-36T4YPQJ.js.map +0 -1
- package/dist/chunk-3BTPX7IJ.js +0 -41
- package/dist/chunk-3BTPX7IJ.js.map +0 -1
- package/dist/chunk-44F52KRE.js.map +0 -1
- package/dist/chunk-A3LYJUD4.js +0 -108
- package/dist/chunk-A3LYJUD4.js.map +0 -1
- package/dist/chunk-FZMP5NQZ.js +0 -173
- package/dist/chunk-FZMP5NQZ.js.map +0 -1
- package/dist/chunk-HBEQEIT6.js.map +0 -1
- package/dist/chunk-HD5RBCM6.js.map +0 -1
- package/dist/chunk-HUEMYP2L.js +0 -193
- package/dist/chunk-HUEMYP2L.js.map +0 -1
- package/dist/chunk-IVCCGJN5.js +0 -63
- package/dist/chunk-IVCCGJN5.js.map +0 -1
- package/dist/chunk-NE7MIZPR.js +0 -144
- package/dist/chunk-NE7MIZPR.js.map +0 -1
- package/dist/chunk-PYLWZZC4.js.map +0 -1
- package/dist/chunk-ZNLHLFQM.js +0 -160
- package/dist/chunk-ZNLHLFQM.js.map +0 -1
package/dist/product.d.cts
CHANGED
|
@@ -7,6 +7,94 @@ import { a as QueryFor } from './query-mLQs2WFr.cjs';
|
|
|
7
7
|
type LocalizedValue = string | {
|
|
8
8
|
[key: string]: string;
|
|
9
9
|
};
|
|
10
|
+
type ProductTemplateBase = {
|
|
11
|
+
/**
|
|
12
|
+
* Localized product template name in a form of a map of translations.
|
|
13
|
+
*/
|
|
14
|
+
name: {
|
|
15
|
+
[key: string]: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* List of attributes related to the product template.
|
|
19
|
+
*/
|
|
20
|
+
attributes: Array<ProductTemplateAttribute>;
|
|
21
|
+
};
|
|
22
|
+
type ProductTemplateCreation = ProductTemplateBase & {
|
|
23
|
+
/**
|
|
24
|
+
* Identifier of the product template.
|
|
25
|
+
*/
|
|
26
|
+
id?: string;
|
|
27
|
+
};
|
|
28
|
+
type ProductTemplateAttribute = {
|
|
29
|
+
/**
|
|
30
|
+
* An identifier of the attribute. The key is used as a field name in a product instance created based on the product template. The key can contain only alphanumeric characters.
|
|
31
|
+
*/
|
|
32
|
+
key: string;
|
|
33
|
+
/**
|
|
34
|
+
* Localized resource name in a form of a map of translations.
|
|
35
|
+
*/
|
|
36
|
+
name: {
|
|
37
|
+
[key: string]: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Attribute type. Correct values: `TEXT`, `NUMBER`, `BOOLEAN`, `DATETIME`. Regardless of the chosen type, the defaultValue and values fields are validated. The DATETIME values must be compliant with the ISO 8601 standard, for example: 2022-03-31T09:52:15.423Z.
|
|
41
|
+
*/
|
|
42
|
+
type: string;
|
|
43
|
+
/**
|
|
44
|
+
* Metadata contains additional information about the attribute.
|
|
45
|
+
*/
|
|
46
|
+
metadata: {
|
|
47
|
+
/**
|
|
48
|
+
* Indicates whether the attribute should be treated as a mandatory.
|
|
49
|
+
*/
|
|
50
|
+
mandatory?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Indicates whether the attribute is a variant-specific attribute. Variant attributes are taken into account during variants creation.
|
|
53
|
+
* If the value is set to true, then the 'values' array cannot be null.
|
|
54
|
+
*/
|
|
55
|
+
variantAttribute?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The attribute stores a default value for the attribute.
|
|
58
|
+
*/
|
|
59
|
+
defaultValue?: string | boolean | number;
|
|
60
|
+
};
|
|
61
|
+
values?: Values & {
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type ProductTemplateMetadata = {
|
|
66
|
+
/**
|
|
67
|
+
* Schema url of the variant attributes.
|
|
68
|
+
*/
|
|
69
|
+
variantAttributesSchema?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Schema url of the template attributes.
|
|
72
|
+
*/
|
|
73
|
+
templateAttributesSchema?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Date and time when the object was created, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`
|
|
76
|
+
*/
|
|
77
|
+
createdAt?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Date and time when the object was last modified, compliant with the ISO 8601 standard. For example: `2022-03-31T09:52:15.423Z`
|
|
80
|
+
*/
|
|
81
|
+
modifiedAt?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Version of the object. The value is required during update operation.
|
|
84
|
+
*/
|
|
85
|
+
version?: number;
|
|
86
|
+
};
|
|
87
|
+
type ProductTemplateResponse = ProductTemplateCreation & {
|
|
88
|
+
metadata?: ProductTemplateMetadata;
|
|
89
|
+
};
|
|
90
|
+
type ProductTemplateUpdate = ProductTemplateBase & {
|
|
91
|
+
metadata: {
|
|
92
|
+
/**
|
|
93
|
+
* Version of the object. The value is required while product template update.
|
|
94
|
+
*/
|
|
95
|
+
version: number;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
10
98
|
/**
|
|
11
99
|
* Indicates the product type, which is immutable. Once the product type is set, it cannot be updated.
|
|
12
100
|
*
|
|
@@ -56,6 +144,10 @@ type Values = Array<Value>;
|
|
|
56
144
|
type VariantAttributes = {
|
|
57
145
|
[key: string]: Values;
|
|
58
146
|
};
|
|
147
|
+
type ResourceLocation = {
|
|
148
|
+
id?: string;
|
|
149
|
+
yrn?: Yrn;
|
|
150
|
+
};
|
|
59
151
|
/**
|
|
60
152
|
* In YaaS, a global resource identifier is a Uniform Resource Name (URN) with a custom YaaS schema and is called a YaaS Resource Name, or YRN.
|
|
61
153
|
*
|
|
@@ -79,6 +171,12 @@ type Published = boolean;
|
|
|
79
171
|
type ProductMixins = {
|
|
80
172
|
[key: string]: unknown;
|
|
81
173
|
};
|
|
174
|
+
/**
|
|
175
|
+
* Mixins request.
|
|
176
|
+
*/
|
|
177
|
+
type ProductVariantMixins = {
|
|
178
|
+
[key: string]: unknown;
|
|
179
|
+
};
|
|
82
180
|
/**
|
|
83
181
|
* Metadata request.
|
|
84
182
|
*/
|
|
@@ -145,6 +243,26 @@ type ProductMetadataGet = ProductMetadataWithVersion & {
|
|
|
145
243
|
*/
|
|
146
244
|
modifiedAt?: string;
|
|
147
245
|
};
|
|
246
|
+
/**
|
|
247
|
+
* Metadata request.
|
|
248
|
+
*/
|
|
249
|
+
type VariantProductMetadataCore = ProductMetadataCore & {
|
|
250
|
+
/**
|
|
251
|
+
* By default, all variant products inherit their attributes from the parent variant. You need to include the name of the attribute in the `metadata.overridden` field to be able to replace the attribute values. For the `mixins` and `metadata` fields, you can provide a nested path so that only a single mixin attribute is overridden, for example `mixins.productCustomAttributes.pricingMeasurePrice`. The same rule is valid for providing the mixins schema, as you can override just this particular field with the provided schema, for example metadata.mixins.yourCustomAttributes.
|
|
252
|
+
*
|
|
253
|
+
* **Note:**You cannot override the following attributes: `id`, `code`, `template`, `variantAttributes`.
|
|
254
|
+
*/
|
|
255
|
+
overridden?: Array<string>;
|
|
256
|
+
};
|
|
257
|
+
/**
|
|
258
|
+
* Metadata with the version information.
|
|
259
|
+
*/
|
|
260
|
+
type VariantProductMetadataWithVersion = VariantProductMetadataCore & {
|
|
261
|
+
/**
|
|
262
|
+
* Version of the document.
|
|
263
|
+
*/
|
|
264
|
+
version?: number;
|
|
265
|
+
};
|
|
148
266
|
/**
|
|
149
267
|
* Unique resource identifier.
|
|
150
268
|
*/
|
|
@@ -275,6 +393,19 @@ type BasicProductWithId = BasicProductCreation & {
|
|
|
275
393
|
*/
|
|
276
394
|
categoryIds?: Array<string>;
|
|
277
395
|
};
|
|
396
|
+
/**
|
|
397
|
+
* Updating products of the BASIC type.
|
|
398
|
+
*/
|
|
399
|
+
type BasicProductUpdate = BasicProduct & {
|
|
400
|
+
metadata?: ProductMetadataWithVersion;
|
|
401
|
+
productType?: ProductTypeUpdate;
|
|
402
|
+
};
|
|
403
|
+
/**
|
|
404
|
+
* Updating products of the BASIC type in bulk.
|
|
405
|
+
*/
|
|
406
|
+
type BasicProductBulkUpdate = BasicProductUpdate & {
|
|
407
|
+
id: Id;
|
|
408
|
+
};
|
|
278
409
|
/**
|
|
279
410
|
* Products of the BUNDLE type.
|
|
280
411
|
*/
|
|
@@ -311,6 +442,18 @@ type BundleProductWithId = BundleProductCreation & {
|
|
|
311
442
|
*/
|
|
312
443
|
categoryIds?: Array<string>;
|
|
313
444
|
};
|
|
445
|
+
/**
|
|
446
|
+
* Updating products of the BUNDLE type.
|
|
447
|
+
*/
|
|
448
|
+
type BundleProductUpdate = BundleProduct & {
|
|
449
|
+
metadata?: ProductMetadataWithVersion;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Updating products of the BUNDLE type in bulk.
|
|
453
|
+
*/
|
|
454
|
+
type BundleProductBulkUpdate = BundleProductUpdate & {
|
|
455
|
+
id: Id;
|
|
456
|
+
};
|
|
314
457
|
/**
|
|
315
458
|
* Products of the PARENT_VARIANT type.
|
|
316
459
|
*/
|
|
@@ -346,6 +489,217 @@ type ParentVariantProductWithId = ParentVariantProductCreation & {
|
|
|
346
489
|
*/
|
|
347
490
|
categoryIds?: Array<string>;
|
|
348
491
|
};
|
|
492
|
+
/**
|
|
493
|
+
* Updating products of the PARENT_VARIANT type.
|
|
494
|
+
*/
|
|
495
|
+
type ParentVariantProductUpdate = ParentVariantProduct & {
|
|
496
|
+
metadata?: ProductMetadataWithVersion;
|
|
497
|
+
productType?: ProductTypeUpdate;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* Updating products of the PARENT_VARIANT type in bulk.
|
|
501
|
+
*/
|
|
502
|
+
type ParentVariantProductBulkUpdate = ParentVariantProductUpdate & {
|
|
503
|
+
id: Id;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Products of the VARIANT type.
|
|
507
|
+
*/
|
|
508
|
+
type VariantProduct = ProductCore & {
|
|
509
|
+
mixins?: ProductVariantMixins;
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* Creating products of the VARIANT type.
|
|
513
|
+
*/
|
|
514
|
+
type VariantProductCreation = VariantProduct & {
|
|
515
|
+
/**
|
|
516
|
+
* Custom product identifier. If not provided, it is automatically generated.
|
|
517
|
+
*/
|
|
518
|
+
id?: string;
|
|
519
|
+
metadata?: VariantProductMetadataCore;
|
|
520
|
+
/**
|
|
521
|
+
* Identifier of the PARENT_VARIANT product.
|
|
522
|
+
*/
|
|
523
|
+
parentVariantId?: string;
|
|
524
|
+
productType?: ProductType;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* Updating products of the VARIANT type.
|
|
528
|
+
*/
|
|
529
|
+
type VariantProductUpdate = VariantProduct & {
|
|
530
|
+
metadata?: VariantProductMetadataWithVersion;
|
|
531
|
+
productType?: ProductTypeUpdate;
|
|
532
|
+
/**
|
|
533
|
+
* Identifier of the PARENT_VARIANT product. This property is taken into account only for insert operations.
|
|
534
|
+
*/
|
|
535
|
+
parentVariantId?: string;
|
|
536
|
+
};
|
|
537
|
+
/**
|
|
538
|
+
* Updating products of the VARIANT type in bulk.
|
|
539
|
+
*/
|
|
540
|
+
type VariantProductBulkUpdate = VariantProductUpdate & {
|
|
541
|
+
id: Id;
|
|
542
|
+
};
|
|
543
|
+
/**
|
|
544
|
+
* The value part of a dynamic variant attribute. Holds the canonical qualifier used for matching, an optional localized display label, and an optional unit code for measurement attributes.
|
|
545
|
+
*
|
|
546
|
+
*/
|
|
547
|
+
type DynamicVariantAttributeValue = {
|
|
548
|
+
/**
|
|
549
|
+
* Data type of the qualifier value.
|
|
550
|
+
*
|
|
551
|
+
*/
|
|
552
|
+
type: 'STRING' | 'NUMBER' | 'DECIMAL' | 'BOOLEAN';
|
|
553
|
+
/**
|
|
554
|
+
* The canonical value used for variant matching. The JSON type must match `type`: a string for `STRING`, a number for `NUMBER` or `DECIMAL`, or a boolean for `BOOLEAN`.
|
|
555
|
+
*
|
|
556
|
+
*/
|
|
557
|
+
qualifier: string | number | boolean;
|
|
558
|
+
name?: LocalizedValue;
|
|
559
|
+
/**
|
|
560
|
+
* Optional unit code for measurement attributes (for example, `"MMT"` for millimetres, `"PCE"` for pieces). Unit translations are resolved by the frontend from a separate dictionary.
|
|
561
|
+
*
|
|
562
|
+
*/
|
|
563
|
+
unit?: string;
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* A single dynamic variant attribute. Combines a localized display name for the attribute itself with a typed, optionally localized value.
|
|
567
|
+
*
|
|
568
|
+
*/
|
|
569
|
+
type DynamicVariantAttribute = {
|
|
570
|
+
name?: LocalizedValue;
|
|
571
|
+
value: DynamicVariantAttributeValue;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Map of variant attributes defined directly on this product. Keys are attribute identifiers (for example, `storageCapacity`). These are the attributes the caller can set by create/update requests. On responses they represent what is stored on this specific product.
|
|
575
|
+
*
|
|
576
|
+
*/
|
|
577
|
+
type OwnVariantAttributes = {
|
|
578
|
+
[key: string]: DynamicVariantAttribute;
|
|
579
|
+
};
|
|
580
|
+
/**
|
|
581
|
+
* Base schema for products of the DYNAMIC_VARIANT type.
|
|
582
|
+
*/
|
|
583
|
+
type DynamicVariantProduct = ProductCore & {
|
|
584
|
+
metadata?: ProductMetadataCore;
|
|
585
|
+
/**
|
|
586
|
+
* Identifier of the immediate parent product in the variant hierarchy. Omit or leave empty for root-level dynamic variant products.
|
|
587
|
+
*
|
|
588
|
+
*/
|
|
589
|
+
parentVariantId?: string;
|
|
590
|
+
/**
|
|
591
|
+
* Optional label identifying the variant level or kind within the hierarchy (for example, `"H1_L1"`). Used for display and filtering purposes.
|
|
592
|
+
*
|
|
593
|
+
*/
|
|
594
|
+
dynamicVariantType?: string;
|
|
595
|
+
/**
|
|
596
|
+
* Indicates whether this variant can be sold directly, if it's a leaf in the hierarchy that a customer can add to a cart. This value is **not inherited** from parent variants — it must be set explicitly on each product. Root products and intermediate-level variants are typically `false`. Leaf variants are typically `true`.
|
|
597
|
+
*
|
|
598
|
+
*/
|
|
599
|
+
sellable?: boolean;
|
|
600
|
+
ownVariantAttributes?: OwnVariantAttributes;
|
|
601
|
+
};
|
|
602
|
+
/**
|
|
603
|
+
* Creating products of the DYNAMIC_VARIANT type.
|
|
604
|
+
*/
|
|
605
|
+
type DynamicVariantProductCreation = DynamicVariantProduct & {
|
|
606
|
+
/**
|
|
607
|
+
* Custom product identifier. If not provided, it is automatically generated.
|
|
608
|
+
*/
|
|
609
|
+
id?: string;
|
|
610
|
+
productType?: ProductType;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* Updating products of the DYNAMIC_VARIANT type.
|
|
614
|
+
*/
|
|
615
|
+
type DynamicVariantProductUpdate = DynamicVariantProduct & {
|
|
616
|
+
metadata?: ProductMetadataWithVersion;
|
|
617
|
+
productType?: ProductTypeUpdate;
|
|
618
|
+
};
|
|
619
|
+
/**
|
|
620
|
+
* Updating products of the DYNAMIC_VARIANT type in bulk.
|
|
621
|
+
*/
|
|
622
|
+
type DynamicVariantProductBulkUpdate = DynamicVariantProductUpdate & {
|
|
623
|
+
id: Id;
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* Request body for triggering dynamic variant recalculation. Accepts up to 1000 product IDs at any level of the hierarchy — the system resolves the root for each ID automatically. Intended to be called after a batch of products has been fully ingested, not per individual product write.
|
|
627
|
+
*
|
|
628
|
+
*/
|
|
629
|
+
type DynamicVariantRecalculationRequest = {
|
|
630
|
+
/**
|
|
631
|
+
* List of product IDs (variants at any hierarchy level) for which recalculation should be triggered. The system groups IDs by their root product and creates one job per unique root.
|
|
632
|
+
*
|
|
633
|
+
*/
|
|
634
|
+
productIds: Array<string>;
|
|
635
|
+
};
|
|
636
|
+
/**
|
|
637
|
+
* Current status of a dynamic variant recalculation job.
|
|
638
|
+
*/
|
|
639
|
+
type DynamicVariantRecalculationJobStatus = 'PENDING' | 'PROCESSING' | 'FINISHED' | 'FAILED' | 'FAILED_PERMANENT';
|
|
640
|
+
/**
|
|
641
|
+
* Represents a single dynamic variant recalculation job. One job is created per unique root product. Jobs remain queryable until automatically removed approximately 30 days after reaching a terminal state.
|
|
642
|
+
*
|
|
643
|
+
*/
|
|
644
|
+
type DynamicVariantRecalculationJobResponse = {
|
|
645
|
+
/**
|
|
646
|
+
* Unique identifier of the recalculation job.
|
|
647
|
+
*/
|
|
648
|
+
id?: string;
|
|
649
|
+
/**
|
|
650
|
+
* Identifier of the root product whose variant tree is being recalculated.
|
|
651
|
+
*/
|
|
652
|
+
parentRoot?: string;
|
|
653
|
+
/**
|
|
654
|
+
* List of product IDs that were submitted in the recalculation request and resolved to this root.
|
|
655
|
+
*/
|
|
656
|
+
requestedByIds?: Array<string>;
|
|
657
|
+
status?: DynamicVariantRecalculationJobStatus;
|
|
658
|
+
/**
|
|
659
|
+
* Timestamp when the job was created.
|
|
660
|
+
*/
|
|
661
|
+
createdAt?: string;
|
|
662
|
+
/**
|
|
663
|
+
* Timestamp when a subscriber picked up the job and started processing. Null while the job is still PENDING.
|
|
664
|
+
*/
|
|
665
|
+
processingStartedAt?: string;
|
|
666
|
+
/**
|
|
667
|
+
* Timestamp when the job reached a terminal state (FINISHED, FAILED, or FAILED_PERMANENT).
|
|
668
|
+
*/
|
|
669
|
+
finishedAt?: string;
|
|
670
|
+
/**
|
|
671
|
+
* Error message if the job failed. Null for successful jobs.
|
|
672
|
+
*/
|
|
673
|
+
error?: string;
|
|
674
|
+
/**
|
|
675
|
+
* Number of processing attempts made for this job. Incremented on each delivery from the pub/sub subscription.
|
|
676
|
+
*/
|
|
677
|
+
attempts?: number;
|
|
678
|
+
};
|
|
679
|
+
/**
|
|
680
|
+
* Response returned when recalculation is triggered. Contains one job per unique root product resolved from the submitted IDs, plus any IDs that were skipped (for example, because a job for that root is already PENDING or PROCESSING).
|
|
681
|
+
*
|
|
682
|
+
*/
|
|
683
|
+
type DynamicVariantRecalculationResponse = {
|
|
684
|
+
/**
|
|
685
|
+
* List of recalculation jobs created or referenced for each unique root product.
|
|
686
|
+
*/
|
|
687
|
+
jobs?: Array<DynamicVariantRecalculationJobResponse>;
|
|
688
|
+
/**
|
|
689
|
+
* Product IDs that were not processed because a recalculation job for their root is already active (PENDING or PROCESSING). The existing job ID is available in the `jobs` list.
|
|
690
|
+
*
|
|
691
|
+
*/
|
|
692
|
+
skippedProductIds?: Array<string>;
|
|
693
|
+
};
|
|
694
|
+
/**
|
|
695
|
+
* Partially updating a product.
|
|
696
|
+
*/
|
|
697
|
+
type ProductPartialUpdate = ProductCore & {
|
|
698
|
+
template?: Template;
|
|
699
|
+
bundledProducts?: BundledProducts;
|
|
700
|
+
variantAttributes?: VariantAttributes;
|
|
701
|
+
metadata?: ProductMetadataWithVersion;
|
|
702
|
+
};
|
|
349
703
|
type Vendor = {
|
|
350
704
|
/**
|
|
351
705
|
* An identifier of a vendor to whom the product belongs.
|
|
@@ -366,11 +720,88 @@ type RelatedItem = {
|
|
|
366
720
|
*/
|
|
367
721
|
type: string;
|
|
368
722
|
};
|
|
723
|
+
type BulkResponse = {
|
|
724
|
+
/**
|
|
725
|
+
* Index of the processed product, matching the price position in request body.
|
|
726
|
+
*
|
|
727
|
+
*/
|
|
728
|
+
index?: number;
|
|
729
|
+
/**
|
|
730
|
+
* Product unique identifier.
|
|
731
|
+
*/
|
|
732
|
+
id?: string;
|
|
733
|
+
/**
|
|
734
|
+
* HTTP Status Code.
|
|
735
|
+
*/
|
|
736
|
+
code?: number;
|
|
737
|
+
/**
|
|
738
|
+
* Error specific errorCode.
|
|
739
|
+
*/
|
|
740
|
+
errorCode?: string;
|
|
741
|
+
/**
|
|
742
|
+
* HTTP Status description.
|
|
743
|
+
*/
|
|
744
|
+
status?: string;
|
|
745
|
+
/**
|
|
746
|
+
* Error message.
|
|
747
|
+
*/
|
|
748
|
+
message?: string;
|
|
749
|
+
/**
|
|
750
|
+
* Error message details.
|
|
751
|
+
*/
|
|
752
|
+
details?: Array<string>;
|
|
753
|
+
};
|
|
754
|
+
type ProductCreateBody = BasicProductCreation | BundleProductCreation | ParentVariantProductCreation | VariantProductCreation | DynamicVariantProductCreation;
|
|
755
|
+
type ProductUpdateBody = BasicProductUpdate | BundleProductUpdate | ParentVariantProductUpdate | VariantProductUpdate | DynamicVariantProductUpdate;
|
|
756
|
+
type ProductPartialUpdateBody = ProductPartialUpdate;
|
|
757
|
+
type ProductBulkUpdateBody = Array<BasicProductBulkUpdate | BundleProductBulkUpdate | ParentVariantProductBulkUpdate | VariantProductBulkUpdate | DynamicVariantProductBulkUpdate>;
|
|
758
|
+
/**
|
|
759
|
+
* A list of product create requests
|
|
760
|
+
*/
|
|
761
|
+
type ProductBulkCreateBody = Array<BasicProductCreation | BundleProductCreation | ParentVariantProductCreation | VariantProductCreation | DynamicVariantProductCreation>;
|
|
369
762
|
|
|
370
763
|
/** A product as returned by the Product service (all generated fields). */
|
|
371
764
|
type Product = BasicProductWithId | BundleProductWithId | ParentVariantProductWithId;
|
|
372
765
|
/** A single product media entry (generated; `ProductMedia` is the list type). */
|
|
373
766
|
type Media = ProductMedia[number];
|
|
767
|
+
/** Body for creating a product (`POST /products`) — any of the 5 product shapes. */
|
|
768
|
+
type ProductCreateInput = ProductCreateBody;
|
|
769
|
+
/** Body for a full product replace (`PUT /products/{id}`). */
|
|
770
|
+
type ProductUpdateInput = ProductUpdateBody;
|
|
771
|
+
/** Body for a partial product update (`PATCH /products/{id}`). */
|
|
772
|
+
type ProductPatchInput = ProductPartialUpdateBody;
|
|
773
|
+
/** Id/location envelope returned when a product is created. */
|
|
774
|
+
type ProductCreated = ResourceLocation;
|
|
775
|
+
/** Body for bulk-creating products (`POST /products/bulk`). */
|
|
776
|
+
type ProductBulkCreateInput = ProductBulkCreateBody;
|
|
777
|
+
/** Body for bulk-updating products (`PUT /products/bulk`). */
|
|
778
|
+
type ProductBulkUpdateInput = ProductBulkUpdateBody;
|
|
779
|
+
/** Per-entry result of a bulk product operation (207 Multi-Status). */
|
|
780
|
+
type ProductBulkResult = BulkResponse;
|
|
781
|
+
/** Body for triggering a dynamic-variant recalculation. */
|
|
782
|
+
type ProductRecalculationInput = DynamicVariantRecalculationRequest;
|
|
783
|
+
/** Result of triggering a recalculation — created jobs plus skipped product ids. */
|
|
784
|
+
type ProductRecalculationResult = DynamicVariantRecalculationResponse;
|
|
785
|
+
/** A dynamic-variant recalculation job. */
|
|
786
|
+
type ProductRecalculationJob = DynamicVariantRecalculationJobResponse;
|
|
787
|
+
/** Status of a recalculation job. */
|
|
788
|
+
type ProductRecalculationJobStatus = DynamicVariantRecalculationJobStatus;
|
|
789
|
+
/** A product template as returned by the Product service. */
|
|
790
|
+
type ProductTemplate = ProductTemplateResponse;
|
|
791
|
+
/** Body for creating a product template. */
|
|
792
|
+
type ProductTemplateCreateInput = ProductTemplateCreation;
|
|
793
|
+
/** Body for updating a product template (`PUT`, full replace). */
|
|
794
|
+
type ProductTemplateUpdateInput = ProductTemplateUpdate;
|
|
795
|
+
/** Id envelope returned when a product template is created. */
|
|
796
|
+
type ProductTemplateCreated = {
|
|
797
|
+
id?: string;
|
|
798
|
+
};
|
|
799
|
+
/** Query flags shared by the product write endpoints. */
|
|
800
|
+
interface ProductWriteOptions {
|
|
801
|
+
skipVariantGeneration?: boolean;
|
|
802
|
+
doIndex?: boolean;
|
|
803
|
+
skipRelatedItemsValidation?: boolean;
|
|
804
|
+
}
|
|
374
805
|
/** Catalog reads. Default auth: anonymous; pass customer for personalized pricing. */
|
|
375
806
|
declare class ProductService {
|
|
376
807
|
private readonly ctx;
|
|
@@ -447,6 +878,77 @@ declare class ProductService {
|
|
|
447
878
|
listVariantChildren(parentVariantId: string, params?: {
|
|
448
879
|
pageSize?: number;
|
|
449
880
|
}, auth?: AuthContext): Promise<Product[]>;
|
|
881
|
+
/**
|
|
882
|
+
* Creates a product (`POST /products`). Default auth: service. Accepts any of
|
|
883
|
+
* the five product shapes (basic, bundle, parent-variant, variant,
|
|
884
|
+
* dynamic-variant).
|
|
885
|
+
*/
|
|
886
|
+
create(input: ProductCreateInput, options?: ProductWriteOptions, auth?: AuthContext): Promise<ProductCreated>;
|
|
887
|
+
/**
|
|
888
|
+
* Partially updates a product (`PATCH /products/{productId}`). Default auth:
|
|
889
|
+
* service. Use {@link replace} for a full replace (PUT).
|
|
890
|
+
*/
|
|
891
|
+
update(productId: string, input: ProductPatchInput, options?: ProductWriteOptions, auth?: AuthContext): Promise<void>;
|
|
892
|
+
/**
|
|
893
|
+
* Full-replaces a product (`PUT /products/{productId}`). Returns the created
|
|
894
|
+
* resource on 201 (upsert) and nothing on 204. `options.partial` sends
|
|
895
|
+
* `?partial=true` for a merge-style replace. Default auth: service.
|
|
896
|
+
*/
|
|
897
|
+
replace(productId: string, input: ProductUpdateInput, options?: ProductWriteOptions & {
|
|
898
|
+
partial?: boolean;
|
|
899
|
+
}, auth?: AuthContext): Promise<ProductCreated | void>;
|
|
900
|
+
/**
|
|
901
|
+
* Deletes a product (`DELETE /products/{productId}`). `options.force` deletes
|
|
902
|
+
* even when the product is referenced. Default auth: service.
|
|
903
|
+
*/
|
|
904
|
+
delete(productId: string, options?: {
|
|
905
|
+
force?: boolean;
|
|
906
|
+
doIndex?: boolean;
|
|
907
|
+
}, auth?: AuthContext): Promise<void>;
|
|
908
|
+
/**
|
|
909
|
+
* Bulk-creates products (`POST /products/bulk`). Responds 207 Multi-Status:
|
|
910
|
+
* partial failures do **not** throw — inspect each entry. Default auth: service.
|
|
911
|
+
*/
|
|
912
|
+
bulkCreate(input: ProductBulkCreateInput, options?: ProductWriteOptions, auth?: AuthContext): Promise<ProductBulkResult[]>;
|
|
913
|
+
/**
|
|
914
|
+
* Bulk-updates products (`PUT /products/bulk`). Responds 207 Multi-Status:
|
|
915
|
+
* partial failures do **not** throw — inspect each entry. Default auth: service.
|
|
916
|
+
*/
|
|
917
|
+
bulkUpdate(input: ProductBulkUpdateInput, options?: ProductWriteOptions, auth?: AuthContext): Promise<ProductBulkResult[]>;
|
|
918
|
+
/**
|
|
919
|
+
* Triggers a dynamic-variant recalculation for the given product ids
|
|
920
|
+
* (`POST /products/recalculate`, 202). The result carries the created or
|
|
921
|
+
* already-referenced `jobs` plus `skippedProductIds` — products whose root
|
|
922
|
+
* already has a PENDING/PROCESSING job. Default auth: service.
|
|
923
|
+
*/
|
|
924
|
+
recalculate(input: ProductRecalculationInput, auth?: AuthContext): Promise<ProductRecalculationResult>;
|
|
925
|
+
/** Lists dynamic-variant recalculation jobs, optionally filtered by status. Default auth: anonymous. */
|
|
926
|
+
listRecalculationJobs(params?: {
|
|
927
|
+
status?: ProductRecalculationJobStatus;
|
|
928
|
+
}, auth?: AuthContext): Promise<ProductRecalculationJob[]>;
|
|
929
|
+
/** Fetches one dynamic-variant recalculation job by id. Default auth: anonymous. */
|
|
930
|
+
getRecalculationJob(jobId: string, auth?: AuthContext): Promise<ProductRecalculationJob>;
|
|
931
|
+
/**
|
|
932
|
+
* Product templates (`/product-templates`). Reads default to anonymous,
|
|
933
|
+
* writes to service auth.
|
|
934
|
+
*/
|
|
935
|
+
readonly templates: {
|
|
936
|
+
/** One page of product templates. Default auth: anonymous. */
|
|
937
|
+
list: (params?: {
|
|
938
|
+
pageNumber?: number;
|
|
939
|
+
pageSize?: number;
|
|
940
|
+
sort?: string;
|
|
941
|
+
q?: string;
|
|
942
|
+
}, auth?: AuthContext) => Promise<ProductTemplate[]>;
|
|
943
|
+
/** Fetches one product template by id. Default auth: anonymous. */
|
|
944
|
+
get: (templateId: string, auth?: AuthContext) => Promise<ProductTemplate>;
|
|
945
|
+
/** Creates a product template. Default auth: service. */
|
|
946
|
+
create: (input: ProductTemplateCreateInput, auth?: AuthContext) => Promise<ProductTemplateCreated>;
|
|
947
|
+
/** Full-replaces a product template (`PUT`). Default auth: service. */
|
|
948
|
+
update: (templateId: string, input: ProductTemplateUpdateInput, auth?: AuthContext) => Promise<void>;
|
|
949
|
+
/** Deletes a product template. Default auth: service. */
|
|
950
|
+
delete: (templateId: string, auth?: AuthContext) => Promise<void>;
|
|
951
|
+
};
|
|
450
952
|
}
|
|
451
953
|
|
|
452
|
-
export { type Media, type Product, ProductService };
|
|
954
|
+
export { type Media, type Product, type ProductBulkCreateInput, type ProductBulkResult, type ProductBulkUpdateInput, type ProductCreateInput, type ProductCreated, type ProductPatchInput, type ProductRecalculationInput, type ProductRecalculationJob, type ProductRecalculationJobStatus, type ProductRecalculationResult, ProductService, type ProductTemplate, type ProductTemplateCreateInput, type ProductTemplateCreated, type ProductTemplateUpdateInput, type ProductUpdateInput, type ProductWriteOptions };
|