@etohq/search-legacy 0.0.0-stage → 2.0.5
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/LICENSE +21 -0
- package/README.md +38 -2
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/loaders/providers.d.ts +18 -0
- package/dist/loaders/providers.d.ts.map +1 -0
- package/dist/loaders/providers.js +46 -0
- package/dist/loaders/providers.js.map +1 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +9 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/search-module-service.d.ts +20 -0
- package/dist/services/search-module-service.d.ts.map +1 -0
- package/dist/services/search-module-service.js +20 -0
- package/dist/services/search-module-service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +62 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Etohq
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,39 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @etohq/search-legacy
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
eto's pre-port search contract, kept as it was so its users keep working while
|
|
4
|
+
they move onto the new Search Module (`@etohq/search`, ported from Medusa).
|
|
5
|
+
Nothing inside changed; only names, paths and the module key did.
|
|
6
|
+
|
|
7
|
+
New work should use `@etohq/search`. Don't add features here.
|
|
8
|
+
|
|
9
|
+
## Renames
|
|
10
|
+
|
|
11
|
+
| Before | After |
|
|
12
|
+
|---|---|
|
|
13
|
+
| package `@etohq/search` | `@etohq/search-legacy` |
|
|
14
|
+
| `Modules.SEARCH` (`"search"`) | `Modules.SEARCH_LEGACY` (`"search_legacy"`) |
|
|
15
|
+
| `AbstractSearchService` | `AbstractLegacySearchService` |
|
|
16
|
+
| `SearchIndexGroup`, `SearchIndexDocument` | `LegacySearchIndexGroup`, `LegacySearchIndexDocument` |
|
|
17
|
+
| `SearchQuery`, `SearchResult`, `SearchHit`, `SearchFacet` | `LegacySearchQuery`, `LegacySearchResult`, `LegacySearchHit`, `LegacySearchFacet` |
|
|
18
|
+
| `SearchValue`, `SearchOperators`, `SearchCondition`, `SearchSort`, `SearchRanking` | `LegacySearchValue`, `LegacySearchOperators`, `LegacySearchCondition`, `LegacySearchSort`, `LegacySearchRanking` |
|
|
19
|
+
| `SearchUtils` (utils bundle) | `SearchLegacyUtils` |
|
|
20
|
+
| `ISearchService`, `IndexSettings` (types) | `ILegacySearchService`, `LegacyIndexSettings` |
|
|
21
|
+
| `SearchTypes` (types bundle) | `SearchLegacyTypes` |
|
|
22
|
+
| `@etohq/types/search`, `/search/interface`, `/search/settings` | `@etohq/types/search-legacy`, `/search-legacy/interface`, `/search-legacy/settings` |
|
|
23
|
+
|
|
24
|
+
`indexTypes`, `variantKeys` and `defaultSearchIndexingProductRelations` keep their
|
|
25
|
+
names. `Modules.SEARCH` now belongs to the new module.
|
|
26
|
+
|
|
27
|
+
The Trieve provider (`@etohq/search-trieve`) registers against
|
|
28
|
+
`Modules.SEARCH_LEGACY`. Register both under the legacy key:
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
modules: {
|
|
32
|
+
[Modules.SEARCH_LEGACY]: {
|
|
33
|
+
resolve: "@etohq/search-legacy",
|
|
34
|
+
options: {
|
|
35
|
+
providers: [{ resolve: "@etohq/search-trieve", id: "trieve", options: { ... } }],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SearchModuleService } from "./services";
|
|
2
|
+
declare const _default: import("@etohq/types").ModuleExports<typeof SearchModuleService> & {
|
|
3
|
+
linkable: Record<string, any>;
|
|
4
|
+
sqlObjects: {
|
|
5
|
+
functions: import("@etohq/types").DmlFunction[];
|
|
6
|
+
triggers: import("@etohq/types").DmlTrigger[];
|
|
7
|
+
views: import("@etohq/types").DmlView[];
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
11
|
+
export * from "./types";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;;;;;;;;;AAEhD,wBAGE;AAEF,cAAc,SAAS,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
21
|
+
const providers_1 = __importDefault(require("./loaders/providers"));
|
|
22
|
+
const services_1 = require("./services");
|
|
23
|
+
exports.default = (0, utils_1.Module)(utils_1.Modules.SEARCH_LEGACY, {
|
|
24
|
+
service: services_1.SearchModuleService,
|
|
25
|
+
loaders: [providers_1.default],
|
|
26
|
+
});
|
|
27
|
+
__exportStar(require("./types"), exports);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,kDAAwD;AAExD,oEAA+C;AAC/C,yCAAgD;AAEhD,kBAAe,IAAA,cAAM,EAAC,eAAO,CAAC,aAAa,EAAE;IAC3C,OAAO,EAAE,8BAAmB;IAC5B,OAAO,EAAE,CAAC,mBAAa,CAAC;CACzB,CAAC,CAAA;AAEF,0CAAuB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LoaderOptions } from "@etohq/framework/types";
|
|
2
|
+
import type { SearchModuleOptions } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the configured search providers and registers the active one.
|
|
5
|
+
*
|
|
6
|
+
* Search is its own module (not the entity index): providers are retrieval
|
|
7
|
+
* engines, and the module owns their registration the way the notification
|
|
8
|
+
* module owns notification providers.
|
|
9
|
+
*/
|
|
10
|
+
/** Prefix for each provider's container registration. */
|
|
11
|
+
export declare const SearchProviderPrefix = "search_provider_";
|
|
12
|
+
/** Container key holding the ids of the loaded providers. */
|
|
13
|
+
export declare const SearchProviderIdentifiers = "searchProviderIds";
|
|
14
|
+
/** Container key the module service reads for the active provider. */
|
|
15
|
+
export declare const SearchServiceRegistrationName = "searchService";
|
|
16
|
+
declare const _default: ({ container, options, }: LoaderOptions<SearchModuleOptions>) => Promise<void>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/loaders/providers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAI3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD;;;;;;GAMG;AAEH,yDAAyD;AACzD,eAAO,MAAM,oBAAoB,qBAAqB,CAAA;AAEtD,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB,sBAAsB,CAAA;AAE5D,sEAAsE;AACtE,eAAO,MAAM,6BAA6B,kBAAkB,CAAA;yBAOtC,yBAGnB,aAAa,CAAC,mBAAmB,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC;AAHrD,wBA+CC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchServiceRegistrationName = exports.SearchProviderIdentifiers = exports.SearchProviderPrefix = void 0;
|
|
4
|
+
const modules_sdk_1 = require("@etohq/framework/modules-sdk");
|
|
5
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
6
|
+
const awilix_1 = require("awilix");
|
|
7
|
+
/**
|
|
8
|
+
* Loads the configured search providers and registers the active one.
|
|
9
|
+
*
|
|
10
|
+
* Search is its own module (not the entity index): providers are retrieval
|
|
11
|
+
* engines, and the module owns their registration the way the notification
|
|
12
|
+
* module owns notification providers.
|
|
13
|
+
*/
|
|
14
|
+
/** Prefix for each provider's container registration. */
|
|
15
|
+
exports.SearchProviderPrefix = "search_provider_";
|
|
16
|
+
/** Container key holding the ids of the loaded providers. */
|
|
17
|
+
exports.SearchProviderIdentifiers = "searchProviderIds";
|
|
18
|
+
/** Container key the module service reads for the active provider. */
|
|
19
|
+
exports.SearchServiceRegistrationName = "searchService";
|
|
20
|
+
exports.default = async ({ container, options, }) => {
|
|
21
|
+
container.registerAdd(exports.SearchProviderIdentifiers, (0, awilix_1.asValue)(undefined));
|
|
22
|
+
const providers = options?.providers ?? [];
|
|
23
|
+
const registered = new Map();
|
|
24
|
+
await (0, modules_sdk_1.moduleProviderLoader)({
|
|
25
|
+
container,
|
|
26
|
+
providers: providers,
|
|
27
|
+
registerServiceFn: async (klass, cradleContainer, moduleDetails) => {
|
|
28
|
+
const id = moduleDetails?.id ?? (0, utils_1.lowerCaseFirst)(klass.name);
|
|
29
|
+
const providerOptions = (moduleDetails?.options ?? {});
|
|
30
|
+
registered.set(id, { klass, options: providerOptions });
|
|
31
|
+
cradleContainer.register({
|
|
32
|
+
[`${exports.SearchProviderPrefix}${id}`]: (0, awilix_1.asFunction)((cradle) => new klass(cradle, providerOptions), { lifetime: klass.LIFE_TIME || awilix_1.Lifetime.SINGLETON }),
|
|
33
|
+
});
|
|
34
|
+
cradleContainer.registerAdd(exports.SearchProviderIdentifiers, (0, awilix_1.asValue)(id));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const activeId = options?.searchProvider ?? providers[0]?.id;
|
|
38
|
+
const active = activeId ? registered.get(activeId) : undefined;
|
|
39
|
+
if (!active) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
container.register({
|
|
43
|
+
[exports.SearchServiceRegistrationName]: (0, awilix_1.asFunction)((cradle) => new active.klass(cradle, active.options), { lifetime: awilix_1.Lifetime.SINGLETON }),
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/loaders/providers.ts"],"names":[],"mappings":";;;AAAA,8DAAmE;AAEnE,kDAAuD;AACvD,mCAAsD;AAItD;;;;;;GAMG;AAEH,yDAAyD;AAC5C,QAAA,oBAAoB,GAAG,kBAAkB,CAAA;AAEtD,6DAA6D;AAChD,QAAA,yBAAyB,GAAG,mBAAmB,CAAA;AAE5D,sEAAsE;AACzD,QAAA,6BAA6B,GAAG,eAAe,CAAA;AAO5D,kBAAe,KAAK,EAAE,EACpB,SAAS,EACT,OAAO,GAC4B,EAAiB,EAAE;IACtD,SAAS,CAAC,WAAW,CAAC,iCAAyB,EAAE,IAAA,gBAAO,EAAC,SAAS,CAAC,CAAC,CAAA;IAEpE,MAAM,SAAS,GAAG,OAAO,EAAE,SAAS,IAAI,EAAE,CAAA;IAC1C,MAAM,UAAU,GAAG,IAAI,GAAG,EAGvB,CAAA;IAEH,MAAM,IAAA,kCAAoB,EAAC;QACzB,SAAS;QACT,SAAS,EAAE,SAAkB;QAC7B,iBAAiB,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE;YACjE,MAAM,EAAE,GAAG,aAAa,EAAE,EAAE,IAAI,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAC1D,MAAM,eAAe,GAAG,CAAC,aAAa,EAAE,OAAO,IAAI,EAAE,CAGpD,CAAA;YAED,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,CAAA;YAEvD,eAAe,CAAC,QAAQ,CAAC;gBACvB,CAAC,GAAG,4BAAoB,GAAG,EAAE,EAAE,CAAC,EAAE,IAAA,mBAAU,EAC1C,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,EAC9C,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,IAAI,iBAAQ,CAAC,SAAS,EAAE,CACpD;aACF,CAAC,CAAA;YAEF,eAAe,CAAC,WAAW,CAAC,iCAAyB,EAAE,IAAA,gBAAO,EAAC,EAAE,CAAC,CAAC,CAAA;QACrE,CAAC;KACF,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,OAAO,EAAE,cAAc,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;IAC5D,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;IAC9D,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAM;IACR,CAAC;IAED,SAAS,CAAC,QAAQ,CAAC;QACjB,CAAC,qCAA6B,CAAC,EAAE,IAAA,mBAAU,EACzC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,EACpD,EAAE,QAAQ,EAAE,iBAAQ,CAAC,SAAS,EAAE,CACjC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SearchModuleService = void 0;
|
|
7
|
+
var search_module_service_1 = require("./search-module-service");
|
|
8
|
+
Object.defineProperty(exports, "SearchModuleService", { enumerable: true, get: function () { return __importDefault(search_module_service_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;AAAA,iEAAwE;AAA/D,6IAAA,OAAO,OAAuB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { InternalModuleDeclaration } from "@etohq/framework/types";
|
|
2
|
+
import type { AbstractLegacySearchService } from "@etohq/framework/utils";
|
|
3
|
+
import { SearchServiceRegistrationName } from "../loaders/providers";
|
|
4
|
+
type InjectedDependencies = Record<string, unknown> & {
|
|
5
|
+
[SearchServiceRegistrationName]?: AbstractLegacySearchService;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The search module has no storage of its own: it exists to load the configured
|
|
9
|
+
* search providers and hand the active one to consumers, which reach it through
|
|
10
|
+
* the module registry (`container[Modules.SEARCH_LEGACY]`).
|
|
11
|
+
*/
|
|
12
|
+
export default class SearchModuleService {
|
|
13
|
+
protected readonly moduleDeclaration: InternalModuleDeclaration;
|
|
14
|
+
protected readonly searchProvider_?: AbstractLegacySearchService;
|
|
15
|
+
constructor(container: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration);
|
|
16
|
+
/** The active retrieval engine, or undefined when none is configured. */
|
|
17
|
+
getSearchProvider(): AbstractLegacySearchService | undefined;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=search-module-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-module-service.d.ts","sourceRoot":"","sources":["../../src/services/search-module-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAA;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAA;AAEpE,KAAK,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACpD,CAAC,6BAA6B,CAAC,CAAC,EAAE,2BAA2B,CAAA;CAC9D,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,mBAAmB;IAKpC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,yBAAyB;IAJjE,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,2BAA2B,CAAA;gBAG9D,SAAS,EAAE,oBAAoB,EACZ,iBAAiB,EAAE,yBAAyB;IAKjE,yEAAyE;IACzE,iBAAiB,IAAI,2BAA2B,GAAG,SAAS;CAG7D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const providers_1 = require("../loaders/providers");
|
|
4
|
+
/**
|
|
5
|
+
* The search module has no storage of its own: it exists to load the configured
|
|
6
|
+
* search providers and hand the active one to consumers, which reach it through
|
|
7
|
+
* the module registry (`container[Modules.SEARCH_LEGACY]`).
|
|
8
|
+
*/
|
|
9
|
+
class SearchModuleService {
|
|
10
|
+
constructor(container, moduleDeclaration) {
|
|
11
|
+
this.moduleDeclaration = moduleDeclaration;
|
|
12
|
+
this.searchProvider_ = container[providers_1.SearchServiceRegistrationName];
|
|
13
|
+
}
|
|
14
|
+
/** The active retrieval engine, or undefined when none is configured. */
|
|
15
|
+
getSearchProvider() {
|
|
16
|
+
return this.searchProvider_;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.default = SearchModuleService;
|
|
20
|
+
//# sourceMappingURL=search-module-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-module-service.js","sourceRoot":"","sources":["../../src/services/search-module-service.ts"],"names":[],"mappings":";;AAGA,oDAAoE;AAMpE;;;;GAIG;AACH,MAAqB,mBAAmB;IAGtC,YACE,SAA+B,EACZ,iBAA4C;QAA5C,sBAAiB,GAAjB,iBAAiB,CAA2B;QAE/D,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC,yCAA6B,CAAC,CAAA;IACjE,CAAC;IAED,yEAAyE;IACzE,iBAAiB;QACf,OAAO,IAAI,CAAC,eAAe,CAAA;IAC7B,CAAC;CACF;AAdD,sCAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/index.ts","../src/loaders/providers.ts","../src/services/index.ts","../src/services/search-module-service.ts","../src/types/index.ts"],"version":"5.8.3"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModuleProvider } from "@etohq/framework/types";
|
|
2
|
+
/** Options the search module accepts. */
|
|
3
|
+
export type SearchModuleOptions = {
|
|
4
|
+
providers?: ModuleProvider[];
|
|
5
|
+
/** Id of the provider to activate; defaults to the first configured. */
|
|
6
|
+
searchProvider?: string;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,yCAAyC;AACzC,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,CAAC,EAAE,cAAc,EAAE,CAAA;IAC5B,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etohq/search-legacy",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "2.0.5",
|
|
4
|
+
"description": "Eto legacy search module — owns search provider registration and exposes the active provider",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/__tests__",
|
|
10
|
+
"!dist/**/__mocks__",
|
|
11
|
+
"!dist/**/__fixtures__"
|
|
12
|
+
],
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=20"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/etohq/eto",
|
|
19
|
+
"directory": "packages/core/modules/search-legacy"
|
|
20
|
+
},
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"author": "Eto",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@etohq/framework": "2.0.5",
|
|
28
|
+
"@etohq/test-utils": "2.0.5",
|
|
29
|
+
"@etohq/types": "2.0.5",
|
|
30
|
+
"@mikro-orm/cli": "6.4.3",
|
|
31
|
+
"@mikro-orm/core": "6.4.3",
|
|
32
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
33
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
34
|
+
"@swc/core": "1.7.28",
|
|
35
|
+
"@swc/jest": "0.2.36",
|
|
36
|
+
"@types/jest": "29.5.14",
|
|
37
|
+
"jest": "29.7.0",
|
|
38
|
+
"rimraf": "5.0.2",
|
|
39
|
+
"tsc-alias": "1.8.6",
|
|
40
|
+
"typescript": "5.8.3"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"awilix": "8.0.1"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@etohq/framework": "2.0.5",
|
|
47
|
+
"@etohq/types": "2.0.5",
|
|
48
|
+
"@mikro-orm/core": "6.4.3",
|
|
49
|
+
"@mikro-orm/migrations": "6.4.3",
|
|
50
|
+
"@mikro-orm/postgresql": "6.4.3",
|
|
51
|
+
"awilix": "8.0.1"
|
|
52
|
+
},
|
|
53
|
+
"scripts": {
|
|
54
|
+
"watch": "tsc --build --watch",
|
|
55
|
+
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
|
56
|
+
"build": "rm -rf dist && tsc --build && npm run resolve:aliases",
|
|
57
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
|
58
|
+
"test": "jest --runInBand --bail --forceExit --passWithNoTests -- src",
|
|
59
|
+
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.spec.ts",
|
|
60
|
+
"migration:initial": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true MIKRO_ORM_PASSWORD=postgres eto-mikro-orm migration:create --initial -n InitialSetupMigration",
|
|
61
|
+
"migration:create": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true MIKRO_ORM_PASSWORD=postgres eto-mikro-orm migration:create",
|
|
62
|
+
"migration:up": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true MIKRO_ORM_PASSWORD=postgres eto-mikro-orm migration:up",
|
|
63
|
+
"orm:cache:clear": " MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true MIKRO_ORM_PASSWORD=postgres eto-mikro-orm cache:clear"
|
|
64
|
+
}
|
|
6
65
|
}
|