@kinotic-ai/persistence 5.0.0-beta.11 → 5.0.0-beta.13
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 +3 -58
- package/dist/index.d.cts +167 -213
- package/dist/index.d.ts +167 -213
- package/dist/index.js +3 -58
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -45,14 +45,10 @@ __export(exports_src, {
|
|
|
45
45
|
Text: () => Text,
|
|
46
46
|
TenantSpecificId: () => TenantSpecificId,
|
|
47
47
|
TenantId: () => TenantId,
|
|
48
|
-
RoleDecorator: () => RoleDecorator,
|
|
49
|
-
Role: () => Role,
|
|
50
48
|
QueryOptions: () => QueryOptions,
|
|
51
49
|
Query: () => Query,
|
|
52
50
|
PrecisionType: () => PrecisionType,
|
|
53
51
|
Precision: () => Precision,
|
|
54
|
-
PolicyDecorator: () => PolicyDecorator,
|
|
55
|
-
Policy: () => Policy,
|
|
56
52
|
PersistencePlugin: () => PersistencePlugin,
|
|
57
53
|
NotNull: () => NotNull,
|
|
58
54
|
NotIndexed: () => NotIndexed,
|
|
@@ -63,19 +59,15 @@ __export(exports_src, {
|
|
|
63
59
|
EsIndexConfigurationData: () => EsIndexConfigurationData,
|
|
64
60
|
EsIndexConfiguration: () => EsIndexConfiguration,
|
|
65
61
|
EntityType: () => EntityType,
|
|
66
|
-
EntityServiceDecoratorsDecorator: () => EntityServiceDecoratorsDecorator,
|
|
67
|
-
EntityServiceDecorators: () => EntityServiceDecorators,
|
|
68
|
-
EntityServiceDecorator: () => EntityServiceDecorator,
|
|
69
62
|
EntityRepository: () => EntityRepository,
|
|
70
63
|
Entity: () => Entity,
|
|
71
64
|
EntitiesRepository: () => EntitiesRepository,
|
|
72
65
|
Discriminator: () => Discriminator,
|
|
66
|
+
DateTime: () => DateTime,
|
|
73
67
|
AutoGeneratedId: () => AutoGeneratedId,
|
|
74
68
|
AdminEntityRepository: () => AdminEntityRepository,
|
|
75
69
|
AdminEntitiesRepository: () => AdminEntitiesRepository,
|
|
76
|
-
APP_API_ZONE: () => APP_API_ZONE
|
|
77
|
-
$Role: () => $Role,
|
|
78
|
-
$Policy: () => $Policy
|
|
70
|
+
APP_API_ZONE: () => APP_API_ZONE
|
|
79
71
|
});
|
|
80
72
|
module.exports = __toCommonJS(exports_src);
|
|
81
73
|
|
|
@@ -120,15 +112,13 @@ var PrecisionType;
|
|
|
120
112
|
|
|
121
113
|
// packages/persistence/src/api/KinoticPersistenceDecorators.ts
|
|
122
114
|
function AutoGeneratedId(_value, _context) {}
|
|
115
|
+
function DateTime(_value, _context) {}
|
|
123
116
|
function Discriminator(_propertyName) {
|
|
124
117
|
return function(_value, _context) {};
|
|
125
118
|
}
|
|
126
119
|
function Entity(_multiTenancyType = 0 /* NONE */, _entityType = 0 /* TABLE */) {
|
|
127
120
|
return function(_value, _context) {};
|
|
128
121
|
}
|
|
129
|
-
function EntityServiceDecorators(_config) {
|
|
130
|
-
return function(_value, _context) {};
|
|
131
|
-
}
|
|
132
122
|
function EsIndexConfiguration(_value) {
|
|
133
123
|
return function(_target, _context) {};
|
|
134
124
|
}
|
|
@@ -137,65 +127,20 @@ function Id(_value, _context) {}
|
|
|
137
127
|
function Nested(_value, _context) {}
|
|
138
128
|
function NotIndexed(_value, _context) {}
|
|
139
129
|
function NotNull(_value, _context) {}
|
|
140
|
-
function Policy(_policies) {
|
|
141
|
-
return function(_value, _context) {};
|
|
142
|
-
}
|
|
143
130
|
function Precision(_precisionType = 2 /* INT */) {
|
|
144
131
|
return function(_value, _context) {};
|
|
145
132
|
}
|
|
146
133
|
function Query(_statements) {
|
|
147
134
|
return function(_value, _context) {};
|
|
148
135
|
}
|
|
149
|
-
function Role(_roles) {
|
|
150
|
-
return function(_value, _context) {};
|
|
151
|
-
}
|
|
152
136
|
function Text(_value, _context) {}
|
|
153
137
|
function TimeReference(_value, _context) {}
|
|
154
138
|
function Version(_value, _context) {}
|
|
155
139
|
function TenantId(_value, _context) {}
|
|
156
|
-
// packages/persistence/src/api/idl/EntityServiceDecorator.ts
|
|
157
|
-
var import_idl = require("@kinotic-ai/idl");
|
|
158
|
-
|
|
159
|
-
class EntityServiceDecorator extends import_idl.C3Decorator {
|
|
160
|
-
}
|
|
161
|
-
// packages/persistence/src/api/idl/EntityServiceDecoratorsDecorator.ts
|
|
162
|
-
var import_idl2 = require("@kinotic-ai/idl");
|
|
163
|
-
|
|
164
|
-
class EntityServiceDecoratorsDecorator extends import_idl2.C3Decorator {
|
|
165
|
-
config;
|
|
166
|
-
constructor() {
|
|
167
|
-
super();
|
|
168
|
-
this.type = "EntityServiceDecoratorsDecorator";
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
140
|
// packages/persistence/src/api/idl/EsIndexConfigurationData.ts
|
|
172
141
|
class EsIndexConfigurationData {
|
|
173
142
|
componentTemplates = [];
|
|
174
143
|
}
|
|
175
|
-
// packages/persistence/src/api/idl/PolicyDecorator.ts
|
|
176
|
-
class PolicyDecorator extends EntityServiceDecorator {
|
|
177
|
-
policies;
|
|
178
|
-
constructor(policies) {
|
|
179
|
-
super();
|
|
180
|
-
this.type = "PolicyDecorator";
|
|
181
|
-
this.policies = policies;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
function $Policy(policies) {
|
|
185
|
-
return new PolicyDecorator(policies);
|
|
186
|
-
}
|
|
187
|
-
// packages/persistence/src/api/idl/RoleDecorator.ts
|
|
188
|
-
class RoleDecorator extends EntityServiceDecorator {
|
|
189
|
-
roles;
|
|
190
|
-
constructor(roles) {
|
|
191
|
-
super();
|
|
192
|
-
this.type = "RoleDecorator";
|
|
193
|
-
this.roles = roles;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
function $Role(roles) {
|
|
197
|
-
return new RoleDecorator(roles);
|
|
198
|
-
}
|
|
199
144
|
// packages/persistence/src/api/IEntitiesRepository.ts
|
|
200
145
|
var import_core = require("@kinotic-ai/core");
|
|
201
146
|
var APP_API_ZONE = "app-api";
|
package/dist/index.d.cts
CHANGED
|
@@ -61,7 +61,7 @@ declare enum MultiTenancyType {
|
|
|
61
61
|
SHARED = 1
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* The {@link PrecisionType} enum is used to define the precision of a numeric field in the
|
|
64
|
+
* The {@link PrecisionType} enum is used to define the precision of a numeric field in the Kinotic IDL.
|
|
65
65
|
*/
|
|
66
66
|
declare enum PrecisionType {
|
|
67
67
|
/**
|
|
@@ -85,12 +85,53 @@ declare enum PrecisionType {
|
|
|
85
85
|
*/
|
|
86
86
|
SHORT = 4
|
|
87
87
|
}
|
|
88
|
-
import { C3Decorator } from "@kinotic-ai/idl";
|
|
89
88
|
/**
|
|
90
|
-
*
|
|
89
|
+
* Signifies that a property is an auto-generated ID for the entity.
|
|
90
|
+
*/
|
|
91
|
+
declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
92
|
+
/**
|
|
93
|
+
* Signifies that a property holds a date, which is stored and queried as a date.
|
|
94
|
+
* The property is a string, or an array of strings, holding ISO-8601 dates such as `Date.prototype.toISOString()` returns.
|
|
95
|
+
*/
|
|
96
|
+
declare function DateTime(_value: undefined, _context: ClassFieldDecoratorContext<unknown, string | readonly string[] | null | undefined>): void;
|
|
97
|
+
/**
|
|
98
|
+
* Signifies that a property is a discriminator for the entity.
|
|
99
|
+
* This is used to determine the type of the entity when deserializing from JSON.
|
|
100
|
+
* @param propertyName the name of the property to use as the discriminator
|
|
101
|
+
*/
|
|
102
|
+
declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Signifies that a class is a Entity.
|
|
105
|
+
* This is required to define the class as an entity in the Kinotic framework.
|
|
106
|
+
* @param multiTenancyType the type of multi-tenancy to use for this entity
|
|
107
|
+
* @param entityType the type of entity to use for this entity
|
|
108
|
+
*/
|
|
109
|
+
declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Provides configuration for the Elasticsearch index.
|
|
112
|
+
* This can be used to override the default index settings and mappings used by Kinotic.
|
|
113
|
+
*/
|
|
114
|
+
declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
|
|
115
|
+
declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
116
|
+
/**
|
|
117
|
+
* Signifies that a property is the ID of the entity.
|
|
118
|
+
*/
|
|
119
|
+
declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
120
|
+
declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
121
|
+
/**
|
|
122
|
+
* Signifies that a property is not indexed in Elasticsearch.
|
|
123
|
+
*/
|
|
124
|
+
declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
125
|
+
declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
126
|
+
declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
127
|
+
declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
|
|
128
|
+
declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
129
|
+
/**
|
|
130
|
+
* This is used for data streams to signify the field that should be used as the time reference.
|
|
91
131
|
*/
|
|
92
|
-
declare
|
|
93
|
-
|
|
132
|
+
declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
133
|
+
declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
134
|
+
declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
94
135
|
import { IKinotic } from "@kinotic-ai/core";
|
|
95
136
|
import { IServiceProxy, Page, Pageable, IterablePage } from "@kinotic-ai/core";
|
|
96
137
|
/**
|
|
@@ -262,6 +303,120 @@ declare class EntitiesRepository implements IEntitiesRepository {
|
|
|
262
303
|
syncIndex(entityDefinitionId: string): Promise<void>;
|
|
263
304
|
update<T>(entityDefinitionId: string, entity: T): Promise<T>;
|
|
264
305
|
}
|
|
306
|
+
import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
|
|
307
|
+
import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable2, IterablePage as IterablePage2 } from "@kinotic-ai/core";
|
|
308
|
+
type TenantSelection = string[];
|
|
309
|
+
interface IAdminEntitiesRepository {
|
|
310
|
+
/**
|
|
311
|
+
* Returns the number of entities available.
|
|
312
|
+
* @param structureId the id of the structure to count
|
|
313
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
314
|
+
* @return {@link Promise} emitting the number of entities.
|
|
315
|
+
*/
|
|
316
|
+
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
317
|
+
/**
|
|
318
|
+
* Returns the number of entities available for the given query.
|
|
319
|
+
*
|
|
320
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
321
|
+
* @param query the query used to limit result
|
|
322
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
323
|
+
* @return Promise emitting the number of entities
|
|
324
|
+
*/
|
|
325
|
+
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
326
|
+
/**
|
|
327
|
+
* Deletes the entity with the given id.
|
|
328
|
+
*
|
|
329
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
330
|
+
* @param id must not be {@literal null}
|
|
331
|
+
* @return {@link Promise} emitting when delete is complete
|
|
332
|
+
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
333
|
+
*/
|
|
334
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
335
|
+
/**
|
|
336
|
+
* Deletes the entity with the given id.
|
|
337
|
+
*
|
|
338
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
339
|
+
* @param query the query used to filter records to delete, must not be {@literal null}
|
|
340
|
+
* @param tenantSelection the list of tenants to use when deleting the entity records
|
|
341
|
+
* @return Promise signaling when operation has completed
|
|
342
|
+
* @throws Error in case the given {@literal query} is {@literal null}
|
|
343
|
+
*/
|
|
344
|
+
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
345
|
+
/**
|
|
346
|
+
* Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
|
|
347
|
+
*
|
|
348
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
349
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
350
|
+
* @param pageable the page settings to be used
|
|
351
|
+
* @return a page of entities
|
|
352
|
+
*/
|
|
353
|
+
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
354
|
+
/**
|
|
355
|
+
* Retrieves an entity by its id.
|
|
356
|
+
*
|
|
357
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
358
|
+
* @param id must not be {@literal null}
|
|
359
|
+
* @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
|
|
360
|
+
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
361
|
+
*/
|
|
362
|
+
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
|
|
363
|
+
/**
|
|
364
|
+
* Retrieves a list of entities by their id.
|
|
365
|
+
*
|
|
366
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
367
|
+
* @param ids must not be {@literal null}
|
|
368
|
+
* @return Promise emitting the entities with the given ids or Promise emitting null if none found
|
|
369
|
+
* @throws Error in case the given {@literal ids} is {@literal null}
|
|
370
|
+
*/
|
|
371
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
372
|
+
/**
|
|
373
|
+
* Executes a named query.
|
|
374
|
+
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
375
|
+
* @param queryName the name of the function that defines the query
|
|
376
|
+
* @param parameters to pass to the query
|
|
377
|
+
* @param tenantSelection the list of tenants to use when executing the query
|
|
378
|
+
* @returns Promise with the result of the query
|
|
379
|
+
*/
|
|
380
|
+
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
381
|
+
/**
|
|
382
|
+
* Executes a named query and returns a Page of results.
|
|
383
|
+
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
384
|
+
* @param queryName the name of the function that defines the query
|
|
385
|
+
* @param parameters to pass to the query
|
|
386
|
+
* @param tenantSelection the list of tenants to use when executing the query
|
|
387
|
+
* @param pageable the page settings to be used
|
|
388
|
+
* @returns Promise with the result of the query
|
|
389
|
+
*/
|
|
390
|
+
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
391
|
+
/**
|
|
392
|
+
* Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
|
|
393
|
+
*
|
|
394
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
395
|
+
* @param searchText the text to search for entities for
|
|
396
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
397
|
+
* @param pageable the page settings to be used
|
|
398
|
+
* @return a page of entities
|
|
399
|
+
*/
|
|
400
|
+
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
401
|
+
}
|
|
402
|
+
declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
|
|
403
|
+
protected serviceProxy: IServiceProxy2;
|
|
404
|
+
constructor(kinotic: IKinotic2);
|
|
405
|
+
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
406
|
+
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
407
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
408
|
+
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
409
|
+
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
410
|
+
findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
411
|
+
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
|
|
412
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
413
|
+
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
414
|
+
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
415
|
+
namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
416
|
+
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
417
|
+
searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
418
|
+
}
|
|
419
|
+
import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
|
|
265
420
|
/**
|
|
266
421
|
* This is the base interface for all entity repositories.
|
|
267
422
|
* It provides the basic CRUD operations for entities.
|
|
@@ -331,7 +486,7 @@ interface IEntityRepository<T> {
|
|
|
331
486
|
* @param pageable the page settings to be used
|
|
332
487
|
* @return a page of entities
|
|
333
488
|
*/
|
|
334
|
-
findAll(pageable:
|
|
489
|
+
findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
335
490
|
/**
|
|
336
491
|
* Retrieves an entity by its id.
|
|
337
492
|
*
|
|
@@ -362,7 +517,7 @@ interface IEntityRepository<T> {
|
|
|
362
517
|
* @param pageable the page settings to be used
|
|
363
518
|
* @returns Promise with the result of the query
|
|
364
519
|
*/
|
|
365
|
-
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable:
|
|
520
|
+
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
|
|
366
521
|
/**
|
|
367
522
|
* Saves a given entity. This will override all data if there is an existing entity with the same id.
|
|
368
523
|
* Use the returned instance for further operations as the save operation might have changed the entity instance.
|
|
@@ -379,7 +534,7 @@ interface IEntityRepository<T> {
|
|
|
379
534
|
* @param pageable the page settings to be used
|
|
380
535
|
* @return a page of entities
|
|
381
536
|
*/
|
|
382
|
-
search(searchText: string, pageable:
|
|
537
|
+
search(searchText: string, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
383
538
|
/**
|
|
384
539
|
* This operation makes all the recent writes immediately available for search.
|
|
385
540
|
* @return a Promise that resolves when the operation is complete
|
|
@@ -413,219 +568,18 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
|
|
|
413
568
|
countByQuery(query: string): Promise<number>;
|
|
414
569
|
deleteById(id: string): Promise<void>;
|
|
415
570
|
deleteByQuery(query: string): Promise<void>;
|
|
416
|
-
findAll(pageable:
|
|
571
|
+
findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
417
572
|
findById(id: string): Promise<T | null>;
|
|
418
573
|
findByIds(ids: string[]): Promise<T[]>;
|
|
419
574
|
namedQuery<U>(queryName: string, queryParameters: QueryParameter[]): Promise<U>;
|
|
420
|
-
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable:
|
|
575
|
+
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
|
|
421
576
|
save(entity: T): Promise<T>;
|
|
422
|
-
search(searchText: string, pageable:
|
|
577
|
+
search(searchText: string, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
423
578
|
syncIndex(): Promise<void>;
|
|
424
579
|
update(entity: T): Promise<T>;
|
|
425
580
|
protected beforeBulkSaveOrUpdate(entities: T[]): Promise<T[]>;
|
|
426
581
|
protected beforeSaveOrUpdate(entity: T): Promise<T>;
|
|
427
582
|
}
|
|
428
|
-
type IfFunction<
|
|
429
|
-
T,
|
|
430
|
-
U
|
|
431
|
-
> = T extends (...args: any[]) => any ? U : never;
|
|
432
|
-
type MethodsOf<T> = { [K in keyof T] : IfFunction<T[K], K> }[keyof T];
|
|
433
|
-
type ExcludedMethods = "namedQuery" | "namedQueryPage";
|
|
434
|
-
type FilteredMethods<T> = Exclude<MethodsOf<T>, ExcludedMethods>;
|
|
435
|
-
type DecoratedFunction = FilteredMethods<IEntityRepository<any>> | "allCreate" | "allRead" | "allUpdate" | "allDelete";
|
|
436
|
-
/**
|
|
437
|
-
* Configuration for the {@link EntityServiceDecoratorsDecorator}
|
|
438
|
-
* This is a map of method names to an array of decorators that should be applied to that method
|
|
439
|
-
*/
|
|
440
|
-
type EntityServiceDecoratorsConfig = Partial<Record<DecoratedFunction, EntityServiceDecorator[]>>;
|
|
441
|
-
/**
|
|
442
|
-
* Signifies that a property is an auto-generated ID for the entity.
|
|
443
|
-
*/
|
|
444
|
-
declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
445
|
-
/**
|
|
446
|
-
* Signifies that a property is a discriminator for the entity.
|
|
447
|
-
* This is used to determine the type of the entity when deserializing from JSON.
|
|
448
|
-
* @param propertyName the name of the property to use as the discriminator
|
|
449
|
-
*/
|
|
450
|
-
declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
451
|
-
/**
|
|
452
|
-
* Signifies that a class is a Entity.
|
|
453
|
-
* This is required to define the class as an entity in the Kinotic framework.
|
|
454
|
-
* @param multiTenancyType the type of multi-tenancy to use for this entity
|
|
455
|
-
* @param entityType the type of entity to use for this entity
|
|
456
|
-
*/
|
|
457
|
-
declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
458
|
-
/**
|
|
459
|
-
* A class Decorator when applied to an Entity will configure Decorators to be applied to the EntityService
|
|
460
|
-
* @param config the {@link EntityServiceDecoratorsConfig} to use
|
|
461
|
-
*/
|
|
462
|
-
declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
463
|
-
/**
|
|
464
|
-
* Provides configuration for the Elasticsearch index.
|
|
465
|
-
* This can be used to override the default index settings and mappings used by Kinotic.
|
|
466
|
-
*/
|
|
467
|
-
declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
|
|
468
|
-
declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
469
|
-
/**
|
|
470
|
-
* Signifies that a property is the ID of the entity.
|
|
471
|
-
*/
|
|
472
|
-
declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
473
|
-
declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
474
|
-
/**
|
|
475
|
-
* Signifies that a property is not indexed in Elasticsearch.
|
|
476
|
-
*/
|
|
477
|
-
declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
478
|
-
declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
479
|
-
declare function Policy(_policies: string[][]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
|
|
480
|
-
declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
481
|
-
declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
|
|
482
|
-
declare function Role(_roles: string[]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
|
|
483
|
-
declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
484
|
-
/**
|
|
485
|
-
* This is used for data streams to signify the field that should be used as the time reference.
|
|
486
|
-
*/
|
|
487
|
-
declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
488
|
-
declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
489
|
-
declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
490
|
-
import { C3Decorator as C3Decorator2 } from "@kinotic-ai/idl";
|
|
491
|
-
/**
|
|
492
|
-
* Provides a way to add decorators to an entity service
|
|
493
|
-
*/
|
|
494
|
-
declare class EntityServiceDecoratorsDecorator extends C3Decorator2 {
|
|
495
|
-
config: EntityServiceDecoratorsConfig;
|
|
496
|
-
constructor();
|
|
497
|
-
}
|
|
498
|
-
declare class PolicyDecorator extends EntityServiceDecorator {
|
|
499
|
-
policies: string[][];
|
|
500
|
-
constructor(policies: string[][]);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Provides a mechanism to apply the @Policy decorator to an {@link EntityService}
|
|
504
|
-
* @param policies to be supplied
|
|
505
|
-
*/
|
|
506
|
-
declare function $Policy(policies: string[][]): PolicyDecorator;
|
|
507
|
-
declare class RoleDecorator extends EntityServiceDecorator {
|
|
508
|
-
roles: string[];
|
|
509
|
-
constructor(roles: string[]);
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Provides a mechanism to apply the @Role decorator to an {@link EntityService}
|
|
513
|
-
* @param roles to be supplied
|
|
514
|
-
*/
|
|
515
|
-
declare function $Role(roles: string[]): RoleDecorator;
|
|
516
|
-
import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
|
|
517
|
-
import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
|
|
518
|
-
type TenantSelection = string[];
|
|
519
|
-
interface IAdminEntitiesRepository {
|
|
520
|
-
/**
|
|
521
|
-
* Returns the number of entities available.
|
|
522
|
-
* @param structureId the id of the structure to count
|
|
523
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
524
|
-
* @return {@link Promise} emitting the number of entities.
|
|
525
|
-
*/
|
|
526
|
-
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
527
|
-
/**
|
|
528
|
-
* Returns the number of entities available for the given query.
|
|
529
|
-
*
|
|
530
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
531
|
-
* @param query the query used to limit result
|
|
532
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
533
|
-
* @return Promise emitting the number of entities
|
|
534
|
-
*/
|
|
535
|
-
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
536
|
-
/**
|
|
537
|
-
* Deletes the entity with the given id.
|
|
538
|
-
*
|
|
539
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
540
|
-
* @param id must not be {@literal null}
|
|
541
|
-
* @return {@link Promise} emitting when delete is complete
|
|
542
|
-
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
543
|
-
*/
|
|
544
|
-
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
545
|
-
/**
|
|
546
|
-
* Deletes the entity with the given id.
|
|
547
|
-
*
|
|
548
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
549
|
-
* @param query the query used to filter records to delete, must not be {@literal null}
|
|
550
|
-
* @param tenantSelection the list of tenants to use when deleting the entity records
|
|
551
|
-
* @return Promise signaling when operation has completed
|
|
552
|
-
* @throws Error in case the given {@literal query} is {@literal null}
|
|
553
|
-
*/
|
|
554
|
-
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
555
|
-
/**
|
|
556
|
-
* Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
|
|
557
|
-
*
|
|
558
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
559
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
560
|
-
* @param pageable the page settings to be used
|
|
561
|
-
* @return a page of entities
|
|
562
|
-
*/
|
|
563
|
-
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
564
|
-
/**
|
|
565
|
-
* Retrieves an entity by its id.
|
|
566
|
-
*
|
|
567
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
568
|
-
* @param id must not be {@literal null}
|
|
569
|
-
* @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
|
|
570
|
-
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
571
|
-
*/
|
|
572
|
-
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
|
|
573
|
-
/**
|
|
574
|
-
* Retrieves a list of entities by their id.
|
|
575
|
-
*
|
|
576
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
577
|
-
* @param ids must not be {@literal null}
|
|
578
|
-
* @return Promise emitting the entities with the given ids or Promise emitting null if none found
|
|
579
|
-
* @throws Error in case the given {@literal ids} is {@literal null}
|
|
580
|
-
*/
|
|
581
|
-
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
582
|
-
/**
|
|
583
|
-
* Executes a named query.
|
|
584
|
-
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
585
|
-
* @param queryName the name of the function that defines the query
|
|
586
|
-
* @param parameters to pass to the query
|
|
587
|
-
* @param tenantSelection the list of tenants to use when executing the query
|
|
588
|
-
* @returns Promise with the result of the query
|
|
589
|
-
*/
|
|
590
|
-
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
591
|
-
/**
|
|
592
|
-
* Executes a named query and returns a Page of results.
|
|
593
|
-
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
594
|
-
* @param queryName the name of the function that defines the query
|
|
595
|
-
* @param parameters to pass to the query
|
|
596
|
-
* @param tenantSelection the list of tenants to use when executing the query
|
|
597
|
-
* @param pageable the page settings to be used
|
|
598
|
-
* @returns Promise with the result of the query
|
|
599
|
-
*/
|
|
600
|
-
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
601
|
-
/**
|
|
602
|
-
* Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
|
|
603
|
-
*
|
|
604
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
605
|
-
* @param searchText the text to search for entities for
|
|
606
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
607
|
-
* @param pageable the page settings to be used
|
|
608
|
-
* @return a page of entities
|
|
609
|
-
*/
|
|
610
|
-
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
611
|
-
}
|
|
612
|
-
declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
|
|
613
|
-
protected serviceProxy: IServiceProxy2;
|
|
614
|
-
constructor(kinotic: IKinotic2);
|
|
615
|
-
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
616
|
-
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
617
|
-
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
618
|
-
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
619
|
-
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
620
|
-
findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
621
|
-
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
|
|
622
|
-
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
623
|
-
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
624
|
-
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
625
|
-
namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
626
|
-
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
627
|
-
searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
628
|
-
}
|
|
629
583
|
import { Pageable as Pageable4, IterablePage as IterablePage4 } from "@kinotic-ai/core";
|
|
630
584
|
/**
|
|
631
585
|
* This is the base interface for all admin entity repositories.
|
|
@@ -763,4 +717,4 @@ declare const PersistencePlugin: KinoticPlugin<IPersistenceExtension>;
|
|
|
763
717
|
declare module "@kinotic-ai/core" {
|
|
764
718
|
interface KinoticSingleton extends IPersistenceExtension {}
|
|
765
719
|
}
|
|
766
|
-
export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId,
|
|
720
|
+
export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, QueryParameter, QueryOptions, Query, PrecisionType, Precision, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityRepository, Entity, EntitiesRepository, Discriminator, DateTime, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, APP_API_ZONE };
|
package/dist/index.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ declare enum MultiTenancyType {
|
|
|
61
61
|
SHARED = 1
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* The {@link PrecisionType} enum is used to define the precision of a numeric field in the
|
|
64
|
+
* The {@link PrecisionType} enum is used to define the precision of a numeric field in the Kinotic IDL.
|
|
65
65
|
*/
|
|
66
66
|
declare enum PrecisionType {
|
|
67
67
|
/**
|
|
@@ -85,12 +85,53 @@ declare enum PrecisionType {
|
|
|
85
85
|
*/
|
|
86
86
|
SHORT = 4
|
|
87
87
|
}
|
|
88
|
-
import { C3Decorator } from "@kinotic-ai/idl";
|
|
89
88
|
/**
|
|
90
|
-
*
|
|
89
|
+
* Signifies that a property is an auto-generated ID for the entity.
|
|
90
|
+
*/
|
|
91
|
+
declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
92
|
+
/**
|
|
93
|
+
* Signifies that a property holds a date, which is stored and queried as a date.
|
|
94
|
+
* The property is a string, or an array of strings, holding ISO-8601 dates such as `Date.prototype.toISOString()` returns.
|
|
95
|
+
*/
|
|
96
|
+
declare function DateTime(_value: undefined, _context: ClassFieldDecoratorContext<unknown, string | readonly string[] | null | undefined>): void;
|
|
97
|
+
/**
|
|
98
|
+
* Signifies that a property is a discriminator for the entity.
|
|
99
|
+
* This is used to determine the type of the entity when deserializing from JSON.
|
|
100
|
+
* @param propertyName the name of the property to use as the discriminator
|
|
101
|
+
*/
|
|
102
|
+
declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Signifies that a class is a Entity.
|
|
105
|
+
* This is required to define the class as an entity in the Kinotic framework.
|
|
106
|
+
* @param multiTenancyType the type of multi-tenancy to use for this entity
|
|
107
|
+
* @param entityType the type of entity to use for this entity
|
|
108
|
+
*/
|
|
109
|
+
declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Provides configuration for the Elasticsearch index.
|
|
112
|
+
* This can be used to override the default index settings and mappings used by Kinotic.
|
|
113
|
+
*/
|
|
114
|
+
declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
|
|
115
|
+
declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
116
|
+
/**
|
|
117
|
+
* Signifies that a property is the ID of the entity.
|
|
118
|
+
*/
|
|
119
|
+
declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
120
|
+
declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
121
|
+
/**
|
|
122
|
+
* Signifies that a property is not indexed in Elasticsearch.
|
|
123
|
+
*/
|
|
124
|
+
declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
125
|
+
declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
126
|
+
declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
127
|
+
declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
|
|
128
|
+
declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
129
|
+
/**
|
|
130
|
+
* This is used for data streams to signify the field that should be used as the time reference.
|
|
91
131
|
*/
|
|
92
|
-
declare
|
|
93
|
-
|
|
132
|
+
declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
133
|
+
declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
134
|
+
declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
94
135
|
import { IKinotic } from "@kinotic-ai/core";
|
|
95
136
|
import { IServiceProxy, Page, Pageable, IterablePage } from "@kinotic-ai/core";
|
|
96
137
|
/**
|
|
@@ -262,6 +303,120 @@ declare class EntitiesRepository implements IEntitiesRepository {
|
|
|
262
303
|
syncIndex(entityDefinitionId: string): Promise<void>;
|
|
263
304
|
update<T>(entityDefinitionId: string, entity: T): Promise<T>;
|
|
264
305
|
}
|
|
306
|
+
import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
|
|
307
|
+
import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable2, IterablePage as IterablePage2 } from "@kinotic-ai/core";
|
|
308
|
+
type TenantSelection = string[];
|
|
309
|
+
interface IAdminEntitiesRepository {
|
|
310
|
+
/**
|
|
311
|
+
* Returns the number of entities available.
|
|
312
|
+
* @param structureId the id of the structure to count
|
|
313
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
314
|
+
* @return {@link Promise} emitting the number of entities.
|
|
315
|
+
*/
|
|
316
|
+
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
317
|
+
/**
|
|
318
|
+
* Returns the number of entities available for the given query.
|
|
319
|
+
*
|
|
320
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
321
|
+
* @param query the query used to limit result
|
|
322
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
323
|
+
* @return Promise emitting the number of entities
|
|
324
|
+
*/
|
|
325
|
+
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
326
|
+
/**
|
|
327
|
+
* Deletes the entity with the given id.
|
|
328
|
+
*
|
|
329
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
330
|
+
* @param id must not be {@literal null}
|
|
331
|
+
* @return {@link Promise} emitting when delete is complete
|
|
332
|
+
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
333
|
+
*/
|
|
334
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
335
|
+
/**
|
|
336
|
+
* Deletes the entity with the given id.
|
|
337
|
+
*
|
|
338
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
339
|
+
* @param query the query used to filter records to delete, must not be {@literal null}
|
|
340
|
+
* @param tenantSelection the list of tenants to use when deleting the entity records
|
|
341
|
+
* @return Promise signaling when operation has completed
|
|
342
|
+
* @throws Error in case the given {@literal query} is {@literal null}
|
|
343
|
+
*/
|
|
344
|
+
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
345
|
+
/**
|
|
346
|
+
* Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
|
|
347
|
+
*
|
|
348
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
349
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
350
|
+
* @param pageable the page settings to be used
|
|
351
|
+
* @return a page of entities
|
|
352
|
+
*/
|
|
353
|
+
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
354
|
+
/**
|
|
355
|
+
* Retrieves an entity by its id.
|
|
356
|
+
*
|
|
357
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
358
|
+
* @param id must not be {@literal null}
|
|
359
|
+
* @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
|
|
360
|
+
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
361
|
+
*/
|
|
362
|
+
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
|
|
363
|
+
/**
|
|
364
|
+
* Retrieves a list of entities by their id.
|
|
365
|
+
*
|
|
366
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
367
|
+
* @param ids must not be {@literal null}
|
|
368
|
+
* @return Promise emitting the entities with the given ids or Promise emitting null if none found
|
|
369
|
+
* @throws Error in case the given {@literal ids} is {@literal null}
|
|
370
|
+
*/
|
|
371
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
372
|
+
/**
|
|
373
|
+
* Executes a named query.
|
|
374
|
+
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
375
|
+
* @param queryName the name of the function that defines the query
|
|
376
|
+
* @param parameters to pass to the query
|
|
377
|
+
* @param tenantSelection the list of tenants to use when executing the query
|
|
378
|
+
* @returns Promise with the result of the query
|
|
379
|
+
*/
|
|
380
|
+
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
381
|
+
/**
|
|
382
|
+
* Executes a named query and returns a Page of results.
|
|
383
|
+
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
384
|
+
* @param queryName the name of the function that defines the query
|
|
385
|
+
* @param parameters to pass to the query
|
|
386
|
+
* @param tenantSelection the list of tenants to use when executing the query
|
|
387
|
+
* @param pageable the page settings to be used
|
|
388
|
+
* @returns Promise with the result of the query
|
|
389
|
+
*/
|
|
390
|
+
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
391
|
+
/**
|
|
392
|
+
* Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
|
|
393
|
+
*
|
|
394
|
+
* @param entityDefinitionId the id of the structure to save the entity for
|
|
395
|
+
* @param searchText the text to search for entities for
|
|
396
|
+
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
397
|
+
* @param pageable the page settings to be used
|
|
398
|
+
* @return a page of entities
|
|
399
|
+
*/
|
|
400
|
+
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
401
|
+
}
|
|
402
|
+
declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
|
|
403
|
+
protected serviceProxy: IServiceProxy2;
|
|
404
|
+
constructor(kinotic: IKinotic2);
|
|
405
|
+
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
406
|
+
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
407
|
+
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
408
|
+
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
409
|
+
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
410
|
+
findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
411
|
+
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
|
|
412
|
+
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
413
|
+
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
414
|
+
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
415
|
+
namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
416
|
+
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<IterablePage2<T>>;
|
|
417
|
+
searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable2): Promise<Page2<T>>;
|
|
418
|
+
}
|
|
419
|
+
import { Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
|
|
265
420
|
/**
|
|
266
421
|
* This is the base interface for all entity repositories.
|
|
267
422
|
* It provides the basic CRUD operations for entities.
|
|
@@ -331,7 +486,7 @@ interface IEntityRepository<T> {
|
|
|
331
486
|
* @param pageable the page settings to be used
|
|
332
487
|
* @return a page of entities
|
|
333
488
|
*/
|
|
334
|
-
findAll(pageable:
|
|
489
|
+
findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
335
490
|
/**
|
|
336
491
|
* Retrieves an entity by its id.
|
|
337
492
|
*
|
|
@@ -362,7 +517,7 @@ interface IEntityRepository<T> {
|
|
|
362
517
|
* @param pageable the page settings to be used
|
|
363
518
|
* @returns Promise with the result of the query
|
|
364
519
|
*/
|
|
365
|
-
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable:
|
|
520
|
+
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
|
|
366
521
|
/**
|
|
367
522
|
* Saves a given entity. This will override all data if there is an existing entity with the same id.
|
|
368
523
|
* Use the returned instance for further operations as the save operation might have changed the entity instance.
|
|
@@ -379,7 +534,7 @@ interface IEntityRepository<T> {
|
|
|
379
534
|
* @param pageable the page settings to be used
|
|
380
535
|
* @return a page of entities
|
|
381
536
|
*/
|
|
382
|
-
search(searchText: string, pageable:
|
|
537
|
+
search(searchText: string, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
383
538
|
/**
|
|
384
539
|
* This operation makes all the recent writes immediately available for search.
|
|
385
540
|
* @return a Promise that resolves when the operation is complete
|
|
@@ -413,219 +568,18 @@ declare class EntityRepository<T> implements IEntityRepository<T> {
|
|
|
413
568
|
countByQuery(query: string): Promise<number>;
|
|
414
569
|
deleteById(id: string): Promise<void>;
|
|
415
570
|
deleteByQuery(query: string): Promise<void>;
|
|
416
|
-
findAll(pageable:
|
|
571
|
+
findAll(pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
417
572
|
findById(id: string): Promise<T | null>;
|
|
418
573
|
findByIds(ids: string[]): Promise<T[]>;
|
|
419
574
|
namedQuery<U>(queryName: string, queryParameters: QueryParameter[]): Promise<U>;
|
|
420
|
-
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable:
|
|
575
|
+
namedQueryPage<U>(queryName: string, queryParameters: QueryParameter[], pageable: Pageable3): Promise<IterablePage3<U>>;
|
|
421
576
|
save(entity: T): Promise<T>;
|
|
422
|
-
search(searchText: string, pageable:
|
|
577
|
+
search(searchText: string, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
423
578
|
syncIndex(): Promise<void>;
|
|
424
579
|
update(entity: T): Promise<T>;
|
|
425
580
|
protected beforeBulkSaveOrUpdate(entities: T[]): Promise<T[]>;
|
|
426
581
|
protected beforeSaveOrUpdate(entity: T): Promise<T>;
|
|
427
582
|
}
|
|
428
|
-
type IfFunction<
|
|
429
|
-
T,
|
|
430
|
-
U
|
|
431
|
-
> = T extends (...args: any[]) => any ? U : never;
|
|
432
|
-
type MethodsOf<T> = { [K in keyof T] : IfFunction<T[K], K> }[keyof T];
|
|
433
|
-
type ExcludedMethods = "namedQuery" | "namedQueryPage";
|
|
434
|
-
type FilteredMethods<T> = Exclude<MethodsOf<T>, ExcludedMethods>;
|
|
435
|
-
type DecoratedFunction = FilteredMethods<IEntityRepository<any>> | "allCreate" | "allRead" | "allUpdate" | "allDelete";
|
|
436
|
-
/**
|
|
437
|
-
* Configuration for the {@link EntityServiceDecoratorsDecorator}
|
|
438
|
-
* This is a map of method names to an array of decorators that should be applied to that method
|
|
439
|
-
*/
|
|
440
|
-
type EntityServiceDecoratorsConfig = Partial<Record<DecoratedFunction, EntityServiceDecorator[]>>;
|
|
441
|
-
/**
|
|
442
|
-
* Signifies that a property is an auto-generated ID for the entity.
|
|
443
|
-
*/
|
|
444
|
-
declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
445
|
-
/**
|
|
446
|
-
* Signifies that a property is a discriminator for the entity.
|
|
447
|
-
* This is used to determine the type of the entity when deserializing from JSON.
|
|
448
|
-
* @param propertyName the name of the property to use as the discriminator
|
|
449
|
-
*/
|
|
450
|
-
declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
451
|
-
/**
|
|
452
|
-
* Signifies that a class is a Entity.
|
|
453
|
-
* This is required to define the class as an entity in the Kinotic framework.
|
|
454
|
-
* @param multiTenancyType the type of multi-tenancy to use for this entity
|
|
455
|
-
* @param entityType the type of entity to use for this entity
|
|
456
|
-
*/
|
|
457
|
-
declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
458
|
-
/**
|
|
459
|
-
* A class Decorator when applied to an Entity will configure Decorators to be applied to the EntityService
|
|
460
|
-
* @param config the {@link EntityServiceDecoratorsConfig} to use
|
|
461
|
-
*/
|
|
462
|
-
declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_value: Function, _context: ClassDecoratorContext<any>) => void;
|
|
463
|
-
/**
|
|
464
|
-
* Provides configuration for the Elasticsearch index.
|
|
465
|
-
* This can be used to override the default index settings and mappings used by Kinotic.
|
|
466
|
-
*/
|
|
467
|
-
declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
|
|
468
|
-
declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
469
|
-
/**
|
|
470
|
-
* Signifies that a property is the ID of the entity.
|
|
471
|
-
*/
|
|
472
|
-
declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
473
|
-
declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
474
|
-
/**
|
|
475
|
-
* Signifies that a property is not indexed in Elasticsearch.
|
|
476
|
-
*/
|
|
477
|
-
declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
478
|
-
declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
479
|
-
declare function Policy(_policies: string[][]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
|
|
480
|
-
declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
|
|
481
|
-
declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
|
|
482
|
-
declare function Role(_roles: string[]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
|
|
483
|
-
declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
484
|
-
/**
|
|
485
|
-
* This is used for data streams to signify the field that should be used as the time reference.
|
|
486
|
-
*/
|
|
487
|
-
declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
488
|
-
declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
489
|
-
declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
|
|
490
|
-
import { C3Decorator as C3Decorator2 } from "@kinotic-ai/idl";
|
|
491
|
-
/**
|
|
492
|
-
* Provides a way to add decorators to an entity service
|
|
493
|
-
*/
|
|
494
|
-
declare class EntityServiceDecoratorsDecorator extends C3Decorator2 {
|
|
495
|
-
config: EntityServiceDecoratorsConfig;
|
|
496
|
-
constructor();
|
|
497
|
-
}
|
|
498
|
-
declare class PolicyDecorator extends EntityServiceDecorator {
|
|
499
|
-
policies: string[][];
|
|
500
|
-
constructor(policies: string[][]);
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Provides a mechanism to apply the @Policy decorator to an {@link EntityService}
|
|
504
|
-
* @param policies to be supplied
|
|
505
|
-
*/
|
|
506
|
-
declare function $Policy(policies: string[][]): PolicyDecorator;
|
|
507
|
-
declare class RoleDecorator extends EntityServiceDecorator {
|
|
508
|
-
roles: string[];
|
|
509
|
-
constructor(roles: string[]);
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Provides a mechanism to apply the @Role decorator to an {@link EntityService}
|
|
513
|
-
* @param roles to be supplied
|
|
514
|
-
*/
|
|
515
|
-
declare function $Role(roles: string[]): RoleDecorator;
|
|
516
|
-
import { IKinotic as IKinotic2 } from "@kinotic-ai/core";
|
|
517
|
-
import { IServiceProxy as IServiceProxy2, Page as Page2, Pageable as Pageable3, IterablePage as IterablePage3 } from "@kinotic-ai/core";
|
|
518
|
-
type TenantSelection = string[];
|
|
519
|
-
interface IAdminEntitiesRepository {
|
|
520
|
-
/**
|
|
521
|
-
* Returns the number of entities available.
|
|
522
|
-
* @param structureId the id of the structure to count
|
|
523
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
524
|
-
* @return {@link Promise} emitting the number of entities.
|
|
525
|
-
*/
|
|
526
|
-
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
527
|
-
/**
|
|
528
|
-
* Returns the number of entities available for the given query.
|
|
529
|
-
*
|
|
530
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
531
|
-
* @param query the query used to limit result
|
|
532
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
533
|
-
* @return Promise emitting the number of entities
|
|
534
|
-
*/
|
|
535
|
-
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
536
|
-
/**
|
|
537
|
-
* Deletes the entity with the given id.
|
|
538
|
-
*
|
|
539
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
540
|
-
* @param id must not be {@literal null}
|
|
541
|
-
* @return {@link Promise} emitting when delete is complete
|
|
542
|
-
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
543
|
-
*/
|
|
544
|
-
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
545
|
-
/**
|
|
546
|
-
* Deletes the entity with the given id.
|
|
547
|
-
*
|
|
548
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
549
|
-
* @param query the query used to filter records to delete, must not be {@literal null}
|
|
550
|
-
* @param tenantSelection the list of tenants to use when deleting the entity records
|
|
551
|
-
* @return Promise signaling when operation has completed
|
|
552
|
-
* @throws Error in case the given {@literal query} is {@literal null}
|
|
553
|
-
*/
|
|
554
|
-
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
555
|
-
/**
|
|
556
|
-
* Returns a {@link IterablePage} of entities meeting the paging restriction provided in the {@link Pageable} object.
|
|
557
|
-
*
|
|
558
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
559
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
560
|
-
* @param pageable the page settings to be used
|
|
561
|
-
* @return a page of entities
|
|
562
|
-
*/
|
|
563
|
-
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
564
|
-
/**
|
|
565
|
-
* Retrieves an entity by its id.
|
|
566
|
-
*
|
|
567
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
568
|
-
* @param id must not be {@literal null}
|
|
569
|
-
* @return {@link Promise} with the entity with the given id or {@link Promise} emitting null if none found
|
|
570
|
-
* @throws IllegalArgumentException in case the given {@literal id} is {@literal null}
|
|
571
|
-
*/
|
|
572
|
-
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T | null>;
|
|
573
|
-
/**
|
|
574
|
-
* Retrieves a list of entities by their id.
|
|
575
|
-
*
|
|
576
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
577
|
-
* @param ids must not be {@literal null}
|
|
578
|
-
* @return Promise emitting the entities with the given ids or Promise emitting null if none found
|
|
579
|
-
* @throws Error in case the given {@literal ids} is {@literal null}
|
|
580
|
-
*/
|
|
581
|
-
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
582
|
-
/**
|
|
583
|
-
* Executes a named query.
|
|
584
|
-
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
585
|
-
* @param queryName the name of the function that defines the query
|
|
586
|
-
* @param parameters to pass to the query
|
|
587
|
-
* @param tenantSelection the list of tenants to use when executing the query
|
|
588
|
-
* @returns Promise with the result of the query
|
|
589
|
-
*/
|
|
590
|
-
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
591
|
-
/**
|
|
592
|
-
* Executes a named query and returns a Page of results.
|
|
593
|
-
* @param entityDefinitionId the id of the structure that this named query is defined for
|
|
594
|
-
* @param queryName the name of the function that defines the query
|
|
595
|
-
* @param parameters to pass to the query
|
|
596
|
-
* @param tenantSelection the list of tenants to use when executing the query
|
|
597
|
-
* @param pageable the page settings to be used
|
|
598
|
-
* @returns Promise with the result of the query
|
|
599
|
-
*/
|
|
600
|
-
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
601
|
-
/**
|
|
602
|
-
* Returns a {@link IterablePage} of entities matching the search text and paging restriction provided in the {@link Pageable} object.
|
|
603
|
-
*
|
|
604
|
-
* @param entityDefinitionId the id of the structure to save the entity for
|
|
605
|
-
* @param searchText the text to search for entities for
|
|
606
|
-
* @param tenantSelection the list of tenants to use when retrieving the entity records
|
|
607
|
-
* @param pageable the page settings to be used
|
|
608
|
-
* @return a page of entities
|
|
609
|
-
*/
|
|
610
|
-
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
611
|
-
}
|
|
612
|
-
declare class AdminEntitiesRepository implements IAdminEntitiesRepository {
|
|
613
|
-
protected serviceProxy: IServiceProxy2;
|
|
614
|
-
constructor(kinotic: IKinotic2);
|
|
615
|
-
count(entityDefinitionId: string, tenantSelection: TenantSelection): Promise<number>;
|
|
616
|
-
countByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<number>;
|
|
617
|
-
deleteById(entityDefinitionId: string, id: TenantSpecificId): Promise<void>;
|
|
618
|
-
deleteByQuery(entityDefinitionId: string, query: string, tenantSelection: TenantSelection): Promise<void>;
|
|
619
|
-
findAll<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
620
|
-
findAllSinglePage<T>(entityDefinitionId: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
621
|
-
findById<T>(entityDefinitionId: string, id: TenantSpecificId): Promise<T>;
|
|
622
|
-
findByIds<T>(entityDefinitionId: string, ids: TenantSpecificId[]): Promise<T[]>;
|
|
623
|
-
namedQuery<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection): Promise<T>;
|
|
624
|
-
namedQueryPage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
625
|
-
namedQuerySinglePage<T>(entityDefinitionId: string, queryName: string, parameters: QueryParameter[], tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
626
|
-
search<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<IterablePage3<T>>;
|
|
627
|
-
searchSinglePage<T>(entityDefinitionId: string, searchText: string, tenantSelection: TenantSelection, pageable: Pageable3): Promise<Page2<T>>;
|
|
628
|
-
}
|
|
629
583
|
import { Pageable as Pageable4, IterablePage as IterablePage4 } from "@kinotic-ai/core";
|
|
630
584
|
/**
|
|
631
585
|
* This is the base interface for all admin entity repositories.
|
|
@@ -763,4 +717,4 @@ declare const PersistencePlugin: KinoticPlugin<IPersistenceExtension>;
|
|
|
763
717
|
declare module "@kinotic-ai/core" {
|
|
764
718
|
interface KinoticSingleton extends IPersistenceExtension {}
|
|
765
719
|
}
|
|
766
|
-
export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId,
|
|
720
|
+
export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, QueryParameter, QueryOptions, Query, PrecisionType, Precision, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityRepository, Entity, EntitiesRepository, Discriminator, DateTime, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, APP_API_ZONE };
|
package/dist/index.js
CHANGED
|
@@ -39,15 +39,13 @@ var PrecisionType;
|
|
|
39
39
|
|
|
40
40
|
// packages/persistence/src/api/KinoticPersistenceDecorators.ts
|
|
41
41
|
function AutoGeneratedId(_value, _context) {}
|
|
42
|
+
function DateTime(_value, _context) {}
|
|
42
43
|
function Discriminator(_propertyName) {
|
|
43
44
|
return function(_value, _context) {};
|
|
44
45
|
}
|
|
45
46
|
function Entity(_multiTenancyType = 0 /* NONE */, _entityType = 0 /* TABLE */) {
|
|
46
47
|
return function(_value, _context) {};
|
|
47
48
|
}
|
|
48
|
-
function EntityServiceDecorators(_config) {
|
|
49
|
-
return function(_value, _context) {};
|
|
50
|
-
}
|
|
51
49
|
function EsIndexConfiguration(_value) {
|
|
52
50
|
return function(_target, _context) {};
|
|
53
51
|
}
|
|
@@ -56,65 +54,20 @@ function Id(_value, _context) {}
|
|
|
56
54
|
function Nested(_value, _context) {}
|
|
57
55
|
function NotIndexed(_value, _context) {}
|
|
58
56
|
function NotNull(_value, _context) {}
|
|
59
|
-
function Policy(_policies) {
|
|
60
|
-
return function(_value, _context) {};
|
|
61
|
-
}
|
|
62
57
|
function Precision(_precisionType = 2 /* INT */) {
|
|
63
58
|
return function(_value, _context) {};
|
|
64
59
|
}
|
|
65
60
|
function Query(_statements) {
|
|
66
61
|
return function(_value, _context) {};
|
|
67
62
|
}
|
|
68
|
-
function Role(_roles) {
|
|
69
|
-
return function(_value, _context) {};
|
|
70
|
-
}
|
|
71
63
|
function Text(_value, _context) {}
|
|
72
64
|
function TimeReference(_value, _context) {}
|
|
73
65
|
function Version(_value, _context) {}
|
|
74
66
|
function TenantId(_value, _context) {}
|
|
75
|
-
// packages/persistence/src/api/idl/EntityServiceDecorator.ts
|
|
76
|
-
import { C3Decorator } from "@kinotic-ai/idl";
|
|
77
|
-
|
|
78
|
-
class EntityServiceDecorator extends C3Decorator {
|
|
79
|
-
}
|
|
80
|
-
// packages/persistence/src/api/idl/EntityServiceDecoratorsDecorator.ts
|
|
81
|
-
import { C3Decorator as C3Decorator2 } from "@kinotic-ai/idl";
|
|
82
|
-
|
|
83
|
-
class EntityServiceDecoratorsDecorator extends C3Decorator2 {
|
|
84
|
-
config;
|
|
85
|
-
constructor() {
|
|
86
|
-
super();
|
|
87
|
-
this.type = "EntityServiceDecoratorsDecorator";
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
67
|
// packages/persistence/src/api/idl/EsIndexConfigurationData.ts
|
|
91
68
|
class EsIndexConfigurationData {
|
|
92
69
|
componentTemplates = [];
|
|
93
70
|
}
|
|
94
|
-
// packages/persistence/src/api/idl/PolicyDecorator.ts
|
|
95
|
-
class PolicyDecorator extends EntityServiceDecorator {
|
|
96
|
-
policies;
|
|
97
|
-
constructor(policies) {
|
|
98
|
-
super();
|
|
99
|
-
this.type = "PolicyDecorator";
|
|
100
|
-
this.policies = policies;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function $Policy(policies) {
|
|
104
|
-
return new PolicyDecorator(policies);
|
|
105
|
-
}
|
|
106
|
-
// packages/persistence/src/api/idl/RoleDecorator.ts
|
|
107
|
-
class RoleDecorator extends EntityServiceDecorator {
|
|
108
|
-
roles;
|
|
109
|
-
constructor(roles) {
|
|
110
|
-
super();
|
|
111
|
-
this.type = "RoleDecorator";
|
|
112
|
-
this.roles = roles;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
function $Role(roles) {
|
|
116
|
-
return new RoleDecorator(roles);
|
|
117
|
-
}
|
|
118
71
|
// packages/persistence/src/api/IEntitiesRepository.ts
|
|
119
72
|
import {
|
|
120
73
|
FunctionalIterablePage
|
|
@@ -369,14 +322,10 @@ export {
|
|
|
369
322
|
Text,
|
|
370
323
|
TenantSpecificId,
|
|
371
324
|
TenantId,
|
|
372
|
-
RoleDecorator,
|
|
373
|
-
Role,
|
|
374
325
|
QueryOptions,
|
|
375
326
|
Query,
|
|
376
327
|
PrecisionType,
|
|
377
328
|
Precision,
|
|
378
|
-
PolicyDecorator,
|
|
379
|
-
Policy,
|
|
380
329
|
PersistencePlugin,
|
|
381
330
|
NotNull,
|
|
382
331
|
NotIndexed,
|
|
@@ -387,17 +336,13 @@ export {
|
|
|
387
336
|
EsIndexConfigurationData,
|
|
388
337
|
EsIndexConfiguration,
|
|
389
338
|
EntityType,
|
|
390
|
-
EntityServiceDecoratorsDecorator,
|
|
391
|
-
EntityServiceDecorators,
|
|
392
|
-
EntityServiceDecorator,
|
|
393
339
|
EntityRepository,
|
|
394
340
|
Entity,
|
|
395
341
|
EntitiesRepository,
|
|
396
342
|
Discriminator,
|
|
343
|
+
DateTime,
|
|
397
344
|
AutoGeneratedId,
|
|
398
345
|
AdminEntityRepository,
|
|
399
346
|
AdminEntitiesRepository,
|
|
400
|
-
APP_API_ZONE
|
|
401
|
-
$Role,
|
|
402
|
-
$Policy
|
|
347
|
+
APP_API_ZONE
|
|
403
348
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kinotic-ai/persistence",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"coverage": "bun test --coverage --pass-with-no-tests"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@kinotic-ai/core": "^5.0.0-beta.
|
|
40
|
+
"@kinotic-ai/core": "^5.0.0-beta.20"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@kinotic-ai/idl": "5.0.0-beta.
|
|
43
|
+
"@kinotic-ai/idl": "5.0.0-beta.2",
|
|
44
44
|
"rxjs": "^7.8.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@kinotic-ai/core": "5.0.0-beta.
|
|
47
|
+
"@kinotic-ai/core": "5.0.0-beta.20",
|
|
48
48
|
"@types/node": "^25.3.2",
|
|
49
49
|
"tslib": "^2.8.1",
|
|
50
50
|
"typescript": "^5.9.3"
|