@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.
Files changed (51) 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 +5 -0
  5. package/dist/http/index.d.ts.map +1 -1
  6. package/dist/http/index.js +3 -0
  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-attribute.js +2 -0
  12. package/dist/http/product-brand.d.ts +16 -0
  13. package/dist/http/product-brand.d.ts.map +1 -0
  14. package/dist/http/product-brand.js +2 -0
  15. package/dist/http/product-category.d.ts +9 -10
  16. package/dist/http/product-category.d.ts.map +1 -1
  17. package/dist/http/product.d.ts +15 -3
  18. package/dist/http/product.d.ts.map +1 -1
  19. package/dist/index.d.ts +2 -1
  20. package/dist/index.d.ts.map +1 -1
  21. package/dist/index.js +14 -3
  22. package/dist/modules.d.ts +2 -3
  23. package/dist/modules.d.ts.map +1 -1
  24. package/dist/modules.js +1 -2
  25. package/dist/offer/common.d.ts +59 -0
  26. package/dist/offer/common.d.ts.map +1 -0
  27. package/dist/offer/common.js +2 -0
  28. package/dist/offer/index.d.ts.map +1 -0
  29. package/dist/offer/mutations.d.ts +113 -0
  30. package/dist/offer/mutations.d.ts.map +1 -0
  31. package/dist/offer/mutations.js +9 -0
  32. package/dist/payout/provider.d.ts.map +1 -1
  33. package/dist/product/common.d.ts +171 -0
  34. package/dist/product/common.d.ts.map +1 -0
  35. package/dist/product/common.js +52 -0
  36. package/dist/product/index.d.ts +3 -0
  37. package/dist/product/index.d.ts.map +1 -0
  38. package/dist/product/index.js +18 -0
  39. package/dist/product/mutations.d.ts +162 -0
  40. package/dist/product/mutations.d.ts.map +1 -0
  41. package/dist/product/mutations.js +2 -0
  42. package/package.json +5 -1
  43. package/dist/attribute/common.d.ts +0 -79
  44. package/dist/attribute/common.d.ts.map +0 -1
  45. package/dist/attribute/common.js +0 -16
  46. package/dist/attribute/index.d.ts.map +0 -1
  47. package/dist/attribute/mutations.d.ts +0 -99
  48. package/dist/attribute/mutations.d.ts.map +0 -1
  49. /package/dist/{attribute/mutations.js → http/offer.js} +0 -0
  50. /package/dist/{attribute → offer}/index.d.ts +0 -0
  51. /package/dist/{attribute → offer}/index.js +0 -0
@@ -1,4 +1,5 @@
1
1
  export declare enum MercurFeatureFlags {
2
- SELLER_REGISTRATION = "seller_registration"
2
+ SELLER_REGISTRATION = "seller_registration",
3
+ PRODUCT_REQUEST = "product_request"
3
4
  }
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-flags/index.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,mBAAmB,wBAAwB;CAC5C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feature-flags/index.ts"],"names":[],"mappings":"AAAA,oBAAY,kBAAkB;IAC5B,mBAAmB,wBAAwB;IAC3C,eAAe,oBAAoB;CACpC"}
@@ -4,4 +4,5 @@ exports.MercurFeatureFlags = void 0;
4
4
  var MercurFeatureFlags;
5
5
  (function (MercurFeatureFlags) {
6
6
  MercurFeatureFlags["SELLER_REGISTRATION"] = "seller_registration";
7
+ MercurFeatureFlags["PRODUCT_REQUEST"] = "product_request";
7
8
  })(MercurFeatureFlags || (exports.MercurFeatureFlags = MercurFeatureFlags = {}));
@@ -14,6 +14,8 @@ export * from "./price-list";
14
14
  export * from "./price-preference";
15
15
  export * from "./product";
16
16
  export * from "./promotion";
17
+ export * from "./product-attribute";
18
+ export * from "./product-brand";
17
19
  export * from "./product-category";
18
20
  export * from "./product-tag";
19
21
  export * from "./product-type";
