@kinotic-ai/persistence 1.1.0 → 1.1.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.
package/dist/index.cjs CHANGED
@@ -268,62 +268,62 @@ class EntitiesRepository {
268
268
  constructor(kinotic) {
269
269
  this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.JsonEntitiesRepository");
270
270
  }
271
- bulkSave(structureId, entities) {
272
- return this.serviceProxy.invoke("bulkSave", [structureId, entities]);
271
+ bulkSave(entityDefinitionId, entities) {
272
+ return this.serviceProxy.invoke("bulkSave", [entityDefinitionId, entities]);
273
273
  }
274
- bulkUpdate(structureId, entities) {
275
- return this.serviceProxy.invoke("bulkUpdate", [structureId, entities]);
274
+ bulkUpdate(entityDefinitionId, entities) {
275
+ return this.serviceProxy.invoke("bulkUpdate", [entityDefinitionId, entities]);
276
276
  }
277
- count(structureId) {
278
- return this.serviceProxy.invoke("count", [structureId]);
277
+ count(entityDefinitionId) {
278
+ return this.serviceProxy.invoke("count", [entityDefinitionId]);
279
279
  }
280
- countByQuery(structureId, query) {
281
- return this.serviceProxy.invoke("countByQuery", [structureId, query]);
280
+ countByQuery(entityDefinitionId, query) {
281
+ return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query]);
282
282
  }
283
- deleteById(structureId, id) {
284
- return this.serviceProxy.invoke("deleteById", [structureId, id]);
283
+ deleteById(entityDefinitionId, id) {
284
+ return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
285
285
  }
286
- deleteByQuery(structureId, query) {
287
- return this.serviceProxy.invoke("deleteByQuery", [structureId, query]);
286
+ deleteByQuery(entityDefinitionId, query) {
287
+ return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query]);
288
288
  }
289
- async findAll(structureId, pageable) {
290
- const page = await this.findAllSinglePage(structureId, pageable);
291
- return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(structureId, pageable2));
289
+ async findAll(entityDefinitionId, pageable) {
290
+ const page = await this.findAllSinglePage(entityDefinitionId, pageable);
291
+ return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(entityDefinitionId, pageable2));
292
292
  }
293
- async findAllSinglePage(structureId, pageable) {
294
- return this.serviceProxy.invoke("findAll", [structureId, pageable]);
293
+ async findAllSinglePage(entityDefinitionId, pageable) {
294
+ return this.serviceProxy.invoke("findAll", [entityDefinitionId, pageable]);
295
295
  }
296
- findById(structureId, id) {
297
- return this.serviceProxy.invoke("findById", [structureId, id]);
296
+ findById(entityDefinitionId, id) {
297
+ return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
298
298
  }
299
- findByIds(structureId, ids) {
300
- return this.serviceProxy.invoke("findByIds", [structureId, ids]);
299
+ findByIds(entityDefinitionId, ids) {
300
+ return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
301
301
  }
302
- namedQuery(structureId, queryName, parameters) {
303
- return this.serviceProxy.invoke("namedQuery", [structureId, queryName, parameters]);
302
+ namedQuery(entityDefinitionId, queryName, parameters) {
303
+ return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
304
304
  }
305
- async namedQueryPage(structureId, queryName, parameters, pageable) {
306
- const page = await this.namedQuerySinglePage(structureId, queryName, parameters, pageable);
307
- return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(structureId, queryName, parameters, pageable2));
305
+ async namedQueryPage(entityDefinitionId, queryName, parameters, pageable) {
306
+ const page = await this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable);
307
+ return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable2));
308
308
  }
309
- namedQuerySinglePage(structureId, queryName, parameters, pageable) {
310
- return this.serviceProxy.invoke("namedQueryPage", [structureId, queryName, parameters, pageable]);
309
+ namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
310
+ return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
311
311
  }
312
- save(structureId, entity) {
313
- return this.serviceProxy.invoke("save", [structureId, entity]);
312
+ save(entityDefinitionId, entity) {
313
+ return this.serviceProxy.invoke("save", [entityDefinitionId, entity]);
314
314
  }
315
- async search(structureId, searchText, pageable) {
316
- const page = await this.searchSinglePage(structureId, searchText, pageable);
317
- return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(structureId, searchText, pageable2));
315
+ async search(entityDefinitionId, searchText, pageable) {
316
+ const page = await this.searchSinglePage(entityDefinitionId, searchText, pageable);
317
+ return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(entityDefinitionId, searchText, pageable2));
318
318
  }
319
- async searchSinglePage(structureId, searchText, pageable) {
320
- return this.serviceProxy.invoke("search", [structureId, searchText, pageable]);
319
+ async searchSinglePage(entityDefinitionId, searchText, pageable) {
320
+ return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, pageable]);
321
321
  }
322
- async syncIndex(structureId) {
323
- return this.serviceProxy.invoke("syncIndex", [structureId]);
322
+ async syncIndex(entityDefinitionId) {
323
+ return this.serviceProxy.invoke("syncIndex", [entityDefinitionId]);
324
324
  }
325
- update(structureId, entity) {
326
- return this.serviceProxy.invoke("update", [structureId, entity]);
325
+ update(entityDefinitionId, entity) {
326
+ return this.serviceProxy.invoke("update", [entityDefinitionId, entity]);
327
327
  }
328
328
  }
329
329
  // packages/persistence/src/api/IAdminEntitiesRepository.ts
@@ -334,47 +334,47 @@ class AdminEntitiesRepository {
334
334
  constructor(kinotic) {
335
335
  this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.AdminJsonEntitiesRepository");
336
336
  }
337
- count(structureId, tenantSelection) {
338
- return this.serviceProxy.invoke("count", [structureId, tenantSelection]);
337
+ count(entityDefinitionId, tenantSelection) {
338
+ return this.serviceProxy.invoke("count", [entityDefinitionId, tenantSelection]);
339
339
  }
340
- countByQuery(structureId, query, tenantSelection) {
341
- return this.serviceProxy.invoke("countByQuery", [structureId, query, tenantSelection]);
340
+ countByQuery(entityDefinitionId, query, tenantSelection) {
341
+ return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query, tenantSelection]);
342
342
  }
343
- deleteById(structureId, id) {
344
- return this.serviceProxy.invoke("deleteById", [structureId, id]);
343
+ deleteById(entityDefinitionId, id) {
344
+ return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
345
345
  }
346
- deleteByQuery(structureId, query, tenantSelection) {
347
- return this.serviceProxy.invoke("deleteByQuery", [structureId, query, tenantSelection]);
346
+ deleteByQuery(entityDefinitionId, query, tenantSelection) {
347
+ return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query, tenantSelection]);
348
348
  }
349
- async findAll(structureId, tenantSelection, pageable) {
350
- const page = await this.findAllSinglePage(structureId, tenantSelection, pageable);
351
- return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(structureId, tenantSelection, pageable2));
349
+ async findAll(entityDefinitionId, tenantSelection, pageable) {
350
+ const page = await this.findAllSinglePage(entityDefinitionId, tenantSelection, pageable);
351
+ return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(entityDefinitionId, tenantSelection, pageable2));
352
352
  }
353
- async findAllSinglePage(structureId, tenantSelection, pageable) {
354
- return this.serviceProxy.invoke("findAll", [structureId, tenantSelection, pageable]);
353
+ async findAllSinglePage(entityDefinitionId, tenantSelection, pageable) {
354
+ return this.serviceProxy.invoke("findAll", [entityDefinitionId, tenantSelection, pageable]);
355
355
  }
356
- findById(structureId, id) {
357
- return this.serviceProxy.invoke("findById", [structureId, id]);
356
+ findById(entityDefinitionId, id) {
357
+ return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
358
358
  }
359
- findByIds(structureId, ids) {
360
- return this.serviceProxy.invoke("findByIds", [structureId, ids]);
359
+ findByIds(entityDefinitionId, ids) {
360
+ return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
361
361
  }
362
- namedQuery(structureId, queryName, parameters) {
363
- return this.serviceProxy.invoke("namedQuery", [structureId, queryName, parameters]);
362
+ namedQuery(entityDefinitionId, queryName, parameters) {
363
+ return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
364
364
  }
365
- async namedQueryPage(structureId, queryName, parameters, pageable) {
366
- const page = await this.namedQuerySinglePage(structureId, queryName, parameters, pageable);
367
- return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(structureId, queryName, parameters, pageable2));
365
+ async namedQueryPage(entityDefinitionId, queryName, parameters, pageable) {
366
+ const page = await this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable);
367
+ return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable2));
368
368
  }
369
- namedQuerySinglePage(structureId, queryName, parameters, pageable) {
370
- return this.serviceProxy.invoke("namedQueryPage", [structureId, queryName, parameters, pageable]);
369
+ namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
370
+ return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
371
371
  }
372
- async search(structureId, searchText, tenantSelection, pageable) {
373
- const page = await this.searchSinglePage(structureId, searchText, tenantSelection, pageable);
374
- return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(structureId, searchText, tenantSelection, pageable2));
372
+ async search(entityDefinitionId, searchText, tenantSelection, pageable) {
373
+ const page = await this.searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable);
374
+ return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable2));
375
375
  }
376
- async searchSinglePage(structureId, searchText, tenantSelection, pageable) {
377
- return this.serviceProxy.invoke("search", [structureId, searchText, tenantSelection, pageable]);
376
+ async searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable) {
377
+ return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, tenantSelection, pageable]);
378
378
  }
