sonamu 0.4.13 → 0.4.14
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/bin/cli.js +51 -51
- package/dist/bin/cli.mjs +2 -2
- package/dist/{chunk-DMJSNO2L.js → chunk-2WAC2GER.js} +44 -44
- package/dist/{chunk-DMJSNO2L.js.map → chunk-2WAC2GER.js.map} +1 -1
- package/dist/{chunk-NI37CY4T.mjs → chunk-C3IPIF6O.mjs} +2 -2
- package/dist/{chunk-DYFCACHD.js → chunk-EXHKSVTE.js} +7 -7
- package/dist/{chunk-QJFHDCBN.mjs → chunk-FCERKIIF.mjs} +2 -2
- package/dist/chunk-FCERKIIF.mjs.map +1 -0
- package/dist/{chunk-DDJ7T4MA.mjs → chunk-HGIBJYOU.mjs} +2 -2
- package/dist/{chunk-NIFOTHBW.mjs → chunk-JKSOJRQA.mjs} +2 -2
- package/dist/{chunk-CXAVBVKC.js → chunk-OTKKFP3Y.js} +100 -100
- package/dist/{chunk-J6S43O7G.js → chunk-UZ2IY5VE.js} +4 -4
- 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.js +9 -9
- package/dist/database/drivers/kysely/base-model.mjs +3 -3
- package/dist/index.js +9 -9
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/api/caster.ts +2 -2
- package/dist/chunk-QJFHDCBN.mjs.map +0 -1
- /package/dist/{chunk-NI37CY4T.mjs.map → chunk-C3IPIF6O.mjs.map} +0 -0
- /package/dist/{chunk-DYFCACHD.js.map → chunk-EXHKSVTE.js.map} +0 -0
- /package/dist/{chunk-DDJ7T4MA.mjs.map → chunk-HGIBJYOU.mjs.map} +0 -0
- /package/dist/{chunk-NIFOTHBW.mjs.map → chunk-JKSOJRQA.mjs.map} +0 -0
- /package/dist/{chunk-CXAVBVKC.js.map → chunk-OTKKFP3Y.js.map} +0 -0
- /package/dist/{chunk-J6S43O7G.js.map → chunk-UZ2IY5VE.js.map} +0 -0
|
@@ -991,7 +991,7 @@ function isZodNumberAnyway(zodType) {
|
|
|
991
991
|
} else if (zodType instanceof _zod.z.ZodNullable && zodType._def.innerType instanceof _zod.z.ZodNumber) {
|
|
992
992
|
return true;
|
|
993
993
|
} else if (zodType instanceof _zod.z.ZodOptional && zodType._def.innerType instanceof _zod.z.ZodNumber) {
|
|
994
|
-
} else if (zodType instanceof _zod.z.ZodOptional && zodType._def.innerType instanceof _zod.z.ZodOptional && zodType._type.def.innerType instanceof _zod.z.ZodNumber) {
|
|
994
|
+
} else if (zodType instanceof _zod.z.ZodOptional && _optionalChain([zodType, 'access', _63 => _63._def, 'optionalAccess', _64 => _64.innerType]) instanceof _zod.z.ZodOptional && _optionalChain([zodType, 'access', _65 => _65._type, 'optionalAccess', _66 => _66.def, 'optionalAccess', _67 => _67.innerType]) instanceof _zod.z.ZodNumber) {
|
|
995
995
|
return true;
|
|
996
996
|
}
|
|
997
997
|
return false;
|
|
@@ -1339,13 +1339,13 @@ var Template__entity = class extends Template {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
})();
|
|
1341
1341
|
return {
|
|
1342
|
-
...this.getTargetAndPath(names, _nullishCoalesce(_optionalChain([parent, 'optionalAccess',
|
|
1342
|
+
...this.getTargetAndPath(names, _nullishCoalesce(_optionalChain([parent, 'optionalAccess', _68 => _68.names]), () => ( names))),
|
|
1343
1343
|
body: JSON.stringify({
|
|
1344
1344
|
id: entityId,
|
|
1345
1345
|
title: _nullishCoalesce(title, () => ( entityId)),
|
|
1346
1346
|
parentId,
|
|
1347
1347
|
table: _nullishCoalesce(table, () => ( names.fsPlural.replace(/\-/g, "_"))),
|
|
1348
|
-
props: _optionalChain([options, 'access',
|
|
1348
|
+
props: _optionalChain([options, 'access', _69 => _69.props, 'optionalAccess', _70 => _70.length]) ? options.props : [
|
|
1349
1349
|
{ name: "id", type: "integer", unsigned: true, desc: "ID" },
|
|
1350
1350
|
...parent ? [
|
|
1351
1351
|
{
|
|
@@ -1436,7 +1436,7 @@ var Template__view_list = class extends Template {
|
|
|
1436
1436
|
return `<>{/* object ${colName} */}</>`;
|
|
1437
1437
|
case "object-pick":
|
|
1438
1438
|
const pickedChild = col.children.find(
|
|
1439
|
-
(child) => child.name === _optionalChain([col, 'access',
|
|
1439
|
+
(child) => child.name === _optionalChain([col, 'access', _71 => _71.config, 'optionalAccess', _72 => _72.picked])
|
|
1440
1440
|
);
|
|
1441
1441
|
if (!pickedChild) {
|
|
1442
1442
|
throw new Error(`object-pick \uC120\uD0DD \uC2E4\uD328 (\uC624\uBE0C\uC81D\uD2B8: ${col.name})`);
|
|
@@ -1550,13 +1550,13 @@ var Template__view_list = class extends Template {
|
|
|
1550
1550
|
orderBy: "id-desc",
|
|
1551
1551
|
search: "title"
|
|
1552
1552
|
};
|
|
1553
|
-
const orderByZodType = _optionalChain([columns, 'access',
|
|
1553
|
+
const orderByZodType = _optionalChain([columns, 'access', _73 => _73.find, 'call', _74 => _74(
|
|
1554
1554
|
(col) => col.name === "orderBy"
|
|
1555
|
-
), 'optionalAccess',
|
|
1555
|
+
), 'optionalAccess', _75 => _75.zodType]);
|
|
1556
1556
|
if (orderByZodType && orderByZodType instanceof _zod.z.ZodEnum) {
|
|
1557
1557
|
def.orderBy = Object.keys(orderByZodType.Enum)[0];
|
|
1558
1558
|
}
|
|
1559
|
-
const searchZodType = _optionalChain([columns, 'access',
|
|
1559
|
+
const searchZodType = _optionalChain([columns, 'access', _76 => _76.find, 'call', _77 => _77((col) => col.name === "search"), 'optionalAccess', _78 => _78.zodType]);
|
|
1560
1560
|
if (searchZodType && searchZodType instanceof _zod.z.ZodEnum) {
|
|
1561
1561
|
def.search = Object.keys(searchZodType.Enum)[0];
|
|
1562
1562
|
}
|
|
@@ -1569,7 +1569,7 @@ var Template__view_list = class extends Template {
|
|
|
1569
1569
|
const propCandidate = entity.props.find((p) => p.name === col.name);
|
|
1570
1570
|
return {
|
|
1571
1571
|
name: col.name,
|
|
1572
|
-
label: _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess',
|
|
1572
|
+
label: _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess', _79 => _79.desc]), () => ( col.label)),
|
|
1573
1573
|
tc: `(row) => ${this.renderColumn(entityId, col, names)}`
|
|
1574
1574
|
};
|
|
1575
1575
|
});
|
|
@@ -2528,11 +2528,11 @@ var KnexClient = (_class = class _KnexClient {
|
|
|
2528
2528
|
__init() {this.generator = new KnexGenerator()}
|
|
2529
2529
|
get connectionInfo() {
|
|
2530
2530
|
return {
|
|
2531
|
-
host: _nullishCoalesce(_optionalChain([this, 'access',
|
|
2532
|
-
port: _nullishCoalesce(_optionalChain([this, 'access',
|
|
2533
|
-
database: _nullishCoalesce(_optionalChain([this, 'access',
|
|
2534
|
-
user: _nullishCoalesce(_optionalChain([this, 'access',
|
|
2535
|
-
password: _nullishCoalesce(_optionalChain([this, 'access',
|
|
2531
|
+
host: _nullishCoalesce(_optionalChain([this, 'access', _80 => _80.knex, 'access', _81 => _81.client, 'access', _82 => _82.config, 'access', _83 => _83.connection, 'optionalAccess', _84 => _84.host]), () => ( "localhost")),
|
|
2532
|
+
port: _nullishCoalesce(_optionalChain([this, 'access', _85 => _85.knex, 'access', _86 => _86.client, 'access', _87 => _87.config, 'access', _88 => _88.connection, 'optionalAccess', _89 => _89.port]), () => ( 3306)),
|
|
2533
|
+
database: _nullishCoalesce(_optionalChain([this, 'access', _90 => _90.knex, 'access', _91 => _91.client, 'access', _92 => _92.config, 'access', _93 => _93.connection, 'optionalAccess', _94 => _94.database]), () => ( "")),
|
|
2534
|
+
user: _nullishCoalesce(_optionalChain([this, 'access', _95 => _95.knex, 'access', _96 => _96.client, 'access', _97 => _97.config, 'access', _98 => _98.connection, 'optionalAccess', _99 => _99.user]), () => ( "")),
|
|
2535
|
+
password: _nullishCoalesce(_optionalChain([this, 'access', _100 => _100.knex, 'access', _101 => _101.client, 'access', _102 => _102.config, 'access', _103 => _103.connection, 'optionalAccess', _104 => _104.password]), () => ( ""))
|
|
2536
2536
|
};
|
|
2537
2537
|
}
|
|
2538
2538
|
|
|
@@ -2627,13 +2627,13 @@ var KnexClient = (_class = class _KnexClient {
|
|
|
2627
2627
|
return this.qb.pluck(column);
|
|
2628
2628
|
}
|
|
2629
2629
|
createRawQuery(query, bindings) {
|
|
2630
|
-
if (_optionalChain([bindings, 'optionalAccess',
|
|
2630
|
+
if (_optionalChain([bindings, 'optionalAccess', _105 => _105.length])) {
|
|
2631
2631
|
return this.knex.raw(query, bindings).toQuery();
|
|
2632
2632
|
}
|
|
2633
2633
|
return this.knex.raw(query).toQuery();
|
|
2634
2634
|
}
|
|
2635
2635
|
async raw(query, bindings) {
|
|
2636
|
-
if (_optionalChain([bindings, 'optionalAccess',
|
|
2636
|
+
if (_optionalChain([bindings, 'optionalAccess', _106 => _106.length])) {
|
|
2637
2637
|
return (await this.knex.raw(query, bindings))[0];
|
|
2638
2638
|
}
|
|
2639
2639
|
return (await this.knex.raw(query))[0];
|
|
@@ -2833,7 +2833,7 @@ var KyselyClient = class _KyselyClient {
|
|
|
2833
2833
|
return result.map((row) => row[column]);
|
|
2834
2834
|
}
|
|
2835
2835
|
createRawQuery(query, bindings) {
|
|
2836
|
-
if (_optionalChain([bindings, 'optionalAccess',
|
|
2836
|
+
if (_optionalChain([bindings, 'optionalAccess', _107 => _107.length])) {
|
|
2837
2837
|
query = query.replace(
|
|
2838
2838
|
/\?/g,
|
|
2839
2839
|
() => _kysely.sql.lit(bindings.shift()).compile(this.kysely).sql
|
|
@@ -2842,7 +2842,7 @@ var KyselyClient = class _KyselyClient {
|
|
|
2842
2842
|
return _kysely.sql.raw(query).compile(this.kysely).sql;
|
|
2843
2843
|
}
|
|
2844
2844
|
async raw(query, bindings) {
|
|
2845
|
-
if (_optionalChain([bindings, 'optionalAccess',
|
|
2845
|
+
if (_optionalChain([bindings, 'optionalAccess', _108 => _108.length])) {
|
|
2846
2846
|
query = query.replace(
|
|
2847
2847
|
/\?/g,
|
|
2848
2848
|
() => _kysely.sql.lit(bindings.shift()).compile(this.kysely).sql
|
|
@@ -2895,14 +2895,14 @@ var KyselyClient = class _KyselyClient {
|
|
|
2895
2895
|
if (error) {
|
|
2896
2896
|
throw error;
|
|
2897
2897
|
}
|
|
2898
|
-
return [0, _optionalChain([results, 'optionalAccess',
|
|
2898
|
+
return [0, _optionalChain([results, 'optionalAccess', _109 => _109.map, 'call', _110 => _110((r) => r.migrationName)])];
|
|
2899
2899
|
}
|
|
2900
2900
|
async rollback() {
|
|
2901
2901
|
const { results, error } = await this.migrator.migrateDown();
|
|
2902
2902
|
if (error) {
|
|
2903
2903
|
throw error;
|
|
2904
2904
|
}
|
|
2905
|
-
return [0, _optionalChain([results, 'optionalAccess',
|
|
2905
|
+
return [0, _optionalChain([results, 'optionalAccess', _111 => _111.map, 'call', _112 => _112((r) => r.migrationName)])];
|
|
2906
2906
|
}
|
|
2907
2907
|
async rollbackAll() {
|
|
2908
2908
|
while (true) {
|
|
@@ -2934,7 +2934,7 @@ var DBClass = class {
|
|
|
2934
2934
|
async getBaseConfig(rootPath) {
|
|
2935
2935
|
const baseConfigPath = _path2.default.join(rootPath, "/dist/configs/db.js");
|
|
2936
2936
|
const module = await Promise.resolve().then(() => _interopRequireWildcard(require(baseConfigPath)));
|
|
2937
|
-
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([module, 'access',
|
|
2937
|
+
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([module, 'access', _113 => _113.default, 'optionalAccess', _114 => _114.default]), () => ( module.default)), () => ( module));
|
|
2938
2938
|
return config;
|
|
2939
2939
|
}
|
|
2940
2940
|
getCurrentConfig(which) {
|
|
@@ -3134,15 +3134,15 @@ var DBKnexClass = (_class2 = class extends DBClass {
|
|
|
3134
3134
|
database: `${config.database}_test`
|
|
3135
3135
|
}
|
|
3136
3136
|
},
|
|
3137
|
-
_optionalChain([config, 'access',
|
|
3137
|
+
_optionalChain([config, 'access', _115 => _115.environments, 'optionalAccess', _116 => _116.test])
|
|
3138
3138
|
);
|
|
3139
3139
|
const fixture_local = _lodash2.default.merge({}, defaultKnexConfig, {
|
|
3140
3140
|
connection: {
|
|
3141
3141
|
database: `${config.database}_fixture`
|
|
3142
3142
|
}
|
|
3143
3143
|
});
|
|
3144
|
-
const devMasterOptions = _optionalChain([config, 'access',
|
|
3145
|
-
const devSlaveOptions = _optionalChain([config, 'access',
|
|
3144
|
+
const devMasterOptions = _optionalChain([config, 'access', _117 => _117.environments, 'optionalAccess', _118 => _118.development]);
|
|
3145
|
+
const devSlaveOptions = _optionalChain([config, 'access', _119 => _119.environments, 'optionalAccess', _120 => _120.development_slave]);
|
|
3146
3146
|
const development_master = _lodash2.default.merge({}, defaultKnexConfig, devMasterOptions);
|
|
3147
3147
|
const development_slave = _lodash2.default.merge(
|
|
3148
3148
|
{},
|
|
@@ -3155,8 +3155,8 @@ var DBKnexClass = (_class2 = class extends DBClass {
|
|
|
3155
3155
|
database: `${config.database}_fixture`
|
|
3156
3156
|
}
|
|
3157
3157
|
});
|
|
3158
|
-
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3159
|
-
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3158
|
+
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access', _121 => _121.environments, 'optionalAccess', _122 => _122.production]), () => ( {}));
|
|
3159
|
+
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access', _123 => _123.environments, 'optionalAccess', _124 => _124.production_slave]), () => ( {}));
|
|
3160
3160
|
const production_master = _lodash2.default.merge({}, defaultKnexConfig, prodMasterOptions);
|
|
3161
3161
|
const production_slave = _lodash2.default.merge(
|
|
3162
3162
|
{},
|
|
@@ -3897,8 +3897,8 @@ var DBKyselyClass = (_class3 = class extends DBClass {
|
|
|
3897
3897
|
const fixture_local = _lodash2.default.merge({}, defaultKyselyConfig, {
|
|
3898
3898
|
database: `${config.database}_fixture`
|
|
3899
3899
|
});
|
|
3900
|
-
const devMasterOptions = _optionalChain([config, 'access',
|
|
3901
|
-
const devSlaveOptions = _optionalChain([config, 'access',
|
|
3900
|
+
const devMasterOptions = _optionalChain([config, 'access', _125 => _125.environments, 'optionalAccess', _126 => _126.development]);
|
|
3901
|
+
const devSlaveOptions = _optionalChain([config, 'access', _127 => _127.environments, 'optionalAccess', _128 => _128.development_slave]);
|
|
3902
3902
|
const development_master = _lodash2.default.merge(
|
|
3903
3903
|
{},
|
|
3904
3904
|
defaultKyselyConfig,
|
|
@@ -3913,8 +3913,8 @@ var DBKyselyClass = (_class3 = class extends DBClass {
|
|
|
3913
3913
|
const fixture_remote = _lodash2.default.merge({}, defaultKyselyConfig, devMasterOptions, {
|
|
3914
3914
|
database: `${config.database}_fixture`
|
|
3915
3915
|
});
|
|
3916
|
-
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3917
|
-
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access',
|
|
3916
|
+
const prodMasterOptions = _nullishCoalesce(_optionalChain([config, 'access', _129 => _129.environments, 'optionalAccess', _130 => _130.production]), () => ( {}));
|
|
3917
|
+
const prodSlaveOptions = _nullishCoalesce(_optionalChain([config, 'access', _131 => _131.environments, 'optionalAccess', _132 => _132.production_slave]), () => ( {}));
|
|
3918
3918
|
const production_master = _lodash2.default.merge(
|
|
3919
3919
|
{},
|
|
3920
3920
|
defaultKyselyConfig,
|
|
@@ -3958,7 +3958,7 @@ var dbConfigPath = _path2.default.join(
|
|
|
3958
3958
|
);
|
|
3959
3959
|
var knexfileModule = __require(dbConfigPath);
|
|
3960
3960
|
var DB = (() => {
|
|
3961
|
-
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([knexfileModule, 'access',
|
|
3961
|
+
const config = _nullishCoalesce(_nullishCoalesce(_optionalChain([knexfileModule, 'access', _133 => _133.default, 'optionalAccess', _134 => _134.default]), () => ( knexfileModule.default)), () => ( knexfileModule));
|
|
3962
3962
|
if (config.client === "knex") {
|
|
3963
3963
|
return new DBKnexClass();
|
|
3964
3964
|
} else if (config.client === "kysely") {
|
|
@@ -3982,7 +3982,7 @@ var Template__model = class extends Template {
|
|
|
3982
3982
|
render({ entityId }, _columnsNode, listParamsNode) {
|
|
3983
3983
|
const names = EntityManager.getNamesFromId(entityId);
|
|
3984
3984
|
const vlTpl = new Template__view_list();
|
|
3985
|
-
if (_optionalChain([listParamsNode, 'optionalAccess',
|
|
3985
|
+
if (_optionalChain([listParamsNode, 'optionalAccess', _135 => _135.children]) === void 0) {
|
|
3986
3986
|
throw new Error(`listParamsNode\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. ${entityId}`);
|
|
3987
3987
|
}
|
|
3988
3988
|
const def = vlTpl.getDefault(listParamsNode.children);
|
|
@@ -4388,7 +4388,7 @@ var Template__view_form = class extends Template {
|
|
|
4388
4388
|
const propCandidate = entity.props.find(
|
|
4389
4389
|
(prop) => prop.name === col.name
|
|
4390
4390
|
);
|
|
4391
|
-
col.label = _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess',
|
|
4391
|
+
col.label = _nullishCoalesce(_optionalChain([propCandidate, 'optionalAccess', _136 => _136.desc]), () => ( col.label));
|
|
4392
4392
|
return col;
|
|
4393
4393
|
});
|
|
4394
4394
|
const defaultValue = this.resolveDefaultValue(columns);
|
|
@@ -5191,8 +5191,8 @@ var Template__kysely_interface = class extends Template {
|
|
|
5191
5191
|
getTargetAndPath() {
|
|
5192
5192
|
const { dir } = Sonamu.config.api;
|
|
5193
5193
|
const { types } = DB.baseConfig;
|
|
5194
|
-
const outDir = _nullishCoalesce(_optionalChain([types, 'optionalAccess',
|
|
5195
|
-
const fileName = _nullishCoalesce(_optionalChain([types, 'optionalAccess',
|
|
5194
|
+
const outDir = _nullishCoalesce(_optionalChain([types, 'optionalAccess', _137 => _137.outDir]), () => ( "src/typings"));
|
|
5195
|
+
const fileName = _nullishCoalesce(_optionalChain([types, 'optionalAccess', _138 => _138.fileName]), () => ( "database.types.ts"));
|
|
5196
5196
|
return {
|
|
5197
5197
|
target: `${dir}/${outDir}`,
|
|
5198
5198
|
path: fileName
|
|
@@ -5416,7 +5416,7 @@ var Syncer = (_class4 = class {
|
|
|
5416
5416
|
if (diffTypes.includes("entity") || diffTypes.includes("types")) {
|
|
5417
5417
|
console.log("// \uC561\uC158: \uC2A4\uD0A4\uB9C8 \uC0DD\uC131");
|
|
5418
5418
|
await this.actionGenerateSchemas();
|
|
5419
|
-
if (_optionalChain([DB, 'access',
|
|
5419
|
+
if (_optionalChain([DB, 'access', _140 => _140.baseConfig, 'optionalAccess', _141 => _141.client]) === "kysely" && _optionalChain([DB, 'access', _142 => _142.baseConfig, 'access', _143 => _143.types, 'optionalAccess', _144 => _144.enabled]) !== false) {
|
|
5420
5420
|
console.log("// \uC561\uC158: kysely \uC778\uD130\uD398\uC774\uC2A4 \uC0DD\uC131");
|
|
5421
5421
|
await this.generateTemplate(
|
|
5422
5422
|
"kysely_interface",
|
|
@@ -5691,7 +5691,7 @@ var Syncer = (_class4 = class {
|
|
|
5691
5691
|
return extendedApis;
|
|
5692
5692
|
}
|
|
5693
5693
|
resolveTypeNode(typeNode) {
|
|
5694
|
-
switch (_optionalChain([typeNode, 'optionalAccess',
|
|
5694
|
+
switch (_optionalChain([typeNode, 'optionalAccess', _145 => _145.kind])) {
|
|
5695
5695
|
case _typescript2.default.SyntaxKind.AnyKeyword:
|
|
5696
5696
|
return "any";
|
|
5697
5697
|
case _typescript2.default.SyntaxKind.UnknownKeyword:
|
|
@@ -5767,7 +5767,7 @@ var Syncer = (_class4 = class {
|
|
|
5767
5767
|
return {
|
|
5768
5768
|
t: "ref",
|
|
5769
5769
|
id: typeNode.typeName.escapedText.toString(),
|
|
5770
|
-
args: _optionalChain([typeNode, 'access',
|
|
5770
|
+
args: _optionalChain([typeNode, 'access', _146 => _146.typeArguments, 'optionalAccess', _147 => _147.map, 'call', _148 => _148(
|
|
5771
5771
|
(typeArg) => this.resolveTypeNode(typeArg)
|
|
5772
5772
|
)])
|
|
5773
5773
|
};
|
|
@@ -5821,7 +5821,7 @@ var Syncer = (_class4 = class {
|
|
|
5821
5821
|
name: name.escapedText ? name.escapedText.toString() : `nonameAt${index}`,
|
|
5822
5822
|
type,
|
|
5823
5823
|
optional: paramDec.optional === true,
|
|
5824
|
-
defaultDef: _optionalChain([paramDec, 'optionalAccess',
|
|
5824
|
+
defaultDef: _optionalChain([paramDec, 'optionalAccess', _149 => _149.defaultDef])
|
|
5825
5825
|
};
|
|
5826
5826
|
if (_typescript2.default.isObjectBindingPattern(name) && _typescript2.default.isTypeReferenceNode(paramDec.type) && _typescript2.default.isIdentifier(paramDec.type.typeName)) {
|
|
5827
5827
|
result.name = _inflection2.default.camelize(paramDec.type.typeName.text, true);
|
|
@@ -6161,7 +6161,7 @@ var Syncer = (_class4 = class {
|
|
|
6161
6161
|
},
|
|
6162
6162
|
{}
|
|
6163
6163
|
);
|
|
6164
|
-
if (_optionalChain([propNode, 'access',
|
|
6164
|
+
if (_optionalChain([propNode, 'access', _150 => _150.prop, 'optionalAccess', _151 => _151.nullable]) === true) {
|
|
6165
6165
|
return _zod.z.object(obj).nullable();
|
|
6166
6166
|
} else {
|
|
6167
6167
|
return _zod.z.object(obj);
|
|
@@ -6560,7 +6560,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6560
6560
|
__init16() {this.asyncLocalStorage = new (0, _async_hooks.AsyncLocalStorage)()}
|
|
6561
6561
|
getContext() {
|
|
6562
6562
|
const store = this.asyncLocalStorage.getStore();
|
|
6563
|
-
if (_optionalChain([store, 'optionalAccess',
|
|
6563
|
+
if (_optionalChain([store, 'optionalAccess', _152 => _152.context])) {
|
|
6564
6564
|
return store.context;
|
|
6565
6565
|
}
|
|
6566
6566
|
throw new Error("Sonamu cannot find context");
|
|
@@ -6675,7 +6675,7 @@ var SonamuClass = (_class5 = class {constructor() { _class5.prototype.__init15.c
|
|
|
6675
6675
|
}
|
|
6676
6676
|
async withFastify(server, config, options) {
|
|
6677
6677
|
if (this.isInitialized === false) {
|
|
6678
|
-
await this.init(_optionalChain([options, 'optionalAccess',
|
|
6678
|
+
await this.init(_optionalChain([options, 'optionalAccess', _153 => _153.doSilent]), _optionalChain([options, 'optionalAccess', _154 => _154.enableSync]));
|
|
6679
6679
|
}
|
|
6680
6680
|
server.get(
|
|
6681
6681
|
`${this.config.route.prefix}/routes`,
|
|
@@ -6811,7 +6811,7 @@ var EntityManagerClass = (_class6 = class {constructor() { _class6.prototype.__i
|
|
|
6811
6811
|
Sonamu.apiRootPath,
|
|
6812
6812
|
`dist/application/sonamu.generated.js?t=${Date.now()}`
|
|
6813
6813
|
);
|
|
6814
|
-
if (_optionalChain([__require, 'optionalAccess',
|
|
6814
|
+
if (_optionalChain([__require, 'optionalAccess', _155 => _155.cache]) && __require.cache[sonamuPath]) {
|
|
6815
6815
|
delete __require.cache[sonamuPath];
|
|
6816
6816
|
}
|
|
6817
6817
|
return await this.autoload(doSilent);
|
|
@@ -7107,7 +7107,7 @@ var Entity = (_class7 = class {
|
|
|
7107
7107
|
const relSubsetQuery = relEntity.resolveSubsetQuery("", relFields);
|
|
7108
7108
|
let manyJoin;
|
|
7109
7109
|
if (isHasManyRelationProp(relation)) {
|
|
7110
|
-
const fromCol = _nullishCoalesce(_optionalChain([relation, 'optionalAccess',
|
|
7110
|
+
const fromCol = _nullishCoalesce(_optionalChain([relation, 'optionalAccess', _156 => _156.fromColumn]), () => ( "id"));
|
|
7111
7111
|
manyJoin = {
|
|
7112
7112
|
fromTable: this.table,
|
|
7113
7113
|
fromCol,
|
|
@@ -7622,4 +7622,4 @@ var Entity = (_class7 = class {
|
|
|
7622
7622
|
|
|
7623
7623
|
|
|
7624
7624
|
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.apiParamToTsCodeAsObject = apiParamToTsCodeAsObject; exports.apiParamTypeToTsType = apiParamTypeToTsType; exports.unwrapPromiseOnce = unwrapPromiseOnce; exports.serializeZodType = serializeZodType; exports.zodTypeToTsTypeDef = zodTypeToTsTypeDef; exports.registeredApis = registeredApis; exports.api = api; exports.stream = stream; 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;
|
|
7625
|
-
//# sourceMappingURL=chunk-
|
|
7625
|
+
//# sourceMappingURL=chunk-2WAC2GER.js.map
|