@@ -26,7 +28,10 @@ export * from "./shipping-option-type";
26
28
  export * from "./shipping-profile";
27
29
  export * from "./stock-location";
28
30
  export * from "./payout";
31
+ export * from "./offer";
29
32
  export * from "./commission";
30
33
  export * from "./subscription";
34
+ export { AdminProductResponse, AdminProductListResponse, AdminProductDeleteResponse, AdminProductVariantResponse, AdminProductVariantListResponse, } from "./product";
35
+ export { AdminProductCategoryResponse, AdminProductCategoryListResponse, AdminProductCategoryDeleteResponse, } from "./product-category";
31
36
  export { StoreCompleteCartResponse } from "./order-group";
32
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAE9D,cAAc,2BAA2B,CAAA;AACzC,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC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3B,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA"}
@@ -32,6 +32,8 @@ __exportStar(require("./price-list"), exports);
32
32
  __exportStar(require("./price-preference"), exports);
33
33
  __exportStar(require("./product"), exports);
34
34
  __exportStar(require("./promotion"), exports);
35
+ __exportStar(require("./product-attribute"), exports);
36
+ __exportStar(require("./product-brand"), exports);
35
37
  __exportStar(require("./product-category"), exports);
36
38
  __exportStar(require("./product-tag"), exports);
37
39
  __exportStar(require("./product-type"), exports);
@@ -44,5 +46,6 @@ __exportStar(require("./shipping-option-type"), exports);
44
46
  __exportStar(require("./shipping-profile"), exports);
45
47
  __exportStar(require("./stock-location"), exports);
46
48
  __exportStar(require("./payout"), exports);
49
+ __exportStar(require("./offer"), exports);
47
50
  __exportStar(require("./commission"), exports);
48
51
  __exportStar(require("./subscription"), exports);
