@mercurjs/types 2.2.0-canary.38 → 2.2.0-canary.40
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/modules.d.ts +2 -1
- package/dist/modules.d.ts.map +1 -1
- package/dist/modules.js +1 -0
- package/dist/offer/common.d.ts +9 -1
- package/dist/offer/common.d.ts.map +1 -1
- package/dist/search/common.d.ts +76 -0
- package/dist/search/common.d.ts.map +1 -0
- package/dist/search/common.js +2 -0
- package/dist/search/index.d.ts +2 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +17 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from "./commission";
|
|
|
5
5
|
export * as HttpTypes from "./http";
|
|
6
6
|
export * from "./payout";
|
|
7
7
|
export * from "./offer";
|
|
8
|
+
export * from "./search";
|
|
8
9
|
export { ProductStatus } from "./product/status";
|
|
9
10
|
export { AttributeType, ProductChangeStatus, ProductChangeActionType, type ProductDTO, type ProductVariantDTO, type ProductCategoryDTO, type ProductAttributeDTO, type ProductAttributeValueDTO, type WrappedProductAttributeDTO, type WrappedProductAttributeValueDTO, type ProductChangeDTO, type ProductChangeActionDTO, type CreateProductDTO, type CreateProductAttributeDTO, type UpdateProductAttributeDTO, type CreateProductAttributeValueDTO, type UpdateProductAttributeValueDTO, type UpsertProductAttributeValueDTO, type ProductAttributeBatchAdd, type ProductAttributeBatchUpdate, type ProductAttributeBatchInput, type CreateProductChangeDTO, type CreateProductChangeActionDTO, } from "./product";
|
|
10
11
|
export * from "./modules";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,UAAU,CAAA;AAGxB,cAAc,SAAS,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,UAAU,CAAA;AAGxB,cAAc,SAAS,CAAA;AAGvB,cAAc,UAAU,CAAA;AAaxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,0BAA0B,EAC/B,KAAK,+BAA+B,EACpC,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAC/B,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
|
@@ -50,6 +50,8 @@ exports.HttpTypes = __importStar(require("./http"));
|
|
|
50
50
|
__exportStar(require("./payout"), exports);
|
|
51
51
|
// Offer types
|
|
52
52
|
__exportStar(require("./offer"), exports);
|
|
53
|
+
// Search types
|
|
54
|
+
__exportStar(require("./search"), exports);
|
|
53
55
|
// Product types — explicit re-export overrides Medusa's product surface.
|
|
54
56
|
// Mercur's runtime enums and Mercur-extended DTOs (Omit + intersection over
|
|
55
57
|
// upstream) win over the wholesale `export * from "@medusajs/types"` above.
|
package/dist/modules.d.ts
CHANGED
package/dist/modules.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;
|
|
1
|
+
{"version":3,"file":"modules.d.ts","sourceRoot":"","sources":["../src/modules.ts"],"names":[],"mappings":"AAAA,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,iBAAiB,sBAAsB;IACvC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB"}
|
package/dist/modules.js
CHANGED
package/dist/offer/common.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InventoryItemDTO, MoneyAmountDTO, ShippingProfileDTO } from "@medusajs/types";
|
|
2
|
-
import { ProductVariantDTO } from "../product/common";
|
|
2
|
+
import { ProductDTO, ProductVariantDTO } from "../product/common";
|
|
3
3
|
import { SellerDTO } from "../seller/common";
|
|
4
4
|
/**
|
|
5
5
|
* One row on the offer's inventory-item link, resolved through the writable
|
|
@@ -47,6 +47,12 @@ export interface OfferDTO {
|
|
|
47
47
|
created_at: Date;
|
|
48
48
|
updated_at: Date;
|
|
49
49
|
deleted_at: Date | null;
|
|
50
|
+
/**
|
|
51
|
+
* Number of offers the seller has for this product, computed only when
|
|
52
|
+
* offers are grouped by seller (`group_by_seller`). One offer per variant,
|
|
53
|
+
* so this is effectively the variant count for the grouped row.
|
|
54
|
+
*/
|
|
55
|
+
variant_count?: number | null;
|
|
50
56
|
/**
|
|
51
57
|
* Joined through the writable `offer ↔ price` list-link defined in
|
|
52
58
|
* `packages/core/src/links/offer-price-link.ts`. Carries the offer's
|
|
@@ -62,6 +68,8 @@ export interface OfferDTO {
|
|
|
62
68
|
inventory_items?: OfferInventoryItemLinkDTO[];
|
|
63
69
|
/** The seller that owns this offer (joined through `offer ↔ seller`). */
|
|
64
70
|
seller?: SellerDTO;
|
|
71
|
+
/** The product this offer points at (joined through `offer ↔ product`). */
|
|
72
|
+
product?: ProductDTO;
|
|
65
73
|
/** The master variant this offer points at (joined through `offer ↔ variant`). */
|
|
66
74
|
product_variant?: ProductVariantDTO;
|
|
67
75
|
/** The offer's shipping profile (joined through `offer ↔ shipping_profile`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/offer/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EACnB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/offer/common.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EACnB,MAAM,iBAAiB,CAAA;AAExB,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C;;;;;;;GAO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|
+
type: "product" | "offer";
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
handle?: string;
|
|
8
|
+
thumbnail?: string;
|
|
9
|
+
seller_handle?: string;
|
|
10
|
+
collection_id?: string;
|
|
11
|
+
collection?: string;
|
|
12
|
+
category_ids?: string[];
|
|
13
|
+
categories?: string[];
|
|
14
|
+
product_id?: string;
|
|
15
|
+
variant_id?: string;
|
|
16
|
+
sku?: string;
|
|
17
|
+
attribute_tokens?: string[];
|
|
18
|
+
attributes?: SearchDocAttribute[];
|
|
19
|
+
prices?: Record<string, SearchDocPrice>;
|
|
20
|
+
calculated_price?: SearchDocPrice | null;
|
|
21
|
+
}
|
|
22
|
+
export interface SearchDocAttribute {
|
|
23
|
+
id: string;
|
|
24
|
+
handle: string;
|
|
25
|
+
name: string;
|
|
26
|
+
type: string;
|
|
27
|
+
values: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
32
|
+
export interface SearchDocPrice {
|
|
33
|
+
calculated_amount: number;
|
|
34
|
+
original_amount: number;
|
|
35
|
+
currency_code: string;
|
|
36
|
+
}
|
|
37
|
+
export interface SearchQueryBase {
|
|
38
|
+
q?: string;
|
|
39
|
+
limit?: number;
|
|
40
|
+
offset?: number;
|
|
41
|
+
context?: Record<string, unknown>;
|
|
42
|
+
filters?: Record<string, unknown>;
|
|
43
|
+
}
|
|
44
|
+
export interface SearchFacetValue {
|
|
45
|
+
id: string;
|
|
46
|
+
label: string;
|
|
47
|
+
count: number;
|
|
48
|
+
}
|
|
49
|
+
export interface SearchFacetAttribute {
|
|
50
|
+
handle: string;
|
|
51
|
+
label: string;
|
|
52
|
+
values: SearchFacetValue[];
|
|
53
|
+
}
|
|
54
|
+
export interface SearchFacets {
|
|
55
|
+
collections: SearchFacetValue[];
|
|
56
|
+
categories: SearchFacetValue[];
|
|
57
|
+
attributes: SearchFacetAttribute[];
|
|
58
|
+
}
|
|
59
|
+
export interface SearchResults {
|
|
60
|
+
hits: SearchDoc[];
|
|
61
|
+
count: number;
|
|
62
|
+
facets?: SearchFacets;
|
|
63
|
+
}
|
|
64
|
+
export interface SearchProvider<TQuery extends SearchQueryBase = SearchQueryBase> {
|
|
65
|
+
index(docs: SearchDoc[]): Promise<void>;
|
|
66
|
+
remove(ids: string[]): Promise<void>;
|
|
67
|
+
search(query: TQuery): Promise<SearchResults>;
|
|
68
|
+
}
|
|
69
|
+
export interface SearchModuleOptions {
|
|
70
|
+
provider?: {
|
|
71
|
+
resolve: string | ModuleProviderExports;
|
|
72
|
+
id: string;
|
|
73
|
+
options?: Record<string, unknown>;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/search/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IAGZ,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,UAAU,CAAC,EAAE,kBAAk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AAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,YAAY,CAAA;CACtB;AAED,MAAM,WAAW,cAAc,CAC7B,MAAM,SAAS,eAAe,GAAG,eAAe;IAEhD,KAAK,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACvC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACpC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAAA;QACvC,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAClC,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/search/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mercurjs/types",
|
|
3
|
-
"version": "2.2.0-canary.
|
|
3
|
+
"version": "2.2.0-canary.40",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/mercurjs/mercur",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dev": "tsc --watch"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@medusajs/types": "
|
|
39
|
+
"@medusajs/types": "2.17.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "5.9.3"
|