@etohq/search 2.0.4 → 2.1.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/NOTICE +24 -0
- package/README.md +189 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -17
- package/dist/index.js.map +1 -1
- package/dist/joiner-config.d.ts +8 -0
- package/dist/joiner-config.d.ts.map +1 -0
- package/dist/joiner-config.js +12 -0
- package/dist/joiner-config.js.map +1 -0
- package/dist/loaders/providers.d.ts +2 -15
- package/dist/loaders/providers.d.ts.map +1 -1
- package/dist/loaders/providers.js +14 -37
- package/dist/loaders/providers.js.map +1 -1
- package/dist/migrations/Migration20260805085626.d.ts +6 -0
- package/dist/migrations/Migration20260805085626.d.ts.map +1 -0
- package/dist/migrations/Migration20260805085626.js +23 -0
- package/dist/migrations/Migration20260805085626.js.map +1 -0
- package/dist/migrations/Migration20260903085616.d.ts +6 -0
- package/dist/migrations/Migration20260903085616.d.ts.map +1 -0
- package/dist/migrations/Migration20260903085616.js +32 -0
- package/dist/migrations/Migration20260903085616.js.map +1 -0
- package/dist/migrations/Migration20260911115931.d.ts +6 -0
- package/dist/migrations/Migration20260911115931.d.ts.map +1 -0
- package/dist/migrations/Migration20260911115931.js +14 -0
- package/dist/migrations/Migration20260911115931.js.map +1 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +10 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/search-index-sync.d.ts +34 -0
- package/dist/models/search-index-sync.d.ts.map +1 -0
- package/dist/models/search-index-sync.js +47 -0
- package/dist/models/search-index-sync.js.map +1 -0
- package/dist/models/search-index-version.d.ts +34 -0
- package/dist/models/search-index-version.d.ts.map +1 -0
- package/dist/models/search-index-version.js +37 -0
- package/dist/models/search-index-version.js.map +1 -0
- package/dist/models/search-index.d.ts +28 -0
- package/dist/models/search-index.d.ts.map +1 -0
- package/dist/models/search-index.js +28 -0
- package/dist/models/search-index.js.map +1 -0
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/search-module-service.d.ts +67 -15
- package/dist/services/search-module-service.d.ts.map +1 -1
- package/dist/services/search-module-service.js +328 -12
- package/dist/services/search-module-service.js.map +1 -1
- package/dist/services/search-provider.d.ts +23 -0
- package/dist/services/search-provider.d.ts.map +1 -0
- package/dist/services/search-provider.js +64 -0
- package/dist/services/search-provider.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +129 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -1
- package/dist/utils/active-version-cache.d.ts +36 -0
- package/dist/utils/active-version-cache.d.ts.map +1 -0
- package/dist/utils/active-version-cache.js +73 -0
- package/dist/utils/active-version-cache.js.map +1 -0
- package/dist/utils/deletion.d.ts +11 -0
- package/dist/utils/deletion.d.ts.map +1 -0
- package/dist/utils/deletion.js +50 -0
- package/dist/utils/deletion.js.map +1 -0
- package/dist/utils/index.d.ts +88 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +524 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/ingestion.d.ts +12 -0
- package/dist/utils/ingestion.d.ts.map +1 -0
- package/dist/utils/ingestion.js +78 -0
- package/dist/utils/ingestion.js.map +1 -0
- package/dist/utils/migrations.d.ts +5 -0
- package/dist/utils/migrations.d.ts.map +1 -0
- package/dist/utils/migrations.js +143 -0
- package/dist/utils/migrations.js.map +1 -0
- package/dist/utils/rate-limit.d.ts +9 -0
- package/dist/utils/rate-limit.d.ts.map +1 -0
- package/dist/utils/rate-limit.js +47 -0
- package/dist/utils/rate-limit.js.map +1 -0
- package/dist/utils/seeding.d.ts +29 -0
- package/dist/utils/seeding.d.ts.map +1 -0
- package/dist/utils/seeding.js +639 -0
- package/dist/utils/seeding.js.map +1 -0
- package/dist/utils/versions.d.ts +50 -0
- package/dist/utils/versions.d.ts.map +1 -0
- package/dist/utils/versions.js +113 -0
- package/dist/utils/versions.js.map +1 -0
- package/package.json +9 -15
|
@@ -1,20 +1,336 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
4
|
+
const _utils_1 = require("../utils");
|
|
5
|
+
const active_version_cache_1 = require("../utils/active-version-cache");
|
|
6
|
+
const deletion_1 = require("../utils/deletion");
|
|
7
|
+
const ingestion_1 = require("../utils/ingestion");
|
|
8
|
+
const migrations_1 = require("../utils/migrations");
|
|
9
|
+
const seeding_1 = require("../utils/seeding");
|
|
10
|
+
const joiner_config_1 = require("../joiner-config");
|
|
11
|
+
class SearchModuleService
|
|
12
|
+
// Deliberately no models: `SearchIndex` and `SearchIndexSync` are the module's
|
|
13
|
+
// own bookkeeping, so they get no generated CRUD and are not linkable. They are
|
|
14
|
+
// still discovered from `src/models` for migrations.
|
|
15
|
+
extends (0, utils_1.EtoService)({}) {
|
|
16
|
+
constructor(container, moduleOptions, moduleDeclaration) {
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
super(...arguments);
|
|
11
19
|
this.moduleDeclaration = moduleDeclaration;
|
|
12
|
-
this.
|
|
20
|
+
this.isWorkerMode = true;
|
|
21
|
+
this.__hooks = {
|
|
22
|
+
onApplicationStart: async () => {
|
|
23
|
+
this.subscribeToIndexEvents_();
|
|
24
|
+
// Seeding can take a long time on a large catalog and must not delay the
|
|
25
|
+
// worker from accepting jobs. Failures are logged rather than blocking boot.
|
|
26
|
+
void this.onApplicationStart_().catch((error) => {
|
|
27
|
+
this.logger_.error(`[Search] Failed to seed search indexes: ${error.message}`, error);
|
|
28
|
+
});
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
this.logger_ = container.logger ?? console;
|
|
32
|
+
this.searchProviderService_ = container.searchProviderService;
|
|
33
|
+
this.moduleOptions_ = (moduleOptions ??
|
|
34
|
+
moduleDeclaration.options ??
|
|
35
|
+
{});
|
|
36
|
+
// `worker_mode` is stamped onto every module's declaration by the
|
|
37
|
+
// modules-sdk from the application's own `projectConfig.workerMode`, so this
|
|
38
|
+
// reads the same value `configModule` would give — an HTTP-only process
|
|
39
|
+
// must not spend its boot seeding indexes.
|
|
40
|
+
this.isWorkerMode = moduleDeclaration.worker_mode !== "server";
|
|
41
|
+
// Resolved here rather than on application start, so anything that resolves the
|
|
42
|
+
// module — `db:migrate` included — sees the definitions without booting first.
|
|
43
|
+
this.indexes_ = this.moduleOptions_.indexes?.length
|
|
44
|
+
? (0, _utils_1.resolveIndexDefinitions)({
|
|
45
|
+
definitions: this.moduleOptions_.indexes,
|
|
46
|
+
default_provider: container.searchProviderService.getDefaultIdentifier(this.moduleOptions_.default_provider),
|
|
47
|
+
index_prefix: this.moduleOptions_.index_prefix,
|
|
48
|
+
})
|
|
49
|
+
: new Map();
|
|
50
|
+
this.eventRoutes_ = (0, ingestion_1.buildEventRoutes)(this.indexes_);
|
|
51
|
+
this.eventBus_ = resolveEventBus(container);
|
|
52
|
+
this.activeVersionCache_ = new active_version_cache_1.ActiveIndexVersionCache(() => this.fetchActiveVersions_(container));
|
|
53
|
+
this.context_ = {
|
|
54
|
+
container: {
|
|
55
|
+
get query() {
|
|
56
|
+
return container[utils_1.ContainerRegistrationKeys.QUERY];
|
|
57
|
+
},
|
|
58
|
+
logger: this.logger_,
|
|
59
|
+
},
|
|
60
|
+
logger: this.logger_,
|
|
61
|
+
options: this.moduleOptions_,
|
|
62
|
+
indexes: this.indexes_,
|
|
63
|
+
providers: container.searchProviderService,
|
|
64
|
+
indexService: container.searchIndexService,
|
|
65
|
+
versionService: container.searchIndexVersionService,
|
|
66
|
+
syncService: container.searchIndexSyncService,
|
|
67
|
+
locking: resolveLocking(container),
|
|
68
|
+
activeVersionCache: this.activeVersionCache_,
|
|
69
|
+
};
|
|
13
70
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
71
|
+
// Reads the DB directly, for every index at once — there are never many
|
|
72
|
+
// search indexes in an app, so listing them all is cheap, and it lets one
|
|
73
|
+
// refresh (triggered by any index) serve every index. Called by
|
|
74
|
+
// `activeVersionCache_` on a cache miss or refresh — never on the request
|
|
75
|
+
// path itself.
|
|
76
|
+
async fetchActiveVersions_(container) {
|
|
77
|
+
const records = (await container.searchIndexService.list({}, { take: null }));
|
|
78
|
+
const versionsByIndexId = await (0, _utils_1.listVersionsByIndexId)({ versionService: container.searchIndexVersionService }, records.map((record) => record.id));
|
|
79
|
+
const values = new Map();
|
|
80
|
+
for (const record of records) {
|
|
81
|
+
if (record.active_version == null) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const version = versionsByIndexId
|
|
85
|
+
.get(record.id)
|
|
86
|
+
?.find((candidate) => candidate.version === record.active_version);
|
|
87
|
+
if (version) {
|
|
88
|
+
values.set(record.name, {
|
|
89
|
+
physical_name: version.physical_name,
|
|
90
|
+
provider: version.provider,
|
|
91
|
+
version: version.version,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return values;
|
|
96
|
+
}
|
|
97
|
+
// Merges in the physical index and provider currently serving reads. Every
|
|
98
|
+
// *live* read or write goes through this rather than `definition.physical_name`
|
|
99
|
+
// directly, since the active version can change out from under this process.
|
|
100
|
+
// Shared with the ingestion path (`resolveActiveDefinition` in `@utils`) so
|
|
101
|
+
// the two can't drift apart.
|
|
102
|
+
async resolveActiveDefinition_(name, options = {}) {
|
|
103
|
+
return await (0, _utils_1.resolveActiveDefinition)(this.context_, name, options);
|
|
104
|
+
}
|
|
105
|
+
// Declared so that `Module()` does not derive one by scanning `src/models`,
|
|
106
|
+
// which would make the module's bookkeeping linkable.
|
|
107
|
+
__joinerConfig() {
|
|
108
|
+
return joiner_config_1.joinerConfig;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Eto has no subscriber directory to drop an ingestion subscriber into, so the
|
|
112
|
+
* module subscribes to the events its definitions declare itself. Only a
|
|
113
|
+
* worker ingests, like a subscriber would; awaiting `ingest` acknowledges
|
|
114
|
+
* the event, so a failed write is redelivered.
|
|
115
|
+
*/
|
|
116
|
+
subscribeToIndexEvents_() {
|
|
117
|
+
if (!this.isWorkerMode || !this.eventBus_ || !this.eventRoutes_.size) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const subscriber = async (event) => {
|
|
121
|
+
await this.ingest(event);
|
|
122
|
+
};
|
|
123
|
+
for (const eventName of this.eventRoutes_.keys()) {
|
|
124
|
+
this.eventBus_.subscribe(eventName, subscriber, {
|
|
125
|
+
subscriberId: `search-ingestion-${eventName}`,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async search(query) {
|
|
130
|
+
const [result] = await this.searchMany([query]);
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
async searchMany(queries) {
|
|
134
|
+
if (!queries.length) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
// Reads take the cached version, so this one can be pointed at a version
|
|
138
|
+
// that has since been dropped. That surfaces as a `NOT_FOUND` from the
|
|
139
|
+
// engine, and the retry resolves it again rather than failing the search.
|
|
140
|
+
return await (0, _utils_1.withActiveIndexRetry)(this.context_, () => this.searchMany_(queries));
|
|
141
|
+
}
|
|
142
|
+
async searchMany_(queries) {
|
|
143
|
+
const prepared = await (0, utils_1.promiseAll)(queries.map(async (query) => {
|
|
144
|
+
const index = await this.resolveActiveDefinition_(query.entity);
|
|
145
|
+
const normalized = (0, _utils_1.normalizeSearchQuery)({ query, index });
|
|
146
|
+
const provider = this.searchProviderService_.retrieve(index.provider);
|
|
147
|
+
// Whether the *provider* can serve the query is the provider's call, made
|
|
148
|
+
// while it translates. This only checks the query against the definition,
|
|
149
|
+
// which is provider-independent.
|
|
150
|
+
(0, _utils_1.validateFieldUsage)({ index, query: normalized });
|
|
151
|
+
return { normalized, provider };
|
|
152
|
+
}));
|
|
153
|
+
const flattened = [];
|
|
154
|
+
prepared.forEach(({ normalized, provider }, originalIndex) => {
|
|
155
|
+
if (!normalized.search_options?.disjunctive_facets) {
|
|
156
|
+
flattened.push({ provider, query: normalized, originalIndex });
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
const { base, per_facet } = (0, _utils_1.buildDisjunctiveFacetQueries)(normalized);
|
|
160
|
+
flattened.push({ provider, query: base, originalIndex });
|
|
161
|
+
for (const [field, facetQuery] of per_facet) {
|
|
162
|
+
flattened.push({
|
|
163
|
+
provider,
|
|
164
|
+
query: facetQuery,
|
|
165
|
+
originalIndex,
|
|
166
|
+
facetField: field,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const groups = new Map();
|
|
171
|
+
flattened.forEach((item, flatIndex) => {
|
|
172
|
+
const group = groups.get(item.provider);
|
|
173
|
+
if (group) {
|
|
174
|
+
group.push({ item, flatIndex });
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
groups.set(item.provider, [{ item, flatIndex }]);
|
|
178
|
+
});
|
|
179
|
+
const flatResults = new Array(flattened.length);
|
|
180
|
+
await (0, utils_1.promiseAll)([...groups].map(async ([provider, group]) => {
|
|
181
|
+
const inputs = group.map(({ item }) => item.query);
|
|
182
|
+
const results = provider.searchMany
|
|
183
|
+
? await provider.searchMany(inputs)
|
|
184
|
+
: await (0, utils_1.promiseAll)(inputs.map((input) => provider.search(input)));
|
|
185
|
+
group.forEach(({ flatIndex }, i) => {
|
|
186
|
+
flatResults[flatIndex] = results[i];
|
|
187
|
+
});
|
|
188
|
+
}));
|
|
189
|
+
const results = new Array(queries.length);
|
|
190
|
+
const pendingFacets = new Map();
|
|
191
|
+
flattened.forEach((item, flatIndex) => {
|
|
192
|
+
if (!item.facetField) {
|
|
193
|
+
results[item.originalIndex] = flatResults[flatIndex];
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const perFacet = pendingFacets.get(item.originalIndex) ?? new Map();
|
|
197
|
+
perFacet.set(item.facetField, flatResults[flatIndex]);
|
|
198
|
+
pendingFacets.set(item.originalIndex, perFacet);
|
|
199
|
+
});
|
|
200
|
+
for (const [index, perFacet] of pendingFacets) {
|
|
201
|
+
results[index] = (0, _utils_1.mergeDisjunctiveFacetResults)({
|
|
202
|
+
base: results[index],
|
|
203
|
+
per_facet: perFacet,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
return results;
|
|
207
|
+
}
|
|
208
|
+
async upsertDocuments({ index, documents, }) {
|
|
209
|
+
if (!documents.length) {
|
|
210
|
+
return { index, status: "succeeded" };
|
|
211
|
+
}
|
|
212
|
+
return await (0, _utils_1.withActiveIndexRetry)(this.context_, async () => {
|
|
213
|
+
const definition = await this.resolveActiveDefinition_(index, {
|
|
214
|
+
fresh: true,
|
|
215
|
+
});
|
|
216
|
+
const provider = this.searchProviderService_.retrieve(definition.provider);
|
|
217
|
+
const task = await provider.upsertDocuments({
|
|
218
|
+
index: definition.physical_name,
|
|
219
|
+
definition,
|
|
220
|
+
documents,
|
|
221
|
+
});
|
|
222
|
+
return (0, _utils_1.assertTaskAccepted)(task, index);
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
async deleteDocuments({ index, filters, }) {
|
|
226
|
+
if (!filters || !Object.keys(filters).length) {
|
|
227
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.INVALID_DATA, `Deleting from search index "${index}" requires filters; pass { id: [...] } to delete by id, or clear the index through a reindex`);
|
|
228
|
+
}
|
|
229
|
+
return await (0, _utils_1.withActiveIndexRetry)(this.context_, async () => {
|
|
230
|
+
const definition = await this.resolveActiveDefinition_(index, {
|
|
231
|
+
fresh: true,
|
|
232
|
+
});
|
|
233
|
+
const provider = this.searchProviderService_.retrieve(definition.provider);
|
|
234
|
+
const task = await provider.deleteDocuments({
|
|
235
|
+
index: definition.physical_name,
|
|
236
|
+
filters,
|
|
237
|
+
});
|
|
238
|
+
return (0, _utils_1.assertTaskAccepted)(task, index);
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
// Waits for its writes, so awaiting this acknowledges the event.
|
|
242
|
+
async ingest(event) {
|
|
243
|
+
return await (0, ingestion_1.ingestEvent)(this.context_, {
|
|
244
|
+
event,
|
|
245
|
+
routes: this.eventRoutes_,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
async listIndexes() {
|
|
249
|
+
const definitions = [...this.indexes_.values()].sort((a, b) => a.name.localeCompare(b.name));
|
|
250
|
+
if (!definitions.length) {
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
const records = (await this.context_.indexService.list({ name: definitions.map((definition) => definition.name) }, { take: null }));
|
|
254
|
+
const byName = new Map(records.map((record) => [record.name, record]));
|
|
255
|
+
const versionsByIndexId = await (0, _utils_1.listVersionsByIndexId)(this.context_, records.map((record) => record.id));
|
|
256
|
+
return definitions.map((definition) => {
|
|
257
|
+
const record = byName.get(definition.name);
|
|
258
|
+
const versions = record ? versionsByIndexId.get(record.id) ?? [] : [];
|
|
259
|
+
const activeVersion = record?.active_version != null
|
|
260
|
+
? versions.find((version) => version.version === record.active_version)
|
|
261
|
+
: undefined;
|
|
262
|
+
return {
|
|
263
|
+
name: definition.name,
|
|
264
|
+
entity: definition.entity,
|
|
265
|
+
provider: activeVersion?.provider ?? definition.provider,
|
|
266
|
+
status: (activeVersion?.status ??
|
|
267
|
+
_utils_1.SearchIndexState.PENDING),
|
|
268
|
+
fields: (0, _utils_1.listIndexedFields)(definition.fields),
|
|
269
|
+
};
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
listRetrievableFields(index) {
|
|
273
|
+
return (0, _utils_1.listRetrievablePaths)((0, _utils_1.retrieveIndexDefinition)(this.indexes_, index).fields);
|
|
274
|
+
}
|
|
275
|
+
getIndex(index) {
|
|
276
|
+
return (0, _utils_1.retrieveIndexDefinition)(this.indexes_, index);
|
|
277
|
+
}
|
|
278
|
+
async reindex(input = {}) {
|
|
279
|
+
return await (0, seeding_1.reindexIndexes)(this.context_, input);
|
|
280
|
+
}
|
|
281
|
+
async deleteIndex(index) {
|
|
282
|
+
return await (0, deletion_1.deleteIndexEntirely)(this.context_, index);
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Seeds whatever needs data. Indexes that are not migrated yet are skipped —
|
|
286
|
+
* creating and migrating physical indexes is the application's job
|
|
287
|
+
* (e.g. `db:migrate`), not something a booting worker invents.
|
|
288
|
+
*/
|
|
289
|
+
async onApplicationStart_() {
|
|
290
|
+
if (!this.indexes_.size || !this.isWorkerMode) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
const seeds = await this.createSeedPlan_();
|
|
294
|
+
if (!seeds.length) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
this.logger_.info(`[Search] Seeding ${seeds.length} index(es): ${seeds
|
|
298
|
+
.map((seed) => `${seed.index} (${seed.reason})`)
|
|
299
|
+
.join(", ")}`);
|
|
300
|
+
await this.executeSeedPlan_(seeds);
|
|
301
|
+
}
|
|
302
|
+
async createSeedPlan_() {
|
|
303
|
+
return await (0, seeding_1.createSeedPlan)(this.context_);
|
|
304
|
+
}
|
|
305
|
+
async executeSeedPlan_(actions) {
|
|
306
|
+
await (0, seeding_1.executeSeedPlan)(this.context_, actions);
|
|
307
|
+
}
|
|
308
|
+
async createIndexMigrationPlan() {
|
|
309
|
+
return await (0, migrations_1.createIndexMigrationPlan)(this.context_);
|
|
310
|
+
}
|
|
311
|
+
async executeIndexMigrationPlan(actions) {
|
|
312
|
+
await (0, migrations_1.executeIndexMigrationPlan)(this.context_, actions);
|
|
17
313
|
}
|
|
18
314
|
}
|
|
19
315
|
exports.default = SearchModuleService;
|
|
316
|
+
// The event bus is a declared dependency, but a module loaded on its own (or in
|
|
317
|
+
// tests) may run without one.
|
|
318
|
+
function resolveEventBus(container) {
|
|
319
|
+
try {
|
|
320
|
+
return container[utils_1.Modules.EVENT_BUS];
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
return undefined;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
// The Locking Module is optional, and reading a missing registration off the
|
|
327
|
+
// container throws rather than returning undefined.
|
|
328
|
+
function resolveLocking(container) {
|
|
329
|
+
try {
|
|
330
|
+
return container[utils_1.Modules.LOCKING];
|
|
331
|
+
}
|
|
332
|
+
catch {
|
|
333
|
+
return undefined;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
20
336
|
//# sourceMappingURL=search-module-service.js.map
|
|
@@ -1 +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"}
|
|
1
|
+
{"version":3,"file":"search-module-service.js","sourceRoot":"","sources":["../../src/services/search-module-service.ts"],"names":[],"mappings":";;AAUA,kDAM+B;AAS/B,mCAce;AACf,wEAGsC;AACtC,gDAAuD;AACvD,kDAAkE;AAClE,oDAG4B;AAC5B,8CAIyB;AACzB,oDAA+C;AAa/C,MAAqB,mBAAmB;AACtC,+EAA+E;AAC/E,gFAAgF;AAChF,qDAAqD;AACrD,SAAQ,IAAA,kBAAU,EAAC,EAAE,CAAC;IA6BtB,YACE,SAA+B,EAC/B,aAAkC,EACf,iBAA4C;QAE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AAM,GAAG,CAAC;aAC/C,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAA;QAED,MAAM,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAA;IACpC,CAAC;IAES,KAAK,CAAC,eAAe;QAC7B,OAAO,MAAM,IAAA,wBAAc,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IAC5C,CAAC;IAES,KAAK,CAAC,gBAAgB,CAC9B,OAAgC;QAEhC,MAAM,IAAA,yBAAe,EAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IAC/C,CAAC;IAED,KAAK,CAAC,wBAAwB;QAG5B,OAAO,MAAM,IAAA,qCAAwB,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACtD,CAAC;IAED,KAAK,CAAC,yBAAyB,CAC7B,OAAiD;QAEjD,MAAM,IAAA,sCAAyB,EAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;IACzD,CAAC;CACF;AAveD,sCAueC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,SAAS,eAAe,CACtB,SAA+B;IAE/B,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,eAAO,CAAC,SAAS,CAAC,CAAA;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC;AAED,6EAA6E;AAC7E,oDAAoD;AACpD,SAAS,cAAc,CACrB,SAA+B;IAE/B,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,eAAO,CAAC,OAAO,CAAC,CAAA;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAA;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Constructor, SearchTypes } from "@etohq/framework/types";
|
|
2
|
+
import { SearchProviderRegistrationPrefix } from "../types";
|
|
3
|
+
type InjectedDependencies = {
|
|
4
|
+
[key: `${typeof SearchProviderRegistrationPrefix}${string}`]: SearchTypes.ISearchProvider;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Registry over the registered providers. Multiple providers can be used, and
|
|
8
|
+
* each index can select which provider to use for itself.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SearchProviderService {
|
|
11
|
+
protected readonly providers_: Map<string, SearchTypes.ISearchProvider>;
|
|
12
|
+
constructor(container: InjectedDependencies);
|
|
13
|
+
static getRegistrationIdentifier(providerClass: Constructor<SearchTypes.ISearchProvider>, optionName?: string): string;
|
|
14
|
+
retrieve(identifier: string): SearchTypes.ISearchProvider;
|
|
15
|
+
list(): SearchTypes.ISearchProvider[];
|
|
16
|
+
/**
|
|
17
|
+
* Used by definitions that do not name a provider. Resolves to the sole
|
|
18
|
+
* registered provider, or to the module's `default_provider` option.
|
|
19
|
+
*/
|
|
20
|
+
getDefaultIdentifier(configured?: string): string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=search-provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-provider.d.ts","sourceRoot":"","sources":["../../src/services/search-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEjE,OAAO,EAAE,gCAAgC,EAAE,MAAM,QAAQ,CAAA;AAEzD,KAAK,oBAAoB,GAAG;IAC1B,CACE,GAAG,EAAE,GAAG,OAAO,gCAAgC,GAAG,MAAM,EAAE,GACzD,WAAW,CAAC,eAAe,CAAA;CAC/B,CAAA;AAED;;;GAGG;AACH,qBAAa,qBAAqB;IAChC,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,eAAe,CAAC,CAC5D;gBAEC,SAAS,EAAE,oBAAoB;IAyB3C,MAAM,CAAC,yBAAyB,CAC9B,aAAa,EAAE,WAAW,CAAC,WAAW,CAAC,eAAe,CAAC,EACvD,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM;IAIT,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC,eAAe;IAezD,IAAI,IAAI,WAAW,CAAC,eAAe,EAAE;IAIrC;;;OAGG;IACH,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM;CA2BlD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchProviderService = void 0;
|
|
4
|
+
const utils_1 = require("@etohq/framework/utils");
|
|
5
|
+
const _types_1 = require("../types");
|
|
6
|
+
/**
|
|
7
|
+
* Registry over the registered providers. Multiple providers can be used, and
|
|
8
|
+
* each index can select which provider to use for itself.
|
|
9
|
+
*/
|
|
10
|
+
class SearchProviderService {
|
|
11
|
+
constructor(container) {
|
|
12
|
+
this.providers_ = new Map();
|
|
13
|
+
for (const key of Object.keys(container)) {
|
|
14
|
+
if (!key.startsWith(_types_1.SearchProviderRegistrationPrefix)) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
const provider = container[key];
|
|
18
|
+
if (!provider?.identifier) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
// Definitions bind to a provider by identifier, so two registrations of
|
|
22
|
+
// the same provider class would be indistinguishable to them — the second
|
|
23
|
+
// would silently shadow the first.
|
|
24
|
+
if (this.providers_.has(provider.identifier)) {
|
|
25
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.INVALID_DATA, `The search provider "${provider.identifier}" is registered twice. Register each provider once; index definitions select it through their "provider" field.`);
|
|
26
|
+
}
|
|
27
|
+
this.providers_.set(provider.identifier, provider);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
static getRegistrationIdentifier(providerClass, optionName) {
|
|
31
|
+
return `${providerClass.identifier}_${optionName}`;
|
|
32
|
+
}
|
|
33
|
+
retrieve(identifier) {
|
|
34
|
+
const provider = this.providers_.get(identifier);
|
|
35
|
+
if (!provider) {
|
|
36
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.NOT_FOUND, `Search provider "${identifier}" is not registered. Registered providers: ${[...this.providers_.keys()].join(", ") || "(none)"}`);
|
|
37
|
+
}
|
|
38
|
+
return provider;
|
|
39
|
+
}
|
|
40
|
+
list() {
|
|
41
|
+
return [...this.providers_.values()];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Used by definitions that do not name a provider. Resolves to the sole
|
|
45
|
+
* registered provider, or to the module's `default_provider` option.
|
|
46
|
+
*/
|
|
47
|
+
getDefaultIdentifier(configured) {
|
|
48
|
+
if (configured) {
|
|
49
|
+
// Surfaces a typo in `default_provider` at boot rather than on first query.
|
|
50
|
+
this.retrieve(configured);
|
|
51
|
+
return configured;
|
|
52
|
+
}
|
|
53
|
+
const identifiers = [...this.providers_.keys()];
|
|
54
|
+
if (identifiers.length === 1) {
|
|
55
|
+
return identifiers[0];
|
|
56
|
+
}
|
|
57
|
+
if (!identifiers.length) {
|
|
58
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.INVALID_DATA, "The Search Module requires at least one provider to be registered");
|
|
59
|
+
}
|
|
60
|
+
throw new utils_1.EtoError(utils_1.EtoError.Types.INVALID_DATA, `Several search providers are registered (${identifiers.join(", ")}), so "default_provider" must be set, or every index definition must name its provider`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.SearchProviderService = SearchProviderService;
|
|
64
|
+
//# sourceMappingURL=search-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-provider.js","sourceRoot":"","sources":["../../src/services/search-provider.ts"],"names":[],"mappings":";;;AACA,kDAAiD;AACjD,mCAAyD;AAQzD;;;GAGG;AACH,MAAa,qBAAqB;IAIhC,YAAY,SAA+B;QAHxB,eAAU,GAC3B,IAAI,GAAG,EAAE,CAAA;QAGT,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAA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AED;;;OAGG;IACH,oBAAoB,CAAC,UAAmB;QACtC,IAAI,UAAU,EAAE,CAAC;YACf,4EAA4E;YAC5E,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;YACzB,OAAO,UAAU,CAAA;QACnB,CAAC;QAED,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAA;QAE/C,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,WAAW,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YACxB,MAAM,IAAI,gBAAQ,CAChB,gBAAQ,CAAC,KAAK,CAAC,YAAY,EAC3B,mEAAmE,CACpE,CAAA;QACH,CAAC;QAED,MAAM,IAAI,gBAAQ,CAChB,gBAAQ,CAAC,KAAK,CAAC,YAAY,EAC3B,4CAA4C,WAAW,CAAC,IAAI,CAC1D,IAAI,CACL,wFAAwF,CAC1F,CAAA;IACH,CAAC;CACF;AAtFD,sDAsFC"}
|
|
@@ -1 +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"}
|
|
1
|
+
{"root":["../src/index.ts","../src/joiner-config.ts","../src/loaders/providers.ts","../src/migrations/migration20260805085626.ts","../src/migrations/migration20260903085616.ts","../src/migrations/migration20260911115931.ts","../src/models/index.ts","../src/models/search-index-sync.ts","../src/models/search-index-version.ts","../src/models/search-index.ts","../src/services/index.ts","../src/services/search-module-service.ts","../src/services/search-provider.ts","../src/services/__tests__/event-subscription.spec.ts","../src/types/index.ts","../src/utils/active-version-cache.ts","../src/utils/deletion.ts","../src/utils/index.ts","../src/utils/ingestion.ts","../src/utils/migrations.ts","../src/utils/rate-limit.ts","../src/utils/seeding.ts","../src/utils/versions.ts","../src/utils/__tests__/active-version.spec.ts","../src/utils/__tests__/migrations.spec.ts","../src/utils/__tests__/rate-limit.spec.ts","../src/utils/__tests__/resolve-index-definitions.spec.ts","../src/utils/__tests__/seeding.spec.ts","../src/utils/__tests__/vector-query.spec.ts","../src/utils/__tests__/versions.spec.ts"],"version":"5.8.3"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,131 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
|
|
1
|
+
import { Logger, ModuleProviderExports, ModuleServiceInitializeOptions, ModulesSdkTypes, SearchTypes } from "@etohq/framework/types";
|
|
2
|
+
export declare const SearchProviderIdentifiersRegistrationName = "search_providers_identifier";
|
|
3
|
+
export declare const SearchProviderRegistrationPrefix = "srh_";
|
|
4
|
+
export type SearchModuleOptions = Partial<ModuleServiceInitializeOptions> & {
|
|
5
|
+
/**
|
|
6
|
+
* More than one may be registered, unlike most provider-backed modules. A
|
|
7
|
+
* definition picks one by identifier through its `provider`, so products can
|
|
8
|
+
* live on a dedicated engine while quieter entities stay on Postgres.
|
|
9
|
+
*/
|
|
10
|
+
providers?: {
|
|
11
|
+
resolve: string | ModuleProviderExports;
|
|
12
|
+
id: string;
|
|
13
|
+
options?: Record<string, unknown>;
|
|
14
|
+
}[];
|
|
15
|
+
default_provider?: string;
|
|
16
|
+
index_prefix?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The definitions this module manages. It does not discover them itself — the
|
|
19
|
+
* application loads them off the file system and passes them in, so there is one
|
|
20
|
+
* input rather than two that can disagree. Already normalized: DSL field
|
|
21
|
+
* schemas are compiled to plain definitions by `defineSearchIndex`, so the
|
|
22
|
+
* module never sees them.
|
|
23
|
+
*/
|
|
24
|
+
indexes?: SearchTypes.SearchIndexDefinition[];
|
|
25
|
+
reindex?: {
|
|
26
|
+
batch_size?: number;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
declare module "@etohq/types" {
|
|
30
|
+
interface ModuleOptions {
|
|
31
|
+
"@etohq/search": SearchModuleOptions;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Handed to the migration and seeding helpers per call; they keep no state of
|
|
36
|
+
* their own. `indexes` is a live reference to the service's registry, not a copy,
|
|
37
|
+
* and `providers` is structural so `utils` need not depend on the service layer.
|
|
38
|
+
*/
|
|
39
|
+
/** Resolved definitions, keyed by index name. */
|
|
40
|
+
export type SearchIndexes = Map<string, SearchTypes.ResolvedSearchIndexDefinition>;
|
|
41
|
+
export type SearchIndexContext = {
|
|
42
|
+
container: SearchTypes.SearchContainer;
|
|
43
|
+
logger: Logger;
|
|
44
|
+
options: SearchModuleOptions;
|
|
45
|
+
indexes: SearchIndexes;
|
|
46
|
+
providers: {
|
|
47
|
+
retrieve(identifier: string): SearchTypes.ISearchProvider;
|
|
48
|
+
};
|
|
49
|
+
indexService: ModulesSdkTypes.IEtoInternalService<any>;
|
|
50
|
+
versionService: ModulesSdkTypes.IEtoInternalService<any>;
|
|
51
|
+
syncService: ModulesSdkTypes.IEtoInternalService<any>;
|
|
52
|
+
locking?: {
|
|
53
|
+
execute<T>(keys: string | string[], job: (signal?: AbortSignal) => Promise<T>, args?: {
|
|
54
|
+
timeout?: number;
|
|
55
|
+
expire?: number;
|
|
56
|
+
}): Promise<T>;
|
|
57
|
+
};
|
|
58
|
+
activeVersionCache?: {
|
|
59
|
+
get(name: string, options?: {
|
|
60
|
+
fresh?: boolean;
|
|
61
|
+
}): Promise<{
|
|
62
|
+
physical_name: string;
|
|
63
|
+
provider: string;
|
|
64
|
+
version: number;
|
|
65
|
+
}>;
|
|
66
|
+
set(name: string, value: {
|
|
67
|
+
physical_name: string;
|
|
68
|
+
provider: string;
|
|
69
|
+
version: number;
|
|
70
|
+
}): Promise<void>;
|
|
71
|
+
invalidate(): Promise<void>;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
export type SearchIndexRegistry = Pick<SearchIndexContext, "indexes" | "indexService" | "versionService" | "providers" | "logger">;
|
|
75
|
+
export type SearchSeedRuntime = SearchIndexRegistry & Pick<SearchIndexContext, "syncService" | "container" | "options" | "activeVersionCache">;
|
|
76
|
+
export type SearchIngestionRuntime = SearchIndexRegistry & Pick<SearchIndexContext, "container" | "activeVersionCache">;
|
|
77
|
+
/** Event name to the indexes that declared it. */
|
|
78
|
+
export type SearchEventRoutes = Map<string, string[]>;
|
|
79
|
+
/** The logical index and which of its versions currently serves reads. */
|
|
80
|
+
export type SearchIndexRecord = {
|
|
81
|
+
id: string;
|
|
82
|
+
name: string;
|
|
83
|
+
active_version: number | null;
|
|
84
|
+
};
|
|
85
|
+
/** One physical index ever built for a logical index. */
|
|
86
|
+
export type SearchIndexVersionRecord = {
|
|
87
|
+
id: string;
|
|
88
|
+
search_index_id: string;
|
|
89
|
+
version: number;
|
|
90
|
+
provider: string;
|
|
91
|
+
physical_name: string;
|
|
92
|
+
definition_hash: string;
|
|
93
|
+
status: string;
|
|
94
|
+
};
|
|
95
|
+
/** One seed run against one index version. Append-only, so these are the history. */
|
|
96
|
+
export type SearchIndexSyncRecord = {
|
|
97
|
+
id: string;
|
|
98
|
+
search_index_version_id: string;
|
|
99
|
+
job_id: string | null;
|
|
100
|
+
status: string;
|
|
101
|
+
filters: Record<string, unknown> | null;
|
|
102
|
+
last_key: string | null;
|
|
103
|
+
/** Whether a later run may continue from `last_key`. */
|
|
104
|
+
resumable: boolean;
|
|
105
|
+
documents_synced: number;
|
|
106
|
+
started_at: Date | null;
|
|
107
|
+
completed_at: Date | null;
|
|
108
|
+
error: string | null;
|
|
109
|
+
created_at: Date;
|
|
110
|
+
updated_at: Date;
|
|
111
|
+
deleted_at: Date | null;
|
|
112
|
+
};
|
|
113
|
+
export type SearchIndexSeedReason =
|
|
114
|
+
/** Created but never filled. */
|
|
115
|
+
"index_created"
|
|
116
|
+
/** Exists and holds no documents — an engine wiped or restarted underneath us. */
|
|
117
|
+
| "index_empty"
|
|
118
|
+
/** A migration built a new index that has to be filled, then swapped in. */
|
|
119
|
+
| "schema_changed" | "last_run_failed";
|
|
120
|
+
export type SearchIndexSeedAction = {
|
|
121
|
+
index: string;
|
|
122
|
+
/** The version being filled. */
|
|
123
|
+
target_version: SearchIndexVersionRecord;
|
|
124
|
+
/**
|
|
125
|
+
* Whether `target_version` has to become the index's active version once
|
|
126
|
+
* filled, rather than being seeded in place as the already-active version.
|
|
127
|
+
*/
|
|
128
|
+
swap: boolean;
|
|
129
|
+
reason: SearchIndexSeedReason;
|
|
7
130
|
};
|
|
8
131
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,EACN,qBAAqB,EACrB,8BAA8B,EAC9B,eAAe,EACf,WAAW,EACZ,MAAM,wBAAwB,CAAA;AAE/B,eAAO,MAAM,yCAAyC,gCACvB,CAAA;AAG/B,eAAO,MAAM,gCAAgC,SAAS,CAAA;AAEtD,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,8BAA8B,CAAC,GAAG;IAC1E;;;;OAIG;IACH,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAAA;QACvC,EAAE,EAAE,MAAM,CAAA;QACV,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAClC,EAAE,CAAA;IAIH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAGzB,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,qBAAqB,EAAE,CAAA;IAE7C,OAAO,CAAC,EAAE;QAGR,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB,CAAA;CACF,CAAA;AAED,OAAO,Q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E,MAAM,CAAA;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IACvC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,wDAAwD;IACxD,SAAS,EAAE,OAAO,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;IACxB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAA;IACvB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAA;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,CAAA;IAChB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAA;CACxB,CAAA;AAQD,MAAM,MAAM,qBAAqB;AAC/B,gCAAgC;AAC9B,eAAe;AACjB,kFAAkF;GAChF,aAAa;AACf,4EAA4E;GAC1E,gBAAgB,GAChB,iBAAiB,CAAA;AAErB,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAA;IACb,gCAAgC;IAChC,cAAc,EAAE,wBAAwB,CAAA;IACxC;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,qBAAqB,CAAA;CAC9B,CAAA"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchProviderRegistrationPrefix = exports.SearchProviderIdentifiersRegistrationName = void 0;
|
|
4
|
+
exports.SearchProviderIdentifiersRegistrationName = "search_providers_identifier";
|
|
5
|
+
// Providers are registered as `srh_{identifier}_{id}`.
|
|
6
|
+
exports.SearchProviderRegistrationPrefix = "srh_";
|
|
3
7
|
//# sourceMappingURL=index.js.map
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;AAQa,QAAA,yCAAyC,GACpD,6BAA6B,CAAA;AAE/B,uDAAuD;AAC1C,QAAA,gCAAgC,GAAG,MAAM,CAAA"}
|