@venizia/ignis-kernel 0.4.8-15 → 0.4.8-16
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/esm/base/applications/artifact-index.d.ts +3 -3
- package/dist/esm/base/applications/artifact-index.js.map +1 -1
- package/dist/esm/base/applications/body-limit.js +1 -1
- package/dist/esm/base/applications/body-limit.js.map +1 -1
- package/dist/esm/base/applications/rest.js.map +1 -1
- package/dist/esm/base/auth/authenticate/common/types/strategy.d.ts +1 -2
- package/dist/esm/base/auth/authenticate/common/types/strategy.js.map +1 -1
- package/dist/esm/base/auth/authorize/providers/request-domain.js +2 -1
- package/dist/esm/base/auth/authorize/providers/request-domain.js.map +1 -1
- package/dist/esm/base/controllers/common/types/route.d.ts +13 -4
- package/dist/esm/base/controllers/common/types/route.js.map +1 -1
- package/dist/esm/base/controllers/factory/controller.d.ts +3 -4
- package/dist/esm/base/controllers/factory/controller.js +0 -1
- package/dist/esm/base/controllers/factory/controller.js.map +1 -1
- package/dist/esm/base/controllers/factory/crud/abstract.d.ts +3 -4
- package/dist/esm/base/controllers/factory/crud/abstract.js.map +1 -1
- package/dist/esm/base/controllers/factory/index.d.ts +1 -0
- package/dist/esm/base/controllers/factory/index.js +1 -0
- package/dist/esm/base/controllers/factory/index.js.map +1 -1
- package/dist/esm/base/controllers/factory/injection.d.ts +38 -0
- package/dist/esm/base/controllers/factory/injection.js +54 -0
- package/dist/esm/base/controllers/factory/injection.js.map +1 -0
- package/dist/esm/base/controllers/rest/base.d.ts +3 -3
- package/dist/esm/base/controllers/rest/base.js.map +1 -1
- package/dist/esm/base/datasources/common/types.d.ts +2 -2
- package/dist/esm/base/datasources/common/types.js.map +1 -1
- package/dist/esm/base/datasources/root.d.ts +2 -2
- package/dist/esm/base/datasources/root.js.map +1 -1
- package/dist/esm/base/events/event-bus.js.map +1 -1
- package/dist/esm/base/metadata/index.d.ts +1 -1
- package/dist/esm/base/metadata/index.js +1 -1
- package/dist/esm/base/metadata/injectors.d.ts +1 -1
- package/dist/esm/base/metadata/persistents/datasource.d.ts +21 -0
- package/dist/esm/base/metadata/persistents/datasource.js +46 -0
- package/dist/esm/base/metadata/persistents/datasource.js.map +1 -0
- package/dist/esm/base/metadata/persistents/index.d.ts +5 -0
- package/dist/esm/base/metadata/persistents/index.js +5 -0
- package/dist/esm/base/metadata/persistents/index.js.map +1 -0
- package/dist/esm/base/metadata/persistents/model.d.ts +18 -0
- package/dist/esm/base/metadata/persistents/model.js +64 -0
- package/dist/esm/base/metadata/persistents/model.js.map +1 -0
- package/dist/esm/base/metadata/persistents/repository/index.d.ts +19 -0
- package/dist/esm/base/metadata/persistents/repository/index.js +32 -0
- package/dist/esm/base/metadata/persistents/repository/index.js.map +1 -0
- package/dist/esm/base/metadata/persistents/repository/injection.d.ts +15 -0
- package/dist/esm/base/metadata/persistents/repository/injection.js +64 -0
- package/dist/esm/base/metadata/persistents/repository/injection.js.map +1 -0
- package/dist/esm/base/metadata/persistents/repository/resolve.d.ts +15 -0
- package/dist/esm/base/metadata/persistents/repository/resolve.js +76 -0
- package/dist/esm/base/metadata/persistents/repository/resolve.js.map +1 -0
- package/dist/esm/base/metadata/persistents/repository/validate.d.ts +15 -0
- package/dist/esm/base/metadata/persistents/repository/validate.js +50 -0
- package/dist/esm/base/metadata/persistents/repository/validate.js.map +1 -0
- package/dist/esm/base/models/common/utilities.d.ts +1 -1
- package/dist/esm/base/repositories/common/types/options.d.ts +2 -2
- package/dist/esm/base/repositories/common/types/options.js.map +1 -1
- package/dist/esm/base/repositories/common/types/query.d.ts +6 -15
- package/dist/esm/base/repositories/common/types/query.js.map +1 -1
- package/dist/esm/base/repositories/query-schemas/index.js +7 -0
- package/dist/esm/base/repositories/query-schemas/index.js.map +1 -1
- package/dist/esm/helpers/inversion/mixins/artifact.mixin.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/controllers/controller.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/controllers/grpc.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/controllers/rest.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/datasource.mixin.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/model.mixin.d.ts +3 -3
- package/dist/esm/helpers/inversion/mixins/repository.mixin.d.ts +8 -8
- package/dist/esm/helpers/inversion/mixins/repository.mixin.js +5 -6
- package/dist/esm/helpers/inversion/mixins/repository.mixin.js.map +1 -1
- package/dist/esm/helpers/inversion/registry.d.ts +26 -26
- package/dist/esm/helpers/inversion/registry.js.map +1 -1
- package/dist/esm/helpers/singleton-realm.js +5 -4
- package/dist/esm/helpers/singleton-realm.js.map +1 -1
- package/dist/esm/metadata.d.ts +1 -1
- package/dist/esm/metadata.js +1 -1
- package/dist/esm/utilities/index.d.ts +1 -0
- package/dist/esm/utilities/index.js +1 -0
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/toggle.utility.d.ts +22 -0
- package/dist/esm/utilities/toggle.utility.js +16 -0
- package/dist/esm/utilities/toggle.utility.js.map +1 -0
- package/package.json +5 -5
- package/dist/esm/base/metadata/persistents.d.ts +0 -55
- package/dist/esm/base/metadata/persistents.js +0 -303
- package/dist/esm/base/metadata/persistents.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TClass } from '@venizia/ignis-helpers/common';
|
|
2
2
|
import { MetadataRegistry as _MetadataRegistry } from '@venizia/ignis-inversion';
|
|
3
3
|
import type { IModelRegistryEntry, IRepositoryBinding } from './common/types/index.js';
|
|
4
4
|
declare const BaseRegistry: {
|
|
@@ -23,12 +23,12 @@ declare const BaseRegistry: {
|
|
|
23
23
|
getProvideMetadata<Target extends object = object>(opts: {
|
|
24
24
|
target: Target;
|
|
25
25
|
}): import("./common/index.js").IProvideMetadata[];
|
|
26
|
-
define: <Target extends object = object, Value =
|
|
26
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
27
27
|
target: Target;
|
|
28
28
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
29
29
|
value: Value;
|
|
30
30
|
}) => void;
|
|
31
|
-
get: <Target extends object = object, Value =
|
|
31
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
32
32
|
target: Target;
|
|
33
33
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
34
34
|
}) => Value | undefined;
|
|
@@ -43,7 +43,7 @@ declare const BaseRegistry: {
|
|
|
43
43
|
getKeys: <Target extends object = object>(opts: {
|
|
44
44
|
target: Target;
|
|
45
45
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
46
|
-
getMethodNames: <T =
|
|
46
|
+
getMethodNames: <T = unknown>(opts: {
|
|
47
47
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
48
48
|
}) => string[];
|
|
49
49
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -97,12 +97,12 @@ declare const BaseRegistry: {
|
|
|
97
97
|
hasRpcs<Target extends object = object>(opts: {
|
|
98
98
|
target: Target;
|
|
99
99
|
}): boolean;
|
|
100
|
-
define: <Target extends object = object, Value =
|
|
100
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
101
101
|
target: Target;
|
|
102
102
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
103
103
|
value: Value;
|
|
104
104
|
}) => void;
|
|
105
|
-
get: <Target extends object = object, Value =
|
|
105
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
106
106
|
target: Target;
|
|
107
107
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
108
108
|
}) => Value | undefined;
|
|
@@ -117,7 +117,7 @@ declare const BaseRegistry: {
|
|
|
117
117
|
getKeys: <Target extends object = object>(opts: {
|
|
118
118
|
target: Target;
|
|
119
119
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
120
|
-
getMethodNames: <T =
|
|
120
|
+
getMethodNames: <T = unknown>(opts: {
|
|
121
121
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
122
122
|
}) => string[];
|
|
123
123
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -171,12 +171,12 @@ declare const BaseRegistry: {
|
|
|
171
171
|
methodName: string | symbol;
|
|
172
172
|
configs: import("../../index.js").IAuthRouteConfig;
|
|
173
173
|
}): void;
|
|
174
|
-
define: <Target extends object = object, Value =
|
|
174
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
175
175
|
target: Target;
|
|
176
176
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
177
177
|
value: Value;
|
|
178
178
|
}) => void;
|
|
179
|
-
get: <Target extends object = object, Value =
|
|
179
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
180
180
|
target: Target;
|
|
181
181
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
182
182
|
}) => Value | undefined;
|
|
@@ -191,7 +191,7 @@ declare const BaseRegistry: {
|
|
|
191
191
|
getKeys: <Target extends object = object>(opts: {
|
|
192
192
|
target: Target;
|
|
193
193
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
194
|
-
getMethodNames: <T =
|
|
194
|
+
getMethodNames: <T = unknown>(opts: {
|
|
195
195
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
196
196
|
}) => string[];
|
|
197
197
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -243,12 +243,12 @@ declare const BaseRegistry: {
|
|
|
243
243
|
getGrpcControllerMetadata<Target extends object = object>(opts: {
|
|
244
244
|
target: Target;
|
|
245
245
|
}): import("./common/index.js").IGrpcControllerMetadata | undefined;
|
|
246
|
-
define: <Target extends object = object, Value =
|
|
246
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
247
247
|
target: Target;
|
|
248
248
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
249
249
|
value: Value;
|
|
250
250
|
}) => void;
|
|
251
|
-
get: <Target extends object = object, Value =
|
|
251
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
252
252
|
target: Target;
|
|
253
253
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
254
254
|
}) => Value | undefined;
|
|
@@ -263,7 +263,7 @@ declare const BaseRegistry: {
|
|
|
263
263
|
getKeys: <Target extends object = object>(opts: {
|
|
264
264
|
target: Target;
|
|
265
265
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
266
|
-
getMethodNames: <T =
|
|
266
|
+
getMethodNames: <T = unknown>(opts: {
|
|
267
267
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
268
268
|
}) => string[];
|
|
269
269
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -304,7 +304,7 @@ declare const BaseRegistry: {
|
|
|
304
304
|
new (...args: any[]): {
|
|
305
305
|
repositoryBindings: Map<string, IRepositoryBinding<import("../../index.js").AbstractEntity>>;
|
|
306
306
|
repositoryBindingsByClass: Map<Function, IRepositoryBinding<import("../../index.js").AbstractEntity>>;
|
|
307
|
-
datasourceModels: Map<string | Function, Set<TClass<
|
|
307
|
+
datasourceModels: Map<string | Function, Set<TClass<unknown>>>;
|
|
308
308
|
setRepositoryMetadata<Target extends object = object, Model extends import("../../index.js").AbstractEntity = import("../../index.js").AbstractEntity<unknown>, DataSource extends import("../../index.js").IDataSource = import("../../index.js").IDataSource<{}, import("../../index.js").TAnyDataSourceSchema, {}>>(opts: {
|
|
309
309
|
target: Target;
|
|
310
310
|
metadata: import("./common/index.js").TRepositoryMetadata<Model, DataSource> & {
|
|
@@ -324,8 +324,8 @@ declare const BaseRegistry: {
|
|
|
324
324
|
}): IRepositoryBinding<import("../../index.js").AbstractEntity> | undefined;
|
|
325
325
|
getDataSourceModelClasses(opts: {
|
|
326
326
|
dataSource: string | TClass<import("../../index.js").IDataSource>;
|
|
327
|
-
}): Set<TClass<
|
|
328
|
-
resolveModelRelations(modelMeta: IModelRegistryEntry): unknown;
|
|
327
|
+
}): Set<TClass<unknown>>;
|
|
328
|
+
resolveModelRelations(modelMeta: Pick<IModelRegistryEntry, "schema" | "relationsResolver" | "_builtRelations">): unknown;
|
|
329
329
|
getModels(opts: {
|
|
330
330
|
dataSource: string | TClass<import("../../index.js").IDataSource>;
|
|
331
331
|
}): {
|
|
@@ -337,7 +337,7 @@ declare const BaseRegistry: {
|
|
|
337
337
|
dataSource: string | TClass<import("../../index.js").IDataSource>;
|
|
338
338
|
}): Array<TClass<unknown>>;
|
|
339
339
|
resolveModelKey(opts: {
|
|
340
|
-
modelClass: TClass<
|
|
340
|
+
modelClass: TClass<unknown>;
|
|
341
341
|
}): string;
|
|
342
342
|
buildSchema(opts: {
|
|
343
343
|
dataSource: string | TClass<import("../../index.js").IDataSource>;
|
|
@@ -348,12 +348,12 @@ declare const BaseRegistry: {
|
|
|
348
348
|
hasModels(opts: {
|
|
349
349
|
dataSource: string | TClass<import("../../index.js").IDataSource>;
|
|
350
350
|
}): boolean;
|
|
351
|
-
define: <Target extends object = object, Value =
|
|
351
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
352
352
|
target: Target;
|
|
353
353
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
354
354
|
value: Value;
|
|
355
355
|
}) => void;
|
|
356
|
-
get: <Target extends object = object, Value =
|
|
356
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
357
357
|
target: Target;
|
|
358
358
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
359
359
|
}) => Value | undefined;
|
|
@@ -368,7 +368,7 @@ declare const BaseRegistry: {
|
|
|
368
368
|
getKeys: <Target extends object = object>(opts: {
|
|
369
369
|
target: Target;
|
|
370
370
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
371
|
-
getMethodNames: <T =
|
|
371
|
+
getMethodNames: <T = unknown>(opts: {
|
|
372
372
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
373
373
|
}) => string[];
|
|
374
374
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -453,12 +453,12 @@ declare const BaseRegistry: {
|
|
|
453
453
|
authorize: import("./common/index.js").IModelAuthorizeSettings;
|
|
454
454
|
entry: IModelRegistryEntry;
|
|
455
455
|
}>;
|
|
456
|
-
define: <Target extends object = object, Value =
|
|
456
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
457
457
|
target: Target;
|
|
458
458
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
459
459
|
value: Value;
|
|
460
460
|
}) => void;
|
|
461
|
-
get: <Target extends object = object, Value =
|
|
461
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
462
462
|
target: Target;
|
|
463
463
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
464
464
|
}) => Value | undefined;
|
|
@@ -473,7 +473,7 @@ declare const BaseRegistry: {
|
|
|
473
473
|
getKeys: <Target extends object = object>(opts: {
|
|
474
474
|
target: Target;
|
|
475
475
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
476
|
-
getMethodNames: <T =
|
|
476
|
+
getMethodNames: <T = unknown>(opts: {
|
|
477
477
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
478
478
|
}) => string[];
|
|
479
479
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -519,12 +519,12 @@ declare const BaseRegistry: {
|
|
|
519
519
|
getDataSourceMetadata<Target extends object = object>(opts: {
|
|
520
520
|
target: Target;
|
|
521
521
|
}): import("./common/index.js").IDataSourceMetadata | undefined;
|
|
522
|
-
define: <Target extends object = object, Value =
|
|
522
|
+
define: <Target extends object = object, Value = unknown>(opts: {
|
|
523
523
|
target: Target;
|
|
524
524
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
525
525
|
value: Value;
|
|
526
526
|
}) => void;
|
|
527
|
-
get: <Target extends object = object, Value =
|
|
527
|
+
get: <Target extends object = object, Value = unknown>(opts: {
|
|
528
528
|
target: Target;
|
|
529
529
|
key: import("@venizia/ignis-inversion").TBindingKey;
|
|
530
530
|
}) => Value | undefined;
|
|
@@ -539,7 +539,7 @@ declare const BaseRegistry: {
|
|
|
539
539
|
getKeys: <Target extends object = object>(opts: {
|
|
540
540
|
target: Target;
|
|
541
541
|
}) => import("@venizia/ignis-inversion").TBindingKey[];
|
|
542
|
-
getMethodNames: <T =
|
|
542
|
+
getMethodNames: <T = unknown>(opts: {
|
|
543
543
|
target: import("@venizia/ignis-inversion").TClass<T>;
|
|
544
544
|
}) => string[];
|
|
545
545
|
clearMetadata: <T extends object = object>(opts: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/helpers/inversion/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,UAAU,CAAC;AAElB,MAAM,YAAY,GAAG,qBAAqB,CACxC,2BAA2B,CACzB,2BAA2B,CACzB,uBAAuB,CACrB,uBAAuB,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACxF,CACF,CACF,CACF,CAAC;AAEF,iHAAiH;AACjH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;aAChC,uBAAkB,GAAG,mBAAmB,CAAC;IAEzD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAA+B,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,EAA+B,CAAC;QACjE,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,EAA8B,CAAC;QAChE,IAAI,CAAC,yBAAyB,GAAG,IAAI,GAAG,EAAgC,CAAC;QACzE,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAA2C,CAAC;IAC7E,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,cAAc,CAAC,OAAO,CAAC;YAC5B,GAAG,EAAE,gBAAgB,CAAC,kBAAkB;YACxC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,EAAE;SACrC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,EAA+B,CAAC;QACjE,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../../src/helpers/inversion/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,IAAI,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,uBAAuB,EACvB,2BAA2B,EAC3B,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,UAAU,CAAC;AAElB,MAAM,YAAY,GAAG,qBAAqB,CACxC,2BAA2B,CACzB,2BAA2B,CACzB,uBAAuB,CACrB,uBAAuB,CAAC,kBAAkB,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CACxF,CACF,CACF,CACF,CAAC;AAEF,iHAAiH;AACjH,MAAM,OAAO,gBAAiB,SAAQ,YAAY;aAChC,uBAAkB,GAAG,mBAAmB,CAAC;IAEzD;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,aAAa,GAAG,IAAI,GAAG,EAA+B,CAAC;QAC5D,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,EAA+B,CAAC;QACjE,IAAI,CAAC,kBAAkB,GAAG,IAAI,GAAG,EAA8B,CAAC;QAChE,IAAI,CAAC,yBAAyB,GAAG,IAAI,GAAG,EAAgC,CAAC;QACzE,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAA2C,CAAC;IAC7E,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,cAAc,CAAC,OAAO,CAAC;YAC5B,GAAG,EAAE,gBAAgB,CAAC,kBAAkB;YACxC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,gBAAgB,EAAE;SACrC,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,cAAc,GAAG,IAAI,OAAO,EAA+B,CAAC;QACjE,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,yBAAyB,CAAC,KAAK,EAAE,CAAC;QACvC,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC","sourcesContent":["import type { TClass } from '@venizia/ignis-helpers/common';\nimport { MetadataRegistry as _MetadataRegistry } from '@venizia/ignis-inversion';\nimport { SingletonRealm } from '../singleton-realm';\nimport type { IModelRegistryEntry, IRepositoryBinding } from './common/types';\nimport {\n ArtifactMetadataMixin,\n ControllerMetadataMixin,\n DatasourceMetadataMixin,\n GrpcControllerMetadataMixin,\n ModelMetadataMixin,\n RepositoryMetadataMixin,\n RestControllerMetadataMixin,\n} from './mixins';\n\nconst BaseRegistry = ArtifactMetadataMixin(\n GrpcControllerMetadataMixin(\n RestControllerMetadataMixin(\n ControllerMetadataMixin(\n RepositoryMetadataMixin(ModelMetadataMixin(DatasourceMetadataMixin(_MetadataRegistry))),\n ),\n ),\n ),\n);\n\n/** Central metadata registry: decorator metadata, the model registry, repository bindings and auto-discovery. */\nexport class MetadataRegistry extends BaseRegistry {\n static readonly SINGLETON_REAL_KEY = 'metadata-registry';\n\n private constructor() {\n super();\n this.modelRegistry = new Map<string, IModelRegistryEntry>();\n this.modelsBySchema = new WeakMap<object, IModelRegistryEntry>();\n this.repositoryBindings = new Map<string, IRepositoryBinding>();\n this.repositoryBindingsByClass = new Map<Function, IRepositoryBinding>();\n this.datasourceModels = new Map<string | Function, Set<TClass<unknown>>>();\n }\n\n static getInstance(): MetadataRegistry {\n return SingletonRealm.resolve({\n key: MetadataRegistry.SINGLETON_REAL_KEY,\n create: () => new MetadataRegistry(),\n });\n }\n\n clearAll(): void {\n this.modelRegistry.clear();\n this.modelsBySchema = new WeakMap<object, IModelRegistryEntry>();\n this.repositoryBindings.clear();\n this.repositoryBindingsByClass.clear();\n this.datasourceModels.clear();\n }\n}\n"]}
|
|
@@ -24,14 +24,15 @@ export class SingletonRealm {
|
|
|
24
24
|
static resolve(opts) {
|
|
25
25
|
const { key, create } = opts;
|
|
26
26
|
const anchor = this.anchorFor({ key });
|
|
27
|
-
const realm = globalThis;
|
|
28
27
|
// `in`, not a truthiness check: a holder whose only field is still `undefined` is a legitimate
|
|
29
28
|
// resolved value, and re-creating it would hand every caller a fresh slot.
|
|
30
|
-
if (anchor in
|
|
31
|
-
|
|
29
|
+
if (anchor in globalThis) {
|
|
30
|
+
const existing = Reflect.get(globalThis, anchor);
|
|
31
|
+
// The slot is filled by `create()` below, under this same `key`, so its value is the caller's `T`; no type reaches the realm.
|
|
32
|
+
return existing;
|
|
32
33
|
}
|
|
33
34
|
const created = create();
|
|
34
|
-
|
|
35
|
+
Reflect.set(globalThis, anchor, created);
|
|
35
36
|
return created;
|
|
36
37
|
}
|
|
37
38
|
static anchorFor(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton-realm.js","sourceRoot":"","sources":["../../../src/helpers/singleton-realm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAAc;aACD,kBAAa,GAAG,wBAAwB,CAAC;IAEjE;;;;OAIG;aACqB,YAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5D,2GAA2G;IAC3G,MAAM,CAAC,OAAO,CAAI,IAAsC;QACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAE7B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"singleton-realm.js","sourceRoot":"","sources":["../../../src/helpers/singleton-realm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,cAAc;aACD,kBAAa,GAAG,wBAAwB,CAAC;IAEjE;;;;OAIG;aACqB,YAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE5D,2GAA2G;IAC3G,MAAM,CAAC,OAAO,CAAI,IAAsC;QACtD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAE7B,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAEvC,+FAA+F;QAC/F,2EAA2E;QAC3E,IAAI,MAAM,IAAI,UAAU,EAAE,CAAC;YACzB,MAAM,QAAQ,GAAY,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;YAE1D,8HAA8H;YAC9H,OAAO,QAAa,CAAC;QACvB,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC;QACzB,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAEzC,OAAO,OAAO,CAAC;IACjB,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,IAAqB;QAC5C,MAAM,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;QAErB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAErC,IAAI,MAAM,EAAE,CAAC;YACX,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QAE9B,OAAO,MAAM,CAAC;IAChB,CAAC","sourcesContent":["/**\n * Anchors a value on the realm instead of on a module.\n *\n * Two copies of `@venizia/ignis-kernel` can end up in one install without either package changing:\n * `@venizia/ignis` and `@venizia/ignis-connectors` each pin a range, and the day those ranges stop\n * intersecting a package manager installs a nested second copy rather than failing. Module-level\n * statics then split in two, and nothing throws - `@repository` writes into one `datasourceModels`\n * map while `discoverSchema()` reads the other, `buildSchema()` returns `{}`, and every query fails\n * for a reason that points nowhere near the cause.\n *\n * `Symbol.for` is keyed on a global registry per realm, so both copies resolve the same symbol and\n * therefore the same instance. A browser tab and its Worker are separate realms and still get one\n * registry each, which is correct - they run separate applications.\n */\nexport class SingletonRealm {\n private static readonly ANCHOR_PREFIX = '@venizia/ignis-kernel:';\n\n /**\n * Anchors are memoized, not the values: an anchored value is created once and only ever mutated,\n * so re-deriving its symbol per call buys nothing. The audit enrichers reach this twice per\n * inserted row.\n */\n private static readonly anchors = new Map<string, symbol>();\n\n /** The realm's own singleton for `key`, created on first call and shared by every copy of this package. */\n static resolve<T>(opts: { key: string; create: () => T }): T {\n const { key, create } = opts;\n\n const anchor = this.anchorFor({ key });\n\n // `in`, not a truthiness check: a holder whose only field is still `undefined` is a legitimate\n // resolved value, and re-creating it would hand every caller a fresh slot.\n if (anchor in globalThis) {\n const existing: unknown = Reflect.get(globalThis, anchor);\n\n // The slot is filled by `create()` below, under this same `key`, so its value is the caller's `T`; no type reaches the realm.\n return existing as T;\n }\n\n const created = create();\n Reflect.set(globalThis, anchor, created);\n\n return created;\n }\n\n private static anchorFor(opts: { key: string }): symbol {\n const { key } = opts;\n\n const cached = this.anchors.get(key);\n\n if (cached) {\n return cached;\n }\n\n const anchor = Symbol.for(`${this.ANCHOR_PREFIX}${key}`);\n this.anchors.set(key, anchor);\n\n return anchor;\n }\n}\n"]}
|
package/dist/esm/metadata.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `src/__tests__/bundle/browser-weight.test.ts`.
|
|
8
8
|
*/
|
|
9
9
|
export { component, configuration, injectable, InjectableUtility, provide, service, } from './base/metadata/injectable.js';
|
|
10
|
-
export { datasource, model, repository } from './base/metadata/persistents.js';
|
|
10
|
+
export { datasource, model, repository } from './base/metadata/persistents/index.js';
|
|
11
11
|
export { inject } from './base/metadata/injectors.js';
|
|
12
12
|
export { ArtifactBindingKeys } from './base/metadata/artifact-keys.js';
|
|
13
13
|
export { ArtifactGroup } from './base/applications/artifact-group.js';
|
package/dist/esm/metadata.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `src/__tests__/bundle/browser-weight.test.ts`.
|
|
8
8
|
*/
|
|
9
9
|
export { component, configuration, injectable, InjectableUtility, provide, service, } from './base/metadata/injectable.js';
|
|
10
|
-
export { datasource, model, repository } from './base/metadata/persistents.js';
|
|
10
|
+
export { datasource, model, repository } from './base/metadata/persistents/index.js';
|
|
11
11
|
export { inject } from './base/metadata/injectors.js';
|
|
12
12
|
export { ArtifactBindingKeys } from './base/metadata/artifact-keys.js';
|
|
13
13
|
// A group of a package's classes, borrowed by an application - a browser kit defines its groups from here, not from the root barrel.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema
|
|
2
2
|
// builders that used to live here are under `base/controllers/common/`, with the REST surface.
|
|
3
3
|
export * from './not-supported.utility.js';
|
|
4
|
+
export * from './toggle.utility.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,cAAc,yBAAyB,CAAC","sourcesContent":["// Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema\n// builders that used to live here are under `base/controllers/common/`, with the REST surface.\nexport * from './not-supported.utility';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utilities/index.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,+FAA+F;AAC/F,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC","sourcesContent":["// Zod-free by design: this barrel must stay reachable from a browser bundle. The OpenAPI schema\n// builders that used to live here are under `base/controllers/common/`, with the REST surface.\nexport * from './not-supported.utility';\nexport * from './toggle.utility';\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A feature that is on or off. `{ use: false }` is the whole off state; `{ use: true, ... }` carries
|
|
3
|
+
* the options. One shape for every switch, so an option is never read from a feature that is off.
|
|
4
|
+
* Shared by components and controllers.
|
|
5
|
+
*/
|
|
6
|
+
export type TToggle<Options extends object = Record<never, never>> = {
|
|
7
|
+
use: false;
|
|
8
|
+
} | ({
|
|
9
|
+
use: true;
|
|
10
|
+
} & Options);
|
|
11
|
+
/** Reads the `{ use }` switches a component or controller option is written with. */
|
|
12
|
+
export declare class ToggleUtility {
|
|
13
|
+
/** The only place a toggle's `use` is read. Narrowing here is what lets every caller reach the options without a cast. */
|
|
14
|
+
static isUsed<Options extends object>(toggle: TToggle<Options> | undefined): toggle is Extract<TToggle<Options>, {
|
|
15
|
+
use: true;
|
|
16
|
+
}>;
|
|
17
|
+
/** The options of a toggle that is on, without `use`; `undefined` when it is off or absent. */
|
|
18
|
+
static pick<Options extends object>(toggle: TToggle<Options> | undefined): Omit<Extract<TToggle<Options>, {
|
|
19
|
+
use: true;
|
|
20
|
+
}>, 'use'> | undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=toggle.utility.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** Reads the `{ use }` switches a component or controller option is written with. */
|
|
2
|
+
export class ToggleUtility {
|
|
3
|
+
/** The only place a toggle's `use` is read. Narrowing here is what lets every caller reach the options without a cast. */
|
|
4
|
+
static isUsed(toggle) {
|
|
5
|
+
return toggle !== undefined && toggle.use;
|
|
6
|
+
}
|
|
7
|
+
/** The options of a toggle that is on, without `use`; `undefined` when it is off or absent. */
|
|
8
|
+
static pick(toggle) {
|
|
9
|
+
if (!ToggleUtility.isUsed(toggle)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const { use: _use, ...options } = toggle;
|
|
13
|
+
return options;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=toggle.utility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.utility.js","sourceRoot":"","sources":["../../../src/utilities/toggle.utility.ts"],"names":[],"mappings":"AASA,qFAAqF;AACrF,MAAM,OAAO,aAAa;IACxB,0HAA0H;IAC1H,MAAM,CAAC,MAAM,CACX,MAAoC;QAEpC,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,GAAG,CAAC;IAC5C,CAAC;IAED,+FAA+F;IAC/F,MAAM,CAAC,IAAI,CACT,MAAoC;QAEpC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,CAAC;QAEzC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["/**\n * A feature that is on or off. `{ use: false }` is the whole off state; `{ use: true, ... }` carries\n * the options. One shape for every switch, so an option is never read from a feature that is off.\n * Shared by components and controllers.\n */\nexport type TToggle<Options extends object = Record<never, never>> =\n | { use: false }\n | ({ use: true } & Options);\n\n/** Reads the `{ use }` switches a component or controller option is written with. */\nexport class ToggleUtility {\n /** The only place a toggle's `use` is read. Narrowing here is what lets every caller reach the options without a cast. */\n static isUsed<Options extends object>(\n toggle: TToggle<Options> | undefined,\n ): toggle is Extract<TToggle<Options>, { use: true }> {\n return toggle !== undefined && toggle.use;\n }\n\n /** The options of a toggle that is on, without `use`; `undefined` when it is off or absent. */\n static pick<Options extends object>(\n toggle: TToggle<Options> | undefined,\n ): Omit<Extract<TToggle<Options>, { use: true }>, 'use'> | undefined {\n if (!ToggleUtility.isUsed(toggle)) {\n return undefined;\n }\n\n const { use: _use, ...options } = toggle;\n\n return options;\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ignis-kernel",
|
|
3
|
-
"version": "0.4.8-
|
|
3
|
+
"version": "0.4.8-16",
|
|
4
4
|
"description": "Browser-pure kernel of the IGNIS framework: dependency injection, lifecycle, REST controllers, repository and datasource abstractions, and the authentication and authorization seams. No node builtin and no server-only peer, so the same kernel serves a Bun server and a browser Worker.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"authentication",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"force-update": "sh ../../scripts/build/force-update.sh"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@venizia/ignis-filter": "0.4.7-
|
|
77
|
-
"@venizia/ignis-helpers": "0.4.8-
|
|
78
|
-
"@venizia/ignis-inversion": "0.4.7-
|
|
76
|
+
"@venizia/ignis-filter": "0.4.7-6",
|
|
77
|
+
"@venizia/ignis-helpers": "0.4.8-14",
|
|
78
|
+
"@venizia/ignis-inversion": "0.4.7-5",
|
|
79
79
|
"reflect-metadata": "^0.2.2"
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
82
|
"@types/bun": "^1.4.3",
|
|
83
|
-
"@venizia/dev-configs": "0.4.8-
|
|
83
|
+
"@venizia/dev-configs": "0.4.8-10",
|
|
84
84
|
"casbin": "^5.51.1",
|
|
85
85
|
"eslint": "^10.13.0",
|
|
86
86
|
"oxlint": "1.89.0",
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import type { IDataSourceMetadata, IModelMetadata, TRepositoryMetadata } from '../../helpers/inversion/index.js';
|
|
3
|
-
import type { IDataSource } from '../datasources/index.js';
|
|
4
|
-
import type { AbstractEntity } from '../models/index.js';
|
|
5
|
-
/**
|
|
6
|
-
* Registers a model class with its static schema and relations.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* import { model } from '@venizia/ignis';
|
|
11
|
-
* import { ModelFactory } from '@venizia/ignis-connectors/postgres';
|
|
12
|
-
* import { pgTable, serial, text } from 'drizzle-orm/pg-core';
|
|
13
|
-
*
|
|
14
|
-
* const noteTable = pgTable('Note', { id: serial('id').primaryKey(), body: text('body') });
|
|
15
|
-
*
|
|
16
|
-
* export @model({ settings: { query: { limit: { default: 20 } } } })
|
|
17
|
-
* class Note extends ModelFactory.defineEntity({ table: noteTable }) {}
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare const model: (input?: IModelMetadata) => ClassDecorator;
|
|
21
|
-
/**
|
|
22
|
-
* Registers a datasource with driver and auto-discovery settings.
|
|
23
|
-
*
|
|
24
|
-
* @example
|
|
25
|
-
* ```typescript
|
|
26
|
-
* import { datasource } from '@venizia/ignis';
|
|
27
|
-
* import { BasePostgresDataSource } from '@venizia/ignis-connectors/postgres';
|
|
28
|
-
* import { NodePostgresDriver } from '@venizia/ignis-connectors/postgres/node-postgres';
|
|
29
|
-
* import { Pool } from 'pg';
|
|
30
|
-
*
|
|
31
|
-
* export @datasource({ driver: NodePostgresDriver })
|
|
32
|
-
* class AppDataSource extends BasePostgresDataSource<{ connectionString: string }> {
|
|
33
|
-
* constructor() { super({ name: AppDataSource.name, config: { connectionString: 'postgres://localhost/app' } }); }
|
|
34
|
-
* override configure(): void { this.client = new Pool(this.settings); }
|
|
35
|
-
* override getConnectionString(): string { return this.settings.connectionString; }
|
|
36
|
-
* }
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
export declare const datasource: (metadata?: IDataSourceMetadata) => ClassDecorator;
|
|
40
|
-
/**
|
|
41
|
-
* Class decorator that registers a repository and binds it to a model (or, for a remote repository, only a datasource). Called without arguments on a subclass it reuses the type, model and datasource of its nearest decorated parent; registration options are not inherited.
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```typescript
|
|
45
|
-
* import { repository } from '@venizia/ignis';
|
|
46
|
-
* import { DefaultCRUDRepository } from '@venizia/ignis-connectors/postgres';
|
|
47
|
-
* import { AppDataSource } from './app.datasource';
|
|
48
|
-
* import { Note, noteTable } from './note.model';
|
|
49
|
-
*
|
|
50
|
-
* export @repository({ model: Note, dataSource: AppDataSource })
|
|
51
|
-
* class NoteRepository extends DefaultCRUDRepository<typeof noteTable> {}
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare const repository: <Model extends AbstractEntity = AbstractEntity, DataSource extends IDataSource = IDataSource>(metadata?: TRepositoryMetadata<Model, DataSource>) => ClassDecorator;
|
|
55
|
-
//# sourceMappingURL=persistents.d.ts.map
|