@@ -0,0 +1,67 @@
1
+ import { DeleteResponse, PaginatedResponse } from "@medusajs/types";
2
+ import { CreateOfferInventoryItemDTO, CreateOfferPriceDTO, OfferDTO, UpsertOfferPriceDTO } from "../offer";
3
+ /**
4
+ * Body for `POST /vendor/offers`. `seller_id` and `created_by` are not part
5
+ * of the public payload — they are derived from the authenticated session
6
+ * before the create workflow runs.
7
+ */
8
+ export interface VendorCreateOfferReq {
9
+ sku: string;
10
+ variant_id: string;
11
+ shipping_profile_id: string;
12
+ inventory_items: CreateOfferInventoryItemDTO[];
13
+ prices: CreateOfferPriceDTO[];
14
+ metadata?: Record<string, unknown> | null;
15
+ }
16
+ /**
17
+ * Body for `POST /vendor/offers/:id`. Setting `prices` rewrites the offer's
18
+ * `PriceSet` with replace semantics; omit it to leave the ladder untouched.
19
+ */
20
+ export interface VendorUpdateOfferReq {
21
+ sku?: string;
22
+ shipping_profile_id?: string;
23
+ metadata?: Record<string, unknown> | null;
24
+ prices?: UpsertOfferPriceDTO[];
25
+ }
26
+ /**
27
+ * Body for `POST /vendor/offers/:id/inventory-items/batch`. The
28
+ * combination of `create`, `update`, and `delete` is applied in one call;
29
+ * inventory ids are required to be unique across the three buckets.
30
+ */
31
+ export interface VendorBatchOfferInventoryItemsReq {
32
+ create?: Array<{
33
+ inventory_item_id: string;
34
+ required_quantity?: number;
35
+ }>;
36
+ update?: Array<{
37
+ inventory_item_id: string;
38
+ required_quantity: number;
39
+ }>;
40
+ delete?: string[];
41
+ }
42
+ export interface VendorOfferResponse {
43
+ offer: OfferDTO;
44
+ }
45
+ export type VendorOfferListResponse = PaginatedResponse<{
46
+ offers: OfferDTO[];
47
+ }>;
48
+ export type VendorOfferDeleteResponse = DeleteResponse<"offer">;
49
+ /**
50
+ * Response shape of `POST /vendor/offers/:id/inventory-items/batch`. The
51
+ * `created`/`updated`/`deleted` arrays mirror the
52
+ * `AdminProductVariantInventoryBatchResponse` shape; the refetched `offer`
53
+ * is included so the client does not need a follow-up GET.
54
+ */
55
+ export interface VendorBatchOfferInventoryItemsResponse {
56
+ created: unknown[];
57
+ updated: unknown[];
58
+ deleted: string[];
59
+ offer: OfferDTO;
60
+ }
61
+ export interface AdminOfferResponse {
62
+ offer: OfferDTO;
63
+ }
64
+ export type AdminOfferListResponse = PaginatedResponse<{
65
+ offers: OfferDTO[];
66
+ }>;
67
+ //# sourceMappingURL=offer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offer.d.ts","sourceRoot":"","sources":["../../src/http/offer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,QAAQ,EACR,mBAAmB,EACpB,MAAM,UAAU,CAAA;AAQjB;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,eAAe,EAAE,2BAA2B,EAAE,CAAA;IAC9C,MAAM,EAAE,mBAAmB,EAAE,CAAA;IAC7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CAAA"}
@@ -0,0 +1,16 @@
1
+ import { DeleteResponse, PaginatedResponse } from "@medusajs/types";
2
+ import { ProductAttributeDTO } from "../product/common";
3
+ export interface AdminProductAttributeResponse {
4
+ product_attribute: ProductAttributeDTO;
5
+ }
6
+ export type AdminProductAttributeListResponse = PaginatedResponse<{
7
+ product_attributes: ProductAttributeDTO[];
8
+ }>;
9
+ export type AdminProductAttributeDeleteResponse = DeleteResponse<"product_attribute">;
10
+ export interface VendorProductAttributeResponse {
11
+ product_attribute: ProductAttributeDTO;
12
+ }
13
+ export type VendorProductAttributeListResponse = PaginatedResponse<{
14
+ product_attributes: ProductAttributeDTO[];
15
+ }>;
16
+ //# sourceMappingURL=product-attribute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-attribute.d.ts","sourceRoot":"","sources":["../../src/http/product-attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAEvD,MAAM,WAAW,6BAA6B;IAC5C,iBAAiB,EAAE,mBAAmB,CAAA;CACvC;AAED,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IAChE,kBAAkB,EAAE,mBAAmB,EAAE,CAAA;CAC1C,CAAC,CAAA;AAEF,MAAM,MAAM,mCAAmC,GAC7C,cAAc,CAAC,mBAAmB,CAAC,CAAA;AAErC,MAAM,WAAW,8BAA8B;IAC7C,iBAAiB,EAAE,mBAAmB,CAAA;CACvC;AAED,MAAM,MAAM,kCAAkC,GAAG,iBAAiB,CAAC;IACjE,kBAAkB,EAAE,mBAAmB,EAAE,CAAA;CAC1C,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { DeleteResponse, PaginatedResponse } from "@medusajs/types";
2
+ import { ProductBrandDTO } from "../product/common";
3
+ export interface AdminProductBrandResponse {
4
+ product_brand: ProductBrandDTO;
5
+ }
6
+ export type AdminProductBrandListResponse = PaginatedResponse<{
7
+ product_brands: ProductBrandDTO[];
8
+ }>;
9
+ export type AdminProductBrandDeleteResponse = DeleteResponse<"product_brand">;
10
+ export interface VendorProductBrandResponse {
11
+ product_brand: ProductBrandDTO;
12
+ }
13
+ export type VendorProductBrandListResponse = PaginatedResponse<{
14
+ product_brands: ProductBrandDTO[];
15
+ }>;
16
+ //# sourceMappingURL=product-brand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product-brand.d.ts","sourceRoot":"","sources":["../../src/http/product-brand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,eAAe,CAAA;CAC/B;AAED,MAAM,MAAM,6BAA6B,GAAG,iBAAiB,CAAC;IAC5D,cAAc,EAAE,eAAe,EAAE,CAAA;CAClC,CAAC,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,cAAc,CAAC,eAAe,CAAC,CAAA;AAE7E,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,eAAe,CAAA;CAC/B;AAED,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,cAAc,EAAE,eAAe,EAAE,CAAA;CAClC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,20 +1,19 @@
1
- import { PaginatedResponse, ProductCategoryDTO, ProductDTO } from "@medusajs/types";
1
+ import { DeleteResponse, PaginatedResponse } from "@medusajs/types";
2
+ import { ProductCategoryDTO, ProductDTO } from "../product/common";
3
+ export interface AdminProductCategoryResponse {
4
+ product_category: ProductCategoryDTO;
5
+ }
6
+ export type AdminProductCategoryListResponse = PaginatedResponse<{
7
+ product_categories: ProductCategoryDTO[];
8
+ }>;
9
+ export type AdminProductCategoryDeleteResponse = DeleteResponse<"product_category">;
2
10
  export interface VendorProductCategoryResponse {
3
- /**
4
- * The product category's details.
5
- */
6
11
  product_category: ProductCategoryDTO;
7
12
  }
