@acmekit/index 2.13.1

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.
Files changed (151) hide show
  1. package/README.md +1 -0
  2. package/dist/index.d.ts +6 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +13 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/loaders/index.d.ts +4 -0
  7. package/dist/loaders/index.d.ts.map +1 -0
  8. package/dist/loaders/index.js +27 -0
  9. package/dist/loaders/index.js.map +1 -0
  10. package/dist/migrations/Migration20231019174230.d.ts +5 -0
  11. package/dist/migrations/Migration20231019174230.d.ts.map +1 -0
  12. package/dist/migrations/Migration20231019174230.js +12 -0
  13. package/dist/migrations/Migration20231019174230.js.map +1 -0
  14. package/dist/migrations/Migration20241209173313.d.ts +6 -0
  15. package/dist/migrations/Migration20241209173313.d.ts.map +1 -0
  16. package/dist/migrations/Migration20241209173313.js +36 -0
  17. package/dist/migrations/Migration20241209173313.js.map +1 -0
  18. package/dist/migrations/Migration20250122154720.d.ts +6 -0
  19. package/dist/migrations/Migration20250122154720.d.ts.map +1 -0
  20. package/dist/migrations/Migration20250122154720.js +16 -0
  21. package/dist/migrations/Migration20250122154720.js.map +1 -0
  22. package/dist/migrations/Migration20250127105159.d.ts +6 -0
  23. package/dist/migrations/Migration20250127105159.d.ts.map +1 -0
  24. package/dist/migrations/Migration20250127105159.js +16 -0
  25. package/dist/migrations/Migration20250127105159.js.map +1 -0
  26. package/dist/migrations/Migration20250127144442.d.ts +6 -0
  27. package/dist/migrations/Migration20250127144442.d.ts.map +1 -0
  28. package/dist/migrations/Migration20250127144442.js +16 -0
  29. package/dist/migrations/Migration20250127144442.js.map +1 -0
  30. package/dist/migrations/Migration20250128132404.d.ts +6 -0
  31. package/dist/migrations/Migration20250128132404.d.ts.map +1 -0
  32. package/dist/migrations/Migration20250128132404.js +16 -0
  33. package/dist/migrations/Migration20250128132404.js.map +1 -0
  34. package/dist/migrations/Migration20250218132404.d.ts +6 -0
  35. package/dist/migrations/Migration20250218132404.d.ts.map +1 -0
  36. package/dist/migrations/Migration20250218132404.js +48 -0
  37. package/dist/migrations/Migration20250218132404.js.map +1 -0
  38. package/dist/migrations/Migration20250515161913.d.ts +6 -0
  39. package/dist/migrations/Migration20250515161913.d.ts.map +1 -0
  40. package/dist/migrations/Migration20250515161913.js +62 -0
  41. package/dist/migrations/Migration20250515161913.js.map +1 -0
  42. package/dist/models/index-data.d.ts +8 -0
  43. package/dist/models/index-data.d.ts.map +1 -0
  44. package/dist/models/index-data.js +12 -0
  45. package/dist/models/index-data.js.map +1 -0
  46. package/dist/models/index-metadata.d.ts +10 -0
  47. package/dist/models/index-metadata.d.ts.map +1 -0
  48. package/dist/models/index-metadata.js +23 -0
  49. package/dist/models/index-metadata.js.map +1 -0
  50. package/dist/models/index-relation.d.ts +11 -0
  51. package/dist/models/index-relation.d.ts.map +1 -0
  52. package/dist/models/index-relation.js +14 -0
  53. package/dist/models/index-relation.js.map +1 -0
  54. package/dist/models/index-sync.d.ts +7 -0
  55. package/dist/models/index-sync.d.ts.map +1 -0
  56. package/dist/models/index-sync.js +18 -0
  57. package/dist/models/index-sync.js.map +1 -0
  58. package/dist/models/index.d.ts +5 -0
  59. package/dist/models/index.d.ts.map +1 -0
  60. package/dist/models/index.js +15 -0
  61. package/dist/models/index.js.map +1 -0
  62. package/dist/services/data-synchronizer.d.ts +35 -0
  63. package/dist/services/data-synchronizer.d.ts.map +1 -0
  64. package/dist/services/data-synchronizer.js +238 -0
  65. package/dist/services/data-synchronizer.js.map +1 -0
  66. package/dist/services/index-data.d.ts +8 -0
  67. package/dist/services/index-data.d.ts.map +1 -0
  68. package/dist/services/index-data.js +9 -0
  69. package/dist/services/index-data.js.map +1 -0
  70. package/dist/services/index-metadata.d.ts +8 -0
  71. package/dist/services/index-metadata.d.ts.map +1 -0
  72. package/dist/services/index-metadata.js +9 -0
  73. package/dist/services/index-metadata.js.map +1 -0
  74. package/dist/services/index-module-service.d.ts +75 -0
  75. package/dist/services/index-module-service.d.ts.map +1 -0
  76. package/dist/services/index-module-service.js +340 -0
  77. package/dist/services/index-module-service.js.map +1 -0
  78. package/dist/services/index-relation.d.ts +8 -0
  79. package/dist/services/index-relation.d.ts.map +1 -0
  80. package/dist/services/index-relation.js +9 -0
  81. package/dist/services/index-relation.js.map +1 -0
  82. package/dist/services/index-sync.d.ts +8 -0
  83. package/dist/services/index-sync.d.ts.map +1 -0
  84. package/dist/services/index-sync.js +9 -0
  85. package/dist/services/index-sync.js.map +1 -0
  86. package/dist/services/index.d.ts +2 -0
  87. package/dist/services/index.d.ts.map +1 -0
  88. package/dist/services/index.js +9 -0
  89. package/dist/services/index.js.map +1 -0
  90. package/dist/services/postgres-provider.d.ts +132 -0
  91. package/dist/services/postgres-provider.d.ts.map +1 -0
  92. package/dist/services/postgres-provider.js +516 -0
  93. package/dist/services/postgres-provider.js.map +1 -0
  94. package/dist/tsconfig.tsbuildinfo +1 -0
  95. package/dist/types/index.d.ts +21 -0
  96. package/dist/types/index.d.ts.map +1 -0
  97. package/dist/types/index.js +12 -0
  98. package/dist/types/index.js.map +1 -0
  99. package/dist/utils/base-graphql-schema.d.ts +2 -0
  100. package/dist/utils/base-graphql-schema.d.ts.map +1 -0
  101. package/dist/utils/base-graphql-schema.js +10 -0
  102. package/dist/utils/base-graphql-schema.js.map +1 -0
  103. package/dist/utils/build-config.d.ts +28 -0
  104. package/dist/utils/build-config.d.ts.map +1 -0
  105. package/dist/utils/build-config.js +840 -0
  106. package/dist/utils/build-config.js.map +1 -0
  107. package/dist/utils/create-partitions.d.ts +4 -0
  108. package/dist/utils/create-partitions.d.ts.map +1 -0
  109. package/dist/utils/create-partitions.js +80 -0
  110. package/dist/utils/create-partitions.js.map +1 -0
  111. package/dist/utils/default-schema.d.ts +2 -0
  112. package/dist/utils/default-schema.d.ts.map +1 -0
  113. package/dist/utils/default-schema.js +41 -0
  114. package/dist/utils/default-schema.js.map +1 -0
  115. package/dist/utils/flatten-object-keys.d.ts +23 -0
  116. package/dist/utils/flatten-object-keys.d.ts.map +1 -0
  117. package/dist/utils/flatten-object-keys.js +54 -0
  118. package/dist/utils/flatten-object-keys.js.map +1 -0
  119. package/dist/utils/gql-to-types.d.ts +3 -0
  120. package/dist/utils/gql-to-types.d.ts.map +1 -0
  121. package/dist/utils/gql-to-types.js +98 -0
  122. package/dist/utils/gql-to-types.js.map +1 -0
  123. package/dist/utils/index-metadata-status.d.ts +7 -0
  124. package/dist/utils/index-metadata-status.d.ts.map +1 -0
  125. package/dist/utils/index-metadata-status.js +11 -0
  126. package/dist/utils/index-metadata-status.js.map +1 -0
  127. package/dist/utils/index.d.ts +10 -0
  128. package/dist/utils/index.d.ts.map +1 -0
  129. package/dist/utils/index.js +26 -0
  130. package/dist/utils/index.js.map +1 -0
  131. package/dist/utils/normalize-fields-selection.d.ts +2 -0
  132. package/dist/utils/normalize-fields-selection.d.ts.map +1 -0
  133. package/dist/utils/normalize-fields-selection.js +10 -0
  134. package/dist/utils/normalize-fields-selection.js.map +1 -0
  135. package/dist/utils/normalze-table-name.d.ts +3 -0
  136. package/dist/utils/normalze-table-name.d.ts.map +1 -0
  137. package/dist/utils/normalze-table-name.js +13 -0
  138. package/dist/utils/normalze-table-name.js.map +1 -0
  139. package/dist/utils/query-builder.d.ts +61 -0
  140. package/dist/utils/query-builder.d.ts.map +1 -0
  141. package/dist/utils/query-builder.js +791 -0
  142. package/dist/utils/query-builder.js.map +1 -0
  143. package/dist/utils/sync/configuration.d.ts +17 -0
  144. package/dist/utils/sync/configuration.d.ts.map +1 -0
  145. package/dist/utils/sync/configuration.js +114 -0
  146. package/dist/utils/sync/configuration.js.map +1 -0
  147. package/dist/utils/sync/orchestrator.d.ts +33 -0
  148. package/dist/utils/sync/orchestrator.d.ts.map +1 -0
  149. package/dist/utils/sync/orchestrator.js +195 -0
  150. package/dist/utils/sync/orchestrator.js.map +1 -0
  151. package/package.json +45 -0
