@bosonprotocol/core-sdk 1.46.1 → 1.47.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core-sdk.d.ts +2 -1
- package/dist/cjs/core-sdk.d.ts.map +1 -1
- package/dist/cjs/core-sdk.js +3 -1
- package/dist/cjs/core-sdk.js.map +1 -1
- package/dist/cjs/search/index.d.ts +2 -0
- package/dist/cjs/search/index.d.ts.map +1 -0
- package/dist/cjs/search/index.js +38 -0
- package/dist/cjs/search/index.js.map +1 -0
- package/dist/cjs/search/mixin.d.ts +21 -0
- package/dist/cjs/search/mixin.d.ts.map +1 -0
- package/dist/cjs/search/mixin.js +68 -0
- package/dist/cjs/search/mixin.js.map +1 -0
- package/dist/cjs/search/subgraph.d.ts +3 -0
- package/dist/cjs/search/subgraph.d.ts.map +1 -0
- package/dist/cjs/search/subgraph.js +21 -0
- package/dist/cjs/search/subgraph.js.map +1 -0
- package/dist/cjs/subgraph.d.ts +145 -0
- package/dist/cjs/subgraph.d.ts.map +1 -1
- package/dist/cjs/subgraph.js +80 -2
- package/dist/cjs/subgraph.js.map +1 -1
- package/dist/cjs/utils/graphql.d.ts +1 -0
- package/dist/cjs/utils/graphql.d.ts.map +1 -1
- package/dist/esm/core-sdk.d.ts +2 -1
- package/dist/esm/core-sdk.d.ts.map +1 -1
- package/dist/esm/core-sdk.js +3 -1
- package/dist/esm/core-sdk.js.map +1 -1
- package/dist/esm/search/index.d.ts +2 -0
- package/dist/esm/search/index.d.ts.map +1 -0
- package/dist/esm/search/index.js +2 -0
- package/dist/esm/search/index.js.map +1 -0
- package/dist/esm/search/mixin.d.ts +21 -0
- package/dist/esm/search/mixin.d.ts.map +1 -0
- package/dist/esm/search/mixin.js +61 -0
- package/dist/esm/search/mixin.js.map +1 -0
- package/dist/esm/search/subgraph.d.ts +3 -0
- package/dist/esm/search/subgraph.d.ts.map +1 -0
- package/dist/esm/search/subgraph.js +9 -0
- package/dist/esm/search/subgraph.js.map +1 -0
- package/dist/esm/subgraph.d.ts +145 -0
- package/dist/esm/subgraph.d.ts.map +1 -1
- package/dist/esm/subgraph.js +78 -0
- package/dist/esm/subgraph.js.map +1 -1
- package/dist/esm/utils/graphql.d.ts +1 -0
- package/dist/esm/utils/graphql.d.ts.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/core-sdk.ts +5 -2
- package/src/search/index.ts +1 -0
- package/src/search/mixin.ts +69 -0
- package/src/search/queries.graphql +64 -0
- package/src/search/subgraph.ts +17 -0
- package/src/subgraph.ts +225 -0
package/dist/cjs/core-sdk.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { ErrorMixin } from "./errors/mixin";
|
|
|
22
22
|
import { SubgraphMixin } from "./subgraph/mixin";
|
|
23
23
|
import { PriceDiscoveryMixin } from "./price-discovery/mixin";
|
|
24
24
|
import { MarketplaceMixin } from "./marketplaces/mixin";
|
|
25
|
+
import { SearchMixin } from "./search/mixin";
|
|
25
26
|
export declare class CoreSDK<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
|
|
26
27
|
/**
|
|
27
28
|
* Creates an instance of `CoreSDK` by using default values derived either from
|
|
@@ -60,6 +61,6 @@ export declare class CoreSDK<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
|
|
|
60
61
|
metaTransactionMethod?: string;
|
|
61
62
|
}): boolean;
|
|
62
63
|
}
|
|
63
|
-
export interface CoreSDK<T extends Web3LibAdapter = Web3LibAdapter> extends MetadataMixin<T>, AccountsMixin<T>, OfferMixin<T>, FundsMixin<T>, ExchangesMixin<T>, DisputesMixin<T>, MetaTxMixin<T>, NativeMetaTxMixin<T>, GroupsMixin<T>, OrchestrationMixin<T>, EventLogsMixin<T>, VoucherMixin<T>, ERC20Mixin<T>, ERC721Mixin<T>, ERC1155Mixin<T>, ERC165Mixin<T>, ProtocolConfigMixin<T>, ErrorMixin<T>, SubgraphMixin<T>, PriceDiscoveryMixin<T>, MarketplaceMixin<T> {
|
|
64
|
+
export interface CoreSDK<T extends Web3LibAdapter = Web3LibAdapter> extends MetadataMixin<T>, AccountsMixin<T>, OfferMixin<T>, FundsMixin<T>, ExchangesMixin<T>, DisputesMixin<T>, MetaTxMixin<T>, NativeMetaTxMixin<T>, GroupsMixin<T>, OrchestrationMixin<T>, EventLogsMixin<T>, VoucherMixin<T>, ERC20Mixin<T>, ERC721Mixin<T>, ERC1155Mixin<T>, ERC165Mixin<T>, ProtocolConfigMixin<T>, ErrorMixin<T>, SubgraphMixin<T>, PriceDiscoveryMixin<T>, MarketplaceMixin<T>, SearchMixin<T> {
|
|
64
65
|
}
|
|
65
66
|
//# sourceMappingURL=core-sdk.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-sdk.d.ts","sourceRoot":"","sources":["../../src/core-sdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAe,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EACL,cAAc,EAEd,QAAQ,EACR,eAAe,EACf,YAAY,EACb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cA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IAAW,WAAW,WAErB;IAED,IAAW,YAAY,0BAEtB;IAED,IAAW,iBAAiB,YAE3B;IAED,IAAW,gBAAgB,IACQ,CAC/B,MAAM,CAAC,EAAE,MAAM,EACf,SAAS,CAAC,EAAE,OAAO,KAChB,MAAM,CACZ;IAED,IAAW,OAAO,MAEjB;IAED,IAAW,IAAI,WAEd;IAEM,oBAAoB,CACzB,IAAI,GAAE;QACJ,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;KAC3B;CAgBT;AAID,MAAM,WAAW,OAAO,CAAC,CAAC,SAAS,cAAc,GAAG,cAAc,CAChE,SAAQ,aAAa,CAAC,CAAC,CAAC,EACtB,aAAa,CAAC,CAAC,CAAC,EAChB,UAAU,CAAC,CAAC,CAAC,EACb,UAAU,CAAC,CAAC,CAAC,EACb,cAAc,CAAC,CAAC,CAAC,EACjB,aAAa,CAAC,CAAC,CAAC,EAChB,WAAW,CAAC,CAAC,CAAC,EACd,iBAAiB,CAAC,CAAC,CAAC,EACpB,WAAW,CAAC,CAAC,CAAC,EACd,kBAAkB,CAAC,CAAC,CAAC,EACrB,cAAc,CAAC,CAAC,CAAC,EACjB,YAAY,CAAC,CAAC,CAAC,EACf,UAAU,CAAC,CAAC,CAAC,EACb,WAAW,CAAC,CAAC,CAAC,EACd,YAAY,CAAC,CAAC,CAAC,EACf,WAAW,CAAC,CAAC,CAAC,EACd,mBAAmB,CAAC,CAAC,CAAC,EACtB,UAAU,CAAC,CAAC,CAAC,EACb,aAAa,CAAC,CAAC,CAAC,EAChB,mBAAmB,CAAC,CAAC,CAAC,EACtB,gBAAgB,CAAC,CAAC,CAAC,EACnB,WAAW,CAAC,CAAC,CAAC;CAAG"}
|
package/dist/cjs/core-sdk.js
CHANGED
|
@@ -24,6 +24,7 @@ const mixin_18 = require("./errors/mixin");
|
|
|
24
24
|
const mixin_19 = require("./subgraph/mixin");
|
|
25
25
|
const mixin_20 = require("./price-discovery/mixin");
|
|
26
26
|
const mixin_21 = require("./marketplaces/mixin");
|
|
27
|
+
const mixin_22 = require("./search/mixin");
|
|
27
28
|
class CoreSDK extends base_core_sdk_1.BaseCoreSDK {
|
|
28
29
|
/**
|
|
29
30
|
* Creates an instance of `CoreSDK` by using default values derived either from
|
|
@@ -112,6 +113,7 @@ exports.CoreSDK = CoreSDK;
|
|
|
112
113
|
mixin_18.ErrorMixin,
|
|
113
114
|
mixin_19.SubgraphMixin,
|
|
114
115
|
mixin_20.PriceDiscoveryMixin,
|
|
115
|
-
mixin_21.MarketplaceMixin
|
|
116
|
+
mixin_21.MarketplaceMixin,
|
|
117
|
+
mixin_22.SearchMixin
|
|
116
118
|
]);
|
|
117
119
|
//# sourceMappingURL=core-sdk.js.map
|
package/dist/cjs/core-sdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-sdk.js","sourceRoot":"","sources":["../../src/core-sdk.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,0CAA6C;AAC7C,kDAA2D;AAC3D,2CAA8C;AAC9C,4CAAiD;AACjD,0DAAkE;AAClE,kDAM+B;AAG/B,4CAAiD;AACjD,4CAAiD;AACjD,0CAA4C;AAC5C,yCAA2C;AAC3C,8CAAmD;AACnD,+CAAoD;AACpD,4CAA+C;AAC/C,0CAA2C;AAC3C,2CAA6C;AAC7C,4CAA+C;AAC/C,2CAA6C;AAC7C,oDAA8D;AAC9D,2CAA4C;AAC5C,6CAAiD;AACjD,oDAA8D;AAC9D,iDAAwD;
|
|
1
|
+
{"version":3,"file":"core-sdk.js","sourceRoot":"","sources":["../../src/core-sdk.ts"],"names":[],"mappings":";;;AAAA,iDAA2D;AAC3D,0CAA6C;AAC7C,kDAA2D;AAC3D,2CAA8C;AAC9C,4CAAiD;AACjD,0DAAkE;AAClE,kDAM+B;AAG/B,4CAAiD;AACjD,4CAAiD;AACjD,0CAA4C;AAC5C,yCAA2C;AAC3C,8CAAmD;AACnD,+CAAoD;AAC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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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.subgraph = void 0;
|
|
37
|
+
exports.subgraph = __importStar(require("./subgraph"));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/search/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAuC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Web3LibAdapter } from "@bosonprotocol/common";
|
|
2
|
+
import { BaseCoreSDK } from "../mixins/base-core-sdk";
|
|
3
|
+
import * as subgraph from "../subgraph";
|
|
4
|
+
export declare class SearchMixin<T extends Web3LibAdapter> extends BaseCoreSDK<T> {
|
|
5
|
+
/**
|
|
6
|
+
* Search for products matching the given keywords.
|
|
7
|
+
*
|
|
8
|
+
* By default, only products that are currently valid (based on their validity dates) are returned.
|
|
9
|
+
* This behavior can be controlled via the `includeInvalidOffers` option in the queryVars parameter.
|
|
10
|
+
*
|
|
11
|
+
* @param keywords - List of keywords to match against product title, description, and tags.
|
|
12
|
+
* @param queryVars - Optional query variables including pagination (productsSkip, productsFirst),
|
|
13
|
+
* ordering (productsOrderBy, productsOrderDirection), filtering (productsFilter),
|
|
14
|
+
* and includeInvalidOffers flag to control validity filtering.
|
|
15
|
+
* @returns A promise that resolves to an array of product search result fragments.
|
|
16
|
+
*/
|
|
17
|
+
searchProducts(keywords: string[], queryVars?: subgraph.SearchProductsQueryQueryVariables & {
|
|
18
|
+
includeInvalidOffers?: boolean;
|
|
19
|
+
}): Promise<subgraph.ProductSearchResultFieldsFragment[]>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=mixin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.d.ts","sourceRoot":"","sources":["../../../src/search/mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AAExC,qBAAa,WAAW,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACvE;;;;;;;;;;;OAWG;IACU,cAAc,CACzB,QAAQ,EAAE,MAAM,EAAE,EAClB,SAAS,CAAC,EAAE,QAAQ,CAAC,iCAAiC,GAAG;QACvD,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,GACA,OAAO,CAAC,QAAQ,CAAC,iCAAiC,EAAE,CAAC;CA6CzD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchMixin = void 0;
|
|
13
|
+
const base_core_sdk_1 = require("../mixins/base-core-sdk");
|
|
14
|
+
const subgraph_1 = require("./subgraph");
|
|
15
|
+
class SearchMixin extends base_core_sdk_1.BaseCoreSDK {
|
|
16
|
+
/**
|
|
17
|
+
* Search for products matching the given keywords.
|
|
18
|
+
*
|
|
19
|
+
* By default, only products that are currently valid (based on their validity dates) are returned.
|
|
20
|
+
* This behavior can be controlled via the `includeInvalidOffers` option in the queryVars parameter.
|
|
21
|
+
*
|
|
22
|
+
* @param keywords - List of keywords to match against product title, description, and tags.
|
|
23
|
+
* @param queryVars - Optional query variables including pagination (productsSkip, productsFirst),
|
|
24
|
+
* ordering (productsOrderBy, productsOrderDirection), filtering (productsFilter),
|
|
25
|
+
* and includeInvalidOffers flag to control validity filtering.
|
|
26
|
+
* @returns A promise that resolves to an array of product search result fragments.
|
|
27
|
+
*/
|
|
28
|
+
searchProducts(keywords, queryVars) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
if (!keywords || keywords.length === 0) {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
const now = Math.floor(Date.now() / 1000);
|
|
34
|
+
const validOffersFilter = {
|
|
35
|
+
allVariantsVoided_not: true,
|
|
36
|
+
minValidFromDate_lte: now + 60 + "", // Add 1 minute to ensure we include offers not valid yet, but valid in a very little time
|
|
37
|
+
maxValidUntilDate_gte: now + ""
|
|
38
|
+
};
|
|
39
|
+
const productsSearchFilter = {
|
|
40
|
+
or: keywords
|
|
41
|
+
.map((keyword) => [
|
|
42
|
+
{ title_contains_nocase: keyword },
|
|
43
|
+
{ description_contains_nocase: keyword },
|
|
44
|
+
{ details_tags_contains_nocase: [keyword] }
|
|
45
|
+
])
|
|
46
|
+
.flat()
|
|
47
|
+
};
|
|
48
|
+
const productsFilter = (queryVars === null || queryVars === void 0 ? void 0 : queryVars.includeInvalidOffers)
|
|
49
|
+
? (queryVars === null || queryVars === void 0 ? void 0 : queryVars.productsFilter)
|
|
50
|
+
? {
|
|
51
|
+
and: [
|
|
52
|
+
Object.assign({}, queryVars.productsFilter),
|
|
53
|
+
productsSearchFilter
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
: productsSearchFilter
|
|
57
|
+
: {
|
|
58
|
+
and: [
|
|
59
|
+
Object.assign(Object.assign({}, validOffersFilter), queryVars === null || queryVars === void 0 ? void 0 : queryVars.productsFilter),
|
|
60
|
+
productsSearchFilter
|
|
61
|
+
]
|
|
62
|
+
};
|
|
63
|
+
return (0, subgraph_1.searchProducts)(this._subgraphUrl, Object.assign(Object.assign({}, queryVars), { productsFilter }));
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.SearchMixin = SearchMixin;
|
|
68
|
+
//# sourceMappingURL=mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixin.js","sourceRoot":"","sources":["../../../src/search/mixin.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2DAAsD;AACtD,yCAA4C;AAG5C,MAAa,WAAsC,SAAQ,2BAAc;IACvE;;;;;;;;;;;OAWG;IACU,cAAc,CACzB,QAAkB,EAClB,SAEC;;YAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACvC,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;YAC1C,MAAM,iBAAiB,GAAqC;gBAC1D,qBAAqB,EAAE,IAAI;gBAC3B,oBAAoB,EAAE,GAAG,GAAG,EAAE,GAAG,EAAE,EAAE,0FAA0F;gBAC/H,qBAAqB,EAAE,GAAG,GAAG,EAAE;aAChC,CAAC;YACF,MAAM,oBAAoB,GAAqC;gBAC7D,EAAE,EAAE,QAAQ;qBACT,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;oBAChB,EAAE,qBAAqB,EAAE,OAAO,EAAE;oBAClC,EAAE,2BAA2B,EAAE,OAAO,EAAE;oBACxC,EAAE,4BAA4B,EAAE,CAAC,OAAO,CAAC,EAAE;iBAC5C,CAAC;qBACD,IAAI,EAAE;aACV,CAAC;YACF,MAAM,cAAc,GAClB,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,oBAAoB;gBAC7B,CAAC,CAAC,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,cAAc;oBACzB,CAAC,CAAC;wBACE,GAAG,EAAE;8CAEE,SAAS,CAAC,cAAc;4BAE7B,oBAAoB;yBACrB;qBACF;oBACH,CAAC,CAAC,oBAAoB;gBACxB,CAAC,CAAC;oBACE,GAAG,EAAE;wDAEE,iBAAiB,GACjB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,cAAc;wBAE9B,oBAAoB;qBACrB;iBACF,CAAC;YACR,OAAO,IAAA,yBAAc,EAAC,IAAI,CAAC,YAAY,kCAClC,SAAS,KACZ,cAAc,IACd,CAAC;QACL,CAAC;KAAA;CACF;AA/DD,kCA+DC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { SearchProductsQueryQuery, SearchProductsQueryQueryVariables } from "../subgraph";
|
|
2
|
+
export declare function searchProducts(subgraphUrl: string, queryVars?: SearchProductsQueryQueryVariables): Promise<SearchProductsQueryQuery["productV1Products"]>;
|
|
3
|
+
//# sourceMappingURL=subgraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph.d.ts","sourceRoot":"","sources":["../../../src/search/subgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAGrB,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,SAAS,GAAE,iCAAsC,GAChD,OAAO,CAAC,wBAAwB,CAAC,mBAAmB,CAAC,CAAC,CAOxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.searchProducts = searchProducts;
|
|
13
|
+
const graphql_1 = require("../utils/graphql");
|
|
14
|
+
function searchProducts(subgraphUrl_1) {
|
|
15
|
+
return __awaiter(this, arguments, void 0, function* (subgraphUrl, queryVars = {}) {
|
|
16
|
+
const subgraphSdk = (0, graphql_1.getSubgraphSdk)(subgraphUrl);
|
|
17
|
+
const { productV1Products = [] } = yield subgraphSdk.searchProductsQuery(Object.assign({}, queryVars));
|
|
18
|
+
return productV1Products;
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=subgraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraph.js","sourceRoot":"","sources":["../../../src/search/subgraph.ts"],"names":[],"mappings":";;;;;;;;;;;AAMA,wCAUC;AAZD,8CAAkD;AAElD,SAAsB,cAAc;yDAClC,WAAmB,EACnB,YAA+C,EAAE;QAEjD,MAAM,WAAW,GAAG,IAAA,wBAAc,EAAC,WAAW,CAAC,CAAC;QAChD,MAAM,EAAE,iBAAiB,GAAG,EAAE,EAAE,GAAG,MAAM,WAAW,CAAC,mBAAmB,mBACnE,SAAS,EACZ,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CAAA"}
|
package/dist/cjs/subgraph.d.ts
CHANGED
|
@@ -74851,6 +74851,148 @@ export type BaseRangeFieldsFragment = {
|
|
|
74851
74851
|
owner: string;
|
|
74852
74852
|
minted: string;
|
|
74853
74853
|
};
|
|
74854
|
+
export type ProductSearchResultFieldsFragment = {
|
|
74855
|
+
__typename?: "ProductV1Product";
|
|
74856
|
+
id: string;
|
|
74857
|
+
uuid: string;
|
|
74858
|
+
version: number;
|
|
74859
|
+
title: string;
|
|
74860
|
+
description: string;
|
|
74861
|
+
productionInformation_brandName: string;
|
|
74862
|
+
details_category?: string | null;
|
|
74863
|
+
details_subCategory?: string | null;
|
|
74864
|
+
details_subCategory2?: string | null;
|
|
74865
|
+
details_offerCategory: string;
|
|
74866
|
+
details_tags?: Array<string> | null;
|
|
74867
|
+
brand: {
|
|
74868
|
+
__typename?: "ProductV1Brand";
|
|
74869
|
+
id: string;
|
|
74870
|
+
name: string;
|
|
74871
|
+
};
|
|
74872
|
+
visuals_images: Array<{
|
|
74873
|
+
__typename?: "ProductV1Media";
|
|
74874
|
+
id: string;
|
|
74875
|
+
url: string;
|
|
74876
|
+
tag?: string | null;
|
|
74877
|
+
type: ProductV1MediaType;
|
|
74878
|
+
width?: number | null;
|
|
74879
|
+
height?: number | null;
|
|
74880
|
+
}>;
|
|
74881
|
+
visuals_videos?: Array<{
|
|
74882
|
+
__typename?: "ProductV1Media";
|
|
74883
|
+
id: string;
|
|
74884
|
+
url: string;
|
|
74885
|
+
tag?: string | null;
|
|
74886
|
+
type: ProductV1MediaType;
|
|
74887
|
+
width?: number | null;
|
|
74888
|
+
height?: number | null;
|
|
74889
|
+
}> | null;
|
|
74890
|
+
productV1Seller?: {
|
|
74891
|
+
__typename?: "ProductV1Seller";
|
|
74892
|
+
sellerId?: string | null;
|
|
74893
|
+
name?: string | null;
|
|
74894
|
+
description?: string | null;
|
|
74895
|
+
} | null;
|
|
74896
|
+
notVoidedVariants?: Array<{
|
|
74897
|
+
__typename?: "ProductV1Variant";
|
|
74898
|
+
offer: {
|
|
74899
|
+
__typename?: "Offer";
|
|
74900
|
+
id: string;
|
|
74901
|
+
price: string;
|
|
74902
|
+
priceType: number;
|
|
74903
|
+
quantityAvailable: string;
|
|
74904
|
+
validUntilDate: string;
|
|
74905
|
+
protocolFee: string;
|
|
74906
|
+
exchangeToken: {
|
|
74907
|
+
__typename?: "ExchangeToken";
|
|
74908
|
+
name: string;
|
|
74909
|
+
address: string;
|
|
74910
|
+
decimals: string;
|
|
74911
|
+
};
|
|
74912
|
+
};
|
|
74913
|
+
variations?: Array<{
|
|
74914
|
+
__typename?: "ProductV1Variation";
|
|
74915
|
+
type: string;
|
|
74916
|
+
option: string;
|
|
74917
|
+
}> | null;
|
|
74918
|
+
}> | null;
|
|
74919
|
+
};
|
|
74920
|
+
export type SearchProductsQueryQueryVariables = Exact<{
|
|
74921
|
+
productsSkip?: InputMaybe<Scalars["Int"]["input"]>;
|
|
74922
|
+
productsFirst?: InputMaybe<Scalars["Int"]["input"]>;
|
|
74923
|
+
productsOrderBy?: InputMaybe<ProductV1Product_OrderBy>;
|
|
74924
|
+
productsOrderDirection?: InputMaybe<OrderDirection>;
|
|
74925
|
+
productsFilter?: InputMaybe<ProductV1Product_Filter>;
|
|
74926
|
+
}>;
|
|
74927
|
+
export type SearchProductsQueryQuery = {
|
|
74928
|
+
__typename?: "Query";
|
|
74929
|
+
productV1Products: Array<{
|
|
74930
|
+
__typename?: "ProductV1Product";
|
|
74931
|
+
id: string;
|
|
74932
|
+
uuid: string;
|
|
74933
|
+
version: number;
|
|
74934
|
+
title: string;
|
|
74935
|
+
description: string;
|
|
74936
|
+
productionInformation_brandName: string;
|
|
74937
|
+
details_category?: string | null;
|
|
74938
|
+
details_subCategory?: string | null;
|
|
74939
|
+
details_subCategory2?: string | null;
|
|
74940
|
+
details_offerCategory: string;
|
|
74941
|
+
details_tags?: Array<string> | null;
|
|
74942
|
+
brand: {
|
|
74943
|
+
__typename?: "ProductV1Brand";
|
|
74944
|
+
id: string;
|
|
74945
|
+
name: string;
|
|
74946
|
+
};
|
|
74947
|
+
visuals_images: Array<{
|
|
74948
|
+
__typename?: "ProductV1Media";
|
|
74949
|
+
id: string;
|
|
74950
|
+
url: string;
|
|
74951
|
+
tag?: string | null;
|
|
74952
|
+
type: ProductV1MediaType;
|
|
74953
|
+
width?: number | null;
|
|
74954
|
+
height?: number | null;
|
|
74955
|
+
}>;
|
|
74956
|
+
visuals_videos?: Array<{
|
|
74957
|
+
__typename?: "ProductV1Media";
|
|
74958
|
+
id: string;
|
|
74959
|
+
url: string;
|
|
74960
|
+
tag?: string | null;
|
|
74961
|
+
type: ProductV1MediaType;
|
|
74962
|
+
width?: number | null;
|
|
74963
|
+
height?: number | null;
|
|
74964
|
+
}> | null;
|
|
74965
|
+
productV1Seller?: {
|
|
74966
|
+
__typename?: "ProductV1Seller";
|
|
74967
|
+
sellerId?: string | null;
|
|
74968
|
+
name?: string | null;
|
|
74969
|
+
description?: string | null;
|
|
74970
|
+
} | null;
|
|
74971
|
+
notVoidedVariants?: Array<{
|
|
74972
|
+
__typename?: "ProductV1Variant";
|
|
74973
|
+
offer: {
|
|
74974
|
+
__typename?: "Offer";
|
|
74975
|
+
id: string;
|
|
74976
|
+
price: string;
|
|
74977
|
+
priceType: number;
|
|
74978
|
+
quantityAvailable: string;
|
|
74979
|
+
validUntilDate: string;
|
|
74980
|
+
protocolFee: string;
|
|
74981
|
+
exchangeToken: {
|
|
74982
|
+
__typename?: "ExchangeToken";
|
|
74983
|
+
name: string;
|
|
74984
|
+
address: string;
|
|
74985
|
+
decimals: string;
|
|
74986
|
+
};
|
|
74987
|
+
};
|
|
74988
|
+
variations?: Array<{
|
|
74989
|
+
__typename?: "ProductV1Variation";
|
|
74990
|
+
type: string;
|
|
74991
|
+
option: string;
|
|
74992
|
+
}> | null;
|
|
74993
|
+
}> | null;
|
|
74994
|
+
}>;
|
|
74995
|
+
};
|
|
74854
74996
|
export declare const BaseOfferCollectionFieldsFragmentDoc: string;
|
|
74855
74997
|
export declare const SellerMetadataMediaFieldsFragmentDoc: string;
|
|
74856
74998
|
export declare const SellerContactLinkFieldsFragmentDoc: string;
|
|
@@ -74906,6 +75048,7 @@ export declare const ProductV1MetadataEntityFieldsFragmentDoc: string;
|
|
|
74906
75048
|
export declare const BaseProductV1ProductWithVariantsFieldsFragmentDoc: string;
|
|
74907
75049
|
export declare const BaseProductV1ProductWithNotVoidedVariantsFieldsFragmentDoc: string;
|
|
74908
75050
|
export declare const OfferFieldsFragmentDoc: string;
|
|
75051
|
+
export declare const ProductSearchResultFieldsFragmentDoc: string;
|
|
74909
75052
|
export declare const GetSellerByIdQueryDocument: string;
|
|
74910
75053
|
export declare const GetSellersQueryDocument: string;
|
|
74911
75054
|
export declare const GetBuyerByIdQueryDocument: string;
|
|
@@ -74939,6 +75082,7 @@ export declare const GetProductV1MetadataEntitiesQueryDocument: string;
|
|
|
74939
75082
|
export declare const GetOfferByIdQueryDocument: string;
|
|
74940
75083
|
export declare const GetOffersQueryDocument: string;
|
|
74941
75084
|
export declare const GetOffersMediaQueryDocument: string;
|
|
75085
|
+
export declare const SearchProductsQueryDocument: string;
|
|
74942
75086
|
export type SdkFunctionWrapper = <T>(action: (requestHeaders?: Record<string, string>) => Promise<T>, operationName: string, operationType?: string, variables?: any) => Promise<T>;
|
|
74943
75087
|
export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionWrapper): {
|
|
74944
75088
|
getSellerByIdQuery(variables: GetSellerByIdQueryQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetSellerByIdQueryQuery>;
|
|
@@ -74974,6 +75118,7 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
|
|
|
74974
75118
|
getOfferByIdQuery(variables: GetOfferByIdQueryQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetOfferByIdQueryQuery>;
|
|
74975
75119
|
getOffersQuery(variables?: GetOffersQueryQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetOffersQueryQuery>;
|
|
74976
75120
|
getOffersMediaQuery(variables?: GetOffersMediaQueryQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<GetOffersMediaQueryQuery>;
|
|
75121
|
+
searchProductsQuery(variables?: SearchProductsQueryQueryVariables, requestHeaders?: GraphQLClientRequestHeaders, signal?: RequestInit["signal"]): Promise<SearchProductsQueryQuery>;
|
|
74977
75122
|
};
|
|
74978
75123
|
export type Sdk = ReturnType<typeof getSdk>;
|
|
74979
75124
|
export {};
|