@cheetah.js/orm 0.1.18 → 0.1.19
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/bun/index.js +91 -91
- package/dist/bun/index.js.map +10 -10
- package/dist/domain/base-entity.js +1 -1
- package/dist/domain/base-entity.js.map +1 -1
- package/package.json +1 -1
package/dist/bun/index.js
CHANGED
|
@@ -218325,7 +218325,7 @@ var PROPERTIES_METADATA = "cheetah:properties:metadata";
|
|
|
218325
218325
|
var PROPERTIES_RELATIONS = "cheetah:properties:relations";
|
|
218326
218326
|
var EVENTS_METADATA = "cheetah:events:metadata";
|
|
218327
218327
|
|
|
218328
|
-
//
|
|
218328
|
+
// /export/htdocs/p/framework/packages/core/dist/domain/provider-type.js
|
|
218329
218329
|
var ProviderType;
|
|
218330
218330
|
(function(ProviderType2) {
|
|
218331
218331
|
ProviderType2["ROUTES"] = "routes";
|
|
@@ -218334,7 +218334,7 @@ var ProviderType;
|
|
|
218334
218334
|
ProviderType2["CONTROLLER"] = "controller";
|
|
218335
218335
|
})(ProviderType || (ProviderType = {}));
|
|
218336
218336
|
|
|
218337
|
-
//
|
|
218337
|
+
// /export/htdocs/p/framework/packages/core/dist/domain/provider-scope.js
|
|
218338
218338
|
var ProviderScope;
|
|
218339
218339
|
(function(ProviderScope2) {
|
|
218340
218340
|
ProviderScope2["REQUEST"] = "request";
|
|
@@ -218342,33 +218342,16 @@ var ProviderScope;
|
|
|
218342
218342
|
ProviderScope2["SINGLETON"] = "singleton";
|
|
218343
218343
|
})(ProviderScope || (ProviderScope = {}));
|
|
218344
218344
|
|
|
218345
|
-
// /export/htdocs/p/framework/packages/core/dist/domain/provider-type.js
|
|
218346
|
-
var ProviderType2;
|
|
218347
|
-
(function(ProviderType3) {
|
|
218348
|
-
ProviderType3["ROUTES"] = "routes";
|
|
218349
|
-
ProviderType3["SERVICE"] = "service";
|
|
218350
|
-
ProviderType3["PROVIDER"] = "provider";
|
|
218351
|
-
ProviderType3["CONTROLLER"] = "controller";
|
|
218352
|
-
})(ProviderType2 || (ProviderType2 = {}));
|
|
218353
|
-
|
|
218354
|
-
// /export/htdocs/p/framework/packages/core/dist/domain/provider-scope.js
|
|
218355
|
-
var ProviderScope2;
|
|
218356
|
-
(function(ProviderScope3) {
|
|
218357
|
-
ProviderScope3["REQUEST"] = "request";
|
|
218358
|
-
ProviderScope3["INSTANCE"] = "instance";
|
|
218359
|
-
ProviderScope3["SINGLETON"] = "singleton";
|
|
218360
|
-
})(ProviderScope2 || (ProviderScope2 = {}));
|
|
218361
|
-
|
|
218362
218345
|
// /export/htdocs/p/framework/packages/core/dist/domain/provider.js
|
|
218363
218346
|
class Provider {
|
|
218364
|
-
type =
|
|
218347
|
+
type = ProviderType.PROVIDER;
|
|
218365
218348
|
deps = [];
|
|
218366
218349
|
instance;
|
|
218367
218350
|
_provide;
|
|
218368
218351
|
_useClass;
|
|
218369
218352
|
hooks;
|
|
218370
218353
|
path;
|
|
218371
|
-
scope =
|
|
218354
|
+
scope = ProviderScope.SINGLETON;
|
|
218372
218355
|
children = [];
|
|
218373
218356
|
parent;
|
|
218374
218357
|
constructor(token, options = {}) {
|
|
@@ -218480,7 +218463,7 @@ class ProviderControl extends Map {
|
|
|
218480
218463
|
}
|
|
218481
218464
|
}
|
|
218482
218465
|
createIfNotExists(key, options) {
|
|
218483
|
-
const type = options.type ||
|
|
218466
|
+
const type = options.type || ProviderType.PROVIDER;
|
|
218484
218467
|
if (!this.has(key)) {
|
|
218485
218468
|
const { model = Provider } = this.settings.get(type) || {};
|
|
218486
218469
|
const item = new model(key, options);
|
|
@@ -218497,9 +218480,9 @@ function registerProvider(provider3) {
|
|
|
218497
218480
|
}
|
|
218498
218481
|
return GlobalProvider.merge(provider3.provide, provider3);
|
|
218499
218482
|
}
|
|
218500
|
-
GlobalProvider.createRegistry(
|
|
218501
|
-
GlobalProvider.createRegistry(
|
|
218502
|
-
var registerController = GlobalProvider.createRegisterFn(
|
|
218483
|
+
GlobalProvider.createRegistry(ProviderType.CONTROLLER, Provider);
|
|
218484
|
+
GlobalProvider.createRegistry(ProviderType.ROUTES, Provider);
|
|
218485
|
+
var registerController = GlobalProvider.createRegisterFn(ProviderType.CONTROLLER);
|
|
218503
218486
|
// /export/htdocs/p/framework/packages/core/node_modules/globby/index.js
|
|
218504
218487
|
var import_merge2 = __toESM(require_merge2(), 1);
|
|
218505
218488
|
var import_fast_glob2 = __toESM(require_out4(), 1);
|
|
@@ -221458,7 +221441,7 @@ var InjectorService = InjectorService_1 = class InjectorService2 {
|
|
|
221458
221441
|
resolveControllers() {
|
|
221459
221442
|
if (!this.settings)
|
|
221460
221443
|
return {};
|
|
221461
|
-
const controllers = GlobalProvider.getByType(
|
|
221444
|
+
const controllers = GlobalProvider.getByType(ProviderType.CONTROLLER).filter((controller2) => !controller2.isChild());
|
|
221462
221445
|
let hydrateRoute = new Map;
|
|
221463
221446
|
for (const controller2 of controllers) {
|
|
221464
221447
|
let routes = Metadata.get(CONTROLLER_ROUTES, controller2.token);
|
|
@@ -221582,16 +221565,16 @@ var InjectorService = InjectorService_1 = class InjectorService2 {
|
|
|
221582
221565
|
const construct = (deps2) => new provider3.useClass(...deps2);
|
|
221583
221566
|
let instance;
|
|
221584
221567
|
if (isRequestScope(provider3, deps, this)) {
|
|
221585
|
-
scope =
|
|
221568
|
+
scope = ProviderScope.REQUEST;
|
|
221586
221569
|
}
|
|
221587
221570
|
const services = deps.filter((t) => !isPrimitiveType(t)).map((token) => this.invoke(getClassOrSymbol(token), locals));
|
|
221588
221571
|
instance = construct(services);
|
|
221589
221572
|
switch (scope) {
|
|
221590
|
-
case
|
|
221573
|
+
case ProviderScope.SINGLETON:
|
|
221591
221574
|
provider3.instance = instance;
|
|
221592
221575
|
this.container.addProvider(provider3.token, provider3);
|
|
221593
221576
|
break;
|
|
221594
|
-
case
|
|
221577
|
+
case ProviderScope.REQUEST:
|
|
221595
221578
|
const clone = provider3.clone();
|
|
221596
221579
|
clone.instance = instance;
|
|
221597
221580
|
locals.set(clone.token, clone);
|
|
@@ -221643,7 +221626,7 @@ var InjectorService = InjectorService_1 = class InjectorService2 {
|
|
|
221643
221626
|
return methodInfo;
|
|
221644
221627
|
}
|
|
221645
221628
|
scopeOf(provider3) {
|
|
221646
|
-
return provider3.scope ||
|
|
221629
|
+
return provider3.scope || ProviderScope.SINGLETON;
|
|
221647
221630
|
}
|
|
221648
221631
|
getConstructorDependencies(target, propertyKey) {
|
|
221649
221632
|
return Metadata.getOwn("override:ctor:design:paramtypes", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)];
|
|
@@ -221774,7 +221757,7 @@ var Context = Context_1 = class Context2 {
|
|
|
221774
221757
|
}
|
|
221775
221758
|
};
|
|
221776
221759
|
Context = Context_1 = __decorate2([
|
|
221777
|
-
Injectable({ scope:
|
|
221760
|
+
Injectable({ scope: ProviderScope.REQUEST }),
|
|
221778
221761
|
__metadata("design:paramtypes", [])
|
|
221779
221762
|
], Context);
|
|
221780
221763
|
// /export/htdocs/p/framework/packages/core/dist/domain/LocalsContainer.js
|
|
@@ -222155,7 +222138,7 @@ function isRequestScope(provider4, deps, injector) {
|
|
|
222155
222138
|
const depProvider = injector.get(dep);
|
|
222156
222139
|
if (!depProvider)
|
|
222157
222140
|
return false;
|
|
222158
|
-
return depProvider.scope ===
|
|
222141
|
+
return depProvider.scope === ProviderScope.REQUEST;
|
|
222159
222142
|
});
|
|
222160
222143
|
}
|
|
222161
222144
|
// /export/htdocs/p/framework/packages/core/dist/utils/nameOf.js
|
|
@@ -222324,16 +222307,73 @@ LoggerService = __decorate4([
|
|
|
222324
222307
|
Service(),
|
|
222325
222308
|
__metadata3("design:paramtypes", [InjectorService])
|
|
222326
222309
|
], LoggerService);
|
|
222310
|
+
// ../../node_modules/balanced-match/
|
|
222311
|
+
function Entity(options) {
|
|
222312
|
+
return (target) => {
|
|
222313
|
+
const entities = Metadata.get(ENTITIES, Reflect) || [];
|
|
222314
|
+
entities.push({ target, options });
|
|
222315
|
+
Metadata.set(ENTITIES, entities, Reflect);
|
|
222316
|
+
};
|
|
222317
|
+
}
|
|
222318
|
+
// ../../node_m
|
|
222319
|
+
function getDefaultLength(type) {
|
|
222320
|
+
return null;
|
|
222321
|
+
}
|
|
222322
|
+
|
|
222323
|
+
// ../../node_modules/balanced-match/in
|
|
222324
|
+
function Property(options) {
|
|
222325
|
+
return (target, propertyKey) => {
|
|
222326
|
+
const properties = Metadata.get(PROPERTIES, target.constructor) || [];
|
|
222327
|
+
const type = Metadata.getType(target, propertyKey);
|
|
222328
|
+
const length = options && options.length || getDefaultLength(type.name);
|
|
222329
|
+
options = { length, ...options };
|
|
222330
|
+
properties.push({ propertyKey, options });
|
|
222331
|
+
Metadata.set(PROPERTIES, properties, target.constructor);
|
|
222332
|
+
if (options.isPrimary) {
|
|
222333
|
+
const indexes = Metadata.get("indexes", target.constructor) || [];
|
|
222334
|
+
indexes.push({ name: `[TABLE]_pkey`, properties: [propertyKey] });
|
|
222335
|
+
Metadata.set("indexes", indexes, target.constructor);
|
|
222336
|
+
}
|
|
222337
|
+
properties.forEach((property) => {
|
|
222338
|
+
const types = Metadata.get(PROPERTIES_METADATA, target.constructor) || {};
|
|
222339
|
+
const type2 = Metadata.getType(target, property.propertyKey);
|
|
222340
|
+
types[property.propertyKey] = { type: type2, options: property.options };
|
|
222341
|
+
Metadata.set(PROPERTIES_METADATA, types, target.constructor);
|
|
222342
|
+
});
|
|
222343
|
+
};
|
|
222344
|
+
}
|
|
222345
|
+
// ../../node_modules/balanced-match/index
|
|
222346
|
+
function PrimaryKey(options) {
|
|
222347
|
+
const isPrimary = true;
|
|
222348
|
+
return Property({ ...options, isPrimary, unique: true });
|
|
222349
|
+
}
|
|
222350
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch
|
|
222351
|
+
var ProviderType2;
|
|
222352
|
+
(function(ProviderType3) {
|
|
222353
|
+
ProviderType3["ROUTES"] = "routes";
|
|
222354
|
+
ProviderType3["SERVICE"] = "service";
|
|
222355
|
+
ProviderType3["PROVIDER"] = "provider";
|
|
222356
|
+
ProviderType3["CONTROLLER"] = "controller";
|
|
222357
|
+
})(ProviderType2 || (ProviderType2 = {}));
|
|
222358
|
+
|
|
222359
|
+
// ../../node_modules/balanced-match/index.jsodules/minimatch/
|
|
222360
|
+
var ProviderScope2;
|
|
222361
|
+
(function(ProviderScope3) {
|
|
222362
|
+
ProviderScope3["REQUEST"] = "request";
|
|
222363
|
+
ProviderScope3["INSTANCE"] = "instance";
|
|
222364
|
+
ProviderScope3["SINGLETON"] = "singleton";
|
|
222365
|
+
})(ProviderScope2 || (ProviderScope2 = {}));
|
|
222366
|
+
|
|
222327
222367
|
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
222328
222368
|
class Provider2 {
|
|
222329
|
-
type =
|
|
222369
|
+
type = ProviderType2.PROVIDER;
|
|
222330
222370
|
deps = [];
|
|
222331
222371
|
instance;
|
|
222332
222372
|
_provide;
|
|
222333
222373
|
_useClass;
|
|
222334
222374
|
hooks;
|
|
222335
222375
|
path;
|
|
222336
|
-
scope =
|
|
222376
|
+
scope = ProviderScope2.SINGLETON;
|
|
222337
222377
|
children = [];
|
|
222338
222378
|
parent;
|
|
222339
222379
|
constructor(token, options = {}) {
|
|
@@ -222445,7 +222485,7 @@ class ProviderControl5 extends Map {
|
|
|
222445
222485
|
}
|
|
222446
222486
|
}
|
|
222447
222487
|
createIfNotExists(key, options) {
|
|
222448
|
-
const type = options.type ||
|
|
222488
|
+
const type = options.type || ProviderType2.PROVIDER;
|
|
222449
222489
|
if (!this.has(key)) {
|
|
222450
222490
|
const { model = Provider2 } = this.settings.get(type) || {};
|
|
222451
222491
|
const item = new model(key, options);
|
|
@@ -222456,9 +222496,9 @@ class ProviderControl5 extends Map {
|
|
|
222456
222496
|
}
|
|
222457
222497
|
var GlobalProvider2 = new ProviderControl5;
|
|
222458
222498
|
// ../../node_modules/balanced-match/index.jsodules/minimatch/dist/cjs/unesc
|
|
222459
|
-
GlobalProvider2.createRegistry(
|
|
222460
|
-
GlobalProvider2.createRegistry(
|
|
222461
|
-
var registerController2 = GlobalProvider2.createRegisterFn(
|
|
222499
|
+
GlobalProvider2.createRegistry(ProviderType2.CONTROLLER, Provider2);
|
|
222500
|
+
GlobalProvider2.createRegistry(ProviderType2.ROUTES, Provider2);
|
|
222501
|
+
var registerController2 = GlobalProvider2.createRegisterFn(ProviderType2.CONTROLLER);
|
|
222462
222502
|
// /export/htdocs/p/framework/node_modules/globby/index.js
|
|
222463
222503
|
var import_merge22 = __toESM(require_merge2(), 1);
|
|
222464
222504
|
var import_fast_glob4 = __toESM(require_out4(), 1);
|
|
@@ -223087,7 +223127,7 @@ var InjectorService5 = InjectorService_12 = class InjectorService6 {
|
|
|
223087
223127
|
resolveControllers() {
|
|
223088
223128
|
if (!this.settings)
|
|
223089
223129
|
return {};
|
|
223090
|
-
const controllers = GlobalProvider.getByType(
|
|
223130
|
+
const controllers = GlobalProvider.getByType(ProviderType.CONTROLLER).filter((controller3) => !controller3.isChild());
|
|
223091
223131
|
let hydrateRoute = new Map;
|
|
223092
223132
|
for (const controller3 of controllers) {
|
|
223093
223133
|
let routes = Metadata.get(CONTROLLER_ROUTES, controller3.token);
|
|
@@ -223211,16 +223251,16 @@ var InjectorService5 = InjectorService_12 = class InjectorService6 {
|
|
|
223211
223251
|
const construct = (deps2) => new provider6.useClass(...deps2);
|
|
223212
223252
|
let instance;
|
|
223213
223253
|
if (isRequestScope(provider6, deps, this)) {
|
|
223214
|
-
scope =
|
|
223254
|
+
scope = ProviderScope.REQUEST;
|
|
223215
223255
|
}
|
|
223216
223256
|
const services = deps.filter((t) => !isPrimitiveType(t)).map((token) => this.invoke(getClassOrSymbol(token), locals));
|
|
223217
223257
|
instance = construct(services);
|
|
223218
223258
|
switch (scope) {
|
|
223219
|
-
case
|
|
223259
|
+
case ProviderScope.SINGLETON:
|
|
223220
223260
|
provider6.instance = instance;
|
|
223221
223261
|
this.container.addProvider(provider6.token, provider6);
|
|
223222
223262
|
break;
|
|
223223
|
-
case
|
|
223263
|
+
case ProviderScope.REQUEST:
|
|
223224
223264
|
const clone = provider6.clone();
|
|
223225
223265
|
clone.instance = instance;
|
|
223226
223266
|
locals.set(clone.token, clone);
|
|
@@ -223272,7 +223312,7 @@ var InjectorService5 = InjectorService_12 = class InjectorService6 {
|
|
|
223272
223312
|
return methodInfo;
|
|
223273
223313
|
}
|
|
223274
223314
|
scopeOf(provider6) {
|
|
223275
|
-
return provider6.scope ||
|
|
223315
|
+
return provider6.scope || ProviderScope.SINGLETON;
|
|
223276
223316
|
}
|
|
223277
223317
|
getConstructorDependencies(target, propertyKey) {
|
|
223278
223318
|
return Metadata.getOwn("override:ctor:design:paramtypes", target, propertyKey) || [...Metadata.getParamTypes(target, propertyKey)];
|
|
@@ -223398,7 +223438,7 @@ var Context4 = Context_12 = class Context5 {
|
|
|
223398
223438
|
}
|
|
223399
223439
|
};
|
|
223400
223440
|
Context4 = Context_12 = __decorate6([
|
|
223401
|
-
Injectable({ scope:
|
|
223441
|
+
Injectable({ scope: ProviderScope.REQUEST }),
|
|
223402
223442
|
__metadata4("design:paramtypes", [])
|
|
223403
223443
|
], Context4);
|
|
223404
223444
|
// ../../node_modules/balanced-match/index.jsodules/mini
|
|
@@ -223697,59 +223737,19 @@ LoggerService3 = __decorate8([
|
|
|
223697
223737
|
Service(),
|
|
223698
223738
|
__metadata6("design:paramtypes", [InjectorService])
|
|
223699
223739
|
], LoggerService3);
|
|
223700
|
-
// ../../node_modules/balanced-match/
|
|
223701
|
-
function Entity(options) {
|
|
223702
|
-
return (target) => {
|
|
223703
|
-
const entities = Metadata3.get(ENTITIES, Reflect) || [];
|
|
223704
|
-
entities.push({ target, options });
|
|
223705
|
-
Metadata3.set(ENTITIES, entities, Reflect);
|
|
223706
|
-
};
|
|
223707
|
-
}
|
|
223708
|
-
// ../../node_m
|
|
223709
|
-
function getDefaultLength(type) {
|
|
223710
|
-
return null;
|
|
223711
|
-
}
|
|
223712
|
-
|
|
223713
|
-
// ../../node_modules/balanced-match/in
|
|
223714
|
-
function Property(options) {
|
|
223715
|
-
return (target, propertyKey) => {
|
|
223716
|
-
const properties = Metadata.get(PROPERTIES, target.constructor) || [];
|
|
223717
|
-
const type = Metadata.getType(target, propertyKey);
|
|
223718
|
-
const length = options && options.length || getDefaultLength(type.name);
|
|
223719
|
-
options = { length, ...options };
|
|
223720
|
-
properties.push({ propertyKey, options });
|
|
223721
|
-
Metadata.set(PROPERTIES, properties, target.constructor);
|
|
223722
|
-
if (options.isPrimary) {
|
|
223723
|
-
const indexes = Metadata.get("indexes", target.constructor) || [];
|
|
223724
|
-
indexes.push({ name: `[TABLE]_pkey`, properties: [propertyKey] });
|
|
223725
|
-
Metadata.set("indexes", indexes, target.constructor);
|
|
223726
|
-
}
|
|
223727
|
-
properties.forEach((property) => {
|
|
223728
|
-
const types = Metadata.get(PROPERTIES_METADATA, target.constructor) || {};
|
|
223729
|
-
const type2 = Metadata.getType(target, property.propertyKey);
|
|
223730
|
-
types[property.propertyKey] = { type: type2, options: property.options };
|
|
223731
|
-
Metadata.set(PROPERTIES_METADATA, types, target.constructor);
|
|
223732
|
-
});
|
|
223733
|
-
};
|
|
223734
|
-
}
|
|
223735
|
-
// ../../node_modules/balanced-match/index
|
|
223736
|
-
function PrimaryKey(options) {
|
|
223737
|
-
const isPrimary = true;
|
|
223738
|
-
return Property({ ...options, isPrimary, unique: true });
|
|
223739
|
-
}
|
|
223740
223740
|
// ../../node_modules/balanced-match/in
|
|
223741
223741
|
function OneToMany(entity, fkKey) {
|
|
223742
223742
|
return (target, propertyKey) => {
|
|
223743
|
-
const existing =
|
|
223744
|
-
existing.push({ relation: "one-to-many", propertyKey, isRelation: true, entity, fkKey, type:
|
|
223745
|
-
|
|
223743
|
+
const existing = Metadata3.get(PROPERTIES_RELATIONS, target.constructor) || [];
|
|
223744
|
+
existing.push({ relation: "one-to-many", propertyKey, isRelation: true, entity, fkKey, type: Metadata3.getType(target, propertyKey), originalEntity: target.constructor });
|
|
223745
|
+
Metadata3.set(PROPERTIES_RELATIONS, existing, target.constructor);
|
|
223746
223746
|
};
|
|
223747
223747
|
}
|
|
223748
223748
|
function ManyToOne(entity) {
|
|
223749
223749
|
return (target, propertyKey) => {
|
|
223750
|
-
const existing =
|
|
223751
|
-
existing.push({ relation: "many-to-one", propertyKey, isRelation: true, entity, type:
|
|
223752
|
-
|
|
223750
|
+
const existing = Metadata3.get(PROPERTIES_RELATIONS, target.constructor) || [];
|
|
223751
|
+
existing.push({ relation: "many-to-one", propertyKey, isRelation: true, entity, type: Metadata3.getType(target, propertyKey), originalEntity: target.constructor });
|
|
223752
|
+
Metadata3.set(PROPERTIES_RELATIONS, existing, target.constructor);
|
|
223753
223753
|
};
|
|
223754
223754
|
}
|
|
223755
223755
|
// ../../node_modules/balanced-match
|
|
@@ -225251,4 +225251,4 @@ export {
|
|
|
225251
225251
|
AfterCreate
|
|
225252
225252
|
};
|
|
225253
225253
|
|
|
225254
|
-
//# debugId=
|
|
225254
|
+
//# debugId=77C58A5FA0C5566C64756e2164756e21
|