379
379
  }
380
380
  // packages/persistence/src/api/IEntityRepository.ts
@@ -384,10 +384,10 @@ class EntityRepository {
384
384
  entityName;
385
385
  entityId;
386
386
  entitiesRepository;
387
- constructor(structureApplicationId, structureName, entitiesRepository) {
388
- this.entityApplicationId = structureApplicationId;
389
- this.entityName = structureName;
390
- this.entityId = (structureApplicationId + "." + structureName).toLowerCase();
387
+ constructor(entityApplicationId, entityName, entitiesRepository) {
388
+ this.entityApplicationId = entityApplicationId;
389
+ this.entityName = entityName;
390
+ this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
391
391
  this.entitiesRepository = entitiesRepository ?? new EntitiesRepository(import_core3.Kinotic);
392
392
  }
393
393
  async bulkSave(entities) {
@@ -453,10 +453,10 @@ class AdminEntityRepository {
453
453
  entityName;
454
454
  entityId;
455
455
  adminEntitiesRepository;
456
- constructor(structureApplicationId, structureName, adminEntitiesRepository) {
457
- this.entityApplicationId = structureApplicationId;
458
- this.entityName = structureName;
459
- this.entityId = (structureApplicationId + "." + structureName).toLowerCase();
456
+ constructor(entityApplicationId, entityName, adminEntitiesRepository) {
457
+ this.entityApplicationId = entityApplicationId;
458
+ this.entityName = entityName;
459
+ this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
460
460
  this.adminEntitiesRepository = adminEntitiesRepository ?? new AdminEntitiesRepository(import_core4.Kinotic);
461
461
  }
462
462
  count(tenantSelection) {
package/dist/index.d.cts CHANGED
@@ -210,166 +210,166 @@ import { IServiceProxy, Page, Pageable, IterablePage } from "@kinotic-ai/core";
210
210
  interface IEntitiesRepository {
211
211
  /**
212
212
  * Saves all given entities.
213
- * @param structureId the id of the structure to save the entities for
213
+ * @param entityDefinitionId the id of the structure to save the entities for
214
214
  * @param entities all the entities to save
215
215
  * @return Promise that will complete when all entities have been saved
216
216
  */
217
- bulkSave<T>(structureId: string, entities: T[]): Promise<void>;
217
+ bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
218
218
  /**
219
219
  * Updates all given entities.
220
- * @param structureId the id of the structure to update the entities for
220
+ * @param entityDefinitionId the id of the structure to update the entities for
221
221
  * @param entities all the entities to save
222
222
  * @return Promise that will complete when all entities have been saved
223
223
  */
224
- bulkUpdate<T>(structureId: string, entities: T[]): Promise<void>;
224
+ bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
225
225
  /**
226
226
  * Returns the number of entities available.
227
- * @param structureId the id of the structure to count
227
+ * @param entityDefinitionId the id of the structure to count
228
228
  * @return {@link Promise} emitting the number of entities.
229
229
  */
230
- count(structureId: string): Promise<number>;
230
+ count(entityDefinitionId: string): Promise<number>;
231
231
  /**
232
232
  * Returns the number of entities available for the given query.
233
233
  *
234
- * @param structureId the id of the structure to save the entity for
234
+ * @param entityDefinitionId the id of the structure to save the entity for
235
235
  * @param query the query used to limit result
236
236
  * @return Promise emitting the number of entities
237
237
  */
238
- countByQuery(structureId: string, query: string): Promise<number>;
238
+ countByQuery(entityDefinitionId: string, query: string): Promise<number>;
239
239
  /**
240
240
  * Deletes the entity with the given id.
241
241
  *
242
- * @param structureId the id of the structure to save the entity for
242
+ * @param entityDefinitionId the id of the structure to save the entity for
243
243
  * @param id must not be {@literal null}
244
244
  * @return {@link Promise} emitting when delete is complete
245
245
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
246
246
  */
247
- deleteById(structureId: string, id: string): Promise<void>;
247
+ deleteById(entityDefinitionId: string, id: string): Promise<void>;
248
248
  /**
249
249
  * Deletes the entity with the given id.
250
250
  *
251
- * @param structureId the id of the structure to save the entity for
251
+ * @param entityDefinitionId the id of the structure to save the entity for
252
252
  * @param query the query used to filter records to delete, must not be {@literal null}
253
253
  * @return Promise signaling when operation has completed
254
254
  * @throws Error in case the given {@literal query} is {@literal null}
255
255
  */
256
- deleteByQuery(structureId: string, query: string): Promise<void>;
256
+ deleteByQuery(entityDefinitionId: string, query: string): Promise<void>;
257
257
  /**
258
258
  * Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
259
259
  *
260
- * @param structureId the id of the structure to save the entity for
260
+ * @param entityDefinitionId the id of the structure to save the entity for
261
261
  * @param pageable the page settings to be used
262
262
  * @return a page of entities
263
263
  */
264
- findAll<T>(structureId: string, pageable: Pageable): Promise<IterablePage<T>>;
264
+ findAll<T>(entityDefinitionId: string, pageable: Pageable): Promise<IterablePage<T>>;
265
265
  /**
266
266
  * Returns a single {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
267
- * @param structureId the id of the structure to save the entity for
267
+ * @param entityDefinitionId the id of the structure to save the entity for
268
268
  * @param pageable the page settings to be used
269
269
  */
270
- findAllSinglePage<T>(structureId: string, pageable: Pageable): Promise<Page<T>>;
270
+ findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
271
271
  /**
272
272
  * Retrieves an entity by its id.
273
273
  *
274
- * @param structureId the id of the structure to save the entity for
274
+ * @param entityDefinitionId the id of the structure to save the entity for
275
275
  * @param id must not be {@literal null}
276
276
  * @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
277
277
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
278
278
  */
279
- findById<T>(structureId: string, id: string): Promise<T>;
279
+ findById<T>(entityDefinitionId: string, id: string): Promise<T | null>;
280
280
  /**
281
281
  * Retrieves a list of entities by their id.
282
282
  *
283
- * @param structureId the id of the structure to save the entity for
283
+ * @param entityDefinitionId the id of the structure to save the entity for
284
284
  * @param ids must not be {@literal null}
285
285
  * @return Promise emitting the entities with the given ids or Promise emitting null if none found
286
286
  * @throws Error in case the given {@literal ids} is {@literal null}
287
287
  */
288
- findByIds<T>(structureId: string, ids: string[]): Promise<T[]>;
288
+ findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
289
289
  /**
290
290
  * Executes a named query.
291
- * @param structureId the id of the structure that this named query is defined for
291
+ * @param entityDefinitionId the id of the structure that this named query is defined for
292
292
  * @param queryName the name of the function that defines the query
293
293
  * @param parameters to pass to the query
294
294
  * @returns Promise with the result of the query
295
295
  */
296
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
296
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
297
297
  /**
298
298
  * Executes a named query and returns a Page of results.
299
- * @param structureId the id of the structure that this named query is defined for
299
+ * @param entityDefinitionId the id of the structure that this named query is defined for
300
300
  * @param queryName the name of the function that defines the query
301
301
  * @param parameters to pass to the query
302
302
  * @param pageable the page settings to be used
303
303
  * @returns Promise with the result of the query
304
304
  */
305
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
305
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
306
306
  /**
307
307
  * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
308
308
  * entity instance completely.
309
309
  *
310
- * @param structureId the id of the structure to save the entity for
310
+ * @param entityDefinitionId the id of the structure to save the entity for
311
311
  * @param entity must not be {@literal null}
312
312
  * @return {@link Promise} emitting the saved entity
313
313
  * @throws IllegalArgumentException in case the given {@literal entity} is {@literal null}
314
314
  */
315
- save<T>(structureId: string, entity: T): Promise<T>;
315
+ save<T>(entityDefinitionId: string, entity: T): Promise<T>;
316
316
  /**
317
317
  * Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
318
318
  *
319
- * @param structureId the id of the structure to save the entity for
319
+ * @param entityDefinitionId the id of the structure to save the entity for
320
320
  * @param searchText the text to search for entities for
321
321
  * @param pageable the page settings to be used
322
322
  * @return a page of entities
323
323
  */
324
- search<T>(structureId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
324
+ search<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
325
325
  /**
326
326
  * Returns a single {@link Page} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
327
327
  *
328
- * @param structureId the id of the structure to save the entity for
328
+ * @param entityDefinitionId the id of the structure to save the entity for
329
329
  * @param searchText the text to search for entities for
330
330
  * @param pageable the page settings to be used
331
331
  * @return a page of entities
332
332
  */
333
- searchSinglePage<T>(structureId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
333
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
334
334
  /**
335
335
  * This operation makes all the recent writes immediately available for search.
336
- * @param structureId the id of the structure to sync the index for.
336
+ * @param entityDefinitionId the id of the structure to sync the index for.
337
337
  * @return a Promise that resolves when the operation is complete
338
338
  */
339
- syncIndex(structureId: string): Promise<void>;
339
+ syncIndex(entityDefinitionId: string): Promise<void>;
340
340
  /**
341
341
  * Updates a given entity. This will only override the fields that are present in the given entity.
342
342
  * If any fields are not present in the given entity data, they will not be changed.
343
343
  * If the entity does not exist, it will be created.
344
344
  *
345
- * @param structureId the id of the structure to update the entity for
345
+ * @param entityDefinitionId the id of the structure to update the entity for
346
346
  * @param entity must not be {@literal null}
347
347
  * @return Promise emitting the saved entity
348
348
  * @throws Error in case the given {@literal entity} is {@literal null}
349
349
  */
350
- update<T>(structureId: string, entity: T): Promise<T>;
350
+ update<T>(entityDefinitionId: string, entity: T): Promise<T>;
351
351
  }
352
352
  declare class EntitiesRepository implements IEntitiesRepository {
353
353
  protected serviceProxy: IServiceProxy;
354
354
  constructor(kinotic: IKinotic);
355
- bulkSave<T>(structureId: string, entities: T[]): Promise<void>;
356
- bulkUpdate<T>(structureId: string, entities: T[]): Promise<void>;
357
- count(structureId: string): Promise<number>;
358
- countByQuery(structureId: string, query: string): Promise<number>;
359
- deleteById(structureId: string, id: string): Promise<void>;
360
- deleteByQuery(structureId: string, query: string): Promise<void>;
361
- findAll<T>(structureId: string, pageable: Pageable): Promise<IterablePage<T>>;
362
- findAllSinglePage<T>(structureId: string, pageable: Pageable): Promise<Page<T>>;
363
- findById<T>(structureId: string, id: string): Promise<T>;
364
- findByIds<T>(structureId: string, ids: string[]): Promise<T[]>;
365
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
366
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
367
- namedQuerySinglePage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<Page<T>>;
368
- save<T>(structureId: string, entity: T): Promise<T>;
369
- search<T>(structureId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
370
- searchSinglePage<T>(structureId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
371
- syncIndex(structureId: string): Promise<void>;
372
- update<T>(structureId: string, entity: T): Promise<T>;
355
+ bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
356
+ bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
357
+ count(entityDefinitionId: string): Promise<number>;
358
+ countByQuery(entityDefinitionId: string, query: string): Promise<number>;
359
+ deleteById(entityDefinitionId: string, id: string): Promise<void>;
360
+ deleteByQuery(entityDefinitionId: string, query: string): Promise<void>;
361
+ findAll<T>(entityDefinitionId: string, pageable: Pageable): Promise<IterablePage<T>>;
362
+ findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
363
+ findById<T>(entityDefinitionId: string, id: string): Promise<T | null>;
364
+ findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
365
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
366
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
367
+ namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<Page<T>>;
368
+ save<T>(entityDefinitionId: string, entity: T): Promise<T>;
369
+ search<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
370
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
371
+ syncIndex(entityDefinitionId: string): Promise<void>;
372
+ update<T>(entityDefinitionId: string, entity: T): Promise<T>;
373
373
  }
374
374
  import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
375
375
  import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable2, IterablePage as IterablePage2 } from "@kinotic-ai/core";
@@ -381,106 +381,106 @@ interface IAdminEntitiesRepository {
381
381
  * @param tenantSelection the list of tenants to use when retrieving the entity records
382
382
  * @return {@link Promise} emitting the number of entities.
383
383
  */
384
- count(structureId: string, tenantSelection: TenantSelection): Promise<number>;
384
+ count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
385
385
  /**
386
386
  * Returns the number of entities available for the given query.
387
387
  *
388
- * @param structureId the id of the structure to save the entity for
388
+ * @param entityDefinitionId the id of the structure to save the entity for
389
389
  * @param query the query used to limit result
390
390
  * @param tenantSelection the list of tenants to use when retrieving the entity records
391
391
  * @return Promise emitting the number of entities
392
392
  */
393
- countByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
393
+ countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
394
394
  /**
395
395
  * Deletes the entity with the given id.
396
396
  *
397
- * @param structureId the id of the structure to save the entity for
397
+ * @param entityDefinitionId the id of the structure to save the entity for
398
398
  * @param id must not be {@literal null}
399
399
  * @return {@link Promise} emitting when delete is complete
400
400
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
401
401
  */
402
- deleteById(structureId: string, id: TenantSpecificId): Promise<void>;
402
+ deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
403
403
  /**
404
404
  * Deletes the entity with the given id.
405
405
  *
406
- * @param structureId the id of the structure to save the entity for
406
+ * @param entityDefinitionId the id of the structure to save the entity for
407
407
  * @param query the query used to filter records to delete, must not be {@literal null}
408
408
  * @param tenantSelection the list of tenants to use when deleting the entity records
409
409
  * @return Promise signaling when operation has completed
410
410
  * @throws Error in case the given {@literal query} is {@literal null}
411
411
  */
412
- deleteByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
412
+ deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
413
413
  /**
414
414
  * Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
415
415
  *
416
- * @param structureId the id of the structure to save the entity for
416
+ * @param entityDefinitionId the id of the structure to save the entity for
417
417
  * @param tenantSelection the list of tenants to use when retrieving the entity records
418
418
  * @param pageable the page settings to be used
419
419
  * @return a page of entities
420
420
  */
421
- findAll<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
421
+ findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
422
422
  /**
423
423
  * Retrieves an entity by its id.
424
424
  *
425
- * @param structureId the id of the structure to save the entity for
425
+ * @param entityDefinitionId the id of the structure to save the entity for
426
426
  * @param id must not be {@literal null}
427
427
  * @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
428
428
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
429
429
  */
430
- findById<T>(structureId: string, id: TenantSpecificId): Promise<T>;
430
+ findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
431
431
  /**
432
432
  * Retrieves a list of entities by their id.
433
433
  *
434
- * @param structureId the id of the structure to save the entity for
434
+ * @param entityDefinitionId the id of the structure to save the entity for
435
435
  * @param ids must not be {@literal null}
436
436
  * @return Promise emitting the entities with the given ids or Promise emitting null if none found
437
437
  * @throws Error in case the given {@literal ids} is {@literal null}
438
438
  */
439
- findByIds<T>(structureId: string, ids: TenantSpecificId[]): Promise<T[]>;
439
+ findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
440
440
  /**
441
441
  * Executes a named query.
442
- * @param structureId the id of the structure that this named query is defined for
442
+ * @param entityDefinitionId the id of the structure that this named query is defined for
443
443
  * @param queryName the name of the function that defines the query
444
444
  * @param parameters to pass to the query
445
445
  * @returns Promise with the result of the query
446
446
  */
447
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
447
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
448
448
  /**
449
449
  * Executes a named query and returns a Page of results.
450
- * @param structureId the id of the structure that this named query is defined for
450
+ * @param entityDefinitionId the id of the structure that this named query is defined for
451
451
  * @param queryName the name of the function that defines the query
452
452
  * @param parameters to pass to the query
453
453
  * @param pageable the page settings to be used
454
454
  * @returns Promise with the result of the query
455
455
  */
456
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
456
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
457
457
  /**
458
458
  * Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
459
459
  *
460
- * @param structureId the id of the structure to save the entity for
460
+ * @param entityDefinitionId the id of the structure to save the entity for
461
461
  * @param searchText the text to search for entities for
462
462
  * @param tenantSelection the list of tenants to use when retrieving the entity records
463
463
  * @param pageable the page settings to be used
464
464
  * @return a page of entities
465
465
  */
466
- search<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
466
+ search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
467
467
  }
468
468
  declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
469
469
  protected serviceProxy: IServiceProxy2;
470
470
  constructor(kinotic: IKinotic2);
471
- count(structureId: string, tenantSelection: TenantSelection): Promise<number>;
472
- countByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
473
- deleteById(structureId: string, id: TenantSpecificId): Promise<void>;
474
- deleteByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
475
- findAll<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
476
- findAllSinglePage<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
477
- findById<T>(structureId: string, id: TenantSpecificId): Promise<T>;
478
- findByIds<T>(structureId: string, ids: TenantSpecificId[]): Promise<T[]>;
479
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
480
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
481
- namedQuerySinglePage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<Page2<T>>;
482
- search<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
483
- searchSinglePage<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
471
+ count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
472
+ countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
473
+ deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
474
+ deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
475
+ findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
476
+ findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
477
+ findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
478
+ findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
479
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
480
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
481
+ namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<Page2<T>>;
482
+ search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
483
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
484
484
  }
485
485
  import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
486
486
  /**
@@ -556,7 +556,7 @@ interface IEntityRepository<T> {
556
556
  * @return Promise emitting the entity with the given id or Promise emitting null if none found
557
557
  * @throws Error in case the given {@literal id} is {@literal null}
558
558
  */
559
- findById(id: string): Promise<T>;
559
+ findById(id: string): Promise<T | null>;
560
560
  /**
561
561
  * Retrieves a list of entities by their id.
562
562
  *
@@ -622,7 +622,7 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
622
622
  entityName: string;
623
623
  entityId: string;
624
624
  private readonly entitiesRepository;
625
- constructor(structureApplicationId: string, structureName: string, entitiesRepository?: IEntitiesRepository);
625
+ constructor(entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
626
626
  bulkSave(entities: T[]): Promise<void>;
627
627
  bulkUpdate(entities: T[]): Promise<void>;
628
628
  count(): Promise<number>;
@@ -630,7 +630,7 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
630
630
  deleteById(id: string): Promise<void>;
631
631
  deleteByQuery(query: string): Promise<void>;
632
632
  findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
633
- findById(id: string): Promise<T>;
633
+ findById(id: string): Promise<T | null>;
634
634
  findByIds(ids: string[]): Promise<T[]>;
635
635
  namedQuery<U>(queryName: string, queryParameters: QueryParameter[]): Promise<U>;
636
636
  namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
@@ -707,7 +707,7 @@ interface IAdminEntityRepository<T> {
707
707
  * @return Promise emitting the entity with the given id or Promise emitting null if none found
708
708
  * @throws Error in case the given {@literal id} is {@literal null}
709
709
  */
710
- findById(id: TenantSpecificId): Promise<T>;
710
+ findById(id: TenantSpecificId): Promise<T | null>;
711
711
  /**
712
712
  * Retrieves a list of entities by their id.
713
713
  *
@@ -750,7 +750,7 @@ declare class AdminEntityRepository<T> implements IAdminEntityRepository<T> {
750
750
  entityName: string;
751
751
  entityId: string;
752
752
  private readonly adminEntitiesRepository;
753
- constructor(structureApplicationId: string, structureName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
753
+ constructor(entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
754
754
  count(tenantSelection: TenantSelection): Promise<number>;
755
755
  countByQuery(query: string, tenantSelection: TenantSelection): Promise<number>;
756
756
  deleteById(id: TenantSpecificId): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -210,166 +210,166 @@ import { IServiceProxy, Page, Pageable, IterablePage } from "@kinotic-ai/core";
210
210
  interface IEntitiesRepository {
211
211
  /**
212
212
  * Saves all given entities.
213
- * @param structureId the id of the structure to save the entities for
213
+ * @param entityDefinitionId the id of the structure to save the entities for
214
214
  * @param entities all the entities to save
215
215
  * @return Promise that will complete when all entities have been saved
216
216
  */
217
- bulkSave<T>(structureId: string, entities: T[]): Promise<void>;
217
+ bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
218
218
  /**
219
219
  * Updates all given entities.
220
- * @param structureId the id of the structure to update the entities for
220
+ * @param entityDefinitionId the id of the structure to update the entities for
221
221
  * @param entities all the entities to save
222
222
  * @return Promise that will complete when all entities have been saved
223
223
  */
224
- bulkUpdate<T>(structureId: string, entities: T[]): Promise<void>;
224
+ bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
225
225
  /**
226
226
  * Returns the number of entities available.
227
- * @param structureId the id of the structure to count
227
+ * @param entityDefinitionId the id of the structure to count
228
228
  * @return {@link Promise} emitting the number of entities.
229
229
  */
230
- count(structureId: string): Promise<number>;
230
+ count(entityDefinitionId: string): Promise<number>;
231
231
  /**
232
232
  * Returns the number of entities available for the given query.
233
233
  *
234
- * @param structureId the id of the structure to save the entity for
234
+ * @param entityDefinitionId the id of the structure to save the entity for
235
235
  * @param query the query used to limit result
236
236
  * @return Promise emitting the number of entities
237
237
  */
238
- countByQuery(structureId: string, query: string): Promise<number>;
238
+ countByQuery(entityDefinitionId: string, query: string): Promise<number>;
239
239
  /**
240
240
  * Deletes the entity with the given id.
241
241
  *
242
- * @param structureId the id of the structure to save the entity for
242
+ * @param entityDefinitionId the id of the structure to save the entity for
243
243
  * @param id must not be {@literal null}
244
244
  * @return {@link Promise} emitting when delete is complete
245
245
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
246
246
  */
247
- deleteById(structureId: string, id: string): Promise<void>;
247
+ deleteById(entityDefinitionId: string, id: string): Promise<void>;
248
248
  /**
249
249
  * Deletes the entity with the given id.
250
250
  *
251
- * @param structureId the id of the structure to save the entity for
251
+ * @param entityDefinitionId the id of the structure to save the entity for
252
252
  * @param query the query used to filter records to delete, must not be {@literal null}
253
253
  * @return Promise signaling when operation has completed
254
254
  * @throws Error in case the given {@literal query} is {@literal null}
255
255
  */
256
- deleteByQuery(structureId: string, query: string): Promise<void>;
256
+ deleteByQuery(entityDefinitionId: string, query: string): Promise<void>;
257
257
  /**
258
258
  * Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
259
259
  *
260
- * @param structureId the id of the structure to save the entity for
260
+ * @param entityDefinitionId the id of the structure to save the entity for
261
261
  * @param pageable the page settings to be used
262
262
  * @return a page of entities
263
263
  */
264
- findAll<T>(structureId: string, pageable: Pageable): Promise<IterablePage<T>>;
264
+ findAll<T>(entityDefinitionId: string, pageable: Pageable): Promise<IterablePage<T>>;
265
265
  /**
266
266
  * Returns a single {@link Page} of entities meeting the paging restriction provided in the {@link Pageable} object.
267
- * @param structureId the id of the structure to save the entity for
267
+ * @param entityDefinitionId the id of the structure to save the entity for
268
268
  * @param pageable the page settings to be used
269
269
  */
270
- findAllSinglePage<T>(structureId: string, pageable: Pageable): Promise<Page<T>>;
270
+ findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
271
271
  /**
272
272
  * Retrieves an entity by its id.
273
273
  *
274
- * @param structureId the id of the structure to save the entity for
274
+ * @param entityDefinitionId the id of the structure to save the entity for
275
275
  * @param id must not be {@literal null}
276
276
  * @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
277
277
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
278
278
  */
279
- findById<T>(structureId: string, id: string): Promise<T>;
279
+ findById<T>(entityDefinitionId: string, id: string): Promise<T | null>;
280
280
  /**
281
281
  * Retrieves a list of entities by their id.
282
282
  *
283
- * @param structureId the id of the structure to save the entity for
283
+ * @param entityDefinitionId the id of the structure to save the entity for
284
284
  * @param ids must not be {@literal null}
285
285
  * @return Promise emitting the entities with the given ids or Promise emitting null if none found
286
286
  * @throws Error in case the given {@literal ids} is {@literal null}
287
287
  */
288
- findByIds<T>(structureId: string, ids: string[]): Promise<T[]>;
288
+ findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
289
289
  /**
290
290
  * Executes a named query.
291
- * @param structureId the id of the structure that this named query is defined for
291
+ * @param entityDefinitionId the id of the structure that this named query is defined for
292
292
  * @param queryName the name of the function that defines the query
293
293
  * @param parameters to pass to the query
294
294
  * @returns Promise with the result of the query
295
295
  */
296
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
296
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
297
297
  /**
298
298
  * Executes a named query and returns a Page of results.
299
- * @param structureId the id of the structure that this named query is defined for
299
+ * @param entityDefinitionId the id of the structure that this named query is defined for
300
300
  * @param queryName the name of the function that defines the query
301
301
  * @param parameters to pass to the query
302
302
  * @param pageable the page settings to be used
303
303
  * @returns Promise with the result of the query
304
304
  */
305
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
305
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
306
306
  /**
307
307
  * Saves a given entity. Use the returned instance for further operations as the save operation might have changed the
308
308
  * entity instance completely.
309
309
  *
310
- * @param structureId the id of the structure to save the entity for
310
+ * @param entityDefinitionId the id of the structure to save the entity for
311
311
  * @param entity must not be {@literal null}
312
312
  * @return {@link Promise} emitting the saved entity
313
313
  * @throws IllegalArgumentException in case the given {@literal entity} is {@literal null}
314
314
  */
315
- save<T>(structureId: string, entity: T): Promise<T>;
315
+ save<T>(entityDefinitionId: string, entity: T): Promise<T>;
316
316
  /**
317
317
  * Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
318
318
  *
319
- * @param structureId the id of the structure to save the entity for
319
+ * @param entityDefinitionId the id of the structure to save the entity for
320
320
  * @param searchText the text to search for entities for
321
321
  * @param pageable the page settings to be used
322
322
  * @return a page of entities
323
323
  */
324
- search<T>(structureId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
324
+ search<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
325
325
  /**
326
326
  * Returns a single {@link Page} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
327
327
  *
328
- * @param structureId the id of the structure to save the entity for
328
+ * @param entityDefinitionId the id of the structure to save the entity for
329
329
  * @param searchText the text to search for entities for
330
330
  * @param pageable the page settings to be used
331
331
  * @return a page of entities
332
332
  */
333
- searchSinglePage<T>(structureId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
333
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
334
334
  /**
335
335
  * This operation makes all the recent writes immediately available for search.
336
- * @param structureId the id of the structure to sync the index for.
336
+ * @param entityDefinitionId the id of the structure to sync the index for.
337
337
  * @return a Promise that resolves when the operation is complete
338
338
  */
339
- syncIndex(structureId: string): Promise<void>;
339
+ syncIndex(entityDefinitionId: string): Promise<void>;
340
340
  /**
341
341
  * Updates a given entity. This will only override the fields that are present in the given entity.
342
342
  * If any fields are not present in the given entity data, they will not be changed.
343
343
  * If the entity does not exist, it will be created.
344
344
  *
345
- * @param structureId the id of the structure to update the entity for
345
+ * @param entityDefinitionId the id of the structure to update the entity for
346
346
  * @param entity must not be {@literal null}
347
347
  * @return Promise emitting the saved entity
348
348
  * @throws Error in case the given {@literal entity} is {@literal null}
349
349
  */
350
- update<T>(structureId: string, entity: T): Promise<T>;
350
+ update<T>(entityDefinitionId: string, entity: T): Promise<T>;
351
351
  }
352
352
  declare class EntitiesRepository implements IEntitiesRepository {
353
353
  protected serviceProxy: IServiceProxy;
354
354
  constructor(kinotic: IKinotic);
355
- bulkSave<T>(structureId: string, entities: T[]): Promise<void>;
356
- bulkUpdate<T>(structureId: string, entities: T[]): Promise<void>;
357
- count(structureId: string): Promise<number>;
358
- countByQuery(structureId: string, query: string): Promise<number>;
359
- deleteById(structureId: string, id: string): Promise<void>;
360
- deleteByQuery(structureId: string, query: string): Promise<void>;
361
- findAll<T>(structureId: string, pageable: Pageable): Promise<IterablePage<T>>;
362
- findAllSinglePage<T>(structureId: string, pageable: Pageable): Promise<Page<T>>;
363
- findById<T>(structureId: string, id: string): Promise<T>;
364
- findByIds<T>(structureId: string, ids: string[]): Promise<T[]>;
365
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
366
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
367
- namedQuerySinglePage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<Page<T>>;
368
- save<T>(structureId: string, entity: T): Promise<T>;
369
- search<T>(structureId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
370
- searchSinglePage<T>(structureId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
371
- syncIndex(structureId: string): Promise<void>;
372
- update<T>(structureId: string, entity: T): Promise<T>;
355
+ bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
356
+ bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
357
+ count(entityDefinitionId: string): Promise<number>;
358
+ countByQuery(entityDefinitionId: string, query: string): Promise<number>;
359
+ deleteById(entityDefinitionId: string, id: string): Promise<void>;
360
+ deleteByQuery(entityDefinitionId: string, query: string): Promise<void>;
361
+ findAll<T>(entityDefinitionId: string, pageable: Pageable): Promise<IterablePage<T>>;
362
+ findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
363
+ findById<T>(entityDefinitionId: string, id: string): Promise<T | null>;
364
+ findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
365
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
366
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<IterablePage<T>>;
367
+ namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable): Promise<Page<T>>;
368
+ save<T>(entityDefinitionId: string, entity: T): Promise<T>;
369
+ search<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<IterablePage<T>>;
370
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, pageable: Pageable): Promise<Page<T>>;
371
+ syncIndex(entityDefinitionId: string): Promise<void>;
372
+ update<T>(entityDefinitionId: string, entity: T): Promise<T>;
373
373
  }
374
374
  import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
375
375
  import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable2, IterablePage as IterablePage2 } from "@kinotic-ai/core";
@@ -381,106 +381,106 @@ interface IAdminEntitiesRepository {
381
381
  * @param tenantSelection the list of tenants to use when retrieving the entity records
382
382
  * @return {@link Promise} emitting the number of entities.
383
383
  */
384
- count(structureId: string, tenantSelection: TenantSelection): Promise<number>;
384
+ count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
385
385
  /**
386
386
  * Returns the number of entities available for the given query.
387
387
  *
388
- * @param structureId the id of the structure to save the entity for
388
+ * @param entityDefinitionId the id of the structure to save the entity for
389
389
  * @param query the query used to limit result
390
390
  * @param tenantSelection the list of tenants to use when retrieving the entity records
391
391
  * @return Promise emitting the number of entities
392
392
  */
393
- countByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
393
+ countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
394
394
  /**
395
395
  * Deletes the entity with the given id.
396
396
  *
397
- * @param structureId the id of the structure to save the entity for
397
+ * @param entityDefinitionId the id of the structure to save the entity for
398
398
  * @param id must not be {@literal null}
399
399
  * @return {@link Promise} emitting when delete is complete
400
400
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
401
401
  */
402
- deleteById(structureId: string, id: TenantSpecificId): Promise<void>;
402
+ deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
403
403
  /**
404
404
  * Deletes the entity with the given id.
405
405
  *
406
- * @param structureId the id of the structure to save the entity for
406
+ * @param entityDefinitionId the id of the structure to save the entity for
407
407
  * @param query the query used to filter records to delete, must not be {@literal null}
408
408
  * @param tenantSelection the list of tenants to use when deleting the entity records
409
409
  * @return Promise signaling when operation has completed
410
410
  * @throws Error in case the given {@literal query} is {@literal null}
411
411
  */
412
- deleteByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
412
+ deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
413
413
  /**
414
414
  * Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
415
415
  *
416
- * @param structureId the id of the structure to save the entity for
416
+ * @param entityDefinitionId the id of the structure to save the entity for
417
417
  * @param tenantSelection the list of tenants to use when retrieving the entity records
418
418
  * @param pageable the page settings to be used
419
419
  * @return a page of entities
420
420
  */
421
- findAll<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
421
+ findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
422
422
  /**
423
423
  * Retrieves an entity by its id.
424
424
  *
425
- * @param structureId the id of the structure to save the entity for
425
+ * @param entityDefinitionId the id of the structure to save the entity for
426
426
  * @param id must not be {@literal null}
427
427
  * @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
428
428
  * @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
429
429
  */
430
- findById<T>(structureId: string, id: TenantSpecificId): Promise<T>;
430
+ findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
431
431
  /**
432
432
  * Retrieves a list of entities by their id.
433
433
  *
434
- * @param structureId the id of the structure to save the entity for
434
+ * @param entityDefinitionId the id of the structure to save the entity for
435
435
  * @param ids must not be {@literal null}
436
436
  * @return Promise emitting the entities with the given ids or Promise emitting null if none found
437
437
  * @throws Error in case the given {@literal ids} is {@literal null}
438
438
  */
439
- findByIds<T>(structureId: string, ids: TenantSpecificId[]): Promise<T[]>;
439
+ findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
440
440
  /**
441
441
  * Executes a named query.
442
- * @param structureId the id of the structure that this named query is defined for
442
+ * @param entityDefinitionId the id of the structure that this named query is defined for
443
443
  * @param queryName the name of the function that defines the query
444
444
  * @param parameters to pass to the query
445
445
  * @returns Promise with the result of the query
446
446
  */
447
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
447
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
448
448
  /**
449
449
  * Executes a named query and returns a Page of results.
450
- * @param structureId the id of the structure that this named query is defined for
450
+ * @param entityDefinitionId the id of the structure that this named query is defined for
451
451
  * @param queryName the name of the function that defines the query
452
452
  * @param parameters to pass to the query
453
453
  * @param pageable the page settings to be used
454
454
  * @returns Promise with the result of the query
455
455
  */
456
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
456
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
457
457
  /**
458
458
  * Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
459
459
  *
460
- * @param structureId the id of the structure to save the entity for
460
+ * @param entityDefinitionId the id of the structure to save the entity for
461
461
  * @param searchText the text to search for entities for
462
462
  * @param tenantSelection the list of tenants to use when retrieving the entity records
463
463
  * @param pageable the page settings to be used
464
464
  * @return a page of entities
465
465
  */
466
- search<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
466
+ search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
467
467
  }
468
468
  declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
469
469
  protected serviceProxy: IServiceProxy2;
470
470
  constructor(kinotic: IKinotic2);
471
- count(structureId: string, tenantSelection: TenantSelection): Promise<number>;
472
- countByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
473
- deleteById(structureId: string, id: TenantSpecificId): Promise<void>;
474
- deleteByQuery(structureId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
475
- findAll<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
476
- findAllSinglePage<T>(structureId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
477
- findById<T>(structureId: string, id: TenantSpecificId): Promise<T>;
478
- findByIds<T>(structureId: string, ids: TenantSpecificId[]): Promise<T[]>;
479
- namedQuery<T>(structureId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
480
- namedQueryPage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
481
- namedQuerySinglePage<T>(structureId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<Page2<T>>;
482
- search<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
483
- searchSinglePage<T>(structureId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
471
+ count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
472
+ countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
473
+ deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
474
+ deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
475
+ findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
476
+ findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
477
+ findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
478
+ findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
479
+ namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[]): Promise<T>;
480
+ namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<IterablePage2<T>>;
481
+ namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], pageable: Pageable2): Promise<Page2<T>>;
482
+ search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
483
+ searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
484
484
  }
485
485
  import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
486
486
  /**
@@ -556,7 +556,7 @@ interface IEntityRepository<T> {
556
556
  * @return Promise emitting the entity with the given id or Promise emitting null if none found
557
557
  * @throws Error in case the given {@literal id} is {@literal null}
558
558
  */
559
- findById(id: string): Promise<T>;
559
+ findById(id: string): Promise<T | null>;
560
560
  /**
561
561
  * Retrieves a list of entities by their id.
562
562
  *
@@ -622,7 +622,7 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
622
622
  entityName: string;
623
623
  entityId: string;
624
624
  private readonly entitiesRepository;
625
- constructor(structureApplicationId: string, structureName: string, entitiesRepository?: IEntitiesRepository);
625
+ constructor(entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
626
626
  bulkSave(entities: T[]): Promise<void>;
627
627
  bulkUpdate(entities: T[]): Promise<void>;
628
628
  count(): Promise<number>;
@@ -630,7 +630,7 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
630
630
  deleteById(id: string): Promise<void>;
631
631
  deleteByQuery(query: string): Promise<void>;
632
632
  findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
633
- findById(id: string): Promise<T>;
633
+ findById(id: string): Promise<T | null>;
634
634
  findByIds(ids: string[]): Promise<T[]>;
635
635
  namedQuery<U>(queryName: string, queryParameters: QueryParameter[]): Promise<U>;
636
636
  namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
@@ -707,7 +707,7 @@ interface IAdminEntityRepository<T> {
707
707
  * @return Promise emitting the entity with the given id or Promise emitting null if none found
708
708
  * @throws Error in case the given {@literal id} is {@literal null}
709
709
  */
710
- findById(id: TenantSpecificId): Promise<T>;
710
+ findById(id: TenantSpecificId): Promise<T | null>;
711
711
  /**
712
712
  * Retrieves a list of entities by their id.
713
713
  *
@@ -750,7 +750,7 @@ declare class AdminEntityRepository<T> implements IAdminEntityRepository<T> {
750
750
  entityName: string;
751
751
  entityId: string;
752
752
  private readonly adminEntitiesRepository;
753
- constructor(structureApplicationId: string, structureName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
753
+ constructor(entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
754
754
  count(tenantSelection: TenantSelection): Promise<number>;
755
755
  countByQuery(query: string, tenantSelection: TenantSelection): Promise<number>;
756
756
  deleteById(id: TenantSpecificId): Promise<void>;
package/dist/index.js CHANGED
@@ -186,62 +186,62 @@ class EntitiesRepository {
186
186
  constructor(kinotic) {
187
187
  this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.JsonEntitiesRepository");
188
188
  }
189
- bulkSave(structureId, entities) {
190
- return this.serviceProxy.invoke("bulkSave", [structureId, entities]);
189
+ bulkSave(entityDefinitionId, entities) {
190
+ return this.serviceProxy.invoke("bulkSave", [entityDefinitionId, entities]);
191
191
  }
192
- bulkUpdate(structureId, entities) {
193
- return this.serviceProxy.invoke("bulkUpdate", [structureId, entities]);
192
+ bulkUpdate(entityDefinitionId, entities) {
193
+ return this.serviceProxy.invoke("bulkUpdate", [entityDefinitionId, entities]);
194
194
  }
195
- count(structureId) {
196
- return this.serviceProxy.invoke("count", [structureId]);
195
+ count(entityDefinitionId) {
196
+ return this.serviceProxy.invoke("count", [entityDefinitionId]);
197
197
  }
198
- countByQuery(structureId, query) {
199
- return this.serviceProxy.invoke("countByQuery", [structureId, query]);
198
+ countByQuery(entityDefinitionId, query) {
199
+ return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query]);
200
200
  }
201
- deleteById(structureId, id) {
202
- return this.serviceProxy.invoke("deleteById", [structureId, id]);
201
+ deleteById(entityDefinitionId, id) {
202
+ return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
203
203
  }
204
- deleteByQuery(structureId, query) {
205
- return this.serviceProxy.invoke("deleteByQuery", [structureId, query]);
204
+ deleteByQuery(entityDefinitionId, query) {
205
+ return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query]);
206
206
  }
207
- async findAll(structureId, pageable) {
208
- const page = await this.findAllSinglePage(structureId, pageable);
209
- return new FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(structureId, pageable2));
207
+ async findAll(entityDefinitionId, pageable) {
208
+ const page = await this.findAllSinglePage(entityDefinitionId, pageable);
209
+ return new FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(entityDefinitionId, pageable2));
210
210
  }
211
- async findAllSinglePage(structureId, pageable) {
212
- return this.serviceProxy.invoke("findAll", [structureId, pageable]);
211
+ async findAllSinglePage(entityDefinitionId, pageable) {
212
+ return this.serviceProxy.invoke("findAll", [entityDefinitionId, pageable]);
213
213
  }
214
- findById(structureId, id) {
215
- return this.serviceProxy.invoke("findById", [structureId, id]);
214
+ findById(entityDefinitionId, id) {
215
+ return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
216
216
  }
217
- findByIds(structureId, ids) {
218
- return this.serviceProxy.invoke("findByIds", [structureId, ids]);
217
+ findByIds(entityDefinitionId, ids) {
218
+ return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
219
219
  }
220
- namedQuery(structureId, queryName, parameters) {
221
- return this.serviceProxy.invoke("namedQuery", [structureId, queryName, parameters]);
220
+ namedQuery(entityDefinitionId, queryName, parameters) {
221
+ return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
222
222
  }
223
- async namedQueryPage(structureId, queryName, parameters, pageable) {
224
- const page = await this.namedQuerySinglePage(structureId, queryName, parameters, pageable);
225
- return new FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(structureId, queryName, parameters, pageable2));
223
+ async namedQueryPage(entityDefinitionId, queryName, parameters, pageable) {
224
+ const page = await this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable);
225
+ return new FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable2));
226
226
  }
227
- namedQuerySinglePage(structureId, queryName, parameters, pageable) {
228
- return this.serviceProxy.invoke("namedQueryPage", [structureId, queryName, parameters, pageable]);
227
+ namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
228
+ return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
229
229
  }
230
- save(structureId, entity) {
231
- return this.serviceProxy.invoke("save", [structureId, entity]);
230
+ save(entityDefinitionId, entity) {
231
+ return this.serviceProxy.invoke("save", [entityDefinitionId, entity]);
232
232
  }
233
- async search(structureId, searchText, pageable) {
234
- const page = await this.searchSinglePage(structureId, searchText, pageable);
235
- return new FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(structureId, searchText, pageable2));
233
+ async search(entityDefinitionId, searchText, pageable) {
234
+ const page = await this.searchSinglePage(entityDefinitionId, searchText, pageable);
235
+ return new FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(entityDefinitionId, searchText, pageable2));
236
236
  }
237
- async searchSinglePage(structureId, searchText, pageable) {
238
- return this.serviceProxy.invoke("search", [structureId, searchText, pageable]);
237
+ async searchSinglePage(entityDefinitionId, searchText, pageable) {
238
+ return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, pageable]);
239
239
  }
240
- async syncIndex(structureId) {
241
- return this.serviceProxy.invoke("syncIndex", [structureId]);
240
+ async syncIndex(entityDefinitionId) {
241
+ return this.serviceProxy.invoke("syncIndex", [entityDefinitionId]);
242
242
  }
243
- update(structureId, entity) {
244
- return this.serviceProxy.invoke("update", [structureId, entity]);
243
+ update(entityDefinitionId, entity) {
244
+ return this.serviceProxy.invoke("update", [entityDefinitionId, entity]);
245
245
  }
246
246
  }
247
247
  // packages/persistence/src/api/IAdminEntitiesRepository.ts
@@ -254,47 +254,47 @@ class AdminEntitiesRepository {
254
254
  constructor(kinotic) {
255
255
  this.serviceProxy = kinotic.serviceProxy("org.kinotic.persistence.api.services.AdminJsonEntitiesRepository");
256
256
  }
257
- count(structureId, tenantSelection) {
258
- return this.serviceProxy.invoke("count", [structureId, tenantSelection]);
257
+ count(entityDefinitionId, tenantSelection) {
258
+ return this.serviceProxy.invoke("count", [entityDefinitionId, tenantSelection]);
259
259
  }
260
- countByQuery(structureId, query, tenantSelection) {
261
- return this.serviceProxy.invoke("countByQuery", [structureId, query, tenantSelection]);
260
+ countByQuery(entityDefinitionId, query, tenantSelection) {
261
+ return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query, tenantSelection]);
262
262
  }
263
- deleteById(structureId, id) {
264
- return this.serviceProxy.invoke("deleteById", [structureId, id]);
263
+ deleteById(entityDefinitionId, id) {
264
+ return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
265
265
  }
266
- deleteByQuery(structureId, query, tenantSelection) {
267
- return this.serviceProxy.invoke("deleteByQuery", [structureId, query, tenantSelection]);
266
+ deleteByQuery(entityDefinitionId, query, tenantSelection) {
267
+ return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query, tenantSelection]);
268
268
  }
269
- async findAll(structureId, tenantSelection, pageable) {
270
- const page = await this.findAllSinglePage(structureId, tenantSelection, pageable);
271
- return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findAllSinglePage(structureId, tenantSelection, pageable2));
269
+ async findAll(entityDefinitionId, tenantSelection, pageable) {
270
+ const page = await this.findAllSinglePage(entityDefinitionId, tenantSelection, pageable);
271
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findAllSinglePage(entityDefinitionId, tenantSelection, pageable2));
272
272
  }
273
- async findAllSinglePage(structureId, tenantSelection, pageable) {
274
- return this.serviceProxy.invoke("findAll", [structureId, tenantSelection, pageable]);
273
+ async findAllSinglePage(entityDefinitionId, tenantSelection, pageable) {
274
+ return this.serviceProxy.invoke("findAll", [entityDefinitionId, tenantSelection, pageable]);
275
275
  }
276
- findById(structureId, id) {
277
- return this.serviceProxy.invoke("findById", [structureId, id]);
276
+ findById(entityDefinitionId, id) {
277
+ return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
278
278
  }
279
- findByIds(structureId, ids) {
280
- return this.serviceProxy.invoke("findByIds", [structureId, ids]);
279
+ findByIds(entityDefinitionId, ids) {
280
+ return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
281
281
  }
282
- namedQuery(structureId, queryName, parameters) {
283
- return this.serviceProxy.invoke("namedQuery", [structureId, queryName, parameters]);
282
+ namedQuery(entityDefinitionId, queryName, parameters) {
283
+ return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
284
284
  }
285
- async namedQueryPage(structureId, queryName, parameters, pageable) {
286
- const page = await this.namedQuerySinglePage(structureId, queryName, parameters, pageable);
287
- return new FunctionalIterablePage2(pageable, page, (pageable2) => this.namedQuerySinglePage(structureId, queryName, parameters, pageable2));
285
+ async namedQueryPage(entityDefinitionId, queryName, parameters, pageable) {
286
+ const page = await this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable);
287
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable2));
288
288
  }
289
- namedQuerySinglePage(structureId, queryName, parameters, pageable) {
290
- return this.serviceProxy.invoke("namedQueryPage", [structureId, queryName, parameters, pageable]);
289
+ namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
290
+ return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
291
291
  }
292
- async search(structureId, searchText, tenantSelection, pageable) {
293
- const page = await this.searchSinglePage(structureId, searchText, tenantSelection, pageable);
294
- return new FunctionalIterablePage2(pageable, page, (pageable2) => this.searchSinglePage(structureId, searchText, tenantSelection, pageable2));
292
+ async search(entityDefinitionId, searchText, tenantSelection, pageable) {
293
+ const page = await this.searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable);
294
+ return new FunctionalIterablePage2(pageable, page, (pageable2) => this.searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable2));
295
295
  }
296
- async searchSinglePage(structureId, searchText, tenantSelection, pageable) {
297
- return this.serviceProxy.invoke("search", [structureId, searchText, tenantSelection, pageable]);
296
+ async searchSinglePage(entityDefinitionId, searchText, tenantSelection, pageable) {
297
+ return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, tenantSelection, pageable]);
298
298
  }
299
299
  }
300
300
  // packages/persistence/src/api/IEntityRepository.ts
@@ -304,10 +304,10 @@ class EntityRepository {
304
304
  entityName;
305
305
  entityId;
306
306
  entitiesRepository;
307
- constructor(structureApplicationId, structureName, entitiesRepository) {
308
- this.entityApplicationId = structureApplicationId;
309
- this.entityName = structureName;
310
- this.entityId = (structureApplicationId + "." + structureName).toLowerCase();
307
+ constructor(entityApplicationId, entityName, entitiesRepository) {
308
+ this.entityApplicationId = entityApplicationId;
309
+ this.entityName = entityName;
310
+ this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
311
311
  this.entitiesRepository = entitiesRepository ?? new EntitiesRepository(Kinotic);
312
312
  }
313
313
  async bulkSave(entities) {
@@ -373,10 +373,10 @@ class AdminEntityRepository {
373
373
  entityName;
374
374
  entityId;
375
375
  adminEntitiesRepository;
376
- constructor(structureApplicationId, structureName, adminEntitiesRepository) {
377
- this.entityApplicationId = structureApplicationId;
378
- this.entityName = structureName;
379
- this.entityId = (structureApplicationId + "." + structureName).toLowerCase();
376
+ constructor(entityApplicationId, entityName, adminEntitiesRepository) {
377
+ this.entityApplicationId = entityApplicationId;
378
+ this.entityName = entityName;
379
+ this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
380
380
  this.adminEntitiesRepository = adminEntitiesRepository ?? new AdminEntitiesRepository(Kinotic2);
381
381
  }
382
382
  count(tenantSelection) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/persistence",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -41,7 +41,7 @@
41
41
  "rxjs": "^7.8.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@kinotic-ai/core": "1.1.1",
44
+ "@kinotic-ai/core": "1.2.1",
45
45
  "@types/node": "^25.3.2",
46
46
  "@vitest/coverage-v8": "^4.0.18",
47
47
  "@vitest/runner": "^4.0.18",