8
13
  export type VendorProductCategoryListResponse = PaginatedResponse<{
9
- /**
10
- * The list of product categories.
11
- */
12
14
  product_categories: ProductCategoryDTO[];
13
15
  }>;
14
16
  export type VendorProductCategoryProductsResponse = PaginatedResponse<{
15
- /**
16
- * The list of products in the category.
17
- */
18
17
  products: ProductDTO[];
19
18
  }>;
20
19
  //# sourceMappingURL=product-category.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product-category.d.ts","sourceRoot":"","sources":["../../src/http/product-category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEnF,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,gBAAgB,EAAE,kBAAkB,CAAA;CACrC;AAED,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IAChE;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CACzC,CAAC,CAAA;AAEF,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,CAAC;IACpE;;OAEG;IACH,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB,CAAC,CAAA"}
1
+ {"version":3,"file":"product-category.d.ts","sourceRoot":"","sources":["../../src/http/product-category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAElE,MAAM,WAAW,4BAA4B;IAC3C,gBAAgB,EAAE,kBAAkB,CAAA;CACrC;AAED,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAC/D,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CACzC,CAAC,CAAA;AAEF,MAAM,MAAM,kCAAkC,GAC5C,cAAc,CAAC,kBAAkB,CAAC,CAAA;AAEpC,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,EAAE,kBAAkB,CAAA;CACrC;AAED,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IAChE,kBAAkB,EAAE,kBAAkB,EAAE,CAAA;CACzC,CAAC,CAAA;AAEF,MAAM,MAAM,qCAAqC,GAAG,iBAAiB,CAAC;IACpE,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB,CAAC,CAAA"}
@@ -1,4 +1,18 @@
1
- import { PaginatedResponse, ProductDTO, ProductVariantDTO, SalesChannelDTO } from "@medusajs/types";
1
+ import { DeleteResponse, PaginatedResponse, SalesChannelDTO } from "@medusajs/types";
2
+ import { ProductDTO, ProductVariantDTO } from "../product/common";
3
+ export interface AdminProductResponse {
4
+ product: ProductDTO;
5
+ }
6
+ export type AdminProductListResponse = PaginatedResponse<{
7
+ products: ProductDTO[];
8
+ }>;
9
+ export type AdminProductDeleteResponse = DeleteResponse<"product">;
10
+ export interface AdminProductVariantResponse {
11
+ variant: ProductVariantDTO;
12
+ }
13
+ export type AdminProductVariantListResponse = PaginatedResponse<{
14
+ variants: ProductVariantDTO[];
15
+ }>;
2
16
  export interface VendorProductResponse {
3
17
  /**
4
18
  * The product's details.
@@ -39,7 +53,5 @@ export interface VendorDeleteResponse {
39
53
  }
40
54
  export interface VendorProduct extends ProductDTO {
41
55
  sales_channels?: SalesChannelDTO[];
42
- informational_attributes?: import("../attribute").InformationalAttributeDTO[];
43
- variation_attributes?: import("../attribute").InformationalAttributeDTO[];
44
56
  }
45
57
  //# sourceMappingURL=product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../src/http/product.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EACjB,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ElE,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAED,MAAM,MAAM,+BAA+B,GAAG,iBAAiB,CAAC;IAC9D,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAC9B,CAAC,CAAA;AAEF,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,OAAO,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,UAAU,EAAE,CAAA;CACvB,CAAC,CAAA;AAEF,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,OAAO,EAAE,iBAAiB,CAAA;CAC3B;AAED,MAAM,MAAM,gCAAgC,GAAG,iBAAiB,CAAC;IAC/D;;OAEG;IACH,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAC9B,CAAC,CAAA;AAEF,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,cAAc,CAAC,EAAE,eAAe,EAAE,CAAC;CACpC"}
package/dist/index.d.ts CHANGED
@@ -5,7 +5,8 @@ export * from "./commission";
5
5
  export * as HttpTypes from "./http";
6
6
  export * from "./subscription";
7
7
  export * from "./payout";
8
- export * from "./attribute";
8
+ export * from "./offer";
9
+ export { ProductStatus, AttributeType, ProductChangeStatus, ProductChangeActionType, type ProductDTO, type ProductVariantDTO, type ProductCategoryDTO, type ProductBrandDTO, type ProductAttributeDTO, type ProductAttributeValueDTO, type ProductChangeDTO, type ProductChangeActionDTO, type MercurProductDTO, type CreateProductDTO, type UpdateProductDTO, type UpsertProductDTO, type CreateProductVariantDTO, type UpdateProductVariantDTO, type UpsertProductVariantDTO, type CreateProductCategoryDTO, type UpdateProductCategoryDTO, type CreateProductBrandDTO, type UpdateProductBrandDTO, type CreateProductAttributeDTO, type UpdateProductAttributeDTO, type CreateProductAttributeValueDTO, type UpdateProductAttributeValueDTO, type UpsertProductAttributeValueDTO, type ProductAttributeInputDTO, type CreateProductChangeDTO, type CreateProductChangeActionDTO, } from "./product";
9
10
  export * from "./modules";
10
11
  export * from "./custom-fields";
11
12
  export * from "./dashboard";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAG/B,cAAc,UAAU,CAAA;AAGxB,cAAc,eAAe,CAAA;AAG7B,cAAc,cAAc,CAAA;AAG5B,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAA;AAGnC,cAAc,gBAAgB,CAAA;AAG9B,cAAc,UAAU,CAAA;AAGxB,cAAc,aAAa,CAAA;AAG3B,cAAc,WAAW,CAAA;AAGzB,cAAc,iBAAiB,CAAA;AAG/B,cAAc,aAAa,CAAA;AAG3B,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAG/B,cAAc,UAAU,CAAA;AAGxB,cAAc,eAAe,CAAA;AAG7B,cAAc,cAAc,CAAA;AAG5B,OAAO,KAAK,SAAS,MAAM,QAAQ,CAAA;AAGnC,cAAc,gBAAgB,CAAA;AAG9B,cAAc,UAAU,CAAA;AAGxB,cAAc,SAAS,CAAA;AAQvB,OAAO,EACL,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,GAClC,MAAM,WAAW,CAAA;AAGlB,cAAc,WAAW,CAAA;AAGzB,cAAc,iBAAiB,CAAA;AAG/B,cAAc,aAAa,CAAA;AAG3B,cAAc,iBAAiB,CAAA"}
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.HttpTypes = void 0;
39
+ exports.ProductChangeActionType = exports.ProductChangeStatus = exports.AttributeType = exports.ProductStatus = exports.HttpTypes = void 0;
40
40
  __exportStar(require("@medusajs/types"), exports);
41
41
  // Seller types
42
42
  __exportStar(require("./seller"), exports);
@@ -50,8 +50,19 @@ exports.HttpTypes = __importStar(require("./http"));
50
50
  __exportStar(require("./subscription"), exports);
51
51
  // Payout types
52
52
  __exportStar(require("./payout"), exports);
53
- // Attribute types
54
- __exportStar(require("./attribute"), exports);
53
+ // Offer types
54
+ __exportStar(require("./offer"), exports);
55
+ // Product types — explicit re-export overrides Medusa's product surface.
56
+ // Mercur's runtime enums and Mercur-extended DTOs (Omit + intersection over
57
+ // upstream) win over the wholesale `export * from "@medusajs/types"` above.
58
+ // Types upstream declares verbatim (ProductImageDTO, ProductTypeDTO,
59
+ // ProductTagDTO, ProductCollectionDTO, etc.) come through the wholesale
60
+ // re-export unchanged.
61
+ var product_1 = require("./product");
62
+ Object.defineProperty(exports, "ProductStatus", { enumerable: true, get: function () { return product_1.ProductStatus; } });
63
+ Object.defineProperty(exports, "AttributeType", { enumerable: true, get: function () { return product_1.AttributeType; } });
64
+ Object.defineProperty(exports, "ProductChangeStatus", { enumerable: true, get: function () { return product_1.ProductChangeStatus; } });
65
+ Object.defineProperty(exports, "ProductChangeActionType", { enumerable: true, get: function () { return product_1.ProductChangeActionType; } });
55
66
  // Modules
56
67
  __exportStar(require("./modules"), exports);
57
68
  // Custom fields types
package/dist/modules.d.ts CHANGED
@@ -3,11 +3,10 @@ export declare enum MercurModules {
3
3
  SUBSCRIPTION = "subscription",
4
4
  COMMISSION = "commission",
5
5
  PAYOUT = "payout",
6
+ OFFER = "offer",
6
7
  CUSTOM_FIELDS = "custom_fields",
7
8
  VENDOR_UI = "vendor_ui",
8
9
  ADMIN_UI = "admin_ui",
9
- CODEGEN = "codegen",
10
- ATTRIBUTE = "attribute",
11
- VENDOR_PRODUCT_ATTRIBUTE = "vendor_product_attribute"
10
+ CODEGEN = "codegen"
12
11
  }
13
12
  //# sourceMappingURL=modules.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,wBAAwB,6BAA6B;CACxD"}
1
+ {"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;CACtB"}
package/dist/modules.js CHANGED
@@ -7,10 +7,9 @@ var MercurModules;
7
7
  MercurModules["SUBSCRIPTION"] = "subscription";
8
8
  MercurModules["COMMISSION"] = "commission";
9
9
  MercurModules["PAYOUT"] = "payout";
10
+ MercurModules["OFFER"] = "offer";
10
11
  MercurModules["CUSTOM_FIELDS"] = "custom_fields";
11
12
  MercurModules["VENDOR_UI"] = "vendor_ui";
12
13
  MercurModules["ADMIN_UI"] = "admin_ui";
13
14
  MercurModules["CODEGEN"] = "codegen";
14
- MercurModules["ATTRIBUTE"] = "attribute";
15
- MercurModules["VENDOR_PRODUCT_ATTRIBUTE"] = "vendor_product_attribute";
16
15
  })(MercurModules || (exports.MercurModules = MercurModules = {}));
@@ -0,0 +1,59 @@
1
+ import { InventoryItemDTO, MoneyAmountDTO, PriceSetDTO } from "@medusajs/types";
2
+ /**
3
+ * One row on the offer's inventory-item link, resolved through the writable
4
+ * `offer ↔ inventory_item` link defined in
5
+ * `packages/core/src/links/offer-inventory-item-link.ts`. The link table
6
+ * exposes `required_quantity` as an extra column, so the link row is the
7
+ * authoritative source for that field; the joined `inventory` is the underlying
8
+ * Medusa `InventoryItem`.
9
+ */
10
+ export interface OfferInventoryItemLinkDTO {
11
+ inventory_item_id: string;
12
+ required_quantity: number;
13
+ inventory?: InventoryItemDTO;
14
+ }
15
+ /**
16
+ * One row on the offer's price ladder, surfaced through the read-only
17
+ * `offer ↔ price_set` link in
18
+ * `packages/core/src/links/offer-price-set-link.ts`. The offer owns one
19
+ * `PriceSet`, and its prices behave like Medusa `MoneyAmount` rows — Mercur
20
+ * does not introduce its own price entity.
21
+ */
22
+ export type OfferPriceDTO = MoneyAmountDTO;
23
+ /**
24
+ * The marketplace's per-vendor sellable. An offer is the thin marketplace-side
25
+ * record that points at a Medusa `ProductVariant`, owns a Medusa `PriceSet`,
26
+ * and links to one or more Medusa `InventoryItem` rows. The base columns
27
+ * (`seller_id`, `variant_id`, `shipping_profile_id`, `price_set_id`,
28
+ * `sku`, `ean`, `upc`, `created_by`, `metadata`) live on the `offer` table;
29
+ * the optional `variant` / `seller` / `shipping_profile` / `price_set` /
30
+ * `inventory_items` relations are joined through module links and only
31
+ * present when the consumer requested those fields.
32
+ */
33
+ export interface OfferDTO {
34
+ id: string;
35
+ seller_id: string;
36
+ variant_id: string;
37
+ shipping_profile_id: string;
38
+ price_set_id: string;
39
+ sku: string;
40
+ ean: string | null;
41
+ upc: string | null;
42
+ created_by: string;
43
+ metadata: Record<string, unknown> | null;
44
+ created_at: Date;
45
+ updated_at: Date;
46
+ deleted_at: Date | null;
47
+ /**
48
+ * Joined through `offer-price-set-link.ts`. Carries the offer's full price
49
+ * ladder when the field is requested.
50
+ */
51
+ price_set?: PriceSetDTO;
52
+ /**
53
+ * Joined through the writable `offer ↔ inventory_item` link. Each row
54
+ * carries the link's `required_quantity` plus the underlying
55
+ * `InventoryItem` when requested.
56
+ */
57
+ inventory_items?: OfferInventoryItemLinkDTO[];
58
+ }
59
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/offer/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE/E;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,cAAc,CAAA;AAE1C;;;;;;;;;GASG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,CAAA;IAClB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACxC,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAA;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,yBAAyB,EAAE,CAAA;CAC9C"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/offer/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Mutation contracts for the offer module + workflows. Shared between
3
+ * `packages/core/src/workflows/offer/{steps,workflows}` and the HTTP
4
+ * validators / route handlers that drive them. Mirrors the shape Medusa's
5
+ * own product/pricing workflows use so external consumers (block packages,
6
+ * the typed `@mercurjs/client`) can target the same DTOs.
7
+ */
8
+ /**
9
+ * One entry on a new offer's `inventory_items` array. Each entry
10
+ * describes a brand-new `InventoryItem` to create and link to the offer
11
+ * in the same workflow run. `sku` defaults to the offer's SKU, `title`
12
+ * defaults to the resolved SKU. `required_quantity` defaults to `1` on
13
+ * persistence.
14
+ */
15
+ export interface CreateOfferInventoryItemDTO {
16
+ required_quantity?: number;
17
+ title?: string;
18
+ sku?: string;
19
+ stock_levels?: Array<{
20
+ location_id: string;
21
+ stocked_quantity: number;
22
+ }>;
23
+ }
24
+ /**
25
+ * One row on a new offer's price ladder. Identical in shape to Medusa's
26
+ * `CreatePriceDTO` so it can be threaded into `createPriceSetsStep` without
27
+ * a re-projection.
28
+ */
29
+ export interface CreateOfferPriceDTO {
30
+ amount: number;
31
+ currency_code: string;
32
+ min_quantity?: number | null;
33
+ max_quantity?: number | null;
34
+ rules?: Record<string, string>;
35
+ }
36
+ /**
37
+ * One row on an existing offer's price ladder when updating. `id` is set for
38
+ * rows that should be updated in place; rows without `id` are added; existing
39
+ * rows omitted from the array are deleted (replace semantics, mirroring
40
+ * Medusa's `updateProductVariantsWorkflow` → `updatePriceSetsStep`).
41
+ */
42
+ export interface UpsertOfferPriceDTO extends CreateOfferPriceDTO {
43
+ id?: string;
44
+ }
45
+ /**
46
+ * Input to `createOffersWorkflow`. `seller_id` and `created_by` are stamped
47
+ * by the route handler from the authenticated session and are not part of
48
+ * the public HTTP body.
49
+ *
50
+ * Each `inventory_items[]` entry describes a new inventory item to
51
+ * create (with optional starting `stock_levels`) and link to the offer
52
+ * in the same workflow run. Offers must have at least one entry.
53
+ */
54
+ export interface CreateOfferDTO {
55
+ seller_id: string;
56
+ created_by: string;
57
+ sku: string;
58
+ variant_id: string;
59
+ shipping_profile_id: string;
60
+ inventory_items: CreateOfferInventoryItemDTO[];
61
+ prices: CreateOfferPriceDTO[];
62
+ ean?: string | null;
63
+ upc?: string | null;
64
+ metadata?: Record<string, unknown> | null;
65
+ }
66
+ /**
67
+ * Persisted offer-row input — the projection that
68
+ * `createOffersWorkflow` hands to `createOffersStep` after seeding the
69
+ * `PriceSet`. `ean` / `upc` are snapshotted off the linked
70
+ * `ProductVariant`.
71
+ */
72
+ export interface CreateOfferRowDTO {
73
+ seller_id: string;
74
+ variant_id: string;
75
+ shipping_profile_id: string;
76
+ price_set_id: string;
77
+ sku: string;
78
+ ean: string | null;
79
+ upc: string | null;
80
+ created_by: string;
81
+ metadata?: Record<string, unknown> | null;
82
+ }
83
+ /**
84
+ * Input to `updateOffersWorkflow`. Each entry is keyed by `id`; setting the
85
+ * `prices` field rewrites the offer's `PriceSet` with replace semantics,
86
+ * omitting it leaves the price ladder untouched. Offer-row fields
87
+ * (`sku`, `shipping_profile_id`, `metadata`) are partial.
88
+ */
89
+ export interface UpdateOfferDTO {
90
+ id: string;
91
+ sku?: string;
92
+ shipping_profile_id?: string;
93
+ metadata?: Record<string, unknown> | null;
94
+ prices?: UpsertOfferPriceDTO[];
95
+ }
96
+ /**
97
+ * Input to `batchOfferInventoryItemsWorkflow`. Mirrors the shape Medusa's
98
+ * own inventory-batch endpoints use. Items in `update` and `delete` must
99
+ * already be linked to the offer; items in `create` must not.
100
+ */
101
+ export interface BatchOfferInventoryItemsDTO {
102
+ offer_id: string;
103
+ create?: Array<{
104
+ inventory_item_id: string;
105
+ required_quantity?: number;
106
+ }>;
107
+ update?: Array<{
108
+ inventory_item_id: string;
109
+ required_quantity: number;
110
+ }>;
111
+ delete?: string[];
112
+ }
113
+ //# sourceMappingURL=mutations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mutations.d.ts","sourceRoot":"","sources":["../../src/offer/mutations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,WAAW,EAAE,MAAM,CAAA;QACnB,gBAAgB,EAAE,MAAM,CAAA;KACzB,CAAC,CAAA;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D,EAAE,CA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B,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAA;QACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAC3B,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,iBAAiB,EAAE,MAAM,CAAA;QACzB,iBAAiB,EAAE,MAAM,CAAA;KAC1B,CAAC,CAAA;IACF,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /**
3
+ * Mutation contracts for the offer module + workflows. Shared between
4
+ * `packages/core/src/workflows/offer/{steps,workflows}` and the HTTP
5
+ * validators / route handlers that drive them. Mirrors the shape Medusa's
6
+ * own product/pricing workflows use so external consumers (block packages,
7
+ * the typed `@mercurjs/client`) can target the same DTOs.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1 @@
1
- {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/payout/provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,WAAW,qBAAqB;IACpC,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,qBAAqB,CAAA;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B;AAED,MAAM,WAAW,wBAAyB,SAAQ,mBAAmB;CACpE;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,mBAAmB,CAAA;CAC7B;AAED,M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