@mercurjs/types 2.1.6 → 2.2.0-canary.11

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 (58) hide show
  1. package/dist/feature-flags/index.d.ts +2 -1
  2. package/dist/feature-flags/index.d.ts.map +1 -1
  3. package/dist/feature-flags/index.js +1 -0
  4. package/dist/http/index.d.ts +4 -1
  5. package/dist/http/index.d.ts.map +1 -1
  6. package/dist/http/index.js +2 -1
  7. package/dist/http/offer.d.ts +67 -0
  8. package/dist/http/offer.d.ts.map +1 -0
  9. package/dist/http/product-attribute.d.ts +16 -0
  10. package/dist/http/product-attribute.d.ts.map +1 -0
  11. package/dist/http/product-category.d.ts +9 -10
  12. package/dist/http/product-category.d.ts.map +1 -1
  13. package/dist/http/product.d.ts +15 -3
  14. package/dist/http/product.d.ts.map +1 -1
  15. package/dist/index.d.ts +3 -2
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +20 -5
  18. package/dist/modules.d.ts +4 -4
  19. package/dist/modules.d.ts.map +1 -1
  20. package/dist/modules.js +3 -3
  21. package/dist/offer/common.d.ts +61 -0
  22. package/dist/offer/common.d.ts.map +1 -0
  23. package/dist/offer/index.d.ts.map +1 -0
  24. package/dist/offer/mutations.d.ts +114 -0
  25. package/dist/offer/mutations.d.ts.map +1 -0
  26. package/dist/offer/mutations.js +9 -0
  27. package/dist/product/common.d.ts +163 -0
  28. package/dist/product/common.d.ts.map +1 -0
  29. package/dist/product/common.js +52 -0
  30. package/dist/product/index.d.ts +3 -0
  31. package/dist/product/index.d.ts.map +1 -0
  32. package/dist/{subscription → product}/index.js +1 -1
  33. package/dist/product/mutations.d.ts +127 -0
  34. package/dist/product/mutations.d.ts.map +1 -0
  35. package/dist/product/status.d.ts +19 -0
  36. package/dist/product/status.d.ts.map +1 -0
  37. package/dist/product/status.js +19 -0
  38. package/package.json +5 -1
  39. package/dist/attribute/common.d.ts +0 -79
  40. package/dist/attribute/common.d.ts.map +0 -1
  41. package/dist/attribute/common.js +0 -16
  42. package/dist/attribute/index.d.ts.map +0 -1
  43. package/dist/attribute/mutations.d.ts +0 -99
  44. package/dist/attribute/mutations.d.ts.map +0 -1
  45. package/dist/http/subscription.d.ts +0 -18
  46. package/dist/http/subscription.d.ts.map +0 -1
  47. package/dist/subscription/common.d.ts +0 -27
  48. package/dist/subscription/common.d.ts.map +0 -1
  49. package/dist/subscription/index.d.ts +0 -3
  50. package/dist/subscription/index.d.ts.map +0 -1
  51. package/dist/subscription/mutation.d.ts +0 -33
  52. package/dist/subscription/mutation.d.ts.map +0 -1
  53. /package/dist/{attribute/mutations.js → http/offer.js} +0 -0
  54. /package/dist/http/{subscription.js → product-attribute.js} +0 -0
  55. /package/dist/{subscription → offer}/common.js +0 -0
  56. /package/dist/{attribute → offer}/index.d.ts +0 -0
  57. /package/dist/{attribute → offer}/index.js +0 -0
  58. /package/dist/{subscription/mutation.js → product/mutations.js} +0 -0
