sonamu 0.4.6 → 0.4.8
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/{base-model-CWRKUX49.d.ts → base-model-C24du9JT.d.ts} +1 -1
- package/dist/{base-model-BzMJ2E_I.d.mts → base-model-IZdmwmB5.d.mts} +1 -1
- package/dist/bin/cli.js +51 -51
- package/dist/bin/cli.mjs +2 -2
- package/dist/{chunk-WJGRXAXE.js → chunk-FXWN5PEO.js} +84 -65
- package/dist/chunk-FXWN5PEO.js.map +1 -0
- package/dist/{chunk-6SP5N5ND.mjs → chunk-GQVZQZ5J.mjs} +2 -2
- package/dist/{chunk-HVVCQLAU.mjs → chunk-IEP5SWTY.mjs} +2 -2
- package/dist/{chunk-N6N3LENC.js → chunk-IEXW7P6A.js} +4 -4
- package/dist/{chunk-4K2F3SOM.mjs → chunk-OBPWSOYN.mjs} +2 -2
- package/dist/{chunk-ZFLQLW37.mjs → chunk-VBBKB2LD.mjs} +46 -27
- package/dist/chunk-VBBKB2LD.mjs.map +1 -0
- package/dist/{chunk-UAG3SKFM.js → chunk-WZJODZL6.js} +7 -7
- package/dist/{chunk-EUP6N7EK.js → chunk-ZNWZQLRN.js} +100 -100
- package/dist/database/drivers/knex/base-model.d.mts +2 -2
- package/dist/database/drivers/knex/base-model.d.ts +2 -2
- package/dist/database/drivers/knex/base-model.js +8 -8
- package/dist/database/drivers/knex/base-model.mjs +3 -3
- package/dist/database/drivers/kysely/base-model.d.mts +2 -2
- package/dist/database/drivers/kysely/base-model.d.ts +2 -2
- package/dist/database/drivers/kysely/base-model.js +9 -9
- package/dist/database/drivers/kysely/base-model.mjs +3 -3
- package/dist/index.d.mts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +11 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{model-CAH_4oQh.d.ts → model-Dbbfpk2X.d.mts} +1 -1
- package/dist/{model-CAH_4oQh.d.mts → model-Dbbfpk2X.d.ts} +1 -1
- package/package.json +1 -1
- package/src/api/sonamu.ts +43 -25
- package/src/database/drivers/knex/db.ts +10 -5
- package/src/database/drivers/kysely/db.ts +1 -1
- package/src/database/types.ts +2 -1
- package/src/index.ts +2 -0
- package/dist/chunk-WJGRXAXE.js.map +0 -1
- package/dist/chunk-ZFLQLW37.mjs.map +0 -1
- /package/dist/{chunk-6SP5N5ND.mjs.map → chunk-GQVZQZ5J.mjs.map} +0 -0
- /package/dist/{chunk-HVVCQLAU.mjs.map → chunk-IEP5SWTY.mjs.map} +0 -0
- /package/dist/{chunk-N6N3LENC.js.map → chunk-IEXW7P6A.js.map} +0 -0
- /package/dist/{chunk-4K2F3SOM.mjs.map → chunk-OBPWSOYN.mjs.map} +0 -0
- /package/dist/{chunk-UAG3SKFM.js.map → chunk-WZJODZL6.js.map} +0 -0
- /package/dist/{chunk-EUP6N7EK.js.map → chunk-ZNWZQLRN.js.map} +0 -0
|
@@ -3094,18 +3094,23 @@ var DBKnexClass = (_class2 = class extends DBClass {
|
|
|
3094
3094
|
},
|
|
3095
3095
|
config.defaultOptions
|
|
3096
3096
|
);
|
|
3097
|
-
const test = _lodash2.default.merge(
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3097
|
+
const test = _lodash2.default.merge(
|
|
3098
|
+
{},
|
|
3099
|
+
defaultKnexConfig,
|
|
3100
|
+
{
|
|
3101
|
+
connection: {
|
|
3102
|
+
database: `${config.database}_test`
|
|
3103
|
+
}
|
|
3104
|
+
},
|
|
3105
|
+
_optionalChain([config, 'access', _110 => _110.environments, 'optionalAccess', _111 => _111.test])
|
|
3106
|
+
);
|
|
3102
3107
|
const fixture_local = _lodash2.default.merge({}, defaultKnexConfig, {
|
|
3103
3108
|
connection: {
|
|
3104
3109
|
database: `${config.database}_fixture`
|
|
3105
3110
|
}
|
|
3106
3111
|
});
|
|
3107
|
-
const devMasterOptions = _optionalChain([config, 'access',
|
|
3108
|
-
const devSlaveOptions = _optionalChain([config, 'access',
|
|
3112
|
+
const devMasterOptions = _optionalChain([config, 'access', _112 => _112.environments, 'optionalAccess', _113 => _113.development]);
|
|
3113
|
+
const devSlaveOptions = _optionalChain([config, 'access', _114 => _114.environments, 'optionalAccess', _115 => _115.development_slave]);
|
|
3109
3114
|
const development_master = _lodash2.default.merge({}, defaultKnexConfig, devMasterOptions);
|
|
3110
3115
|
const development_slave = _lodash2.default.merge(
|
|
3111
3116
|
{},
|
|
@@ -3118,8 +3123,8 @@ var DBKnexClass = (_class2 = class extends DBClass {
|
|
|
3118
3123
|
database: `${config.database}_fixture`
|
|
3119
3124
|
}
|
|
3120
3125
|
});
|
|
3121
|
-
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3122
|
-
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3126
|
+
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access', _116 => _116.environments, 'optionalAccess', _117 => _117.production]), () => ( {}));
|
|
3127
|
+
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access', _118 => _118.environments, 'optionalAccess', _119 => _119.production_slave]), () => ( {}));
|
|
3123
3128
|
const production_master = _lodash2.default.merge({}, defaultKnexConfig, prodMasterOptions);
|
|
3124
3129
|
const production_slave = _lodash2.default.merge(
|
|
3125
3130
|
{},
|
|
@@ -3860,8 +3865,8 @@ var DBKyselyClass = (_class3 = class extends DBClass {
|
|
|
3860
3865
|
const fixture_local = _lodash2.default.merge({}, defaultKyselyConfig, {
|
|
3861
3866
|
database: `${config.database}_fixture`
|
|
3862
3867
|
});
|
|
3863
|
-
const devMasterOptions = _optionalChain([config, 'access',
|
|
3864
|
-
const devSlaveOptions = _optionalChain([config, 'access',
|
|
3868
|
+
const devMasterOptions = _optionalChain([config, 'access', _120 => _120.environments, 'optionalAccess', _121 => _121.development]);
|
|
3869
|
+
const devSlaveOptions = _optionalChain([config, 'access', _122 => _122.environments, 'optionalAccess', _123 => _123.development_slave]);
|
|
3865
3870
|
const development_master = _lodash2.default.merge(
|
|
3866
3871
|
{},
|
|
3867
3872
|
defaultKyselyConfig,
|
|
@@ -3876,8 +3881,8 @@ var DBKyselyClass = (_class3 = class extends DBClass {
|
|
|
3876
3881
|
const fixture_remote = _lodash2.default.merge({}, defaultKyselyConfig, devMasterOptions, {
|
|
3877
3882
|
database: `${config.database}_fixture`
|
|
3878
3883
|
});
|
|
3879
|
-
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3880
|
-
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3884
|
+
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access', _124 => _124.environments, 'optionalAccess', _125 => _125.production]), () => ( {}));
|
|
3885
|
+
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access', _126 => _126.environments, 'optionalAccess', _127 => _127.production_slave]), () => ( {}));
|
|
3881
3886
|
const production_master = _lodash2.default.merge(
|
|
3882
3887
|
{},
|
|
3883
3888
|
defaultKyselyConfig,
|
|
@@ -3921,7 +3926,7 @@ var dbConfigPath = _path2.default.join(
|
|
|
3921
3926
|
);
|
|
3922
3927
|
var knexfileModule = __require(dbConfigPath);
|
|
3923
3928
|
var DB = (() => {
|
|
3924
|
-
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([knexfileModule, 'access',
|
|
3929
|
+
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([knexfileModule, 'access', _128 => _128.default, 'optionalAccess', _129 => _129.default]), () => ( knexfileModule.default)), () => ( knexfileModule));
|
|
3925
3930
|
if (config.client === "knex") {
|
|
3926
3931
|
return new DBKnexClass();
|
|
3927
3932
|
} else if (config.client === "kysely") {
|
|
@@ -3945,7 +3950,7 @@ var Template__model = class extends Template {
|
|
|
3945
3950
|
render({ entityId }, _columnsNode, listParamsNode) {
|
|
3946
3951
|
const names = EntityManager.getNamesFromId(entityId);
|
|
3947
3952
|
const vlTpl = new Template__view_list();
|
|
3948
|
-
if (_optionalChain([listParamsNode, 'optionalAccess',
|
|
3953
|
+
if (_optionalChain([listParamsNode, 'optionalAccess', _130 => _130.children]) === void 0) {
|
|
3949
3954
|
throw new Error(`listParamsNode\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. ${entityId}`);
|
|
3950
3955
|
}
|
|
3951
3956
|
const def = vlTpl.getDefault(listParamsNode.children);
|
|
@@ -4327,7 +4332,7 @@ var Template__view_form = class extends Template {
|
|
|
4327
4332
|
const propCandidate = entity.props.find(
|
|
4328
4333
|
(prop) => prop.name === col.name
|
|
4329
4334
|
);
|
|
4330
|
-
col.label = _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess',
|
|
4335
|
+
col.label = _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess', _131 => _131.desc]), () => ( col.label));
|
|
4331
4336
|
return col;
|
|
4332
4337
|
});
|
|
4333
4338
|
const defaultValue = this.resolveDefaultValue(columns);
|
|
@@ -5130,8 +5135,8 @@ var Template__kysely_interface = class extends Template {
|
|
|
5130
5135
|
getTargetAndPath() {
|
|
5131
5136
|
const { dir } = Sonamu.config.api;
|
|
5132
5137
|
const { types } = DB.baseConfig;
|
|
5133
|
-
const outDir = _nullishCoalesce(_optionalChain([types, 'optionalAccess',
|
|
5134
|
-
const fileName = _nullishCoalesce(_optionalChain([types, 'optionalAccess',
|
|
5138
|
+
const outDir = _nullishCoalesce(_optionalChain([types, 'optionalAccess', _132 => _132.outDir]), () => ( "src/typings"));
|
|
5139
|
+
const fileName = _nullishCoalesce(_optionalChain([types, 'optionalAccess', _133 => _133.fileName]), () => ( "database.types.ts"));
|
|
5135
5140
|
return {
|
|
5136
5141
|
target: `${dir}/${outDir}`,
|
|
5137
5142
|
path: fileName
|
|
@@ -5353,7 +5358,7 @@ var Syncer = (_class4 = class {
|
|
|
5353
5358
|
if (diffTypes.includes("entity") || diffTypes.includes("types")) {
|
|
5354
5359
|
console.log("// \uC561\uC158: \uC2A4\uD0A4\uB9C8 \uC0DD\uC131");
|
|
5355
5360
|
await this.actionGenerateSchemas();
|
|
5356
|
-
if (_optionalChain([DB, 'access',
|
|
5361
|
+
if (_optionalChain([DB, 'access', _135 => _135.baseConfig, 'optionalAccess', _136 => _136.client]) === "kysely" && _optionalChain([DB, 'access', _137 => _137.baseConfig, 'access', _138 => _138.types, 'optionalAccess', _139 => _139.enabled]) !== false) {
|
|
5357
5362
|
console.log("// \uC561\uC158: kysely \uC778\uD130\uD398\uC774\uC2A4 \uC0DD\uC131");
|
|
5358
5363
|
await this.generateTemplate(
|
|
5359
5364
|
"kysely_interface",
|
|
@@ -5604,7 +5609,7 @@ var Syncer = (_class4 = class {
|
|
|
5604
5609
|
return extendedApis;
|
|
5605
5610
|
}
|
|
5606
5611
|
resolveTypeNode(typeNode) {
|
|
5607
|
-
switch (_optionalChain([typeNode, 'optionalAccess',
|
|
5612
|
+
switch (_optionalChain([typeNode, 'optionalAccess', _140 => _140.kind])) {
|
|
5608
5613
|
case _typescript2.default.SyntaxKind.AnyKeyword:
|
|
5609
5614
|
return "any";
|
|
5610
5615
|
case _typescript2.default.SyntaxKind.UnknownKeyword:
|
|
@@ -5680,7 +5685,7 @@ var Syncer = (_class4 = class {
|
|
|
5680
5685
|
return {
|
|
5681
5686
|
t: "ref",
|
|
5682
5687
|
id: typeNode.typeName.escapedText.toString(),
|
|
5683
|
-
args: _optionalChain([typeNode, 'access',
|
|
5688
|
+
args: _optionalChain([typeNode, 'access', _141 => _141.typeArguments, 'optionalAccess', _142 => _142.map, 'call', _143 => _143(
|
|
5684
5689
|
(typeArg) => this.resolveTypeNode(typeArg)
|
|
5685
5690
|
)])
|
|
5686
5691
|
};
|
|
@@ -5734,7 +5739,7 @@ var Syncer = (_class4 = class {
|
|
|
5734
5739
|
name: name.escapedText ? name.escapedText.toString() : `nonameAt${index}`,
|
|
5735
5740
|
type,
|
|
5736
5741
|
optional: paramDec.optional === true,
|
|
5737
|
-
defaultDef: _optionalChain([paramDec, 'optionalAccess',
|
|
5742
|
+
defaultDef: _optionalChain([paramDec, 'optionalAccess', _144 => _144.defaultDef])
|
|
5738
5743
|
};
|
|
5739
5744
|
if (_typescript2.default.isObjectBindingPattern(name) && _typescript2.default.isTypeReferenceNode(paramDec.type) && _typescript2.default.isIdentifier(paramDec.type.typeName)) {
|
|
5740
5745
|
result.name = _inflection2.default.camelize(paramDec.type.typeName.text, true);
|
|
@@ -6078,7 +6083,7 @@ var Syncer = (_class4 = class {
|
|
|
6078
6083
|
},
|
|
6079
6084
|
{}
|
|
6080
6085
|
);
|
|
6081
|
-
if (_optionalChain([propNode, 'access',
|
|
6086
|
+
if (_optionalChain([propNode, 'access', _145 => _145.prop, 'optionalAccess', _146 => _146.nullable]) === true) {
|
|
6082
6087
|
return _zod.z.object(obj).nullable();
|
|
6083
6088
|
} else {
|
|
6084
6089
|
return _zod.z.object(obj);
|
|
@@ -6471,9 +6476,18 @@ function formatDateConstraint(value) {
|
|
|
6471
6476
|
}
|
|
6472
6477
|
|
|
6473
6478
|
// src/api/sonamu.ts
|
|
6474
|
-
var
|
|
6479
|
+
var _async_hooks = require('async_hooks');
|
|
6480
|
+
var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.call(this);_class5.prototype.__init16.call(this);_class5.prototype.__init17.call(this);_class5.prototype.__init18.call(this);_class5.prototype.__init19.call(this);_class5.prototype.__init20.call(this);_class5.prototype.__init21.call(this);_class5.prototype.__init22.call(this); }
|
|
6475
6481
|
__init15() {this.isInitialized = false}
|
|
6476
|
-
__init16() {this.
|
|
6482
|
+
__init16() {this.asyncLocalStorage = new (0, _async_hooks.AsyncLocalStorage)()}
|
|
6483
|
+
getContext() {
|
|
6484
|
+
const store = this.asyncLocalStorage.getStore();
|
|
6485
|
+
if (_optionalChain([store, 'optionalAccess', _147 => _147.context])) {
|
|
6486
|
+
return store.context;
|
|
6487
|
+
}
|
|
6488
|
+
throw new Error("Sonamu cannot find context");
|
|
6489
|
+
}
|
|
6490
|
+
__init17() {this._apiRootPath = null}
|
|
6477
6491
|
set apiRootPath(apiRootPath) {
|
|
6478
6492
|
this._apiRootPath = apiRootPath;
|
|
6479
6493
|
}
|
|
@@ -6486,7 +6500,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6486
6500
|
get appRootPath() {
|
|
6487
6501
|
return this.apiRootPath.split(_path2.default.sep).slice(0, -1).join(_path2.default.sep);
|
|
6488
6502
|
}
|
|
6489
|
-
|
|
6503
|
+
__init18() {this._dbConfig = null}
|
|
6490
6504
|
set dbConfig(dbConfig) {
|
|
6491
6505
|
this._dbConfig = dbConfig;
|
|
6492
6506
|
}
|
|
@@ -6496,7 +6510,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6496
6510
|
}
|
|
6497
6511
|
return this._dbConfig;
|
|
6498
6512
|
}
|
|
6499
|
-
|
|
6513
|
+
__init19() {this._dbClient = null}
|
|
6500
6514
|
set dbClient(_dbClient) {
|
|
6501
6515
|
this._dbClient = _dbClient;
|
|
6502
6516
|
}
|
|
@@ -6506,7 +6520,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6506
6520
|
}
|
|
6507
6521
|
return this._dbClient;
|
|
6508
6522
|
}
|
|
6509
|
-
|
|
6523
|
+
__init20() {this._syncer = null}
|
|
6510
6524
|
set syncer(syncer) {
|
|
6511
6525
|
this._syncer = syncer;
|
|
6512
6526
|
}
|
|
@@ -6516,7 +6530,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6516
6530
|
}
|
|
6517
6531
|
return this._syncer;
|
|
6518
6532
|
}
|
|
6519
|
-
|
|
6533
|
+
__init21() {this._config = null}
|
|
6520
6534
|
set config(config) {
|
|
6521
6535
|
this._config = config;
|
|
6522
6536
|
}
|
|
@@ -6526,7 +6540,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6526
6540
|
}
|
|
6527
6541
|
return this._config;
|
|
6528
6542
|
}
|
|
6529
|
-
|
|
6543
|
+
__init22() {this._secrets = null}
|
|
6530
6544
|
set secrets(secrets) {
|
|
6531
6545
|
this._secrets = secrets;
|
|
6532
6546
|
}
|
|
@@ -6583,7 +6597,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6583
6597
|
}
|
|
6584
6598
|
async withFastify(server, config, options) {
|
|
6585
6599
|
if (this.isInitialized === false) {
|
|
6586
|
-
await this.init(_optionalChain([options, 'optionalAccess',
|
|
6600
|
+
await this.init(_optionalChain([options, 'optionalAccess', _148 => _148.doSilent]), _optionalChain([options, 'optionalAccess', _149 => _149.enableSync]));
|
|
6587
6601
|
}
|
|
6588
6602
|
server.get(
|
|
6589
6603
|
`${this.config.route.prefix}/routes`,
|
|
@@ -6644,28 +6658,31 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6644
6658
|
if (cachedData !== null) {
|
|
6645
6659
|
return cachedData;
|
|
6646
6660
|
}
|
|
6647
|
-
const
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
reply
|
|
6655
|
-
},
|
|
6656
|
-
request,
|
|
6657
|
-
reply
|
|
6658
|
-
);
|
|
6659
|
-
} else {
|
|
6660
|
-
return reqBody[param.name];
|
|
6661
|
-
}
|
|
6662
|
-
})
|
|
6661
|
+
const context = config.contextProvider(
|
|
6662
|
+
{
|
|
6663
|
+
headers: request.headers,
|
|
6664
|
+
reply
|
|
6665
|
+
},
|
|
6666
|
+
request,
|
|
6667
|
+
reply
|
|
6663
6668
|
);
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
+
return this.asyncLocalStorage.run({ context }, async () => {
|
|
6670
|
+
const result = await model[api2.methodName].apply(
|
|
6671
|
+
model,
|
|
6672
|
+
api2.parameters.map((param) => {
|
|
6673
|
+
if (ApiParamType.isContext(param.type)) {
|
|
6674
|
+
return context;
|
|
6675
|
+
} else {
|
|
6676
|
+
return reqBody[param.name];
|
|
6677
|
+
}
|
|
6678
|
+
})
|
|
6679
|
+
);
|
|
6680
|
+
reply.type(_nullishCoalesce(api2.options.contentType, () => ( "application/json")));
|
|
6681
|
+
if (config.cache && cacheKey) {
|
|
6682
|
+
await config.cache.put(cacheKey, result, cacheTtl);
|
|
6683
|
+
}
|
|
6684
|
+
return result;
|
|
6685
|
+
});
|
|
6669
6686
|
}
|
|
6670
6687
|
});
|
|
6671
6688
|
});
|
|
@@ -6678,11 +6695,11 @@ var Sonamu = new SonamuClass();
|
|
|
6678
6695
|
|
|
6679
6696
|
// src/entity/entity-manager.ts
|
|
6680
6697
|
|
|
6681
|
-
var EntityManagerClass = (_class6 = class {constructor() { _class6.prototype.
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6698
|
+
var EntityManagerClass = (_class6 = class {constructor() { _class6.prototype.__init23.call(this);_class6.prototype.__init24.call(this);_class6.prototype.__init25.call(this);_class6.prototype.__init26.call(this); }
|
|
6699
|
+
__init23() {this.entities = /* @__PURE__ */ new Map()}
|
|
6700
|
+
__init24() {this.modulePaths = /* @__PURE__ */ new Map()}
|
|
6701
|
+
__init25() {this.tableSpecs = /* @__PURE__ */ new Map()}
|
|
6702
|
+
__init26() {this.isAutoloaded = false}
|
|
6686
6703
|
// 경로 전달받아 모든 entity.json 파일 로드
|
|
6687
6704
|
async autoload(doSilent = false) {
|
|
6688
6705
|
if (this.isAutoloaded) {
|
|
@@ -6716,7 +6733,7 @@ var EntityManagerClass = (_class6 = class {constructor() { _class6.prototype.__i
|
|
|
6716
6733
|
Sonamu.apiRootPath,
|
|
6717
6734
|
`dist/application/sonamu.generated.js?t=${Date.now()}`
|
|
6718
6735
|
);
|
|
6719
|
-
if (_optionalChain([__require, 'optionalAccess',
|
|
6736
|
+
if (_optionalChain([__require, 'optionalAccess', _150 => _150.cache]) && __require.cache[sonamuPath]) {
|
|
6720
6737
|
delete __require.cache[sonamuPath];
|
|
6721
6738
|
}
|
|
6722
6739
|
return await this.autoload(doSilent);
|
|
@@ -6806,9 +6823,9 @@ var Entity = (_class7 = class {
|
|
|
6806
6823
|
|
|
6807
6824
|
|
|
6808
6825
|
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6826
|
+
__init27() {this.types = {}}
|
|
6827
|
+
__init28() {this.enums = {}}
|
|
6828
|
+
__init29() {this.enumLabels = {}}
|
|
6812
6829
|
constructor({
|
|
6813
6830
|
id,
|
|
6814
6831
|
parentId,
|
|
@@ -6818,7 +6835,7 @@ var Entity = (_class7 = class {
|
|
|
6818
6835
|
indexes,
|
|
6819
6836
|
subsets,
|
|
6820
6837
|
enums
|
|
6821
|
-
}) {;_class7.prototype.
|
|
6838
|
+
}) {;_class7.prototype.__init27.call(this);_class7.prototype.__init28.call(this);_class7.prototype.__init29.call(this);
|
|
6822
6839
|
this.id = id;
|
|
6823
6840
|
this.parentId = parentId;
|
|
6824
6841
|
this.title = _nullishCoalesce(title, () => ( this.id));
|
|
@@ -7012,7 +7029,7 @@ var Entity = (_class7 = class {
|
|
|
7012
7029
|
const relSubsetQuery = relEntity.resolveSubsetQuery("", relFields);
|
|
7013
7030
|
let manyJoin;
|
|
7014
7031
|
if (isHasManyRelationProp(relation)) {
|
|
7015
|
-
const fromCol = _nullishCoalesce(_optionalChain([relation, 'optionalAccess',
|
|
7032
|
+
const fromCol = _nullishCoalesce(_optionalChain([relation, 'optionalAccess', _151 => _151.fromColumn]), () => ( "id"));
|
|
7016
7033
|
manyJoin = {
|
|
7017
7034
|
fromTable: this.table,
|
|
7018
7035
|
fromCol,
|
|
@@ -7522,5 +7539,7 @@ var Entity = (_class7 = class {
|
|
|
7522
7539
|
|
|
7523
7540
|
|
|
7524
7541
|
|
|
7525
|
-
|
|
7526
|
-
|
|
7542
|
+
|
|
7543
|
+
|
|
7544
|
+
exports.SQLDateTimeString = SQLDateTimeString; exports.zArrayable = zArrayable; exports.isIntegerProp = isIntegerProp; exports.isBigIntegerProp = isBigIntegerProp; exports.isTextProp = isTextProp; exports.isStringProp = isStringProp; exports.isEnumProp = isEnumProp; exports.isFloatProp = isFloatProp; exports.isDoubleProp = isDoubleProp; exports.isDecimalProp = isDecimalProp; exports.isBooleanProp = isBooleanProp; exports.isDateProp = isDateProp; exports.isDateTimeProp = isDateTimeProp; exports.isTimeProp = isTimeProp; exports.isTimestampProp = isTimestampProp; exports.isJsonProp = isJsonProp; exports.isUuidProp = isUuidProp; exports.isVirtualProp = isVirtualProp; exports.isRelationProp = isRelationProp; exports.isOneToOneRelationProp = isOneToOneRelationProp; exports.isBelongsToOneRelationProp = isBelongsToOneRelationProp; exports.isHasManyRelationProp = isHasManyRelationProp; exports.isManyToManyRelationProp = isManyToManyRelationProp; exports.isCustomJoinClause = isCustomJoinClause; exports.SonamuQueryMode = SonamuQueryMode; exports.isKnexError = isKnexError; exports.isKyselyError = isKyselyError; exports.ApiParamType = ApiParamType; exports.RenderingNode = RenderingNode; exports.TemplateOptions = TemplateOptions; exports.TemplateKey = TemplateKey; exports.GenerateOptions = GenerateOptions; exports.PathAndCode = PathAndCode; exports.getZodObjectFromApi = getZodObjectFromApi; exports.getZodObjectFromApiParams = getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = getZodTypeFromApiParamType; exports.propNodeToZodTypeDef = propNodeToZodTypeDef; exports.getTextTypeLength = getTextTypeLength; exports.propToZodTypeDef = propToZodTypeDef; exports.zodTypeToZodCode = zodTypeToZodCode; exports.apiParamToTsCode = apiParamToTsCode; exports.apiParamTypeToTsType = apiParamTypeToTsType; exports.unwrapPromiseOnce = unwrapPromiseOnce; exports.serializeZodType = serializeZodType; exports.zodTypeToTsTypeDef = zodTypeToTsTypeDef; exports.registeredApis = registeredApis; exports.api = api; exports.SoException = SoException; exports.isSoException = isSoException; exports.BadRequestException = BadRequestException; exports.UnauthorizedException = UnauthorizedException; exports.NotFoundException = NotFoundException; exports.ServiceUnavailableException = ServiceUnavailableException; exports.InternalServerErrorException = InternalServerErrorException; exports.AlreadyProcessedException = AlreadyProcessedException; exports.DuplicateRowException = DuplicateRowException; exports.TargetNotFoundException = TargetNotFoundException; exports.globAsync = globAsync; exports.importMultiple = importMultiple; exports.findAppRootPath = findAppRootPath; exports.findApiRootPath = findApiRootPath; exports.nonNullable = nonNullable; exports.hydrate = hydrate; exports.Entity = Entity; exports.EntityManager = EntityManager; exports.asArray = asArray; exports.objToMap = objToMap; exports.KnexClient = KnexClient; exports.KyselyClient = KyselyClient; exports.DBKnexClass = DBKnexClass; exports.DBKyselyClass = DBKyselyClass; exports.DB = DB; exports.Syncer = Syncer; exports.isLocal = isLocal; exports.isRemote = isRemote; exports.isInDocker = isInDocker; exports.isDaemonServer = isDaemonServer; exports.isDevelopment = isDevelopment; exports.isStaging = isStaging; exports.isProduction = isProduction; exports.isTest = isTest; exports.Sonamu = Sonamu;
|
|
7545
|
+
//# sourceMappingURL=chunk-FXWN5PEO.js.map
|