@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 +76 -76
- package/dist/index.d.cts +89 -89
- package/dist/index.d.ts +89 -89
- package/dist/index.js +76 -76
- package/package.json +2 -2
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(
|
|
272
|
-
return this.serviceProxy.invoke("bulkSave", [
|
|
271
|
+
bulkSave(entityDefinitionId, entities) {
|
|
272
|
+
return this.serviceProxy.invoke("bulkSave", [entityDefinitionId, entities]);
|
|
273
273
|
}
|
|
274
|
-
bulkUpdate(
|
|
275
|
-
return this.serviceProxy.invoke("bulkUpdate", [
|
|
274
|
+
bulkUpdate(entityDefinitionId, entities) {
|
|
275
|
+
return this.serviceProxy.invoke("bulkUpdate", [entityDefinitionId, entities]);
|
|
276
276
|
}
|
|
277
|
-
count(
|
|
278
|
-
return this.serviceProxy.invoke("count", [
|
|
277
|
+
count(entityDefinitionId) {
|
|
278
|
+
return this.serviceProxy.invoke("count", [entityDefinitionId]);
|
|
279
279
|
}
|
|
280
|
-
countByQuery(
|
|
281
|
-
return this.serviceProxy.invoke("countByQuery", [
|
|
280
|
+
countByQuery(entityDefinitionId, query) {
|
|
281
|
+
return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query]);
|
|
282
282
|
}
|
|
283
|
-
deleteById(
|
|
284
|
-
return this.serviceProxy.invoke("deleteById", [
|
|
283
|
+
deleteById(entityDefinitionId, id) {
|
|
284
|
+
return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
|
|
285
285
|
}
|
|
286
|
-
deleteByQuery(
|
|
287
|
-
return this.serviceProxy.invoke("deleteByQuery", [
|
|
286
|
+
deleteByQuery(entityDefinitionId, query) {
|
|
287
|
+
return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query]);
|
|
288
288
|
}
|
|
289
|
-
async findAll(
|
|
290
|
-
const page = await this.findAllSinglePage(
|
|
291
|
-
return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(
|
|
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(
|
|
294
|
-
return this.serviceProxy.invoke("findAll", [
|
|
293
|
+
async findAllSinglePage(entityDefinitionId, pageable) {
|
|
294
|
+
return this.serviceProxy.invoke("findAll", [entityDefinitionId, pageable]);
|
|
295
295
|
}
|
|
296
|
-
findById(
|
|
297
|
-
return this.serviceProxy.invoke("findById", [
|
|
296
|
+
findById(entityDefinitionId, id) {
|
|
297
|
+
return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
|
|
298
298
|
}
|
|
299
|
-
findByIds(
|
|
300
|
-
return this.serviceProxy.invoke("findByIds", [
|
|
299
|
+
findByIds(entityDefinitionId, ids) {
|
|
300
|
+
return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
|
|
301
301
|
}
|
|
302
|
-
namedQuery(
|
|
303
|
-
return this.serviceProxy.invoke("namedQuery", [
|
|
302
|
+
namedQuery(entityDefinitionId, queryName, parameters) {
|
|
303
|
+
return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
|
|
304
304
|
}
|
|
305
|
-
async namedQueryPage(
|
|
306
|
-
const page = await this.namedQuerySinglePage(
|
|
307
|
-
return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(
|
|
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(
|
|
310
|
-
return this.serviceProxy.invoke("namedQueryPage", [
|
|
309
|
+
namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
|
|
310
|
+
return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
|
|
311
311
|
}
|
|
312
|
-
save(
|
|
313
|
-
return this.serviceProxy.invoke("save", [
|
|
312
|
+
save(entityDefinitionId, entity) {
|
|
313
|
+
return this.serviceProxy.invoke("save", [entityDefinitionId, entity]);
|
|
314
314
|
}
|
|
315
|
-
async search(
|
|
316
|
-
const page = await this.searchSinglePage(
|
|
317
|
-
return new import_core.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(
|
|
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(
|
|
320
|
-
return this.serviceProxy.invoke("search", [
|
|
319
|
+
async searchSinglePage(entityDefinitionId, searchText, pageable) {
|
|
320
|
+
return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, pageable]);
|
|
321
321
|
}
|
|
322
|
-
async syncIndex(
|
|
323
|
-
return this.serviceProxy.invoke("syncIndex", [
|
|
322
|
+
async syncIndex(entityDefinitionId) {
|
|
323
|
+
return this.serviceProxy.invoke("syncIndex", [entityDefinitionId]);
|
|
324
324
|
}
|
|
325
|
-
update(
|
|
326
|
-
return this.serviceProxy.invoke("update", [
|
|
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(
|
|
338
|
-
return this.serviceProxy.invoke("count", [
|
|
337
|
+
count(entityDefinitionId, tenantSelection) {
|
|
338
|
+
return this.serviceProxy.invoke("count", [entityDefinitionId, tenantSelection]);
|
|
339
339
|
}
|
|
340
|
-
countByQuery(
|
|
341
|
-
return this.serviceProxy.invoke("countByQuery", [
|
|
340
|
+
countByQuery(entityDefinitionId, query, tenantSelection) {
|
|
341
|
+
return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query, tenantSelection]);
|
|
342
342
|
}
|
|
343
|
-
deleteById(
|
|
344
|
-
return this.serviceProxy.invoke("deleteById", [
|
|
343
|
+
deleteById(entityDefinitionId, id) {
|
|
344
|
+
return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
|
|
345
345
|
}
|
|
346
|
-
deleteByQuery(
|
|
347
|
-
return this.serviceProxy.invoke("deleteByQuery", [
|
|
346
|
+
deleteByQuery(entityDefinitionId, query, tenantSelection) {
|
|
347
|
+
return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query, tenantSelection]);
|
|
348
348
|
}
|
|
349
|
-
async findAll(
|
|
350
|
-
const page = await this.findAllSinglePage(
|
|
351
|
-
return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(
|
|
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(
|
|
354
|
-
return this.serviceProxy.invoke("findAll", [
|
|
353
|
+
async findAllSinglePage(entityDefinitionId, tenantSelection, pageable) {
|
|
354
|
+
return this.serviceProxy.invoke("findAll", [entityDefinitionId, tenantSelection, pageable]);
|
|
355
355
|
}
|
|
356
|
-
findById(
|
|
357
|
-
return this.serviceProxy.invoke("findById", [
|
|
356
|
+
findById(entityDefinitionId, id) {
|
|
357
|
+
return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
|
|
358
358
|
}
|
|
359
|
-
findByIds(
|
|
360
|
-
return this.serviceProxy.invoke("findByIds", [
|
|
359
|
+
findByIds(entityDefinitionId, ids) {
|
|
360
|
+
return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
|
|
361
361
|
}
|
|
362
|
-
namedQuery(
|
|
363
|
-
return this.serviceProxy.invoke("namedQuery", [
|
|
362
|
+
namedQuery(entityDefinitionId, queryName, parameters) {
|
|
363
|
+
return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
|
|
364
364
|
}
|
|
365
|
-
async namedQueryPage(
|
|
366
|
-
const page = await this.namedQuerySinglePage(
|
|
367
|
-
return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(
|
|
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(
|
|
370
|
-
return this.serviceProxy.invoke("namedQueryPage", [
|
|
369
|
+
namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
|
|
370
|
+
return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
|
|
371
371
|
}
|
|
372
|
-
async search(
|
|
373
|
-
const page = await this.searchSinglePage(
|
|
374
|
-
return new import_core2.FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(
|
|
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(
|
|
377
|
-
return this.serviceProxy.invoke("search", [
|
|
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(
|
|
388
|
-
this.entityApplicationId =
|
|
389
|
-
this.entityName =
|
|
390
|
-
this.entityId = (
|
|
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(
|
|
457
|
-
this.entityApplicationId =
|
|
458
|
-
this.entityName =
|
|
459
|
-
this.entityId = (
|
|
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
|
|
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>(
|
|
217
|
+
bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
|
|
218
218
|
/**
|
|
219
219
|
* Updates all given entities.
|
|
220
|
-
* @param
|
|
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>(
|
|
224
|
+
bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
|
|
225
225
|
/**
|
|
226
226
|
* Returns the number of entities available.
|
|
227
|
-
* @param
|
|
227
|
+
* @param entityDefinitionId the id of the structure to count
|
|
228
228
|
* @return {@link Promise} emitting the number of entities.
|
|
229
229
|
*/
|
|
230
|
-
count(
|
|
230
|
+
count(entityDefinitionId: string): Promise<number>;
|
|
231
231
|
/**
|
|
232
232
|
* Returns the number of entities available for the given query.
|
|
233
233
|
*
|
|
234
|
-
* @param
|
|
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(
|
|
238
|
+
countByQuery(entityDefinitionId: string, query: string): Promise<number>;
|
|
239
239
|
/**
|
|
240
240
|
* Deletes the entity with the given id.
|
|
241
241
|
*
|
|
242
|
-
* @param
|
|
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(
|
|
247
|
+
deleteById(entityDefinitionId: string, id: string): Promise<void>;
|
|
248
248
|
/**
|
|
249
249
|
* Deletes the entity with the given id.
|
|
250
250
|
*
|
|
251
|
-
* @param
|
|
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(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
270
|
+
findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
|
|
271
271
|
/**
|
|
272
272
|
* Retrieves an entity by its id.
|
|
273
273
|
*
|
|
274
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
288
|
+
findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
|
|
289
289
|
/**
|
|
290
290
|
* Executes a named query.
|
|
291
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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(
|
|
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
|
|
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>(
|
|
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>(
|
|
356
|
-
bulkUpdate<T>(
|
|
357
|
-
count(
|
|
358
|
-
countByQuery(
|
|
359
|
-
deleteById(
|
|
360
|
-
deleteByQuery(
|
|
361
|
-
findAll<T>(
|
|
362
|
-
findAllSinglePage<T>(
|
|
363
|
-
findById<T>(
|
|
364
|
-
findByIds<T>(
|
|
365
|
-
namedQuery<T>(
|
|
366
|
-
namedQueryPage<T>(
|
|
367
|
-
namedQuerySinglePage<T>(
|
|
368
|
-
save<T>(
|
|
369
|
-
search<T>(
|
|
370
|
-
searchSinglePage<T>(
|
|
371
|
-
syncIndex(
|
|
372
|
-
update<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(
|
|
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
|
|
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(
|
|
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
|
|
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(
|
|
402
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
403
403
|
/**
|
|
404
404
|
* Deletes the entity with the given id.
|
|
405
405
|
*
|
|
406
|
-
* @param
|
|
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(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
439
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
440
440
|
/**
|
|
441
441
|
* Executes a named query.
|
|
442
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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(
|
|
472
|
-
countByQuery(
|
|
473
|
-
deleteById(
|
|
474
|
-
deleteByQuery(
|
|
475
|
-
findAll<T>(
|
|
476
|
-
findAllSinglePage<T>(
|
|
477
|
-
findById<T>(
|
|
478
|
-
findByIds<T>(
|
|
479
|
-
namedQuery<T>(
|
|
480
|
-
namedQueryPage<T>(
|
|
481
|
-
namedQuerySinglePage<T>(
|
|
482
|
-
search<T>(
|
|
483
|
-
searchSinglePage<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(
|
|
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(
|
|
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
|
|
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>(
|
|
217
|
+
bulkSave<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
|
|
218
218
|
/**
|
|
219
219
|
* Updates all given entities.
|
|
220
|
-
* @param
|
|
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>(
|
|
224
|
+
bulkUpdate<T>(entityDefinitionId: string, entities: T[]): Promise<void>;
|
|
225
225
|
/**
|
|
226
226
|
* Returns the number of entities available.
|
|
227
|
-
* @param
|
|
227
|
+
* @param entityDefinitionId the id of the structure to count
|
|
228
228
|
* @return {@link Promise} emitting the number of entities.
|
|
229
229
|
*/
|
|
230
|
-
count(
|
|
230
|
+
count(entityDefinitionId: string): Promise<number>;
|
|
231
231
|
/**
|
|
232
232
|
* Returns the number of entities available for the given query.
|
|
233
233
|
*
|
|
234
|
-
* @param
|
|
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(
|
|
238
|
+
countByQuery(entityDefinitionId: string, query: string): Promise<number>;
|
|
239
239
|
/**
|
|
240
240
|
* Deletes the entity with the given id.
|
|
241
241
|
*
|
|
242
|
-
* @param
|
|
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(
|
|
247
|
+
deleteById(entityDefinitionId: string, id: string): Promise<void>;
|
|
248
248
|
/**
|
|
249
249
|
* Deletes the entity with the given id.
|
|
250
250
|
*
|
|
251
|
-
* @param
|
|
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(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
270
|
+
findAllSinglePage<T>(entityDefinitionId: string, pageable: Pageable): Promise<Page<T>>;
|
|
271
271
|
/**
|
|
272
272
|
* Retrieves an entity by its id.
|
|
273
273
|
*
|
|
274
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
288
|
+
findByIds<T>(entityDefinitionId: string, ids: string[]): Promise<T[]>;
|
|
289
289
|
/**
|
|
290
290
|
* Executes a named query.
|
|
291
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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(
|
|
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
|
|
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>(
|
|
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>(
|
|
356
|
-
bulkUpdate<T>(
|
|
357
|
-
count(
|
|
358
|
-
countByQuery(
|
|
359
|
-
deleteById(
|
|
360
|
-
deleteByQuery(
|
|
361
|
-
findAll<T>(
|
|
362
|
-
findAllSinglePage<T>(
|
|
363
|
-
findById<T>(
|
|
364
|
-
findByIds<T>(
|
|
365
|
-
namedQuery<T>(
|
|
366
|
-
namedQueryPage<T>(
|
|
367
|
-
namedQuerySinglePage<T>(
|
|
368
|
-
save<T>(
|
|
369
|
-
search<T>(
|
|
370
|
-
searchSinglePage<T>(
|
|
371
|
-
syncIndex(
|
|
372
|
-
update<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(
|
|
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
|
|
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(
|
|
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
|
|
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(
|
|
402
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
403
403
|
/**
|
|
404
404
|
* Deletes the entity with the given id.
|
|
405
405
|
*
|
|
406
|
-
* @param
|
|
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(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
439
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
440
440
|
/**
|
|
441
441
|
* Executes a named query.
|
|
442
|
-
* @param
|
|
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>(
|
|
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
|
|
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>(
|
|
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
|
|
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>(
|
|
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(
|
|
472
|
-
countByQuery(
|
|
473
|
-
deleteById(
|
|
474
|
-
deleteByQuery(
|
|
475
|
-
findAll<T>(
|
|
476
|
-
findAllSinglePage<T>(
|
|
477
|
-
findById<T>(
|
|
478
|
-
findByIds<T>(
|
|
479
|
-
namedQuery<T>(
|
|
480
|
-
namedQueryPage<T>(
|
|
481
|
-
namedQuerySinglePage<T>(
|
|
482
|
-
search<T>(
|
|
483
|
-
searchSinglePage<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(
|
|
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(
|
|
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(
|
|
190
|
-
return this.serviceProxy.invoke("bulkSave", [
|
|
189
|
+
bulkSave(entityDefinitionId, entities) {
|
|
190
|
+
return this.serviceProxy.invoke("bulkSave", [entityDefinitionId, entities]);
|
|
191
191
|
}
|
|
192
|
-
bulkUpdate(
|
|
193
|
-
return this.serviceProxy.invoke("bulkUpdate", [
|
|
192
|
+
bulkUpdate(entityDefinitionId, entities) {
|
|
193
|
+
return this.serviceProxy.invoke("bulkUpdate", [entityDefinitionId, entities]);
|
|
194
194
|
}
|
|
195
|
-
count(
|
|
196
|
-
return this.serviceProxy.invoke("count", [
|
|
195
|
+
count(entityDefinitionId) {
|
|
196
|
+
return this.serviceProxy.invoke("count", [entityDefinitionId]);
|
|
197
197
|
}
|
|
198
|
-
countByQuery(
|
|
199
|
-
return this.serviceProxy.invoke("countByQuery", [
|
|
198
|
+
countByQuery(entityDefinitionId, query) {
|
|
199
|
+
return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query]);
|
|
200
200
|
}
|
|
201
|
-
deleteById(
|
|
202
|
-
return this.serviceProxy.invoke("deleteById", [
|
|
201
|
+
deleteById(entityDefinitionId, id) {
|
|
202
|
+
return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
|
|
203
203
|
}
|
|
204
|
-
deleteByQuery(
|
|
205
|
-
return this.serviceProxy.invoke("deleteByQuery", [
|
|
204
|
+
deleteByQuery(entityDefinitionId, query) {
|
|
205
|
+
return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query]);
|
|
206
206
|
}
|
|
207
|
-
async findAll(
|
|
208
|
-
const page = await this.findAllSinglePage(
|
|
209
|
-
return new FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(
|
|
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(
|
|
212
|
-
return this.serviceProxy.invoke("findAll", [
|
|
211
|
+
async findAllSinglePage(entityDefinitionId, pageable) {
|
|
212
|
+
return this.serviceProxy.invoke("findAll", [entityDefinitionId, pageable]);
|
|
213
213
|
}
|
|
214
|
-
findById(
|
|
215
|
-
return this.serviceProxy.invoke("findById", [
|
|
214
|
+
findById(entityDefinitionId, id) {
|
|
215
|
+
return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
|
|
216
216
|
}
|
|
217
|
-
findByIds(
|
|
218
|
-
return this.serviceProxy.invoke("findByIds", [
|
|
217
|
+
findByIds(entityDefinitionId, ids) {
|
|
218
|
+
return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
|
|
219
219
|
}
|
|
220
|
-
namedQuery(
|
|
221
|
-
return this.serviceProxy.invoke("namedQuery", [
|
|
220
|
+
namedQuery(entityDefinitionId, queryName, parameters) {
|
|
221
|
+
return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
|
|
222
222
|
}
|
|
223
|
-
async namedQueryPage(
|
|
224
|
-
const page = await this.namedQuerySinglePage(
|
|
225
|
-
return new FunctionalIterablePage(pageable, page, (pageable2) => this.namedQuerySinglePage(
|
|
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(
|
|
228
|
-
return this.serviceProxy.invoke("namedQueryPage", [
|
|
227
|
+
namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
|
|
228
|
+
return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
|
|
229
229
|
}
|
|
230
|
-
save(
|
|
231
|
-
return this.serviceProxy.invoke("save", [
|
|
230
|
+
save(entityDefinitionId, entity) {
|
|
231
|
+
return this.serviceProxy.invoke("save", [entityDefinitionId, entity]);
|
|
232
232
|
}
|
|
233
|
-
async search(
|
|
234
|
-
const page = await this.searchSinglePage(
|
|
235
|
-
return new FunctionalIterablePage(pageable, page, (pageable2) => this.searchSinglePage(
|
|
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(
|
|
238
|
-
return this.serviceProxy.invoke("search", [
|
|
237
|
+
async searchSinglePage(entityDefinitionId, searchText, pageable) {
|
|
238
|
+
return this.serviceProxy.invoke("search", [entityDefinitionId, searchText, pageable]);
|
|
239
239
|
}
|
|
240
|
-
async syncIndex(
|
|
241
|
-
return this.serviceProxy.invoke("syncIndex", [
|
|
240
|
+
async syncIndex(entityDefinitionId) {
|
|
241
|
+
return this.serviceProxy.invoke("syncIndex", [entityDefinitionId]);
|
|
242
242
|
}
|
|
243
|
-
update(
|
|
244
|
-
return this.serviceProxy.invoke("update", [
|
|
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(
|
|
258
|
-
return this.serviceProxy.invoke("count", [
|
|
257
|
+
count(entityDefinitionId, tenantSelection) {
|
|
258
|
+
return this.serviceProxy.invoke("count", [entityDefinitionId, tenantSelection]);
|
|
259
259
|
}
|
|
260
|
-
countByQuery(
|
|
261
|
-
return this.serviceProxy.invoke("countByQuery", [
|
|
260
|
+
countByQuery(entityDefinitionId, query, tenantSelection) {
|
|
261
|
+
return this.serviceProxy.invoke("countByQuery", [entityDefinitionId, query, tenantSelection]);
|
|
262
262
|
}
|
|
263
|
-
deleteById(
|
|
264
|
-
return this.serviceProxy.invoke("deleteById", [
|
|
263
|
+
deleteById(entityDefinitionId, id) {
|
|
264
|
+
return this.serviceProxy.invoke("deleteById", [entityDefinitionId, id]);
|
|
265
265
|
}
|
|
266
|
-
deleteByQuery(
|
|
267
|
-
return this.serviceProxy.invoke("deleteByQuery", [
|
|
266
|
+
deleteByQuery(entityDefinitionId, query, tenantSelection) {
|
|
267
|
+
return this.serviceProxy.invoke("deleteByQuery", [entityDefinitionId, query, tenantSelection]);
|
|
268
268
|
}
|
|
269
|
-
async findAll(
|
|
270
|
-
const page = await this.findAllSinglePage(
|
|
271
|
-
return new FunctionalIterablePage2(pageable, page, (pageable2) => this.findAllSinglePage(
|
|
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(
|
|
274
|
-
return this.serviceProxy.invoke("findAll", [
|
|
273
|
+
async findAllSinglePage(entityDefinitionId, tenantSelection, pageable) {
|
|
274
|
+
return this.serviceProxy.invoke("findAll", [entityDefinitionId, tenantSelection, pageable]);
|
|
275
275
|
}
|
|
276
|
-
findById(
|
|
277
|
-
return this.serviceProxy.invoke("findById", [
|
|
276
|
+
findById(entityDefinitionId, id) {
|
|
277
|
+
return this.serviceProxy.invoke("findById", [entityDefinitionId, id]);
|
|
278
278
|
}
|
|
279
|
-
findByIds(
|
|
280
|
-
return this.serviceProxy.invoke("findByIds", [
|
|
279
|
+
findByIds(entityDefinitionId, ids) {
|
|
280
|
+
return this.serviceProxy.invoke("findByIds", [entityDefinitionId, ids]);
|
|
281
281
|
}
|
|
282
|
-
namedQuery(
|
|
283
|
-
return this.serviceProxy.invoke("namedQuery", [
|
|
282
|
+
namedQuery(entityDefinitionId, queryName, parameters) {
|
|
283
|
+
return this.serviceProxy.invoke("namedQuery", [entityDefinitionId, queryName, parameters]);
|
|
284
284
|
}
|
|
285
|
-
async namedQueryPage(
|
|
286
|
-
const page = await this.namedQuerySinglePage(
|
|
287
|
-
return new FunctionalIterablePage2(pageable, page, (pageable2) => this.namedQuerySinglePage(
|
|
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(
|
|
290
|
-
return this.serviceProxy.invoke("namedQueryPage", [
|
|
289
|
+
namedQuerySinglePage(entityDefinitionId, queryName, parameters, pageable) {
|
|
290
|
+
return this.serviceProxy.invoke("namedQueryPage", [entityDefinitionId, queryName, parameters, pageable]);
|
|
291
291
|
}
|
|
292
|
-
async search(
|
|
293
|
-
const page = await this.searchSinglePage(
|
|
294
|
-
return new FunctionalIterablePage2(pageable, page, (pageable2) => this.searchSinglePage(
|
|
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(
|
|
297
|
-
return this.serviceProxy.invoke("search", [
|
|
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(
|
|
308
|
-
this.entityApplicationId =
|
|
309
|
-
this.entityName =
|
|
310
|
-
this.entityId = (
|
|
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(
|
|
377
|
-
this.entityApplicationId =
|
|
378
|
-
this.entityName =
|
|
379
|
-
this.entityId = (
|
|
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.
|
|
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.
|
|
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",
|