@@ -0,0 +1,340 @@
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
+ };
14
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
15
+ if (kind === "m") throw new TypeError("Private method is not writable");
16
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
17
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
18
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
19
+ };
20
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
21
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
22
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
23
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
24
+ };
25
+ var _IndexModuleService_isWorkerMode;
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ const utils_1 = require("@acmekit/framework/utils");
28
+ const _models_1 = require("../models");
29
+ const _types_1 = require("../types");
30
+ const _utils_1 = require("../utils");
31
+ const base_graphql_schema_1 = require("../utils/base-graphql-schema");
32
+ class IndexModuleService extends utils_1.ModulesSdkUtils.AcmeKitService({}) {
33
+ get indexMetadataService_() {
34
+ return this.container_.indexMetadataService;
35
+ }
36
+ get indexSyncService_() {
37
+ return this.container_.indexSyncService;
38
+ }
39
+ get dataSynchronizer_() {
40
+ return this.container_.dataSynchronizer;
41
+ }
42
+ get logger_() {
43
+ try {
44
+ return this.container_.logger;
45
+ }
46
+ catch (e) {
47
+ return console;
48
+ }
49
+ }
50
+ constructor(container, moduleOptions, moduleDeclaration) {
51
+ super(...arguments);
52
+ this.moduleDeclaration = moduleDeclaration;
53
+ _IndexModuleService_isWorkerMode.set(this, false);
54
+ this.__hooks = {
55
+ onApplicationStart() {
56
+ return this.onApplicationStart_();
57
+ },
58
+ };
59
+ this.baseRepository_ = container.baseRepository;
60
+ this.container_ = container;
61
+ this.moduleOptions_ = (moduleOptions ??
62
+ moduleDeclaration.options ??
63
+ moduleDeclaration);
64
+ __classPrivateFieldSet(this, _IndexModuleService_isWorkerMode, moduleDeclaration.worker_mode !== "server", "f");
65
+ const { [utils_1.Modules.EVENT_BUS]: eventBusModuleService, storageProviderCtr, storageProviderCtrOptions, } = container;
66
+ this.eventBusModuleService_ = eventBusModuleService;
67
+ this.storageProviderCtr_ = storageProviderCtr;
68
+ this.storageProviderCtrOptions_ = storageProviderCtrOptions;
69
+ if (!this.eventBusModuleService_) {
70
+ throw new Error("EventBusModuleService is required for the IndexModule to work");
71
+ }
72
+ }
73
+ async onApplicationStart_() {
74
+ try {
75
+ const executableSchema = this.buildSchemaObjectRepresentation_();
76
+ this.storageProvider_ = new this.storageProviderCtr_(this.container_, Object.assign(this.storageProviderCtrOptions_ ?? {}, {
77
+ schemaObjectRepresentation: this.schemaObjectRepresentation_,
78
+ entityMap: this.schemaEntitiesMap_,
79
+ }), this.moduleOptions_);
80
+ this.registerListeners();
81
+ if (this.storageProvider_.onApplicationStart) {
82
+ await this.storageProvider_.onApplicationStart();
83
+ }
84
+ await (0, _utils_1.gqlSchemaToTypes)(executableSchema);
85
+ /**
86
+ * Only run the data synchronization in worker mode
87
+ */
88
+ if (__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
89
+ this.dataSynchronizer_.onApplicationStart({
90
+ schemaObjectRepresentation: this.schemaObjectRepresentation_,
91
+ storageProvider: this.storageProvider_,
92
+ });
93
+ this.configurationChecker_ = new _utils_1.Configuration({
94
+ logger: this.logger_,
95
+ schemaObjectRepresentation: this.schemaObjectRepresentation_,
96
+ indexMetadataService: this.indexMetadataService_,
97
+ indexSyncService: this.indexSyncService_,
98
+ dataSynchronizer: this.dataSynchronizer_,
99
+ });
100
+ const entitiesMetadataChanged = await this.configurationChecker_.checkChanges();
101
+ if (entitiesMetadataChanged.length) {
102
+ await this.dataSynchronizer_.syncEntities(entitiesMetadataChanged);
103
+ }
104
+ }
105
+ }
106
+ catch (e) {
107
+ this.logger_.error(e);
108
+ }
109
+ }
110
+ async query(config) {
111
+ return await this.storageProvider_.query(config);
112
+ }
113
+ registerListeners() {
114
+ if (!__classPrivateFieldGet(this, _IndexModuleService_isWorkerMode, "f")) {
115
+ return;
116
+ }
117
+ const schemaObjectRepresentation = (this.schemaObjectRepresentation_ ??
118
+ {});
119
+ // Register entity event listeners
120
+ for (const [entityName, schemaEntityObjectRepresentation] of Object.entries(schemaObjectRepresentation)) {
121
+ if (_types_1.schemaObjectRepresentationPropertiesToOmit.includes(entityName)) {
122
+ continue;
123
+ }
124
+ ;
125
+ schemaEntityObjectRepresentation.listeners.forEach((listener) => {
126
+ this.eventBusModuleService_.subscribe(listener, this.storageProvider_.consumeEvent(schemaEntityObjectRepresentation));
127
+ });
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
+ }
133
+ }
134
+ buildSchemaObjectRepresentation_() {
135
+ if (this.schemaObjectRepresentation_) {
136
+ return;
137
+ }
138
+ const { objectRepresentation, entitiesMap, executableSchema } = (0, _utils_1.buildSchemaObjectRepresentation)(base_graphql_schema_1.baseGraphqlSchema + (this.moduleOptions_.schema ?? _utils_1.defaultSchema));
139
+ this.schemaObjectRepresentation_ = objectRepresentation;
140
+ this.schemaEntitiesMap_ = entitiesMap;
141
+ return executableSchema;
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
+ }
322
+ }
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
+ };
332
+ exports.default = IndexModuleService;
333
+ __decorate([
334
+ (0, utils_1.InjectManager)(),
335
+ __param(0, (0, utils_1.AcmeKitContext)()),
336
+ __metadata("design:type", Function),
337
+ __metadata("design:paramtypes", [Object]),
338
+ __metadata("design:returntype", Promise)
339
+ ], IndexModuleService.prototype, "getInfo", null);
340
+ //# sourceMappingURL=index-module-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-module-service.js","sourceRoot":"","sources":["../../src/services/index-module-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,oDAUiC;AACjC,qCAA4E;AAC5E,mCAAmE;AACnE,mCAMe;AACf,sEAAgE;AAehE,MAAqB,kBACnB,SAAQ,uBAAe,CAAC,cAAc,CAAC,EAAE,CAAC;IA+B1C,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,eAAe,GAAG,SAAS,CAAC,cAAc,CAAA;QAC/C,IAAI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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,sBAAc,GAAE,CAAA;;;;iDAmClB"}
@@ -0,0 +1,8 @@
1
+ declare const IndexRelationService_base: {
2
+ new <TContainer extends object = object, TEntity extends object = any>(container: TContainer): import("@acmekit/types").IAcmeKitInternalService<TEntity, TContainer>;
3
+ setEventSubscriber(subscriber: import("@acmekit/framework/utils").AcmeKitMikroOrmEventSubscriber): void;
4
+ };
5
+ export declare class IndexRelationService extends IndexRelationService_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=index-relation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-relation.d.ts","sourceRoot":"","sources":["../../src/services/index-relation.ts"],"names":[],"mappings":";;;;AAGA,qBAAa,oBAAqB,SAAQ,yBAEzC;CAAG"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IndexRelationService = void 0;
4
+ const utils_1 = require("@acmekit/framework/utils");
5
+ const _models_1 = require("../models");
6
+ class IndexRelationService extends (0, utils_1.AcmeKitInternalService)(_models_1.IndexRelation) {
7
+ }
8
+ exports.IndexRelationService = IndexRelationService;
9
+ //# sourceMappingURL=index-relation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-relation.js","sourceRoot":"","sources":["../../src/services/index-relation.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,qCAAuC;AAEvC,MAAa,oBAAqB,SAAQ,IAAA,8BAAsB,EAC9D,uBAAa,CACd;CAAG;AAFJ,oDAEI"}
@@ -0,0 +1,8 @@
1
+ declare const IndexSyncService_base: {
2
+ new <TContainer extends object = object, TEntity extends object = any>(container: TContainer): import("@acmekit/types").IAcmeKitInternalService<TEntity, TContainer>;
3
+ setEventSubscriber(subscriber: import("@acmekit/framework/utils").AcmeKitMikroOrmEventSubscriber): void;
4
+ };
5
+ export declare class IndexSyncService extends IndexSyncService_base {
6
+ }
7
+ export {};
8
+ //# sourceMappingURL=index-sync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-sync.d.ts","sourceRoot":"","sources":["../../src/services/index-sync.ts"],"names":[],"mappings":";;;;AAGA,qBAAa,gBAAiB,SAAQ,qBAAiC;CAAG"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IndexSyncService = void 0;
4
+ const utils_1 = require("@acmekit/framework/utils");
5
+ const _models_1 = require("../models");
6
+ class IndexSyncService extends (0, utils_1.AcmeKitInternalService)(_models_1.IndexSync) {
7
+ }
8
+ exports.IndexSyncService = IndexSyncService;
9
+ //# sourceMappingURL=index-sync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-sync.js","sourceRoot":"","sources":["../../src/services/index-sync.ts"],"names":[],"mappings":";;;AAAA,oDAAiE;AACjE,qCAAmC;AAEnC,MAAa,gBAAiB,SAAQ,IAAA,8BAAsB,EAAC,mBAAS,CAAC;CAAG;AAA1E,4CAA0E"}
@@ -0,0 +1,2 @@
1
+ export { default as IndexModuleService } from "./index-module-service";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,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.IndexModuleService = void 0;
7
+ var index_module_service_1 = require("./index-module-service");
8
+ Object.defineProperty(exports, "IndexModuleService", { enumerable: true, get: function () { return __importDefault(index_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,+DAAsE;AAA7D,2IAAA,OAAO,OAAsB"}
@@ -0,0 +1,132 @@
1
+ import { Context, Event, IndexTypes, RemoteQueryFunction, Subscriber } from "@acmekit/framework/types";
2
+ import { MikroOrmBaseRepository as BaseRepository, ContainerRegistrationKeys } from "@acmekit/framework/utils";
3
+ import { EntityManager, SqlEntityManager } from "@acmekit/framework/mikro-orm/postgresql";
4
+ type InjectedDependencies = {
5
+ manager: EntityManager;
6
+ [ContainerRegistrationKeys.QUERY]: RemoteQueryFunction;
7
+ baseRepository: BaseRepository;
8
+ };
9
+ export declare class PostgresProvider implements IndexTypes.StorageProvider {
10
+ #private;
11
+ protected readonly eventActionToMethodMap_: {
12
+ created: string;
13
+ updated: string;
14
+ deleted: string;
15
+ attached: string;
16
+ detached: string;
17
+ };
18
+ protected container_: InjectedDependencies;
19
+ protected readonly schemaObjectRepresentation_: IndexTypes.SchemaObjectRepresentation;
20
+ protected readonly schemaEntitiesMap_: Record<string, any>;
21
+ protected readonly moduleOptions_: IndexTypes.IndexModuleOptions;
22
+ protected readonly manager_: SqlEntityManager;
23
+ protected readonly query_: RemoteQueryFunction;
24
+ protected baseRepository_: BaseRepository;
25
+ constructor(container: InjectedDependencies, options: {
26
+ schemaObjectRepresentation: IndexTypes.SchemaObjectRepresentation;
27
+ entityMap: Record<string, any>;
28
+ }, moduleOptions: IndexTypes.IndexModuleOptions);
29
+ onApplicationStart(): Promise<void>;
30
+ protected static parseData<TData extends {
31
+ id: string;
32
+ [key: string]: unknown;
33
+ }>(data: TData | TData[], schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation): {
34
+ data: TData[];
35
+ entityProperties: string[];
36
+ parentsProperties: {
37
+ [entity: string]: string[];
38
+ };
39
+ };
40
+ protected static parseMessageData<TData extends {
41
+ id: string | string[];
42
+ }>(message?: Event): {
43
+ action: string;
44
+ data: TData[];
45
+ ids: string[];
46
+ } | void;
47
+ consumeEvent(schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation): Subscriber<{
48
+ id: string | string[];
49
+ }>;
50
+ query<const TEntry extends string>(config: IndexTypes.IndexQueryConfig<TEntry>, sharedContext?: Context): Promise<IndexTypes.QueryResultSet<TEntry>>;
51
+ /**
52
+ * Create the index entry and the index relation entry when this event is emitted.
53
+ * @param entity
54
+ * @param data
55
+ * @param schemaEntityObjectRepresentation
56
+ * @param sharedContext
57
+ * @protected
58
+ */
59
+ onCreate<TData extends {
60
+ id: string;
61
+ [key: string]: unknown;
62
+ }>({ entity, data, schemaEntityObjectRepresentation, }: {
63
+ entity: string;
64
+ data: TData | TData[];
65
+ schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation;
66
+ }, sharedContext?: Context<SqlEntityManager>): Promise<void>;
67
+ /**
68
+ * Update the index entry when this event is emitted.
69
+ * @param entity
70
+ * @param data
71
+ * @param schemaEntityObjectRepresentation
72
+ * @param sharedContext
73
+ * @protected
74
+ */
75
+ onUpdate<TData extends {
76
+ id: string;
77
+ [key: string]: unknown;
78
+ }>({ entity, data, schemaEntityObjectRepresentation, }: {
79
+ entity: string;
80
+ data: TData | TData[];
81
+ schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation;
82
+ }, sharedContext?: Context<SqlEntityManager>): Promise<void>;
83
+ /**
84
+ * Delete the index entry when this event is emitted.
85
+ * @param entity
86
+ * @param data
87
+ * @param schemaEntityObjectRepresentation
88
+ * @param sharedContext
89
+ * @protected
90
+ */
91
+ onDelete<TData extends {
92
+ id: string;
93
+ [key: string]: unknown;
94
+ }>({ entity, data, schemaEntityObjectRepresentation, }: {
95
+ entity: string;
96
+ data: TData | TData[];
97
+ schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation;
98
+ }, sharedContext?: Context<SqlEntityManager>): Promise<void>;
99
+ /**
100
+ * event emitted from the link modules to attach a link entity to its parent and child entities from the linked modules.
101
+ * @param entity
102
+ * @param data
103
+ * @param schemaEntityObjectRepresentation
104
+ * @protected
105
+ */
106
+ onAttach<TData extends {
107
+ id: string;
108
+ [key: string]: unknown;
109
+ }>({ entity, data, schemaEntityObjectRepresentation, }: {
110
+ entity: string;
111
+ data: TData | TData[];
112
+ schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation;
113
+ }, sharedContext?: Context<SqlEntityManager>): Promise<void>;
114
+ /**
115
+ * Event emitted from the link modules to detach a link entity from its parent and child entities from the linked modules.
116
+ * @param entity
117
+ * @param data
118
+ * @param schemaEntityObjectRepresentation
119
+ * @param sharedContext
120
+ * @protected
121
+ */
122
+ onDetach<TData extends {
123
+ id: string;
124
+ [key: string]: unknown;
125
+ }>({ entity, data, schemaEntityObjectRepresentation, }: {
126
+ entity: string;
127
+ data: TData | TData[];
128
+ schemaEntityObjectRepresentation: IndexTypes.SchemaObjectEntityRepresentation;
129
+ }, sharedContext?: Context<SqlEntityManager>): Promise<void>;
130
+ }
131
+ export {};
132
+ //# sourceMappingURL=postgres-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-provider.d.ts","sourceRoot":"","sources":["../../src/services/postgres-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,EACL,UAAU,EAEV,mBAAmB,EACnB,UAAU,EAC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