@kinotic-ai/persistence 1.1.1 → 1.2.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 +8 -4
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +8 -4
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -380,14 +380,16 @@ class AdminEntitiesRepository {
|
|
|
380
380
|
// packages/persistence/src/api/IEntityRepository.ts
|
|
381
381
|
var import_core3 = require("@kinotic-ai/core");
|
|
382
382
|
class EntityRepository {
|
|
383
|
+
entityOrganizationId;
|
|
383
384
|
entityApplicationId;
|
|
384
385
|
entityName;
|
|
385
386
|
entityId;
|
|
386
387
|
entitiesRepository;
|
|
387
|
-
constructor(entityApplicationId, entityName, entitiesRepository) {
|
|
388
|
+
constructor(entityOrganizationId, entityApplicationId, entityName, entitiesRepository) {
|
|
389
|
+
this.entityOrganizationId = entityOrganizationId;
|
|
388
390
|
this.entityApplicationId = entityApplicationId;
|
|
389
391
|
this.entityName = entityName;
|
|
390
|
-
this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
|
|
392
|
+
this.entityId = (entityOrganizationId + "." + entityApplicationId + "." + entityName).toLowerCase();
|
|
391
393
|
this.entitiesRepository = entitiesRepository ?? new EntitiesRepository(import_core3.Kinotic);
|
|
392
394
|
}
|
|
393
395
|
async bulkSave(entities) {
|
|
@@ -449,14 +451,16 @@ class EntityRepository {
|
|
|
449
451
|
// packages/persistence/src/api/IAdminEntityRepository.ts
|
|
450
452
|
var import_core4 = require("@kinotic-ai/core");
|
|
451
453
|
class AdminEntityRepository {
|
|
454
|
+
entityOrganizationId;
|
|
452
455
|
entityApplicationId;
|
|
453
456
|
entityName;
|
|
454
457
|
entityId;
|
|
455
458
|
adminEntitiesRepository;
|
|
456
|
-
constructor(entityApplicationId, entityName, adminEntitiesRepository) {
|
|
459
|
+
constructor(entityOrganizationId, entityApplicationId, entityName, adminEntitiesRepository) {
|
|
460
|
+
this.entityOrganizationId = entityOrganizationId;
|
|
457
461
|
this.entityApplicationId = entityApplicationId;
|
|
458
462
|
this.entityName = entityName;
|
|
459
|
-
this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
|
|
463
|
+
this.entityId = (entityOrganizationId + "." + entityApplicationId + "." + entityName).toLowerCase();
|
|
460
464
|
this.adminEntitiesRepository = adminEntitiesRepository ?? new AdminEntitiesRepository(import_core4.Kinotic);
|
|
461
465
|
}
|
|
462
466
|
count(tenantSelection) {
|
package/dist/index.d.cts
CHANGED
|
@@ -488,6 +488,10 @@ import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-a
|
|
|
488
488
|
* It provides the basic CRUD operations for entities.
|
|
489
489
|
*/
|
|
490
490
|
interface IEntityRepository<T> {
|
|
491
|
+
/**
|
|
492
|
+
* The organizationId of the Entity this repository is for
|
|
493
|
+
*/
|
|
494
|
+
entityOrganizationId: string;
|
|
491
495
|
/**
|
|
492
496
|
* The applicationId of the Entity this repository is for
|
|
493
497
|
*/
|
|
@@ -498,7 +502,7 @@ interface IEntityRepository<T> {
|
|
|
498
502
|
entityName: string;
|
|
499
503
|
/**
|
|
500
504
|
* The id of the Entity this repository is for
|
|
501
|
-
* Which is the applicationId + '.' + name
|
|
505
|
+
* Which is the organizationId + '.' + applicationId + '.' + name
|
|
502
506
|
*/
|
|
503
507
|
entityId: string;
|
|
504
508
|
/**
|
|
@@ -618,11 +622,12 @@ interface IEntityRepository<T> {
|
|
|
618
622
|
* It provides the basic CRUD operations for entities.
|
|
619
623
|
*/
|
|
620
624
|
declare class EntityRepository<T> implements IEntityRepository<T> {
|
|
625
|
+
entityOrganizationId: string;
|
|
621
626
|
entityApplicationId: string;
|
|
622
627
|
entityName: string;
|
|
623
628
|
entityId: string;
|
|
624
629
|
private readonly entitiesRepository;
|
|
625
|
-
constructor(entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
|
|
630
|
+
constructor(entityOrganizationId: string, entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
|
|
626
631
|
bulkSave(entities: T[]): Promise<void>;
|
|
627
632
|
bulkUpdate(entities: T[]): Promise<void>;
|
|
628
633
|
count(): Promise<number>;
|
|
@@ -647,6 +652,10 @@ import { Pageable as Pageable4, IterablePage as IterablePage4 } from "@kinotic-a
|
|
|
647
652
|
* It provides the basic CRUD operations for entities with multi-tenancy support.
|
|
648
653
|
*/
|
|
649
654
|
interface IAdminEntityRepository<T> {
|
|
655
|
+
/**
|
|
656
|
+
* The organization id of the Entity this repository is for
|
|
657
|
+
*/
|
|
658
|
+
entityOrganizationId: string;
|
|
650
659
|
/**
|
|
651
660
|
* The application id of the Entity this repository is for
|
|
652
661
|
*/
|
|
@@ -657,7 +666,7 @@ interface IAdminEntityRepository<T> {
|
|
|
657
666
|
entityName: string;
|
|
658
667
|
/**
|
|
659
668
|
* The id of the Entity this repository is for
|
|
660
|
-
* Which is the applicationId + '.' + name
|
|
669
|
+
* Which is the organizationId + '.' + applicationId + '.' + name
|
|
661
670
|
*/
|
|
662
671
|
entityId: string;
|
|
663
672
|
/**
|
|
@@ -746,11 +755,12 @@ interface IAdminEntityRepository<T> {
|
|
|
746
755
|
* It provides the basic CRUD operations for entities with multi-tenancy support.
|
|
747
756
|
*/
|
|
748
757
|
declare class AdminEntityRepository<T> implements IAdminEntityRepository<T> {
|
|
758
|
+
entityOrganizationId: string;
|
|
749
759
|
entityApplicationId: string;
|
|
750
760
|
entityName: string;
|
|
751
761
|
entityId: string;
|
|
752
762
|
private readonly adminEntitiesRepository;
|
|
753
|
-
constructor(entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
|
|
763
|
+
constructor(entityOrganizationId: string, entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
|
|
754
764
|
count(tenantSelection: TenantSelection): Promise<number>;
|
|
755
765
|
countByQuery(query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
756
766
|
deleteById(id: TenantSpecificId): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -488,6 +488,10 @@ import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-a
|
|
|
488
488
|
* It provides the basic CRUD operations for entities.
|
|
489
489
|
*/
|
|
490
490
|
interface IEntityRepository<T> {
|
|
491
|
+
/**
|
|
492
|
+
* The organizationId of the Entity this repository is for
|
|
493
|
+
*/
|
|
494
|
+
entityOrganizationId: string;
|
|
491
495
|
/**
|
|
492
496
|
* The applicationId of the Entity this repository is for
|
|
493
497
|
*/
|
|
@@ -498,7 +502,7 @@ interface IEntityRepository<T> {
|
|
|
498
502
|
entityName: string;
|
|
499
503
|
/**
|
|
500
504
|
* The id of the Entity this repository is for
|
|
501
|
-
* Which is the applicationId + '.' + name
|
|
505
|
+
* Which is the organizationId + '.' + applicationId + '.' + name
|
|
502
506
|
*/
|
|
503
507
|
entityId: string;
|
|
504
508
|
/**
|
|
@@ -618,11 +622,12 @@ interface IEntityRepository<T> {
|
|
|
618
622
|
* It provides the basic CRUD operations for entities.
|
|
619
623
|
*/
|
|
620
624
|
declare class EntityRepository<T> implements IEntityRepository<T> {
|
|
625
|
+
entityOrganizationId: string;
|
|
621
626
|
entityApplicationId: string;
|
|
622
627
|
entityName: string;
|
|
623
628
|
entityId: string;
|
|
624
629
|
private readonly entitiesRepository;
|
|
625
|
-
constructor(entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
|
|
630
|
+
constructor(entityOrganizationId: string, entityApplicationId: string, entityName: string, entitiesRepository?: IEntitiesRepository);
|
|
626
631
|
bulkSave(entities: T[]): Promise<void>;
|
|
627
632
|
bulkUpdate(entities: T[]): Promise<void>;
|
|
628
633
|
count(): Promise<number>;
|
|
@@ -647,6 +652,10 @@ import { Pageable as Pageable4, IterablePage as IterablePage4 } from "@kinotic-a
|
|
|
647
652
|
* It provides the basic CRUD operations for entities with multi-tenancy support.
|
|
648
653
|
*/
|
|
649
654
|
interface IAdminEntityRepository<T> {
|
|
655
|
+
/**
|
|
656
|
+
* The organization id of the Entity this repository is for
|
|
657
|
+
*/
|
|
658
|
+
entityOrganizationId: string;
|
|
650
659
|
/**
|
|
651
660
|
* The application id of the Entity this repository is for
|
|
652
661
|
*/
|
|
@@ -657,7 +666,7 @@ interface IAdminEntityRepository<T> {
|
|
|
657
666
|
entityName: string;
|
|
658
667
|
/**
|
|
659
668
|
* The id of the Entity this repository is for
|
|
660
|
-
* Which is the applicationId + '.' + name
|
|
669
|
+
* Which is the organizationId + '.' + applicationId + '.' + name
|
|
661
670
|
*/
|
|
662
671
|
entityId: string;
|
|
663
672
|
/**
|
|
@@ -746,11 +755,12 @@ interface IAdminEntityRepository<T> {
|
|
|
746
755
|
* It provides the basic CRUD operations for entities with multi-tenancy support.
|
|
747
756
|
*/
|
|
748
757
|
declare class AdminEntityRepository<T> implements IAdminEntityRepository<T> {
|
|
758
|
+
entityOrganizationId: string;
|
|
749
759
|
entityApplicationId: string;
|
|
750
760
|
entityName: string;
|
|
751
761
|
entityId: string;
|
|
752
762
|
private readonly adminEntitiesRepository;
|
|
753
|
-
constructor(entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
|
|
763
|
+
constructor(entityOrganizationId: string, entityApplicationId: string, entityName: string, adminEntitiesRepository?: IAdminEntitiesRepository);
|
|
754
764
|
count(tenantSelection: TenantSelection): Promise<number>;
|
|
755
765
|
countByQuery(query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
756
766
|
deleteById(id: TenantSpecificId): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -300,14 +300,16 @@ class AdminEntitiesRepository {
|
|
|
300
300
|
// packages/persistence/src/api/IEntityRepository.ts
|
|
301
301
|
import { Kinotic } from "@kinotic-ai/core";
|
|
302
302
|
class EntityRepository {
|
|
303
|
+
entityOrganizationId;
|
|
303
304
|
entityApplicationId;
|
|
304
305
|
entityName;
|
|
305
306
|
entityId;
|
|
306
307
|
entitiesRepository;
|
|
307
|
-
constructor(entityApplicationId, entityName, entitiesRepository) {
|
|
308
|
+
constructor(entityOrganizationId, entityApplicationId, entityName, entitiesRepository) {
|
|
309
|
+
this.entityOrganizationId = entityOrganizationId;
|
|
308
310
|
this.entityApplicationId = entityApplicationId;
|
|
309
311
|
this.entityName = entityName;
|
|
310
|
-
this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
|
|
312
|
+
this.entityId = (entityOrganizationId + "." + entityApplicationId + "." + entityName).toLowerCase();
|
|
311
313
|
this.entitiesRepository = entitiesRepository ?? new EntitiesRepository(Kinotic);
|
|
312
314
|
}
|
|
313
315
|
async bulkSave(entities) {
|
|
@@ -369,14 +371,16 @@ class EntityRepository {
|
|
|
369
371
|
// packages/persistence/src/api/IAdminEntityRepository.ts
|
|
370
372
|
import { Kinotic as Kinotic2 } from "@kinotic-ai/core";
|
|
371
373
|
class AdminEntityRepository {
|
|
374
|
+
entityOrganizationId;
|
|
372
375
|
entityApplicationId;
|
|
373
376
|
entityName;
|
|
374
377
|
entityId;
|
|
375
378
|
adminEntitiesRepository;
|
|
376
|
-
constructor(entityApplicationId, entityName, adminEntitiesRepository) {
|
|
379
|
+
constructor(entityOrganizationId, entityApplicationId, entityName, adminEntitiesRepository) {
|
|
380
|
+
this.entityOrganizationId = entityOrganizationId;
|
|
377
381
|
this.entityApplicationId = entityApplicationId;
|
|
378
382
|
this.entityName = entityName;
|
|
379
|
-
this.entityId = (entityApplicationId + "." + entityName).toLowerCase();
|
|
383
|
+
this.entityId = (entityOrganizationId + "." + entityApplicationId + "." + entityName).toLowerCase();
|
|
380
384
|
this.adminEntitiesRepository = adminEntitiesRepository ?? new AdminEntitiesRepository(Kinotic2);
|
|
381
385
|
}
|
|
382
386
|
count(tenantSelection) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/persistence",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ui-test": "vitest --ui --coverage.enabled=true --mode development"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@kinotic-ai/core": ">=1.
|
|
36
|
+
"@kinotic-ai/core": ">=1.2.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@kinotic-ai/idl": "1.0.9",
|