@medusajs/index 2.11.2-snapshot-20251026124930 → 2.11.2-snapshot-20251029122124
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/services/index-module-service.d.ts +36 -2
- package/dist/services/index-module-service.d.ts.map +1 -1
- package/dist/services/index-module-service.js +221 -4
- package/dist/services/index-module-service.js.map +1 -1
- package/dist/utils/sync/configuration.js +1 -1
- package/dist/utils/sync/configuration.js.map +1 -1
- package/dist/utils/sync/orchestrator.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Constructor, IEventBusModuleService, IndexTypes, InternalModuleDeclaration, Logger, ModulesSdkTypes, RemoteQueryFunction } from "@medusajs/framework/types";
|
|
1
|
+
import { Constructor, Context, IEventBusModuleService, IndexTypes, InternalModuleDeclaration, Logger, ModulesSdkTypes, RemoteQueryFunction } from "@medusajs/framework/types";
|
|
2
2
|
import { MikroOrmBaseRepository as BaseRepository, ContainerRegistrationKeys, Modules, ModulesSdkUtils } from "@medusajs/framework/utils";
|
|
3
3
|
import { DataSynchronizer } from "./data-synchronizer";
|
|
4
4
|
type InjectedDependencies = {
|
|
@@ -16,6 +16,8 @@ declare const IndexModuleService_base: ModulesSdkUtils.MedusaServiceReturnType<M
|
|
|
16
16
|
export default class IndexModuleService extends IndexModuleService_base implements IndexTypes.IIndexService {
|
|
17
17
|
#private;
|
|
18
18
|
protected readonly moduleDeclaration: InternalModuleDeclaration;
|
|
19
|
+
private static readonly SyncSubscribersDescriptor;
|
|
20
|
+
private readonly baseRepository_;
|
|
19
21
|
private readonly container_;
|
|
20
22
|
private readonly moduleOptions_;
|
|
21
23
|
protected readonly eventBusModuleService_: IEventBusModuleService;
|
|
@@ -24,11 +26,12 @@ export default class IndexModuleService extends IndexModuleService_base implemen
|
|
|
24
26
|
protected readonly storageProviderCtr_: Constructor<IndexTypes.StorageProvider>;
|
|
25
27
|
protected readonly storageProviderCtrOptions_: unknown;
|
|
26
28
|
protected storageProvider_: IndexTypes.StorageProvider;
|
|
29
|
+
private configurationChecker_;
|
|
27
30
|
private get indexMetadataService_();
|
|
28
31
|
private get indexSyncService_();
|
|
29
32
|
private get dataSynchronizer_();
|
|
30
33
|
private get logger_();
|
|
31
|
-
constructor(container: InjectedDependencies, moduleDeclaration: InternalModuleDeclaration);
|
|
34
|
+
constructor(container: InjectedDependencies, moduleOptions: IndexTypes.IndexModuleOptions, moduleDeclaration: InternalModuleDeclaration);
|
|
32
35
|
__hooks: {
|
|
33
36
|
onApplicationStart(this: IndexModuleService): Promise<void>;
|
|
34
37
|
};
|
|
@@ -36,6 +39,37 @@ export default class IndexModuleService extends IndexModuleService_base implemen
|
|
|
36
39
|
query<const TEntry extends string>(config: IndexTypes.IndexQueryConfig<TEntry>): Promise<IndexTypes.QueryResultSet<TEntry>>;
|
|
37
40
|
protected registerListeners(): void;
|
|
38
41
|
private buildSchemaObjectRepresentation_;
|
|
42
|
+
/**
|
|
43
|
+
* Example output:
|
|
44
|
+
*
|
|
45
|
+
*
|
|
46
|
+
* ```json
|
|
47
|
+
* [
|
|
48
|
+
* {
|
|
49
|
+
* "id": "prod_123",
|
|
50
|
+
* "entity": "product",
|
|
51
|
+
* "status": "pending",
|
|
52
|
+
* "fields": ["id"],
|
|
53
|
+
* "updated_at": "<timestamp of last indexed data>",
|
|
54
|
+
* "last_synced_key": "prod_4321"
|
|
55
|
+
* },
|
|
56
|
+
* ...
|
|
57
|
+
* ]
|
|
58
|
+
* ```
|
|
59
|
+
* @returns Detailed index metadata with the last synced key for each entity
|
|
60
|
+
*/
|
|
61
|
+
getInfo(sharedContext?: Context): Promise<IndexTypes.IndexInfo[]>;
|
|
62
|
+
sync({ strategy }?: {
|
|
63
|
+
strategy?: "full" | "reset";
|
|
64
|
+
}): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Continue the sync of the entities no matter their status
|
|
67
|
+
* @param sharedContext
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
private continueSync;
|
|
71
|
+
private fullSync;
|
|
72
|
+
private resetSync;
|
|
39
73
|
}
|
|
40
74
|
export {};
|
|
41
75
|
//# sourceMappingURL=index-module-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-module-service.d.ts","sourceRoot":"","sources":["../../src/services/index-module-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-module-service.d.ts","sourceRoot":"","sources":["../../src/services/index-module-service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,OAAO,EAGP,sBAAsB,EACtB,UAAU,EAEV,yBAAyB,EACzB,MAAM,EACN,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EACL,sBAAsB,IAAI,cAAc,EACxC,yBAAyB,EAIzB,OAAO,EACP,eAAe,EAGhB,MAAM,2BAA2B,CAAA;AAWlC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAA;IAC3C,kBAAkB,EAAE,WAAW,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;IAC3D,CAAC,yBAAyB,CAAC,KAAK,CAAC,EAAE,mBAAmB,CAAA;IACtD,yBAAyB,EAAE,OAAO,CAAA;IAClC,cAAc,EAAE,cAAc,CAAA;IAC9B,oBAAoB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IACjE,gBAAgB,EAAE,eAAe,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAA;IAC7D,gBAAgB,EAAE,gBAAgB,CAAA;CACnC,CAAA;;AAED,MAAM,CAAC,OAAO,OAAO,kBACnB,SAAQ,uBACR,YAAW,UAAU,CAAC,aAAa;;IAqDjC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,E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OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;IAoC5B,IAAI,CAAC,EAAE,QAAQ,EAAE,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;KAAO;IAoB7D;;;;OAIG;YACW,YAAY;YA8CZ,QAAQ;YAsDR,SAAS;CA0CxB"}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
2
14
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
15
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
16
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -13,6 +25,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
25
|
var _IndexModuleService_isWorkerMode;
|
|
14
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
27
|
const utils_1 = require("@medusajs/framework/utils");
|
|
28
|
+
const _models_1 = require("../models");
|
|
16
29
|
const _types_1 = require("../types");
|
|
17
30
|
const _utils_1 = require("../utils");
|
|
18
31
|
const base_graphql_schema_1 = require("../utils/base-graphql-schema");
|
|
@@ -34,7 +47,7 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
34
47
|
return console;
|
|
35
48
|
}
|
|
36
49
|
}
|
|
37
|
-
constructor(container, moduleDeclaration) {
|
|
50
|
+
constructor(container, moduleOptions, moduleDeclaration) {
|
|
38
51
|
super(...arguments);
|
|
39
52
|
this.moduleDeclaration = moduleDeclaration;
|
|
40
53
|
_IndexModuleService_isWorkerMode.set(this, false);
|
|
@@ -43,8 +56,10 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
43
56
|
return this.onApplicationStart_();
|
|
44
57
|
},
|
|
45
58
|
};
|
|
59
|
+
this.baseRepository_ = container.baseRepository;
|
|
46
60
|
this.container_ = container;
|
|
47
|
-
this.moduleOptions_ = (
|
|
61
|
+
this.moduleOptions_ = (moduleOptions ??
|
|
62
|
+
moduleDeclaration.options ??
|
|
48
63
|
moduleDeclaration);
|
|
49
64
|
__classPrivateFieldSet(this, _IndexModuleService_isWorkerMode, moduleDeclaration.worker_mode !== "server", "f");
|
|
50
65
|
const { [utils_1.Modules.EVENT_BUS]: eventBusModuleService, storageProviderCtr, storageProviderCtrOptions, } = container;
|
|
@@ -75,14 +90,14 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
75
90
|
schemaObjectRepresentation: this.schemaObjectRepresentation_,
|
|
76
91
|
storageProvider: this.storageProvider_,
|
|
77
92
|
});
|
|
78
|
-
|
|
93
|
+
this.configurationChecker_ = new _utils_1.Configuration({
|
|
79
94
|
logger: this.logger_,
|
|
80
95
|
schemaObjectRepresentation: this.schemaObjectRepresentation_,
|
|
81
96
|
indexMetadataService: this.indexMetadataService_,
|
|
82
97
|
indexSyncService: this.indexSyncService_,
|
|
83
98
|
dataSynchronizer: this.dataSynchronizer_,
|
|
84
99
|
});
|
|
85
|
-
const entitiesMetadataChanged = await
|
|
100
|
+
const entitiesMetadataChanged = await this.configurationChecker_.checkChanges();
|
|
86
101
|
if (entitiesMetadataChanged.length) {
|
|
87
102
|
await this.dataSynchronizer_.syncEntities(entitiesMetadataChanged);
|
|
88
103
|
}
|
|
@@ -96,8 +111,12 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
96
111
|
return await this.storageProvider_.query(config);
|
|
97
112
|
}
|
|
98
113
|
registerListeners() {
|
|
114
|
+
if (!__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
99
117
|
const schemaObjectRepresentation = (this.schemaObjectRepresentation_ ??
|
|
100
118
|
{});
|
|
119
|
+
// Register entity event listeners
|
|
101
120
|
for (const [entityName, schemaEntityObjectRepresentation] of Object.entries(schemaObjectRepresentation)) {
|
|
102
121
|
if (_types_1.schemaObjectRepresentationPropertiesToOmit.includes(entityName)) {
|
|
103
122
|
continue;
|
|
@@ -107,6 +126,10 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
107
126
|
this.eventBusModuleService_.subscribe(listener, this.storageProvider_.consumeEvent(schemaEntityObjectRepresentation));
|
|
108
127
|
});
|
|
109
128
|
}
|
|
129
|
+
// Register sync subscribers
|
|
130
|
+
for (const { eventName, methodName } of Object.values(IndexModuleService.SyncSubscribersDescriptor)) {
|
|
131
|
+
this.eventBusModuleService_.subscribe(eventName, this[methodName].bind(this));
|
|
132
|
+
}
|
|
110
133
|
}
|
|
111
134
|
buildSchemaObjectRepresentation_() {
|
|
112
135
|
if (this.schemaObjectRepresentation_) {
|
|
@@ -117,7 +140,201 @@ class IndexModuleService extends utils_1.ModulesSdkUtils.MedusaService({}) {
|
|
|
117
140
|
this.schemaEntitiesMap_ = entitiesMap;
|
|
118
141
|
return executableSchema;
|
|
119
142
|
}
|
|
143
|
+
/**
|
|
144
|
+
* Example output:
|
|
145
|
+
*
|
|
146
|
+
*
|
|
147
|
+
* ```json
|
|
148
|
+
* [
|
|
149
|
+
* {
|
|
150
|
+
* "id": "prod_123",
|
|
151
|
+
* "entity": "product",
|
|
152
|
+
* "status": "pending",
|
|
153
|
+
* "fields": ["id"],
|
|
154
|
+
* "updated_at": "<timestamp of last indexed data>",
|
|
155
|
+
* "last_synced_key": "prod_4321"
|
|
156
|
+
* },
|
|
157
|
+
* ...
|
|
158
|
+
* ]
|
|
159
|
+
* ```
|
|
160
|
+
* @returns Detailed index metadata with the last synced key for each entity
|
|
161
|
+
*/
|
|
162
|
+
async getInfo(sharedContext) {
|
|
163
|
+
const listArguments = [
|
|
164
|
+
{},
|
|
165
|
+
{},
|
|
166
|
+
sharedContext,
|
|
167
|
+
];
|
|
168
|
+
const [indexMetadata, indexSync] = await (0, utils_1.promiseAll)([
|
|
169
|
+
this.indexMetadataService_.list(...listArguments),
|
|
170
|
+
this.indexSyncService_.list(...listArguments),
|
|
171
|
+
]);
|
|
172
|
+
const lastEntitySyncedKeyMap = new Map(indexSync
|
|
173
|
+
.filter((sync) => sync.last_key !== null)
|
|
174
|
+
.map((sync) => [sync.entity, sync.last_key]));
|
|
175
|
+
const indexInfo = indexMetadata.map((metadata) => {
|
|
176
|
+
return {
|
|
177
|
+
id: metadata.id,
|
|
178
|
+
entity: metadata.entity,
|
|
179
|
+
status: metadata.status,
|
|
180
|
+
fields: metadata.fields.split(","),
|
|
181
|
+
updated_at: metadata.updated_at,
|
|
182
|
+
last_synced_key: lastEntitySyncedKeyMap.get(metadata.entity) ?? null,
|
|
183
|
+
};
|
|
184
|
+
});
|
|
185
|
+
return indexInfo;
|
|
186
|
+
}
|
|
187
|
+
async sync({ strategy } = {}) {
|
|
188
|
+
if (strategy && !["full", "reset"].includes(strategy)) {
|
|
189
|
+
throw new Error(`Invalid sync strategy: ${strategy}. Must be "full" or "reset"`);
|
|
190
|
+
}
|
|
191
|
+
switch (strategy) {
|
|
192
|
+
case "full":
|
|
193
|
+
await this.fullSync();
|
|
194
|
+
break;
|
|
195
|
+
case "reset":
|
|
196
|
+
await this.resetSync();
|
|
197
|
+
break;
|
|
198
|
+
default:
|
|
199
|
+
await this.continueSync();
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Continue the sync of the entities no matter their status
|
|
205
|
+
* @param sharedContext
|
|
206
|
+
* @returns
|
|
207
|
+
*/
|
|
208
|
+
async continueSync() {
|
|
209
|
+
if (!__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
|
|
210
|
+
await this.baseRepository_.transaction(async (transactionManager) => {
|
|
211
|
+
await this.indexMetadataService_.update({
|
|
212
|
+
selector: {
|
|
213
|
+
status: [
|
|
214
|
+
_utils_1.IndexMetadataStatus.DONE,
|
|
215
|
+
_utils_1.IndexMetadataStatus.ERROR,
|
|
216
|
+
_utils_1.IndexMetadataStatus.PROCESSING,
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
data: {
|
|
220
|
+
status: _utils_1.IndexMetadataStatus.PENDING,
|
|
221
|
+
},
|
|
222
|
+
}, { transactionManager });
|
|
223
|
+
this.eventBusModuleService_.emit({
|
|
224
|
+
name: IndexModuleService.SyncSubscribersDescriptor.continueSync
|
|
225
|
+
.eventName,
|
|
226
|
+
data: {},
|
|
227
|
+
options: {
|
|
228
|
+
internal: true,
|
|
229
|
+
},
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
const entities = await this.configurationChecker_.checkChanges();
|
|
236
|
+
if (!entities.length) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
return await this.dataSynchronizer_.syncEntities(entities);
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
this.logger_.error(e);
|
|
243
|
+
throw new Error("[Index engine] Failed to continue sync");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
async fullSync() {
|
|
247
|
+
if (!__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
|
|
248
|
+
await this.baseRepository_.transaction(async (transactionManager) => {
|
|
249
|
+
await (0, utils_1.promiseAll)([
|
|
250
|
+
this.indexMetadataService_.update({
|
|
251
|
+
selector: {
|
|
252
|
+
status: [
|
|
253
|
+
_utils_1.IndexMetadataStatus.DONE,
|
|
254
|
+
_utils_1.IndexMetadataStatus.ERROR,
|
|
255
|
+
_utils_1.IndexMetadataStatus.PROCESSING,
|
|
256
|
+
],
|
|
257
|
+
},
|
|
258
|
+
data: {
|
|
259
|
+
status: _utils_1.IndexMetadataStatus.PENDING,
|
|
260
|
+
},
|
|
261
|
+
}, { transactionManager }),
|
|
262
|
+
this.indexSyncService_.update({
|
|
263
|
+
selector: { last_key: { $ne: null } },
|
|
264
|
+
data: { last_key: null },
|
|
265
|
+
}, { transactionManager }),
|
|
266
|
+
]);
|
|
267
|
+
await this.eventBusModuleService_.emit({
|
|
268
|
+
name: IndexModuleService.SyncSubscribersDescriptor.fullSync.eventName,
|
|
269
|
+
data: {},
|
|
270
|
+
options: {
|
|
271
|
+
internal: true,
|
|
272
|
+
},
|
|
273
|
+
});
|
|
274
|
+
});
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
try {
|
|
278
|
+
const entities = await this.configurationChecker_.checkChanges();
|
|
279
|
+
if (!entities.length) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
return await this.dataSynchronizer_.syncEntities(entities);
|
|
283
|
+
}
|
|
284
|
+
catch (e) {
|
|
285
|
+
this.logger_.error(e);
|
|
286
|
+
throw new Error("[Index engine] Failed to full sync");
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
async resetSync() {
|
|
290
|
+
if (!__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
|
|
291
|
+
await this.baseRepository_.transaction(async (transactionManager) => {
|
|
292
|
+
const truncableTables = [
|
|
293
|
+
(0, utils_1.toMikroORMEntity)(_models_1.IndexData).prototype,
|
|
294
|
+
(0, utils_1.toMikroORMEntity)(_models_1.IndexRelation).prototype,
|
|
295
|
+
(0, utils_1.toMikroORMEntity)(_models_1.IndexMetadata).prototype,
|
|
296
|
+
(0, utils_1.toMikroORMEntity)(_models_1.IndexSync).prototype,
|
|
297
|
+
].map((table) => table.__helper.__meta.collection);
|
|
298
|
+
await transactionManager.execute(`TRUNCATE TABLE ${truncableTables.join(", ")} CASCADE`);
|
|
299
|
+
await this.eventBusModuleService_.emit({
|
|
300
|
+
name: IndexModuleService.SyncSubscribersDescriptor.resetSync
|
|
301
|
+
.eventName,
|
|
302
|
+
data: {},
|
|
303
|
+
options: {
|
|
304
|
+
internal: true,
|
|
305
|
+
},
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
try {
|
|
311
|
+
const changes = await this.configurationChecker_.checkChanges();
|
|
312
|
+
if (!changes.length) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
await this.dataSynchronizer_.syncEntities(changes);
|
|
316
|
+
}
|
|
317
|
+
catch (e) {
|
|
318
|
+
this.logger_.error(e);
|
|
319
|
+
throw new Error("[Index engine] Failed to reset sync");
|
|
320
|
+
}
|
|
321
|
+
}
|
|
120
322
|
}
|
|
121
323
|
_IndexModuleService_isWorkerMode = new WeakMap();
|
|
324
|
+
IndexModuleService.SyncSubscribersDescriptor = {
|
|
325
|
+
continueSync: {
|
|
326
|
+
eventName: "index.continue-sync",
|
|
327
|
+
methodName: "continueSync",
|
|
328
|
+
},
|
|
329
|
+
fullSync: { eventName: "index.full-sync", methodName: "fullSync" },
|
|
330
|
+
resetSync: { eventName: "index.reset-sync", methodName: "resetSync" },
|
|
331
|
+
};
|
|
122
332
|
exports.default = IndexModuleService;
|
|
333
|
+
__decorate([
|
|
334
|
+
(0, utils_1.InjectManager)(),
|
|
335
|
+
__param(0, (0, utils_1.MedusaContext)()),
|
|
336
|
+
__metadata("design:type", Function),
|
|
337
|
+
__metadata("design:paramtypes", [Object]),
|
|
338
|
+
__metadata("design:returntype", Promise)
|
|
339
|
+
], IndexModuleService.prototype, "getInfo", null);
|
|
123
340
|
//# sourceMappingURL=index-module-service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-module-service.js","sourceRoot":"","sources":["../../src/services/index-module-service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index-module-service.js","sourceRoot":"","sources":["../../src/services/index-module-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,qDAUkC;AAClC,qCAA4E;AAC5E,mCAAmE;AACnE,mCAMe;AACf,sEAAgE;AAehE,MAAqB,kBACnB,SAAQ,uBAAe,CAAC,aAAa,CAAC,EAAE,CAAC;IA+BzC,IAAY,qBAAqB;QAC/B,OAAO,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAA;IAC7C,CAAC;IAED,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAA;IACzC,CAAC;IAED,IAAY,iBAAiB;QAC3B,OAAO,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAA;IACzC,CAAC;IAED,IAAY,OAAO;QACjB,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAA;QAC/B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,OAA4B,CAAA;QACrC,CAAC;IACH,CAAC;IAED,YACE,SAA+B,EAC/B,aAA4C,EACzB,iBAA4C;QAE/D,KAAK,CAAC,GAAG,SAAS,CAAC,CAAA;QAFA,sBAAiB,GAAjB,iBAAiB,CAA2B;QAnDjE,2CAAyB,KAAK,EAAA;QA+E9B,YAAO,GAAG;YACR,kBAAkB;gBAChB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAA;YACnC,CAAC;SACF,CAAA;QA5BC,IAAI,CAAC,eA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C,OAAO,CAAC,CAAA;QACpD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;QACxD,CAAC;IACH,CAAC;;;AAlauB,4CAAyB,GAAG;IAClD,YAAY,EAAE;QACZ,SAAS,EAAE,qBAAqB;QAChC,UAAU,EAAE,cAAc;KAC3B;IACD,QAAQ,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,UAAU,EAAE;IAClE,SAAS,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,WAAW,EAAE;CAC7D,AAPuC,CAOvC;kBAbS,kBAAkB;AA4N/B;IADL,IAAA,qBAAa,GAAE;IAEb,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;iDAmCjB"}
|
|
@@ -32,7 +32,7 @@ class Configuration {
|
|
|
32
32
|
async checkChanges() {
|
|
33
33
|
__classPrivateFieldGet(this, _Configuration_logger, "f").info("[Index engine] Checking for index changes");
|
|
34
34
|
const schemaObjectRepresentation = __classPrivateFieldGet(this, _Configuration_schemaObjectRepresentation, "f");
|
|
35
|
-
const currentConfig = await __classPrivateFieldGet(this, _Configuration_indexMetadataService, "f").list();
|
|
35
|
+
const currentConfig = await __classPrivateFieldGet(this, _Configuration_indexMetadataService, "f").list({});
|
|
36
36
|
const currentConfigMap = new Map(currentConfig.map((c) => [c.entity, c]));
|
|
37
37
|
const entityPresent = new Set();
|
|
38
38
|
const newConfig = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/sync/configuration.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,qDAAsD;AAGtD,mCAAmE;AAInE,oEAA8D;AAE9D,MAAa,aAAa;IAOxB,YAAY,EACV,0BAA0B,EAC1B,oBAAoB,EACpB,gBAAgB,EA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,CAAC,IAAI,CAAC;gBAC5C,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;aACzC,CAAC,CAAA;YACF,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;gBAC3B,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAA;gBACxD,IAAI,EAAE,EAAE,CAAC;oBACP,IAAI,CAAC,EAAE,GAAG,EAAE,CAAA;gBACd,CAAC;YACH,CAAC,CAAC,CAAA;YAEF,MAAM,uBAAA,IAAI,uCAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QAClD,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,uBAAA,IAAI,2CAAsB,CAAC,IAAI,CAAC;YACpD,MAAM,EAAE;gBACN,2CAAmB,CAAC,OAAO;gBAC3B,2CAAmB,CAAC,UAAU;gBAC9B,2CAAmB,CAAC,KAAK;aAC1B;SACF,CAAC,CAAA;QAEF,uBAAA,IAAI,6BAAQ,CAAC,IAAI,CACf,wBAAwB,OAAO,CAAC,MAAM,gBACpC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAC7B,wCAAwC,CACzC,CAAA;QAED,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AAnJD,sCAmJC"}
|
|
@@ -4,7 +4,7 @@ export declare class Orchestrator {
|
|
|
4
4
|
/**
|
|
5
5
|
* The current state of the orchestrator
|
|
6
6
|
*/
|
|
7
|
-
get state(): "
|
|
7
|
+
get state(): "processing" | "error" | "idle" | "completed";
|
|
8
8
|
/**
|
|
9
9
|
* Reference to the currently processed entity
|
|
10
10
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/index",
|
|
3
|
-
"version": "2.11.2-snapshot-
|
|
3
|
+
"version": "2.11.2-snapshot-20251029122124",
|
|
4
4
|
"description": "Medusa Index module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,15 +29,15 @@
|
|
|
29
29
|
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
|
30
30
|
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
|
31
31
|
"test": "jest --passWithNoTests ./src",
|
|
32
|
-
"test:integration": "jest --forceExit -- integration-tests/__tests__/**/*.ts",
|
|
32
|
+
"test:integration": "jest --forceExit -- integration-tests/__tests__/**/*.spec.ts",
|
|
33
33
|
"migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:create --initial",
|
|
34
34
|
"migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:create",
|
|
35
35
|
"migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:up",
|
|
36
36
|
"orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm cache:clear"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@medusajs/framework": "2.11.2-snapshot-
|
|
40
|
-
"@medusajs/test-utils": "2.11.2-snapshot-
|
|
39
|
+
"@medusajs/framework": "2.11.2-snapshot-20251029122124",
|
|
40
|
+
"@medusajs/test-utils": "2.11.2-snapshot-20251029122124",
|
|
41
41
|
"@swc/core": "^1.7.28",
|
|
42
42
|
"@swc/jest": "^0.2.36",
|
|
43
43
|
"jest": "^29.7.0",
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"typescript": "^5.6.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@medusajs/framework": "2.11.2-snapshot-
|
|
49
|
+
"@medusajs/framework": "2.11.2-snapshot-20251029122124"
|
|
50
50
|
}
|
|
51
51
|
}
|