@@ -0,0 +1,163 @@
1
+ import type { ProductDTO as UpstreamProductDTO, ProductVariantDTO as UpstreamProductVariantDTO, ProductCategoryDTO as UpstreamProductCategoryDTO, ProductImageDTO } from "@medusajs/types";
2
+ import { SellerDTO } from "../seller/common";
3
+ /**
4
+ * Data types for product attributes. Determines validation rules and UI
5
+ * rendering.
6
+ */
7
+ export declare enum AttributeType {
8
+ SINGLE_SELECT = "single_select",
9
+ MULTI_SELECT = "multi_select",
10
+ UNIT = "unit",
11
+ TOGGLE = "toggle",
12
+ TEXT = "text"
13
+ }
14
+ /**
15
+ * Product change lifecycle statuses. Vendor edits land as `PENDING`
16
+ * (awaiting admin action) and resolve to `CONFIRMED` / `DECLINED` /
17
+ * `CANCELED`. Audit-trail rows (publish approval, change requests)
18
+ * are created already `CONFIRMED`.
19
+ */
20
+ export declare enum ProductChangeStatus {
21
+ PENDING = "pending",
22
+ CONFIRMED = "confirmed",
23
+ DECLINED = "declined",
24
+ CANCELED = "canceled"
25
+ }
26
+ /**
27
+ * Action types for ProductChangeAction. Each action's `details` JSON carries
28
+ * the operation payload; `ProductModuleService.applyProductChangeActions_`
29
+ * dispatches based on `action`.
30
+ */
31
+ export declare enum ProductChangeActionType {
32
+ STATUS_CHANGE = "STATUS_CHANGE",
33
+ UPDATE = "UPDATE",
34
+ VARIANT_ADD = "VARIANT_ADD",
35
+ VARIANT_UPDATE = "VARIANT_UPDATE",
36
+ VARIANT_REMOVE = "VARIANT_REMOVE",
37
+ ATTRIBUTE_ADD = "ATTRIBUTE_ADD",
38
+ ATTRIBUTE_REMOVE = "ATTRIBUTE_REMOVE",
39
+ PRODUCT_DELETE = "PRODUCT_DELETE",
40
+ /**
41
+ * Operator asked the vendor to revise a submission. Auto-applied
42
+ * (no product mutation) — the parent `ProductChange.external_note`
43
+ * carries the operator's message and the action's existence in the
44
+ * audit trail is the durable signal.
45
+ */
46
+ CHANGE_REQUESTED = "CHANGE_REQUESTED"
47
+ }
48
+ export interface ProductAttributeValueDTO {
49
+ id: string;
50
+ handle: string | null;
51
+ name: string;
52
+ rank: number;
53
+ is_active: boolean;
54
+ metadata: Record<string, unknown> | null;
55
+ attribute?: ProductAttributeDTO;
56
+ attribute_id?: string;
57
+ variants?: ProductVariantDTO[];
58
+ products?: ProductDTO[];
59
+ created_at: string | Date;
60
+ updated_at: string | Date;
61
+ deleted_at: string | Date | null;
62
+ }
63
+ export interface ProductAttributeDTO {
64
+ id: string;
65
+ handle: string | null;
66
+ name: string;
67
+ description: string | null;
68
+ type: AttributeType;
69
+ is_required: boolean;
70
+ is_filterable: boolean;
71
+ is_variant_axis: boolean;
72
+ rank: number;
73
+ is_active: boolean;
74
+ created_by: string | null;
75
+ /**
76
+ * Legacy override-only column on the fused Mercur product module. Optional
77
+ * because the new standalone `product-attribute` module (SPEC-008) drops
78
+ * this field — product-scoped attributes are migrated to stock
79
+ * `ProductOption` / `ProductOptionValue` instead. The legacy fused module
80
+ * still populates the column until step 5 retires it.
81
+ */
82
+ product_id?: string | null;
83
+ metadata: Record<string, unknown> | null;
84
+ values?: ProductAttributeValueDTO[];
85
+ /**
86
+ * Legacy entity-level M:N relations populated by the fused Mercur product
87
+ * module. The new `product-attribute` module exposes these via Module
88
+ * Links instead (`product_attribute_category_link`,
89
+ * `product_variant_attribute`) and the link aliases resolve through
90
+ * Query Graph rather than the service.
91
+ */
92
+ categories?: ProductCategoryDTO[];
93
+ variant_products?: ProductDTO[];
94
+ created_at: string | Date;
95
+ updated_at: string | Date;
96
+ deleted_at: string | Date | null;
97
+ }
98
+ export interface ProductChangeActionDTO {
99
+ id: string;
100
+ product_id: string;
101
+ product_change_id: string | null;
102
+ ordering: number;
103
+ action: string;
104
+ details: Record<string, unknown>;
105
+ internal_note: string | null;
106
+ applied: boolean;
107
+ product_change?: ProductChangeDTO;
108
+ created_at: string | Date;
109
+ updated_at: string | Date;
110
+ deleted_at: string | Date | null;
111
+ }
112
+ export interface ProductChangeDTO {
113
+ id: string;
114
+ product?: ProductDTO;
115
+ product_id?: string;
116
+ status: ProductChangeStatus;
117
+ internal_note: string | null;
118
+ external_note: string | null;
119
+ created_by: string | null;
120
+ confirmed_by: string | null;
121
+ confirmed_at: string | Date | null;
122
+ declined_by: string | null;
123
+ declined_at: string | Date | null;
124
+ declined_reason: string | null;
125
+ canceled_by: string | null;
126
+ canceled_at: string | Date | null;
127
+ metadata: Record<string, unknown> | null;
128
+ actions?: ProductChangeActionDTO[];
129
+ created_at: string | Date;
130
+ updated_at: string | Date;
131
+ deleted_at: string | Date | null;
132
+ }
133
+ /**
134
+ * Mercur extends `ProductCategoryDTO` with `is_restricted`. Pure addition,
135
+ * no field conflicts.
136
+ */
137
+ export type ProductCategoryDTO = UpstreamProductCategoryDTO & {
138
+ is_restricted: boolean;
139
+ attributes?: ProductAttributeDTO[];
140
+ };
141
+ /**
142
+ * Mercur extends `ProductVariantDTO` with `attribute_values` and Mercur's
143
+ * own `images` link. Upstream fields kept intact.
144
+ */
145
+ export type ProductVariantDTO = UpstreamProductVariantDTO & {
146
+ attribute_values?: ProductAttributeValueDTO[];
147
+ images?: ProductImageDTO[];
148
+ };
149
+ /**
150
+ * Mercur's `ProductDTO`. Replaces `status` (Mercur enum includes
151
+ * `REQUIRES_ACTION`) and drops `options`. Adds marketplace-only fields.
152
+ */
153
+ export type ProductDTO = UpstreamProductDTO & {
154
+ variants?: ProductVariantDTO[];
155
+ categories?: ProductCategoryDTO[];
156
+ variant_attributes?: ProductAttributeDTO[];
157
+ custom_attributes?: ProductAttributeDTO[];
158
+ attribute_values?: ProductAttributeValueDTO[];
159
+ attributes?: ProductAttributeDTO[];
160
+ sellers?: SellerDTO[];
161
+ changes?: ProductChangeDTO[];
162
+ };
163
+ //# 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;AAK5C;;;GAGG;AACH,oBAAY,aAAa;IACvB,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED;;;;;GAKG;AACH,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;IACjC;;;;;OAKG;IACH,gBAAgB,qBAAqB;CACtC;AAID,MAAM,WAAW,w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AAW,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACxC,OAAO,CAAC,EAAE,sBAAsB,EAAE,CAAA;IAClC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAA;CACjC;AAID;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,0BAA0B,GAAG;IAC5D,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAA;CACnC,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,GAAG;IAC1D,gBAAgB,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC7C,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;CAC3B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,kBAAkB,GAAG;IAC5C,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAA;IAC9B,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAA;IACjC,kBAAkB,CAAC,EAAE,mBAAmB,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"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductChangeActionType = exports.ProductChangeStatus = exports.AttributeType = void 0;
4
+ // --- Enums ---
5
+ /**
6
+ * Data types for product attributes. Determines validation rules and UI
7
+ * rendering.
8
+ */
9
+ var AttributeType;
10
+ (function (AttributeType) {
11
+ AttributeType["SINGLE_SELECT"] = "single_select";
12
+ AttributeType["MULTI_SELECT"] = "multi_select";
13
+ AttributeType["UNIT"] = "unit";
14
+ AttributeType["TOGGLE"] = "toggle";
15
+ AttributeType["TEXT"] = "text";
16
+ })(AttributeType || (exports.AttributeType = AttributeType = {}));
17
+ /**
18
+ * Product change lifecycle statuses. Vendor edits land as `PENDING`
19
+ * (awaiting admin action) and resolve to `CONFIRMED` / `DECLINED` /
20
+ * `CANCELED`. Audit-trail rows (publish approval, change requests)
21
+ * are created already `CONFIRMED`.
22
+ */
23
+ var ProductChangeStatus;
24
+ (function (ProductChangeStatus) {
25
+ ProductChangeStatus["PENDING"] = "pending";
26
+ ProductChangeStatus["CONFIRMED"] = "confirmed";
27
+ ProductChangeStatus["DECLINED"] = "declined";
28
+ ProductChangeStatus["CANCELED"] = "canceled";
29
+ })(ProductChangeStatus || (exports.ProductChangeStatus = ProductChangeStatus = {}));
30
+ /**
31
+ * Action types for ProductChangeAction. Each action's `details` JSON carries
32
+ * the operation payload; `ProductModuleService.applyProductChangeActions_`
33
+ * dispatches based on `action`.
34
+ */
35
+ var ProductChangeActionType;
36
+ (function (ProductChangeActionType) {
37
+ ProductChangeActionType["STATUS_CHANGE"] = "STATUS_CHANGE";
38
+ ProductChangeActionType["UPDATE"] = "UPDATE";
39
+ ProductChangeActionType["VARIANT_ADD"] = "VARIANT_ADD";
40
+ ProductChangeActionType["VARIANT_UPDATE"] = "VARIANT_UPDATE";
41
+ ProductChangeActionType["VARIANT_REMOVE"] = "VARIANT_REMOVE";
42
+ ProductChangeActionType["ATTRIBUTE_ADD"] = "ATTRIBUTE_ADD";
43
+ ProductChangeActionType["ATTRIBUTE_REMOVE"] = "ATTRIBUTE_REMOVE";
44
+ ProductChangeActionType["PRODUCT_DELETE"] = "PRODUCT_DELETE";
45
+ /**
46
+ * Operator asked the vendor to revise a submission. Auto-applied
47
+ * (no product mutation) — the parent `ProductChange.external_note`
48
+ * carries the operator's message and the action's existence in the
49
+ * audit trail is the durable signal.
50
+ */
51
+ ProductChangeActionType["CHANGE_REQUESTED"] = "CHANGE_REQUESTED";
52
+ })(ProductChangeActionType || (exports.ProductChangeActionType = ProductChangeActionType = {}));
@@ -0,0 +1,3 @@
1
+ export * from "./common";
2
+ export * from "./mutations";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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"}
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./common"), exports);
18
- __exportStar(require("./mutation"), exports);
18
+ __exportStar(require("./mutations"), exports);
@@ -0,0 +1,127 @@
1
+ import type { CreateProductDTO as UpstreamCreateProductDTO, UpdateProductDTO as UpstreamUpdateProductDTO, CreateProductVariantDTO as UpstreamCreateProductVariantDTO } from "@medusajs/types";
2
+ import { AttributeType, ProductChangeStatus } from "./common";
3
+ import { ProductStatus } from "./status";
4
+ export interface CreateProductAttributeValueDTO {
5
+ handle?: string;
6
+ name: string;
7
+ rank?: number;
8
+ is_active?: boolean;
9
+ metadata?: Record<string, unknown> | null;
10
+ }
11
+ export interface UpdateProductAttributeValueDTO {
12
+ handle?: string;
13
+ name?: string;
14
+ rank?: number;
15
+ is_active?: boolean;
16
+ metadata?: Record<string, unknown> | null;
17
+ }
18
+ export interface UpsertProductAttributeValueDTO extends UpdateProductAttributeValueDTO {
19
+ id?: string;
20
+ }
21
+ export interface CreateProductAttributeDTO {
22
+ handle?: string;
23
+ name: string;
24
+ description?: string | null;
25
+ type: AttributeType;
26
+ is_required?: boolean;
27
+ is_filterable?: boolean;
28
+ is_variant_axis?: boolean;
29
+ rank?: number;
30
+ is_active?: boolean;
31
+ created_by?: string | null;
32
+ product_id?: string | null;
33
+ metadata?: Record<string, unknown> | null;
34
+ values?: CreateProductAttributeValueDTO[];
35
+ }
36
+ export interface UpdateProductAttributeDTO {
37
+ handle?: string;
38
+ name?: string;
39
+ description?: string | null;
40
+ type?: AttributeType;
41
+ is_required?: boolean;
42
+ is_filterable?: boolean;
43
+ is_variant_axis?: boolean;
44
+ rank?: number;
45
+ is_active?: boolean;
46
+ metadata?: Record<string, unknown> | null;
47
+ }
48
+ /**
49
+ * Inline input for product attributes. Each entry is either:
50
+ *
51
+ * 1. A global attribute reference: `{ attribute_id, value_ids?: [...] }`
52
+ * Links an existing ProductAttribute. Use `value_ids` for known IDs,
53
+ * or `values` (names) to upsert values on the attribute.
54
+ *
55
+ * 2. An inline custom attribute: `{ name, type, values: ["Red", "Blue"] }`
56
+ * Creates a new ProductAttribute with `product_id` set (scoped to product).
57
+ */
58
+ export type ProductAttributeInputDTO = {
59
+ attribute_id: string;
60
+ value_ids?: string[];
61
+ values?: string[];
62
+ } | {
63
+ name: string;
64
+ type: AttributeType;
65
+ values?: string[];
66
+ is_variant_axis?: boolean;
67
+ is_filterable?: boolean;
68
+ is_required?: boolean;
69
+ description?: string | null;
70
+ metadata?: Record<string, unknown> | null;
71
+ };
72
+ /**
73
+ * `attribute_values` accepts either:
74
+ * - An array of `ProductAttributeValue` IDs (already resolved).
75
+ * - A map of attribute key (attribute `handle` or `name`) to value name(s),
76
+ * resolved to IDs by the service against the parent product's variant
77
+ * attributes.
78
+ *
79
+ * @example `["pattrval_red", "pattrval_small"]`
80
+ * @example `{ Color: "Red", Size: ["S", "M"] }`
81
+ */
82
+ type VariantAttributeValuesInput = string[] | Record<string, string | string[]>;
83
+ export type CreateProductVariantDTO = UpstreamCreateProductVariantDTO & {
84
+ attribute_values?: VariantAttributeValuesInput;
85
+ };
86
+ export type CreateProductDTO = Omit<UpstreamCreateProductDTO, "status"> & {
87
+ status?: ProductStatus;
88
+ variants?: CreateProductVariantDTO[];
89
+ /**
90
+ * Product variant attributes. Each entry is either:
91
+ * - A global attribute reference: `{ attribute_id, value_ids: ["pattrval_..."] }`
92
+ * - An inline custom attribute: `{ name, type, values: ["Red", "Blue"] }`
93
+ */
94
+ variant_attributes?: ProductAttributeInputDTO[];
95
+ /**
96
+ * Non-variant product-level attributes. Same format as variant_attributes.
97
+ * Creates product-scoped attributes and links their values to the product.
98
+ */
99
+ product_attributes?: ProductAttributeInputDTO[];
100
+ };
101
+ export type UpdateProductDTO = Omit<UpstreamUpdateProductDTO, "status"> & {
102
+ status?: ProductStatus;
103
+ /** See {@link CreateProductDTO.variant_attributes}. */
104
+ variant_attributes?: ProductAttributeInputDTO[];
105
+ /** See {@link CreateProductDTO.product_attributes}. */
106
+ product_attributes?: ProductAttributeInputDTO[];
107
+ };
108
+ export interface CreateProductChangeDTO {
109
+ product_id: string;
110
+ internal_note?: string;
111
+ external_note?: string;
112
+ created_by?: string;
113
+ status?: ProductChangeStatus;
114
+ confirmed_by?: string;
115
+ confirmed_at?: Date;
116
+ metadata?: Record<string, unknown>;
117
+ }
118
+ export interface CreateProductChangeActionDTO {
119
+ product_change_id?: string;
120
+ product_id: string;
121
+ action: string;
122
+ details?: Record<string, unknown>;
123
+ internal_note?: string;
124
+ applied?: boolean;
125
+ }
126
+ export {};
127
+ //# 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,EAC3D,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAIxC,MAAM,WAAW,8BAA8B;IAC7C,MAAM,CAAC,EAAE,MAAM,C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pC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC/C;;;OAGG;IACH,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,GAAG;IACxE,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAA;IAC/C,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,wBAAwB,EAAE,CAAA;CAChD,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,mBAAmB,CAAA;IAC5B,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"}
@@ -0,0 +1,19 @@
1
+ import type { ProductStatus as UpstreamProductStatus } from "@medusajs/types";
2
+ /**
3
+ * Mirror of Medusa's `ProductStatus` string union as a runtime const so
4
+ * consumers can keep doing `ProductStatus.PUBLISHED`-style member access
5
+ * AND get the same string-union type when used as a type position.
6
+ *
7
+ * `REQUIRES_ACTION` is intentionally absent — the concept moved to
8
+ * `ProductChangeStatus.REQUIRES_ACTION` (any pending product-change row
9
+ * with that status flips the computed `Product.requires_action`
10
+ * boolean). See SPEC-008.
11
+ */
12
+ export declare const ProductStatus: {
13
+ readonly DRAFT: "draft";
14
+ readonly PROPOSED: "proposed";
15
+ readonly PUBLISHED: "published";
16
+ readonly REJECTED: "rejected";
17
+ };
18
+ export type ProductStatus = UpstreamProductStatus;
19
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/product/status.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;;CAKgC,CAAA;AAE1D,MAAM,MAAM,aAAa,GAAG,qBAAqB,CAAA"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductStatus = void 0;
4
+ /**
5
+ * Mirror of Medusa's `ProductStatus` string union as a runtime const so
6
+ * consumers can keep doing `ProductStatus.PUBLISHED`-style member access
7
+ * AND get the same string-union type when used as a type position.
8
+ *
9
+ * `REQUIRES_ACTION` is intentionally absent — the concept moved to
10
+ * `ProductChangeStatus.REQUIRES_ACTION` (any pending product-change row
11
+ * with that status flips the computed `Product.requires_action`
12
+ * boolean). See SPEC-008.
13
+ */
14
+ exports.ProductStatus = {
15
+ DRAFT: "draft",
16
+ PROPOSED: "proposed",
17
+ PUBLISHED: "published",
18
+ REJECTED: "rejected",
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/types",
3
- "version": "2.1.6",
3
+ "version": "2.2.0-canary.11",
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,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,eAAe,CAAA;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAClC,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,OAAO,CAA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AA8B,EAAE,CAAA;CACzC"}
@@ -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,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