@kinotic-ai/persistence 1.5.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -50,7 +50,6 @@ __export(exports_src, {
50
50
  QueryOptions: () => QueryOptions,
51
51
  Query: () => Query,
52
52
  PrecisionType: () => PrecisionType,
53
- PrecisionConfig: () => PrecisionConfig,
54
53
  Precision: () => Precision,
55
54
  PolicyDecorator: () => PolicyDecorator,
56
55
  Policy: () => Policy,
@@ -59,7 +58,6 @@ __export(exports_src, {
59
58
  NotIndexed: () => NotIndexed,
60
59
  Nested: () => Nested,
61
60
  MultiTenancyType: () => MultiTenancyType,
62
- KinoticPersistenceDecorator: () => KinoticPersistenceDecorator,
63
61
  Id: () => Id,
64
62
  Flattened: () => Flattened,
65
63
  EsIndexConfigurationData: () => EsIndexConfigurationData,
@@ -69,10 +67,8 @@ __export(exports_src, {
69
67
  EntityServiceDecorators: () => EntityServiceDecorators,
70
68
  EntityServiceDecorator: () => EntityServiceDecorator,
71
69
  EntityRepository: () => EntityRepository,
72
- EntityConfig: () => EntityConfig,
73
70
  Entity: () => Entity,
74
71
  EntitiesRepository: () => EntitiesRepository,
75
- DiscriminatorConfig: () => DiscriminatorConfig,
76
72
  Discriminator: () => Discriminator,
77
73
  AutoGeneratedId: () => AutoGeneratedId,
78
74
  AdminEntityRepository: () => AdminEntityRepository,
@@ -97,9 +93,6 @@ class TenantSpecificId {
97
93
  this.tenantId = tenantId;
98
94
  }
99
95
  }
100
- // packages/persistence/src/api/KinoticPersistenceDecorators.ts
101
- var import_reflect_metadata = require("reflect-metadata");
102
-
103
96
  // packages/persistence/src/api/idl/EntityType.ts
104
97
  var EntityType;
105
98
  ((EntityType2) => {
@@ -125,98 +118,40 @@ var PrecisionType;
125
118
  })(PrecisionType ||= {});
126
119
 
127
120
  // packages/persistence/src/api/KinoticPersistenceDecorators.ts
128
- var KinoticPersistenceDecorator;
129
- ((KinoticPersistenceDecorator2) => {
130
- KinoticPersistenceDecorator2["Entity"] = "__structures-entity__";
131
- KinoticPersistenceDecorator2["Id"] = "__structures-id__";
132
- KinoticPersistenceDecorator2["AutoGeneratedId"] = "__structures-auto-generated-id__";
133
- KinoticPersistenceDecorator2["Flattened"] = "__structures-flattened__";
134
- KinoticPersistenceDecorator2["Nested"] = "__structures-nested__";
135
- KinoticPersistenceDecorator2["Text"] = "__structures-text__";
136
- KinoticPersistenceDecorator2["NotNull"] = "__structures-notnull__";
137
- KinoticPersistenceDecorator2["Precision"] = "__structures-precision__";
138
- KinoticPersistenceDecorator2["Discriminator"] = "__structures-discriminator__";
139
- KinoticPersistenceDecorator2["Query"] = "__structures-query__";
140
- KinoticPersistenceDecorator2["EntityServiceDecorators"] = "__structures-entity-service-decorators__";
141
- })(KinoticPersistenceDecorator ||= {});
142
- function AutoGeneratedId(target, propertyKey) {
143
- Reflect.defineMetadata("__structures-auto-generated-id__" /* AutoGeneratedId */, {}, target, propertyKey);
144
- }
145
-
146
- class DiscriminatorConfig {
147
- propertyName;
148
- constructor(propertyName) {
149
- this.propertyName = propertyName;
150
- }
151
- }
152
- function Discriminator(propertyName) {
153
- return function(target, propertyKey) {
154
- Reflect.defineMetadata("__structures-discriminator__" /* Discriminator */, new DiscriminatorConfig(propertyName), target, propertyKey);
155
- };
156
- }
157
-
158
- class EntityConfig {
159
- multiTenancyType;
160
- entityType;
161
- constructor(multiTenancyType, entityType = 0 /* TABLE */) {
162
- this.multiTenancyType = multiTenancyType;
163
- this.entityType = entityType;
164
- }
121
+ function AutoGeneratedId(_value, _context) {}
122
+ function Discriminator(_propertyName) {
123
+ return function(_value, _context) {};
165
124
  }
166
- function Entity(multiTenancyType = 0 /* NONE */, entityType = 0 /* TABLE */) {
167
- return function(constructor) {
168
- Reflect.defineMetadata("__structures-entity__" /* Entity */, new EntityConfig(multiTenancyType, entityType), constructor);
169
- };
125
+ function Entity(_multiTenancyType = 0 /* NONE */, _entityType = 0 /* TABLE */) {
126
+ return function(_value, _context) {};
170
127
  }
171
128
  function EntityServiceDecorators(_config) {
172
- return function(_constructor) {};
129
+ return function(_value, _context) {};
173
130
  }
174
131
  function EsIndexConfiguration(_value) {
175
- return function(_constructor) {};
176
- }
177
- function Flattened(target, propertyKey) {
178
- Reflect.defineMetadata("__structures-flattened__" /* Flattened */, {}, target, propertyKey);
179
- }
180
- function Id(target, propertyKey) {
181
- Reflect.defineMetadata("__structures-id__" /* Id */, {}, target, propertyKey);
182
- }
183
- function Nested(target, propertyKey) {
184
- Reflect.defineMetadata("__structures-nested__" /* Nested */, {}, target, propertyKey);
185
- }
186
- function NotIndexed(_target, _propertyKey) {}
187
- function NotNull(target, propertyKey) {
188
- Reflect.defineMetadata("__structures-notnull__" /* NotNull */, {}, target, propertyKey);
132
+ return function(_target, _context) {};
189
133
  }
134
+ function Flattened(_value, _context) {}
135
+ function Id(_value, _context) {}
136
+ function Nested(_value, _context) {}
137
+ function NotIndexed(_value, _context) {}
138
+ function NotNull(_value, _context) {}
190
139
  function Policy(_policies) {
191
- return function(_target, _propertyKey, _descriptor) {};
140
+ return function(_value, _context) {};
192
141
  }
193
-
194
- class PrecisionConfig {
195
- precisionType;
196
- constructor(precisionType) {
197
- this.precisionType = precisionType;
198
- }
142
+ function Precision(_precisionType = 2 /* INT */) {
143
+ return function(_value, _context) {};
199
144
  }
200
- function Precision(precisionType = 2 /* INT */) {
201
- return function(target, propertyKey) {
202
- Reflect.defineMetadata("__structures-precision__" /* Precision */, new PrecisionConfig(precisionType), target, propertyKey);
203
- };
204
- }
205
- function Query(statements) {
206
- return function(target, key, descriptor) {
207
- Reflect.defineMetadata("__structures-query__" /* Query */, statements, target, key);
208
- return descriptor;
209
- };
145
+ function Query(_statements) {
146
+ return function(_value, _context) {};
210
147
  }
211
148
  function Role(_roles) {
212
- return function(_target, _propertyKey, _descriptor) {};
213
- }
214
- function Text(target, propertyKey) {
215
- Reflect.defineMetadata("__structures-text__" /* Text */, {}, target, propertyKey);
149
+ return function(_value, _context) {};
216
150
  }
217
- function TimeReference(_target, _propertyKey) {}
218
- function Version(_target, _propertyKey) {}
219
- function TenantId(_target, _propertyKey) {}
151
+ function Text(_value, _context) {}
152
+ function TimeReference(_value, _context) {}
153
+ function Version(_value, _context) {}
154
+ function TenantId(_value, _context) {}
220
155
  // packages/persistence/src/api/idl/EntityServiceDecorator.ts
221
156
  var import_idl = require("@kinotic-ai/idl");
222
157
 
package/dist/index.d.cts CHANGED
@@ -104,81 +104,55 @@ type DecoratedFunction = FilteredMethods<IEntityService<any>> | "allCreate" | "a
104
104
  * This is a map of method names to an array of decorators that should be applied to that method
105
105
  */
106
106
  type EntityServiceDecoratorsConfig = Partial<Record<DecoratedFunction, EntityServiceDecorator[]>>;
107
- declare enum KinoticPersistenceDecorator {
108
- Entity = "__structures-entity__",
109
- Id = "__structures-id__",
110
- AutoGeneratedId = "__structures-auto-generated-id__",
111
- Flattened = "__structures-flattened__",
112
- Nested = "__structures-nested__",
113
- Text = "__structures-text__",
114
- NotNull = "__structures-notnull__",
115
- Precision = "__structures-precision__",
116
- Discriminator = "__structures-discriminator__",
117
- Query = "__structures-query__",
118
- EntityServiceDecorators = "__structures-entity-service-decorators__"
119
- }
120
107
  /**
121
108
  * Signifies that a property is an auto-generated ID for the entity.
122
109
  */
123
- declare function AutoGeneratedId(target: any, propertyKey: string): void;
124
- declare class DiscriminatorConfig {
125
- propertyName: string;
126
- constructor(propertyName: string);
127
- }
110
+ declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
128
111
  /**
129
112
  * Signifies that a property is a discriminator for the entity.
130
113
  * This is used to determine the type of the entity when deserializing from JSON.
131
114
  * @param propertyName the name of the property to use as the discriminator
132
115
  */
133
- declare function Discriminator(propertyName: string): (target: any, propertyKey: string) => void;
134
- declare class EntityConfig {
135
- multiTenancyType: MultiTenancyType;
136
- entityType: EntityType;
137
- constructor(multiTenancyType: MultiTenancyType, entityType?: EntityType);
138
- }
116
+ declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
139
117
  /**
140
118
  * Signifies that a class is a Structures Entity.
141
119
  * This is required to define the class as an entity in the Structures framework.
142
120
  * @param multiTenancyType the type of multi-tenancy to use for this entity
143
121
  * @param entityType the type of entity to use for this entity
144
122
  */
145
- declare function Entity(multiTenancyType?: MultiTenancyType, entityType?: EntityType): (constructor: Function) => void;
123
+ declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
146
124
  /**
147
125
  * A class Decorator when applied to an Entity will configure Decorators to be applied to the EntityService
148
126
  * @param config the {@link EntityServiceDecoratorsConfig} to use
149
127
  */
150
- declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_constructor: Function) => void;
128
+ declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_value: Function, _context: ClassDecoratorContext<any>) => void;
151
129
  /**
152
130
  * Provides configuration for the Elasticsearch index.
153
131
  * This can be used to override the default index settings and mappings used by Structures.
154
132
  */
155
- declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_constructor: Function) => void;
156
- declare function Flattened(target: any, propertyKey: string): void;
133
+ declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
134
+ declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
157
135
  /**
158
136
  * Signifies that a property is the ID of the entity.
159
137
  */
160
- declare function Id(target: any, propertyKey: string): void;
161
- declare function Nested(target: any, propertyKey: string): void;
138
+ declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
139
+ declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
162
140
  /**
163
141
  * Signifies that a property is not indexed in Elasticsearch.
164
142
  */
165
- declare function NotIndexed(_target: any, _propertyKey: string): void;
166
- declare function NotNull(target: any, propertyKey: string): void;
167
- declare function Policy(_policies: string[][]): (_target: any, _propertyKey?: string, _descriptor?: PropertyDescriptor) => void;
168
- declare class PrecisionConfig {
169
- precisionType: PrecisionType;
170
- constructor(precisionType: PrecisionType);
171
- }
172
- declare function Precision(precisionType?: PrecisionType): (target: any, propertyKey: string) => void;
173
- declare function Query(statements: string): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
174
- declare function Role(_roles: string[]): (_target: any, _propertyKey?: string, _descriptor?: PropertyDescriptor) => void;
175
- declare function Text(target: any, propertyKey: string): void;
143
+ declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
144
+ declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
145
+ declare function Policy(_policies: string[][]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
146
+ declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
147
+ declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
148
+ declare function Role(_roles: string[]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
149
+ declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
176
150
  /**
177
151
  * This is used for data streams to signify the field that should be used as the time reference.
178
152
  */
179
- declare function TimeReference(_target: any, _propertyKey: string): void;
180
- declare function Version(_target: any, _propertyKey: string): void;
181
- declare function TenantId(_target: any, _propertyKey: string): void;
153
+ declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
154
+ declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
155
+ declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
182
156
  import { C3Decorator as C3Decorator2 } from "@kinotic-ai/idl";
183
157
  /**
184
158
  * Provides a way to add decorators to an entity service
@@ -781,4 +755,4 @@ declare const PersistencePlugin: KinoticPlugin<IPersistenceExtension>;
781
755
  declare module "@kinotic-ai/core" {
782
756
  interface KinoticSingleton extends IPersistenceExtension {}
783
757
  }
784
- export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, RoleDecorator, Role, QueryParameter, QueryOptions, Query, PrecisionType, PrecisionConfig, Precision, PolicyDecorator, Policy, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, KinoticPersistenceDecorator, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityServiceDecoratorsDecorator, EntityServiceDecoratorsConfig, EntityServiceDecorators, EntityServiceDecorator, EntityRepository, EntityConfig, Entity, EntitiesRepository, DiscriminatorConfig, Discriminator, DecoratedFunction, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, $Role, $Policy };
758
+ export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, RoleDecorator, Role, QueryParameter, QueryOptions, Query, PrecisionType, Precision, PolicyDecorator, Policy, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityServiceDecoratorsDecorator, EntityServiceDecoratorsConfig, EntityServiceDecorators, EntityServiceDecorator, EntityRepository, Entity, EntitiesRepository, Discriminator, DecoratedFunction, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, $Role, $Policy };
package/dist/index.d.ts CHANGED
@@ -104,81 +104,55 @@ type DecoratedFunction = FilteredMethods<IEntityService<any>> | "allCreate" | "a
104
104
  * This is a map of method names to an array of decorators that should be applied to that method
105
105
  */
106
106
  type EntityServiceDecoratorsConfig = Partial<Record<DecoratedFunction, EntityServiceDecorator[]>>;
107
- declare enum KinoticPersistenceDecorator {
108
- Entity = "__structures-entity__",
109
- Id = "__structures-id__",
110
- AutoGeneratedId = "__structures-auto-generated-id__",
111
- Flattened = "__structures-flattened__",
112
- Nested = "__structures-nested__",
113
- Text = "__structures-text__",
114
- NotNull = "__structures-notnull__",
115
- Precision = "__structures-precision__",
116
- Discriminator = "__structures-discriminator__",
117
- Query = "__structures-query__",
118
- EntityServiceDecorators = "__structures-entity-service-decorators__"
119
- }
120
107
  /**
121
108
  * Signifies that a property is an auto-generated ID for the entity.
122
109
  */
123
- declare function AutoGeneratedId(target: any, propertyKey: string): void;
124
- declare class DiscriminatorConfig {
125
- propertyName: string;
126
- constructor(propertyName: string);
127
- }
110
+ declare function AutoGeneratedId(_value: undefined, _context: ClassFieldDecoratorContext): void;
128
111
  /**
129
112
  * Signifies that a property is a discriminator for the entity.
130
113
  * This is used to determine the type of the entity when deserializing from JSON.
131
114
  * @param propertyName the name of the property to use as the discriminator
132
115
  */
133
- declare function Discriminator(propertyName: string): (target: any, propertyKey: string) => void;
134
- declare class EntityConfig {
135
- multiTenancyType: MultiTenancyType;
136
- entityType: EntityType;
137
- constructor(multiTenancyType: MultiTenancyType, entityType?: EntityType);
138
- }
116
+ declare function Discriminator(_propertyName: string): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
139
117
  /**
140
118
  * Signifies that a class is a Structures Entity.
141
119
  * This is required to define the class as an entity in the Structures framework.
142
120
  * @param multiTenancyType the type of multi-tenancy to use for this entity
143
121
  * @param entityType the type of entity to use for this entity
144
122
  */
145
- declare function Entity(multiTenancyType?: MultiTenancyType, entityType?: EntityType): (constructor: Function) => void;
123
+ declare function Entity(_multiTenancyType?: MultiTenancyType, _entityType?: EntityType): (_value: Function, _context: ClassDecoratorContext<any>) => void;
146
124
  /**
147
125
  * A class Decorator when applied to an Entity will configure Decorators to be applied to the EntityService
148
126
  * @param config the {@link EntityServiceDecoratorsConfig} to use
149
127
  */
150
- declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_constructor: Function) => void;
128
+ declare function EntityServiceDecorators(_config: EntityServiceDecoratorsConfig): (_value: Function, _context: ClassDecoratorContext<any>) => void;
151
129
  /**
152
130
  * Provides configuration for the Elasticsearch index.
153
131
  * This can be used to override the default index settings and mappings used by Structures.
154
132
  */
155
- declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_constructor: Function) => void;
156
- declare function Flattened(target: any, propertyKey: string): void;
133
+ declare function EsIndexConfiguration(_value: EsIndexConfigurationData): (_target: Function, _context: ClassDecoratorContext<any>) => void;
134
+ declare function Flattened(_value: undefined, _context: ClassFieldDecoratorContext): void;
157
135
  /**
158
136
  * Signifies that a property is the ID of the entity.
159
137
  */
160
- declare function Id(target: any, propertyKey: string): void;
161
- declare function Nested(target: any, propertyKey: string): void;
138
+ declare function Id(_value: undefined, _context: ClassFieldDecoratorContext): void;
139
+ declare function Nested(_value: undefined, _context: ClassFieldDecoratorContext): void;
162
140
  /**
163
141
  * Signifies that a property is not indexed in Elasticsearch.
164
142
  */
165
- declare function NotIndexed(_target: any, _propertyKey: string): void;
166
- declare function NotNull(target: any, propertyKey: string): void;
167
- declare function Policy(_policies: string[][]): (_target: any, _propertyKey?: string, _descriptor?: PropertyDescriptor) => void;
168
- declare class PrecisionConfig {
169
- precisionType: PrecisionType;
170
- constructor(precisionType: PrecisionType);
171
- }
172
- declare function Precision(precisionType?: PrecisionType): (target: any, propertyKey: string) => void;
173
- declare function Query(statements: string): (target: any, key: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
174
- declare function Role(_roles: string[]): (_target: any, _propertyKey?: string, _descriptor?: PropertyDescriptor) => void;
175
- declare function Text(target: any, propertyKey: string): void;
143
+ declare function NotIndexed(_value: undefined, _context: ClassFieldDecoratorContext): void;
144
+ declare function NotNull(_value: undefined, _context: ClassFieldDecoratorContext): void;
145
+ declare function Policy(_policies: string[][]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
146
+ declare function Precision(_precisionType?: PrecisionType): (_value: undefined, _context: ClassFieldDecoratorContext) => void;
147
+ declare function Query(_statements: string): (_value: Function, _context: ClassMethodDecoratorContext) => void;
148
+ declare function Role(_roles: string[]): (_value: unknown, _context: ClassDecoratorContext<any> | ClassFieldDecoratorContext | ClassMethodDecoratorContext) => void;
149
+ declare function Text(_value: undefined, _context: ClassFieldDecoratorContext): void;
176
150
  /**
177
151
  * This is used for data streams to signify the field that should be used as the time reference.
178
152
  */
179
- declare function TimeReference(_target: any, _propertyKey: string): void;
180
- declare function Version(_target: any, _propertyKey: string): void;
181
- declare function TenantId(_target: any, _propertyKey: string): void;
153
+ declare function TimeReference(_value: undefined, _context: ClassFieldDecoratorContext): void;
154
+ declare function Version(_value: undefined, _context: ClassFieldDecoratorContext): void;
155
+ declare function TenantId(_value: undefined, _context: ClassFieldDecoratorContext): void;
182
156
  import { C3Decorator as C3Decorator2 } from "@kinotic-ai/idl";
183
157
  /**
184
158
  * Provides a way to add decorators to an entity service
@@ -781,4 +755,4 @@ declare const PersistencePlugin: KinoticPlugin<IPersistenceExtension>;
781
755
  declare module "@kinotic-ai/core" {
782
756
  interface KinoticSingleton extends IPersistenceExtension {}
783
757
  }
784
- export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, RoleDecorator, Role, QueryParameter, QueryOptions, Query, PrecisionType, PrecisionConfig, Precision, PolicyDecorator, Policy, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, KinoticPersistenceDecorator, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityServiceDecoratorsDecorator, EntityServiceDecoratorsConfig, EntityServiceDecorators, EntityServiceDecorator, EntityRepository, EntityConfig, Entity, EntitiesRepository, DiscriminatorConfig, Discriminator, DecoratedFunction, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, $Role, $Policy };
758
+ export { Version, TimeReference, Text, TenantSpecificId, TenantSelection, TenantId, RoleDecorator, Role, QueryParameter, QueryOptions, Query, PrecisionType, Precision, PolicyDecorator, Policy, PersistencePlugin, NotNull, NotIndexed, Nested, MultiTenancyType, Id, IPersistenceExtension, IEntityRepository, IEntitiesRepository, IAdminEntityRepository, IAdminEntitiesRepository, Flattened, EsIndexConfigurationData, EsIndexConfiguration, EntityType, EntityServiceDecoratorsDecorator, EntityServiceDecoratorsConfig, EntityServiceDecorators, EntityServiceDecorator, EntityRepository, Entity, EntitiesRepository, Discriminator, DecoratedFunction, AutoGeneratedId, AdminEntityRepository, AdminEntitiesRepository, $Role, $Policy };
package/dist/index.js CHANGED
@@ -13,9 +13,6 @@ class TenantSpecificId {
13
13
  this.tenantId = tenantId;
14
14
  }
15
15
  }
16
- // packages/persistence/src/api/KinoticPersistenceDecorators.ts
17
- import"reflect-metadata";
18
-
19
16
  // packages/persistence/src/api/idl/EntityType.ts
20
17
  var EntityType;
21
18
  ((EntityType2) => {
@@ -41,98 +38,40 @@ var PrecisionType;
41
38
  })(PrecisionType ||= {});
42
39
 
43
40
  // packages/persistence/src/api/KinoticPersistenceDecorators.ts
44
- var KinoticPersistenceDecorator;
45
- ((KinoticPersistenceDecorator2) => {
46
- KinoticPersistenceDecorator2["Entity"] = "__structures-entity__";
47
- KinoticPersistenceDecorator2["Id"] = "__structures-id__";
48
- KinoticPersistenceDecorator2["AutoGeneratedId"] = "__structures-auto-generated-id__";
49
- KinoticPersistenceDecorator2["Flattened"] = "__structures-flattened__";
50
- KinoticPersistenceDecorator2["Nested"] = "__structures-nested__";
51
- KinoticPersistenceDecorator2["Text"] = "__structures-text__";
52
- KinoticPersistenceDecorator2["NotNull"] = "__structures-notnull__";
53
- KinoticPersistenceDecorator2["Precision"] = "__structures-precision__";
54
- KinoticPersistenceDecorator2["Discriminator"] = "__structures-discriminator__";
55
- KinoticPersistenceDecorator2["Query"] = "__structures-query__";
56
- KinoticPersistenceDecorator2["EntityServiceDecorators"] = "__structures-entity-service-decorators__";
57
- })(KinoticPersistenceDecorator ||= {});
58
- function AutoGeneratedId(target, propertyKey) {
59
- Reflect.defineMetadata("__structures-auto-generated-id__" /* AutoGeneratedId */, {}, target, propertyKey);
60
- }
61
-
62
- class DiscriminatorConfig {
63
- propertyName;
64
- constructor(propertyName) {
65
- this.propertyName = propertyName;
66
- }
67
- }
68
- function Discriminator(propertyName) {
69
- return function(target, propertyKey) {
70
- Reflect.defineMetadata("__structures-discriminator__" /* Discriminator */, new DiscriminatorConfig(propertyName), target, propertyKey);
71
- };
72
- }
73
-
74
- class EntityConfig {
75
- multiTenancyType;
76
- entityType;
77
- constructor(multiTenancyType, entityType = 0 /* TABLE */) {
78
- this.multiTenancyType = multiTenancyType;
79
- this.entityType = entityType;
80
- }
41
+ function AutoGeneratedId(_value, _context) {}
42
+ function Discriminator(_propertyName) {
43
+ return function(_value, _context) {};
81
44
  }
82
- function Entity(multiTenancyType = 0 /* NONE */, entityType = 0 /* TABLE */) {
83
- return function(constructor) {
84
- Reflect.defineMetadata("__structures-entity__" /* Entity */, new EntityConfig(multiTenancyType, entityType), constructor);
85
- };
45
+ function Entity(_multiTenancyType = 0 /* NONE */, _entityType = 0 /* TABLE */) {
46
+ return function(_value, _context) {};
86
47
  }
87
48
  function EntityServiceDecorators(_config) {
88
- return function(_constructor) {};
49
+ return function(_value, _context) {};
89
50
  }
90
51
  function EsIndexConfiguration(_value) {
91
- return function(_constructor) {};
92
- }
93
- function Flattened(target, propertyKey) {
94
- Reflect.defineMetadata("__structures-flattened__" /* Flattened */, {}, target, propertyKey);
95
- }
96
- function Id(target, propertyKey) {
97
- Reflect.defineMetadata("__structures-id__" /* Id */, {}, target, propertyKey);
98
- }
99
- function Nested(target, propertyKey) {
100
- Reflect.defineMetadata("__structures-nested__" /* Nested */, {}, target, propertyKey);
101
- }
102
- function NotIndexed(_target, _propertyKey) {}
103
- function NotNull(target, propertyKey) {
104
- Reflect.defineMetadata("__structures-notnull__" /* NotNull */, {}, target, propertyKey);
52
+ return function(_target, _context) {};
105
53
  }
54
+ function Flattened(_value, _context) {}
55
+ function Id(_value, _context) {}
56
+ function Nested(_value, _context) {}
57
+ function NotIndexed(_value, _context) {}
58
+ function NotNull(_value, _context) {}
106
59
  function Policy(_policies) {
107
- return function(_target, _propertyKey, _descriptor) {};
60
+ return function(_value, _context) {};
108
61
  }
109
-
110
- class PrecisionConfig {
111
- precisionType;
112
- constructor(precisionType) {
113
- this.precisionType = precisionType;
114
- }
62
+ function Precision(_precisionType = 2 /* INT */) {
63
+ return function(_value, _context) {};
115
64
  }
116
- function Precision(precisionType = 2 /* INT */) {
117
- return function(target, propertyKey) {
118
- Reflect.defineMetadata("__structures-precision__" /* Precision */, new PrecisionConfig(precisionType), target, propertyKey);
119
- };
120
- }
121
- function Query(statements) {
122
- return function(target, key, descriptor) {
123
- Reflect.defineMetadata("__structures-query__" /* Query */, statements, target, key);
124
- return descriptor;
125
- };
65
+ function Query(_statements) {
66
+ return function(_value, _context) {};
126
67
  }
127
68
  function Role(_roles) {
128
- return function(_target, _propertyKey, _descriptor) {};
129
- }
130
- function Text(target, propertyKey) {
131
- Reflect.defineMetadata("__structures-text__" /* Text */, {}, target, propertyKey);
69
+ return function(_value, _context) {};
132
70
  }
133
- function TimeReference(_target, _propertyKey) {}
134
- function Version(_target, _propertyKey) {}
135
- function TenantId(_target, _propertyKey) {}
71
+ function Text(_value, _context) {}
72
+ function TimeReference(_value, _context) {}
73
+ function Version(_value, _context) {}
74
+ function TenantId(_value, _context) {}
136
75
  // packages/persistence/src/api/idl/EntityServiceDecorator.ts
137
76
  import { C3Decorator } from "@kinotic-ai/idl";
138
77
 
@@ -434,7 +373,6 @@ export {
434
373
  QueryOptions,
435
374
  Query,
436
375
  PrecisionType,
437
- PrecisionConfig,
438
376
  Precision,
439
377
  PolicyDecorator,
440
378
  Policy,
@@ -443,7 +381,6 @@ export {
443
381
  NotIndexed,
444
382
  Nested,
445
383
  MultiTenancyType,
446
- KinoticPersistenceDecorator,
447
384
  Id,
448
385
  Flattened,
449
386
  EsIndexConfigurationData,
@@ -453,10 +390,8 @@ export {
453
390
  EntityServiceDecorators,
454
391
  EntityServiceDecorator,
455
392
  EntityRepository,
456
- EntityConfig,
457
393
  Entity,
458
394
  EntitiesRepository,
459
- DiscriminatorConfig,
460
395
  Discriminator,
461
396
  AutoGeneratedId,
462
397
  AdminEntityRepository,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/persistence",
3
- "version": "1.5.1",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -32,15 +32,14 @@
32
32
  "coverage": "bun test --coverage --pass-with-no-tests"
33
33
  },
34
34
  "peerDependencies": {
35
- "@kinotic-ai/core": ">=1.9.0"
35
+ "@kinotic-ai/core": ">=2.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@kinotic-ai/idl": "1.0.9",
39
- "reflect-metadata": "^0.2.2",
38
+ "@kinotic-ai/idl": "1.0.10",
40
39
  "rxjs": "^7.8.2"
41
40
  },
42
41
  "devDependencies": {
43
- "@kinotic-ai/core": "1.9.0",
42
+ "@kinotic-ai/core": "2.0.0",
44
43
  "@types/node": "^25.3.2",
45
44
  "tslib": "^2.8.1",
46
45
  "typescript": "^5.9.3"