@mercurjs/types 2.1.2-canary.5 → 2.2.0-canary.1
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/feature-flags/index.d.ts +2 -1
- package/dist/feature-flags/index.d.ts.map +1 -1
- package/dist/feature-flags/index.js +1 -0
- package/dist/http/index.d.ts +5 -0
- package/dist/http/index.d.ts.map +1 -1
- package/dist/http/index.js +3 -0
- package/dist/http/offer.d.ts +67 -0
- package/dist/http/offer.d.ts.map +1 -0
- package/dist/http/product-attribute.d.ts +16 -0
- package/dist/http/product-attribute.d.ts.map +1 -0
- package/dist/http/product-attribute.js +2 -0
- package/dist/http/product-brand.d.ts +16 -0
- package/dist/http/product-brand.d.ts.map +1 -0
- package/dist/http/product-brand.js +2 -0
- package/dist/http/product-category.d.ts +9 -10
- package/dist/http/product-category.d.ts.map +1 -1
- package/dist/http/product.d.ts +15 -3
- package/dist/http/product.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -3
- package/dist/modules.d.ts +2 -3
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +1 -2
- package/dist/offer/common.d.ts +59 -0
- package/dist/offer/common.d.ts.map +1 -0
- package/dist/offer/common.js +2 -0
- package/dist/offer/index.d.ts.map +1 -0
- package/dist/offer/mutations.d.ts +113 -0
- package/dist/offer/mutations.d.ts.map +1 -0
- package/dist/offer/mutations.js +9 -0
- package/dist/payout/provider.d.ts.map +1 -1
- package/dist/product/common.d.ts +171 -0
- package/dist/product/common.d.ts.map +1 -0
- package/dist/product/common.js +52 -0
- package/dist/product/index.d.ts +3 -0
- package/dist/product/index.d.ts.map +1 -0
- package/dist/product/index.js +18 -0
- package/dist/product/mutations.d.ts +162 -0
- package/dist/product/mutations.d.ts.map +1 -0
- package/dist/product/mutations.js +2 -0
- package/package.json +5 -1
- package/dist/attribute/common.d.ts +0 -79
- package/dist/attribute/common.d.ts.map +0 -1
- package/dist/attribute/common.js +0 -16
- package/dist/attribute/index.d.ts.map +0 -1
- package/dist/attribute/mutations.d.ts +0 -99
- package/dist/attribute/mutations.d.ts.map +0 -1
- /package/dist/{attribute/mutations.js → http/offer.js} +0 -0
- /package/dist/{attribute → offer}/index.d.ts +0 -0
- /package/dist/{attribute → offer}/index.js +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { ProductDTO as UpstreamProductDTO, ProductVariantDTO as UpstreamProductVariantDTO, ProductCategoryDTO as UpstreamProductCategoryDTO, ProductImageDTO } from "@medusajs/types";
|
|
2
|
+
import { SellerDTO } from "../seller/common";
|
|
3
|
+
/**
|
|
4
|
+
* Mercur product acceptance workflow. Adds `REQUIRES_ACTION` to the
|
|
5
|
+
* upstream `draft / proposed / published / rejected` set.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum ProductStatus {
|
|
8
|
+
DRAFT = "draft",
|
|
9
|
+
PROPOSED = "proposed",
|
|
10
|
+
PUBLISHED = "published",
|
|
11
|
+
REQUIRES_ACTION = "requires_action",
|
|
12
|
+
REJECTED = "rejected"
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Data types for product attributes. Determines validation rules and UI
|
|
16
|
+
* rendering.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum AttributeType {
|
|
19
|
+
SINGLE_SELECT = "single_select",
|
|
20
|
+
MULTI_SELECT = "multi_select",
|
|
21
|
+
UNIT = "unit",
|
|
22
|
+
TOGGLE = "toggle",
|
|
23
|
+
TEXT = "text"
|
|
24
|
+
}
|
|
25
|
+
/** Product change lifecycle statuses. */
|
|
26
|
+
export declare enum ProductChangeStatus {
|
|
27
|
+
PENDING = "pending",
|
|
28
|
+
CONFIRMED = "confirmed",
|
|
29
|
+
DECLINED = "declined",
|
|
30
|
+
CANCELED = "canceled"
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Action types for ProductChangeAction. Each action's `details` JSON carries
|
|
34
|
+
* the operation payload; `ProductModuleService.applyProductChangeActions_`
|
|
35
|
+
* dispatches based on `action`.
|
|
36
|
+
*/
|
|
37
|
+
export declare enum ProductChangeActionType {
|
|
38
|
+
STATUS_CHANGE = "STATUS_CHANGE",
|
|
39
|
+
UPDATE = "UPDATE",
|
|
40
|
+
VARIANT_ADD = "VARIANT_ADD",
|
|
41
|
+
VARIANT_UPDATE = "VARIANT_UPDATE",
|
|
42
|
+
VARIANT_REMOVE = "VARIANT_REMOVE",
|
|
43
|
+
ATTRIBUTE_ADD = "ATTRIBUTE_ADD",
|
|
44
|
+
ATTRIBUTE_REMOVE = "ATTRIBUTE_REMOVE",
|
|
45
|
+
PRODUCT_DELETE = "PRODUCT_DELETE"
|
|
46
|
+
}
|
|
47
|
+
export interface ProductBrandDTO {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
handle: string;
|
|
51
|
+
is_restricted: boolean;
|
|
52
|
+
metadata: Record<string, unknown> | null;
|
|
53
|
+
products?: ProductDTO[];
|
|
54
|
+
created_at: string | Date;
|
|
55
|
+
updated_at: string | Date;
|
|
56
|
+
deleted_at: string | Date | null;
|
|
57
|
+
}
|
|
58
|
+
export interface ProductAttributeValueDTO {
|
|
59
|
+
id: string;
|
|
60
|
+
handle: string | null;
|
|
61
|
+
name: string;
|
|
62
|
+
rank: number;
|
|
63
|
+
is_active: boolean;
|
|
64
|
+
metadata: Record<string, unknown> | null;
|
|
65
|
+
attribute?: ProductAttributeDTO;
|
|
66
|
+
attribute_id?: string;
|
|
67
|
+
variants?: ProductVariantDTO[];
|
|
68
|
+
products?: ProductDTO[];
|
|
69
|
+
created_at: string | Date;
|
|
70
|
+
updated_at: string | Date;
|
|
71
|
+
deleted_at: string | Date | null;
|
|
72
|
+
}
|
|
73
|
+
export interface ProductAttributeDTO {
|
|
74
|
+
id: string;
|
|
75
|
+
handle: string | null;
|
|
76
|
+
name: string;
|
|
77
|
+
description: string | null;
|
|
78
|
+
type: AttributeType;
|
|
79
|
+
is_required: boolean;
|
|
80
|
+
is_filterable: boolean;
|
|
81
|
+
is_variant_axis: boolean;
|
|
82
|
+
rank: number;
|
|
83
|
+
is_active: boolean;
|
|
84
|
+
created_by: string | null;
|
|
85
|
+
product_id: string | null;
|
|
86
|
+
metadata: Record<string, unknown> | null;
|
|
87
|
+
values?: ProductAttributeValueDTO[];
|
|
88
|
+
categories?: ProductCategoryDTO[];
|
|
89
|
+
variant_products?: ProductDTO[];
|
|
90
|
+
created_at: string | Date;
|
|
91
|
+
updated_at: string | Date;
|
|
92
|
+
deleted_at: string | Date | null;
|
|
93
|
+
}
|
|
94
|
+
export interface ProductChangeActionDTO {
|
|
95
|
+
id: string;
|
|
96
|
+
product_id: string;
|
|
97
|
+
product_change_id: string | null;
|
|
98
|
+
ordering: number;
|
|
99
|
+
action: string;
|
|
100
|
+
details: Record<string, unknown>;
|
|
101
|
+
internal_note: string | null;
|
|
102
|
+
applied: boolean;
|
|
103
|
+
product_change?: ProductChangeDTO;
|
|
104
|
+
created_at: string | Date;
|
|
105
|
+
updated_at: string | Date;
|
|
106
|
+
deleted_at: string | Date | null;
|
|
107
|
+
}
|
|
108
|
+
export interface ProductChangeDTO {
|
|
109
|
+
id: string;
|
|
110
|
+
product?: ProductDTO;
|
|
111
|
+
product_id?: string;
|
|
112
|
+
status: ProductChangeStatus;
|
|
113
|
+
internal_note: string | null;
|
|
114
|
+
external_note: string | null;
|
|
115
|
+
created_by: string | null;
|
|
116
|
+
confirmed_by: string | null;
|
|
117
|
+
confirmed_at: string | Date | null;
|
|
118
|
+
declined_by: string | null;
|
|
119
|
+
declined_at: string | Date | null;
|
|
120
|
+
declined_reason: string | null;
|
|
121
|
+
canceled_by: string | null;
|
|
122
|
+
canceled_at: string | Date | null;
|
|
123
|
+
metadata: Record<string, unknown> | null;
|
|
124
|
+
actions?: ProductChangeActionDTO[];
|
|
125
|
+
created_at: string | Date;
|
|
126
|
+
updated_at: string | Date;
|
|
127
|
+
deleted_at: string | Date | null;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Mercur extends `ProductCategoryDTO` with `is_restricted`. Pure addition,
|
|
131
|
+
* no field conflicts.
|
|
132
|
+
*/
|
|
133
|
+
export type ProductCategoryDTO = UpstreamProductCategoryDTO & {
|
|
134
|
+
is_restricted: boolean;
|
|
135
|
+
attributes?: ProductAttributeDTO[];
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* Mercur extends `ProductVariantDTO` with `attribute_values` and Mercur's
|
|
139
|
+
* own `images` link. Upstream fields kept intact.
|
|
140
|
+
*/
|
|
141
|
+
export type ProductVariantDTO = UpstreamProductVariantDTO & {
|
|
142
|
+
attribute_values?: ProductAttributeValueDTO[];
|
|
143
|
+
images?: ProductImageDTO[];
|
|
144
|
+
};
|
|
145
|
+
/**
|
|
146
|
+
* Mercur's `ProductDTO`. Replaces `status` (Mercur enum includes
|
|
147
|
+
* `REQUIRES_ACTION`) and drops `options`. Adds marketplace-only fields.
|
|
148
|
+
*/
|
|
149
|
+
export type ProductDTO = Omit<UpstreamProductDTO, "status" | "options"> & {
|
|
150
|
+
status: ProductStatus;
|
|
151
|
+
is_restricted: boolean;
|
|
152
|
+
created_by: string | null;
|
|
153
|
+
created_by_actor: string | null;
|
|
154
|
+
variants?: ProductVariantDTO[];
|
|
155
|
+
brand?: ProductBrandDTO | null;
|
|
156
|
+
brand_id?: string | null;
|
|
157
|
+
categories?: ProductCategoryDTO[];
|
|
158
|
+
variant_attributes?: ProductAttributeDTO[];
|
|
159
|
+
custom_attributes?: ProductAttributeDTO[];
|
|
160
|
+
attribute_values?: ProductAttributeValueDTO[];
|
|
161
|
+
attributes?: ProductAttributeDTO[];
|
|
162
|
+
sellers?: SellerDTO[];
|
|
163
|
+
changes?: ProductChangeDTO[];
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Internal alias of `ProductDTO`. Used by the `.mercur/types.d.ts` shim so
|
|
167
|
+
* consumers writing `import { ProductDTO } from "@medusajs/types"` resolve
|
|
168
|
+
* to the Mercur shape.
|
|
169
|
+
*/
|
|
170
|
+
export type MercurProductDTO = ProductDTO;
|
|
171
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/product/common.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,IAAI,kBAAkB,EAChC,iBAAiB,IAAI,yBAAyB,EAC9C,kBAAkB,IAAI,0BAA0B,EAChD,eAAe,EAChB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAI5C;;;GAGG;AACH,oBAAY,aAAa;IACvB,KAAK,UAAU;IACf,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,eAAe,oBAAoB;IACnC,QAAQ,aAAa;CACtB;AAED;;;GAGG;AACH,oBAAY,aAAa;IACvB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,yCAAyC;AACzC,oBAAY,mBAAmB;IAC7B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACtB;AAED;;;;GAIG;AACH,oBAAY,uBAAuB;IACjC,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;CAClC;AAID,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,OAAO,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC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BAAmB,EAAE,CAAA;IAC1C,iBAAiB,CAAC,EAAE,mBAAmB,EAAE,CAAA;IACzC,gBAAgB,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC7C,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAA;IAClC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAA;IACrB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC7B,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductChangeActionType = exports.ProductChangeStatus = exports.AttributeType = exports.ProductStatus = void 0;
|
|
4
|
+
// --- Enums ---
|
|
5
|
+
/**
|
|
6
|
+
* Mercur product acceptance workflow. Adds `REQUIRES_ACTION` to the
|
|
7
|
+
* upstream `draft / proposed / published / rejected` set.
|
|
8
|
+
*/
|
|
9
|
+
var ProductStatus;
|
|
10
|
+
(function (ProductStatus) {
|
|
11
|
+
ProductStatus["DRAFT"] = "draft";
|
|
12
|
+
ProductStatus["PROPOSED"] = "proposed";
|
|
13
|
+
ProductStatus["PUBLISHED"] = "published";
|
|
14
|
+
ProductStatus["REQUIRES_ACTION"] = "requires_action";
|
|
15
|
+
ProductStatus["REJECTED"] = "rejected";
|
|
16
|
+
})(ProductStatus || (exports.ProductStatus = ProductStatus = {}));
|
|
17
|
+
/**
|
|
18
|
+
* Data types for product attributes. Determines validation rules and UI
|
|
19
|
+
* rendering.
|
|
20
|
+
*/
|
|
21
|
+
var AttributeType;
|
|
22
|
+
(function (AttributeType) {
|
|
23
|
+
AttributeType["SINGLE_SELECT"] = "single_select";
|
|
24
|
+
AttributeType["MULTI_SELECT"] = "multi_select";
|
|
25
|
+
AttributeType["UNIT"] = "unit";
|
|
26
|
+
AttributeType["TOGGLE"] = "toggle";
|
|
27
|
+
AttributeType["TEXT"] = "text";
|
|
28
|
+
})(AttributeType || (exports.AttributeType = AttributeType = {}));
|
|
29
|
+
/** Product change lifecycle statuses. */
|
|
30
|
+
var ProductChangeStatus;
|
|
31
|
+
(function (ProductChangeStatus) {
|
|
32
|
+
ProductChangeStatus["PENDING"] = "pending";
|
|
33
|
+
ProductChangeStatus["CONFIRMED"] = "confirmed";
|
|
34
|
+
ProductChangeStatus["DECLINED"] = "declined";
|
|
35
|
+
ProductChangeStatus["CANCELED"] = "canceled";
|
|
36
|
+
})(ProductChangeStatus || (exports.ProductChangeStatus = ProductChangeStatus = {}));
|
|
37
|
+
/**
|
|
38
|
+
* Action types for ProductChangeAction. Each action's `details` JSON carries
|
|
39
|
+
* the operation payload; `ProductModuleService.applyProductChangeActions_`
|
|
40
|
+
* dispatches based on `action`.
|
|
41
|
+
*/
|
|
42
|
+
var ProductChangeActionType;
|
|
43
|
+
(function (ProductChangeActionType) {
|
|
44
|
+
ProductChangeActionType["STATUS_CHANGE"] = "STATUS_CHANGE";
|
|
45
|
+
ProductChangeActionType["UPDATE"] = "UPDATE";
|
|
46
|
+
ProductChangeActionType["VARIANT_ADD"] = "VARIANT_ADD";
|
|
47
|
+
ProductChangeActionType["VARIANT_UPDATE"] = "VARIANT_UPDATE";
|
|
48
|
+
ProductChangeActionType["VARIANT_REMOVE"] = "VARIANT_REMOVE";
|
|
49
|
+
ProductChangeActionType["ATTRIBUTE_ADD"] = "ATTRIBUTE_ADD";
|
|
50
|
+
ProductChangeActionType["ATTRIBUTE_REMOVE"] = "ATTRIBUTE_REMOVE";
|
|
51
|
+
ProductChangeActionType["PRODUCT_DELETE"] = "PRODUCT_DELETE";
|
|
52
|
+
})(ProductChangeActionType || (exports.ProductChangeActionType = ProductChangeActionType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/product/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
__exportStar(require("./mutations"), exports);
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import type { CreateProductDTO as UpstreamCreateProductDTO, UpdateProductDTO as UpstreamUpdateProductDTO, CreateProductVariantDTO as UpstreamCreateProductVariantDTO, UpdateProductVariantDTO as UpstreamUpdateProductVariantDTO, CreateProductCategoryDTO as UpstreamCreateProductCategoryDTO, UpdateProductCategoryDTO as UpstreamUpdateProductCategoryDTO } from "@medusajs/types";
|
|
2
|
+
import { AttributeType, ProductStatus } from "./common";
|
|
3
|
+
export interface CreateProductBrandDTO {
|
|
4
|
+
name: string;
|
|
5
|
+
handle?: string;
|
|
6
|
+
is_restricted?: boolean;
|
|
7
|
+
metadata?: Record<string, unknown> | null;
|
|
8
|
+
}
|
|
9
|
+
export interface UpdateProductBrandDTO {
|
|
10
|
+
name?: string;
|
|
11
|
+
handle?: string;
|
|
12
|
+
is_restricted?: boolean;
|
|
13
|
+
metadata?: Record<string, unknown> | null;
|
|
14
|
+
}
|
|
15
|
+
export interface CreateProductAttributeValueDTO {
|
|
16
|
+
handle?: string;
|
|
17
|
+
name: string;
|
|
18
|
+
rank?: number;
|
|
19
|
+
is_active?: boolean;
|
|
20
|
+
metadata?: Record<string, unknown> | null;
|
|
21
|
+
}
|
|
22
|
+
export interface UpdateProductAttributeValueDTO {
|
|
23
|
+
handle?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
rank?: number;
|
|
26
|
+
is_active?: boolean;
|
|
27
|
+
metadata?: Record<string, unknown> | null;
|
|
28
|
+
}
|
|
29
|
+
export interface UpsertProductAttributeValueDTO extends UpdateProductAttributeValueDTO {
|
|
30
|
+
id?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreateProductAttributeDTO {
|
|
33
|
+
handle?: string;
|
|
34
|
+
name: string;
|
|
35
|
+
description?: string | null;
|
|
36
|
+
type: AttributeType;
|
|
37
|
+
is_required?: boolean;
|
|
38
|
+
is_filterable?: boolean;
|
|
39
|
+
is_variant_axis?: boolean;
|
|
40
|
+
rank?: number;
|
|
41
|
+
is_active?: boolean;
|
|
42
|
+
created_by?: string | null;
|
|
43
|
+
product_id?: string | null;
|
|
44
|
+
metadata?: Record<string, unknown> | null;
|
|
45
|
+
values?: CreateProductAttributeValueDTO[];
|
|
46
|
+
}
|
|
47
|
+
export interface UpdateProductAttributeDTO {
|
|
48
|
+
handle?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
description?: string | null;
|
|
51
|
+
type?: AttributeType;
|
|
52
|
+
is_required?: boolean;
|
|
53
|
+
is_filterable?: boolean;
|
|
54
|
+
is_variant_axis?: boolean;
|
|
55
|
+
rank?: number;
|
|
56
|
+
is_active?: boolean;
|
|
57
|
+
metadata?: Record<string, unknown> | null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Inline input for product attributes. Each entry is either:
|
|
61
|
+
*
|
|
62
|
+
* 1. A global attribute reference: `{ attribute_id, value_ids?: [...] }`
|
|
63
|
+
* Links an existing ProductAttribute. Use `value_ids` for known IDs,
|
|
64
|
+
* or `values` (names) to upsert values on the attribute.
|
|
65
|
+
*
|
|
66
|
+
* 2. An inline custom attribute: `{ name, type, values: ["Red", "Blue"] }`
|
|
67
|
+
* Creates a new ProductAttribute with `product_id` set (scoped to product).
|
|
68
|
+
*/
|
|
69
|
+
export type ProductAttributeInputDTO = {
|
|
70
|
+
attribute_id: string;
|
|
71
|
+
value_ids?: string[];
|
|
72
|
+
values?: string[];
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
type: AttributeType;
|
|
76
|
+
values?: string[];
|
|
77
|
+
is_variant_axis?: boolean;
|
|
78
|
+
is_filterable?: boolean;
|
|
79
|
+
is_required?: boolean;
|
|
80
|
+
description?: string | null;
|
|
81
|
+
metadata?: Record<string, unknown> | null;
|
|
82
|
+
};
|
|
83
|
+
export type CreateProductCategoryDTO = UpstreamCreateProductCategoryDTO & {
|
|
84
|
+
is_restricted?: boolean;
|
|
85
|
+
};
|
|
86
|
+
export type UpdateProductCategoryDTO = UpstreamUpdateProductCategoryDTO & {
|
|
87
|
+
is_restricted?: boolean;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* `attribute_values` accepts either:
|
|
91
|
+
* - An array of `ProductAttributeValue` IDs (already resolved).
|
|
92
|
+
* - A map of attribute key (attribute `handle` or `name`) to value name(s),
|
|
93
|
+
* resolved to IDs by the service against the parent product's variant
|
|
94
|
+
* attributes.
|
|
95
|
+
*
|
|
96
|
+
* @example `["pattrval_red", "pattrval_small"]`
|
|
97
|
+
* @example `{ Color: "Red", Size: ["S", "M"] }`
|
|
98
|
+
*/
|
|
99
|
+
type VariantAttributeValuesInput = string[] | Record<string, string | string[]>;
|
|
100
|
+
export type CreateProductVariantDTO = UpstreamCreateProductVariantDTO & {
|
|
101
|
+
attribute_values?: VariantAttributeValuesInput;
|
|
102
|
+
};
|
|
103
|
+
export type UpdateProductVariantDTO = UpstreamUpdateProductVariantDTO & {
|
|
104
|
+
attribute_values?: VariantAttributeValuesInput;
|
|
105
|
+
};
|
|
106
|
+
export type UpsertProductVariantDTO = UpdateProductVariantDTO & {
|
|
107
|
+
id?: string;
|
|
108
|
+
title: string;
|
|
109
|
+
};
|
|
110
|
+
export type CreateProductDTO = Omit<UpstreamCreateProductDTO, "status"> & {
|
|
111
|
+
status?: ProductStatus;
|
|
112
|
+
is_restricted?: boolean;
|
|
113
|
+
created_by?: string | null;
|
|
114
|
+
created_by_actor?: string | null;
|
|
115
|
+
brand_id?: string | null;
|
|
116
|
+
variants?: CreateProductVariantDTO[];
|
|
117
|
+
/**
|
|
118
|
+
* Product variant attributes. Each entry is either:
|
|
119
|
+
* - A global attribute reference: `{ attribute_id, value_ids: ["pattrval_..."] }`
|
|
120
|
+
* - An inline custom attribute: `{ name, type, values: ["Red", "Blue"] }`
|
|
121
|
+
*/
|
|
122
|
+
variant_attributes?: ProductAttributeInputDTO[];
|
|
123
|
+
/**
|
|
124
|
+
* Non-variant product-level attributes. Same format as variant_attributes.
|
|
125
|
+
* Creates product-scoped attributes and links their values to the product.
|
|
126
|
+
*/
|
|
127
|
+
product_attributes?: ProductAttributeInputDTO[];
|
|
128
|
+
};
|
|
129
|
+
export type UpdateProductDTO = Omit<UpstreamUpdateProductDTO, "status"> & {
|
|
130
|
+
status?: ProductStatus;
|
|
131
|
+
is_restricted?: boolean;
|
|
132
|
+
brand_id?: string | null;
|
|
133
|
+
variants?: UpsertProductVariantDTO[];
|
|
134
|
+
/** See {@link CreateProductDTO.variant_attributes}. */
|
|
135
|
+
variant_attributes?: ProductAttributeInputDTO[];
|
|
136
|
+
/** See {@link CreateProductDTO.product_attributes}. */
|
|
137
|
+
product_attributes?: ProductAttributeInputDTO[];
|
|
138
|
+
};
|
|
139
|
+
export type UpsertProductDTO = UpdateProductDTO & {
|
|
140
|
+
id?: string;
|
|
141
|
+
title: string;
|
|
142
|
+
};
|
|
143
|
+
export interface CreateProductChangeDTO {
|
|
144
|
+
product_id: string;
|
|
145
|
+
internal_note?: string;
|
|
146
|
+
external_note?: string;
|
|
147
|
+
created_by?: string;
|
|
148
|
+
status?: string;
|
|
149
|
+
confirmed_by?: string;
|
|
150
|
+
confirmed_at?: Date;
|
|
151
|
+
metadata?: Record<string, unknown>;
|
|
152
|
+
}
|
|
153
|
+
export interface CreateProductChangeActionDTO {
|
|
154
|
+
product_change_id?: string;
|
|
155
|
+
product_id: string;
|
|
156
|
+
action: string;
|
|
157
|
+
details?: Record<string, unknown>;
|
|
158
|
+
internal_note?: string;
|
|
159
|
+
applied?: boolean;
|
|
160
|
+
}
|
|
161
|
+
export {};
|
|
162
|
+
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/product/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,IAAI,wBAAwB,EAC5C,gBAAgB,IAAI,wBAAwB,EAC5C,uBAAuB,IAAI,+BAA+B,EAC1D,uBAAuB,IAAI,+BAA+B,EAC1D,wBAAwB,IAAI,gCAAgC,EAC5D,wBAAwB,IAAI,gCAAgC,EAC7D,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIvD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,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B,GAAG,gBAAgB,GAAG;IAChD,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAID,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,4BAA4B;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-canary.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
".": {
|
|
26
26
|
"types": "./dist/index.d.ts",
|
|
27
27
|
"default": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./product": {
|
|
30
|
+
"types": "./dist/product/index.d.ts",
|
|
31
|
+
"default": "./dist/product/index.js"
|
|
28
32
|
}
|
|
29
33
|
},
|
|
30
34
|
"scripts": {
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
export declare enum AttributeUIComponent {
|
|
2
|
-
SELECT = "select",
|
|
3
|
-
MULTIVALUE = "multivalue",
|
|
4
|
-
UNIT = "unit",
|
|
5
|
-
TOGGLE = "toggle",
|
|
6
|
-
TEXTAREA = "text_area",
|
|
7
|
-
COLOR_PICKER = "color_picker"
|
|
8
|
-
}
|
|
9
|
-
export declare const AttributeSource: {
|
|
10
|
-
readonly ADMIN: "admin";
|
|
11
|
-
readonly VENDOR: "vendor";
|
|
12
|
-
};
|
|
13
|
-
export type AttributeSource = (typeof AttributeSource)[keyof typeof AttributeSource];
|
|
14
|
-
export interface AttributePossibleValueDTO {
|
|
15
|
-
id: string;
|
|
16
|
-
value: string;
|
|
17
|
-
rank: number;
|
|
18
|
-
metadata?: Record<string, unknown>;
|
|
19
|
-
created_at: string;
|
|
20
|
-
updated_at: string;
|
|
21
|
-
}
|
|
22
|
-
export interface AttributeValueDTO {
|
|
23
|
-
id: string;
|
|
24
|
-
value: string;
|
|
25
|
-
rank: number;
|
|
26
|
-
source: AttributeSource;
|
|
27
|
-
metadata?: Record<string, unknown>;
|
|
28
|
-
attribute_id: string;
|
|
29
|
-
created_at: string;
|
|
30
|
-
updated_at: string;
|
|
31
|
-
}
|
|
32
|
-
export interface AttributeDTO {
|
|
33
|
-
id: string;
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
handle: string;
|
|
37
|
-
is_filterable: boolean;
|
|
38
|
-
is_required: boolean;
|
|
39
|
-
source: AttributeSource;
|
|
40
|
-
ui_component: AttributeUIComponent;
|
|
41
|
-
metadata?: Record<string, unknown>;
|
|
42
|
-
possible_values?: AttributePossibleValueDTO[];
|
|
43
|
-
values?: AttributeValueDTO[];
|
|
44
|
-
created_at: string;
|
|
45
|
-
updated_at: string;
|
|
46
|
-
}
|
|
47
|
-
export interface ProductAttributeValueDTO {
|
|
48
|
-
value: string;
|
|
49
|
-
attribute_id: string;
|
|
50
|
-
}
|
|
51
|
-
export interface VendorProductAttributeDTO {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
value: string;
|
|
55
|
-
ui_component: AttributeUIComponent;
|
|
56
|
-
extends_attribute_id?: string | null;
|
|
57
|
-
rank: number;
|
|
58
|
-
metadata?: Record<string, unknown> | null;
|
|
59
|
-
created_at: string;
|
|
60
|
-
updated_at: string;
|
|
61
|
-
}
|
|
62
|
-
export interface InformationalAttributeValueDTO {
|
|
63
|
-
value: string;
|
|
64
|
-
source: AttributeSource;
|
|
65
|
-
attribute_value_id: string;
|
|
66
|
-
is_filterable: boolean;
|
|
67
|
-
is_editable: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface InformationalAttributeDTO {
|
|
70
|
-
attribute_id: string;
|
|
71
|
-
name: string;
|
|
72
|
-
ui_component: AttributeUIComponent;
|
|
73
|
-
attribute_source: AttributeSource;
|
|
74
|
-
is_filterable: boolean;
|
|
75
|
-
is_required: boolean;
|
|
76
|
-
is_definition_editable: boolean;
|
|
77
|
-
values: InformationalAttributeValueDTO[];
|
|
78
|
-
}
|
|
79
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/attribute/common.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,cAAc;IACtB,YAAY,iBAAiB;CAC9B;AAED,eAAO,MAAM,eAAe;;;CAGlB,CAAA;AAEV,MAAM,MAAM,eAAe,GACzB,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,OAAO,eAAe,CAAC,CAAA;AAExD,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,UAAU,EAA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AAI,CAAA;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,eAAe,CAAA;IACvB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED,MAAM,WAAW,yBAAyB;IACxC,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,oBAAoB,CAAA;IAClC,gBAAgB,EAAE,eAAe,CAAA;IACjC,aAAa,EAAE,OAAO,CAAA;IACtB,WAAW,EAAE,OAAO,CAAA;IACpB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,MAAM,EAAE,8BAA8B,EAAE,CAAA;CACzC"}
|
package/dist/attribute/common.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.AttributeSource = exports.AttributeUIComponent = void 0;
|
|
4
|
-
var AttributeUIComponent;
|
|
5
|
-
(function (AttributeUIComponent) {
|
|
6
|
-
AttributeUIComponent["SELECT"] = "select";
|
|
7
|
-
AttributeUIComponent["MULTIVALUE"] = "multivalue";
|
|
8
|
-
AttributeUIComponent["UNIT"] = "unit";
|
|
9
|
-
AttributeUIComponent["TOGGLE"] = "toggle";
|
|
10
|
-
AttributeUIComponent["TEXTAREA"] = "text_area";
|
|
11
|
-
AttributeUIComponent["COLOR_PICKER"] = "color_picker";
|
|
12
|
-
})(AttributeUIComponent || (exports.AttributeUIComponent = AttributeUIComponent = {}));
|
|
13
|
-
exports.AttributeSource = {
|
|
14
|
-
ADMIN: "admin",
|
|
15
|
-
VENDOR: "vendor",
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/attribute/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { AttributeSource, AttributeUIComponent } from "./common";
|
|
2
|
-
export interface CreateAttributeValueDTO {
|
|
3
|
-
value: string;
|
|
4
|
-
rank: number;
|
|
5
|
-
attribute_id: string;
|
|
6
|
-
source?: AttributeSource;
|
|
7
|
-
metadata?: Record<string, unknown>;
|
|
8
|
-
}
|
|
9
|
-
export interface UpdateAttributeDTO {
|
|
10
|
-
id: string;
|
|
11
|
-
name?: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
handle?: string;
|
|
14
|
-
is_filterable?: boolean;
|
|
15
|
-
is_required?: boolean;
|
|
16
|
-
metadata?: Record<string, unknown>;
|
|
17
|
-
possible_values?: UpsertAttributeValueDTO[];
|
|
18
|
-
product_category_ids?: {
|
|
19
|
-
id: string;
|
|
20
|
-
}[];
|
|
21
|
-
}
|
|
22
|
-
export interface UpsertAttributeValueDTO {
|
|
23
|
-
id?: string;
|
|
24
|
-
value?: string;
|
|
25
|
-
rank?: number;
|
|
26
|
-
source?: AttributeSource;
|
|
27
|
-
metadata?: Record<string, unknown>;
|
|
28
|
-
attribute_id?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface CreateAttributeDTO {
|
|
31
|
-
name: string;
|
|
32
|
-
description?: string;
|
|
33
|
-
handle?: string;
|
|
34
|
-
is_filterable?: boolean;
|
|
35
|
-
is_required?: boolean;
|
|
36
|
-
source?: AttributeSource;
|
|
37
|
-
metadata?: Record<string, unknown>;
|
|
38
|
-
ui_component: AttributeUIComponent;
|
|
39
|
-
possible_values?: Omit<CreateAttributeValueDTO, "attribute_id">[];
|
|
40
|
-
product_category_ids?: string[];
|
|
41
|
-
}
|
|
42
|
-
export interface UpdateAttributeValueDTO {
|
|
43
|
-
id: string;
|
|
44
|
-
value?: string;
|
|
45
|
-
rank?: number;
|
|
46
|
-
source?: AttributeSource;
|
|
47
|
-
metadata?: Record<string, unknown> | null;
|
|
48
|
-
}
|
|
49
|
-
export type CreateProductAttributeValueDTO = {
|
|
50
|
-
attribute_id: string;
|
|
51
|
-
product_id: string;
|
|
52
|
-
value: string;
|
|
53
|
-
source?: AttributeSource;
|
|
54
|
-
};
|
|
55
|
-
export interface AdminAttributeInput {
|
|
56
|
-
attribute_id: string;
|
|
57
|
-
values: string[];
|
|
58
|
-
use_for_variations: boolean;
|
|
59
|
-
}
|
|
60
|
-
export interface VendorAttributeInput {
|
|
61
|
-
name: string;
|
|
62
|
-
values: string[];
|
|
63
|
-
use_for_variations: boolean;
|
|
64
|
-
ui_component?: AttributeUIComponent;
|
|
65
|
-
}
|
|
66
|
-
export interface ProductAttributesAdditionalData {
|
|
67
|
-
admin_attributes?: AdminAttributeInput[];
|
|
68
|
-
vendor_attributes?: VendorAttributeInput[];
|
|
69
|
-
}
|
|
70
|
-
export interface AddProductAttributeInput {
|
|
71
|
-
attribute_id?: string;
|
|
72
|
-
name?: string;
|
|
73
|
-
values: string[];
|
|
74
|
-
use_for_variations: boolean;
|
|
75
|
-
ui_component?: AttributeUIComponent;
|
|
76
|
-
}
|
|
77
|
-
export interface UpdateProductAttributeInput {
|
|
78
|
-
name?: string;
|
|
79
|
-
ui_component?: AttributeUIComponent;
|
|
80
|
-
values?: string[];
|
|
81
|
-
use_for_variations?: boolean;
|
|
82
|
-
}
|
|
83
|
-
export interface CreateVendorProductAttributeDTO {
|
|
84
|
-
name: string;
|
|
85
|
-
value: string;
|
|
86
|
-
ui_component?: AttributeUIComponent;
|
|
87
|
-
extends_attribute_id?: string;
|
|
88
|
-
rank?: number;
|
|
89
|
-
metadata?: Record<string, unknown>;
|
|
90
|
-
}
|
|
91
|
-
export interface UpdateVendorProductAttributeDTO {
|
|
92
|
-
id: string;
|
|
93
|
-
name?: string;
|
|
94
|
-
value?: string;
|
|
95
|
-
ui_component?: AttributeUIComponent;
|
|
96
|
-
rank?: number;
|
|
97
|
-
metadata?: Record<string, unknown> | null;
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=mutations.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/attribute/mutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAEhE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACnC;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,eAAe,CAAC,EAAE,uBAAuB,EAAE,CAAA;IAC3C,oBAAoB,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CACxC;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM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