sonamu 0.4.8 → 0.4.9
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-FXWN5PEO.js → chunk-2VEHSKNA.js} +3 -3
- package/dist/chunk-2VEHSKNA.js.map +1 -0
- package/dist/{chunk-IEP5SWTY.mjs → chunk-AK547YMV.mjs} +2 -2
- package/dist/{chunk-WZJODZL6.js → chunk-GHF56FO6.js} +7 -7
- package/dist/{chunk-IEXW7P6A.js → chunk-IDNBP4MH.js} +4 -4
- package/dist/{chunk-VBBKB2LD.mjs → chunk-IV7ZWWBN.mjs} +3 -3
- package/dist/chunk-IV7ZWWBN.mjs.map +1 -0
- package/dist/{chunk-OBPWSOYN.mjs → chunk-L3RJSG2K.mjs} +2 -2
- package/dist/{chunk-ZNWZQLRN.js → chunk-LD7OHPVK.js} +100 -100
- package/dist/{chunk-GQVZQZ5J.mjs → chunk-OTL37JQ4.mjs} +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.js +9 -9
- package/dist/database/drivers/kysely/base-model.mjs +3 -3
- package/dist/index.js +7 -7
- package/dist/index.mjs +3 -3
- package/package.json +1 -1
- package/src/entity/entity-manager.ts +1 -1
- package/src/templates/generated.template.ts +1 -1
- package/dist/chunk-FXWN5PEO.js.map +0 -1
- package/dist/chunk-VBBKB2LD.mjs.map +0 -1
- /package/dist/{chunk-IEP5SWTY.mjs.map → chunk-AK547YMV.mjs.map} +0 -0
- /package/dist/{chunk-WZJODZL6.js.map → chunk-GHF56FO6.js.map} +0 -0
- /package/dist/{chunk-IEXW7P6A.js.map → chunk-IDNBP4MH.js.map} +0 -0
- /package/dist/{chunk-OBPWSOYN.mjs.map → chunk-L3RJSG2K.mjs.map} +0 -0
- /package/dist/{chunk-ZNWZQLRN.js.map → chunk-LD7OHPVK.js.map} +0 -0
- /package/dist/{chunk-GQVZQZ5J.mjs.map → chunk-OTL37JQ4.mjs.map} +0 -0
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIDNBP4MHjs = require('../../../chunk-IDNBP4MH.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkGHF56FO6js = require('../../../chunk-GHF56FO6.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunk2VEHSKNAjs = require('../../../chunk-2VEHSKNA.js');
|
|
11
11
|
|
|
12
12
|
// src/database/drivers/knex/base-model.ts
|
|
13
|
-
var BaseModelClass = class extends
|
|
13
|
+
var BaseModelClass = class extends _chunkIDNBP4MHjs.BaseModelClassAbstract {
|
|
14
14
|
getDB(which) {
|
|
15
|
-
return
|
|
15
|
+
return _chunk2VEHSKNAjs.DB.getDB(which);
|
|
16
16
|
}
|
|
17
17
|
async destroy() {
|
|
18
|
-
return
|
|
18
|
+
return _chunk2VEHSKNAjs.DB.destroy();
|
|
19
19
|
}
|
|
20
20
|
getUpsertBuilder() {
|
|
21
|
-
return new (0,
|
|
21
|
+
return new (0, _chunkGHF56FO6js.UpsertBuilder)();
|
|
22
22
|
}
|
|
23
23
|
applyJoins(clonedQb, joins) {
|
|
24
24
|
for (const join of joins) {
|
|
25
|
-
if (
|
|
25
|
+
if (_chunk2VEHSKNAjs.isCustomJoinClause.call(void 0, join)) {
|
|
26
26
|
if (join.join === "inner") {
|
|
27
27
|
clonedQb.qb = clonedQb.qb.innerJoin(
|
|
28
28
|
`${join.table} as ${join.as}`,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseModelClassAbstract
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-L3RJSG2K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
UpsertBuilder
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-AK547YMV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
DB,
|
|
9
9
|
isCustomJoinClause
|
|
10
|
-
} from "../../../chunk-
|
|
10
|
+
} from "../../../chunk-IV7ZWWBN.mjs";
|
|
11
11
|
import "../../../chunk-PTFDTOJU.mjs";
|
|
12
12
|
|
|
13
13
|
// src/database/drivers/knex/base-model.ts
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkIDNBP4MHjs = require('../../../chunk-IDNBP4MH.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkGHF56FO6js = require('../../../chunk-GHF56FO6.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk2VEHSKNAjs = require('../../../chunk-2VEHSKNA.js');
|
|
12
12
|
|
|
13
13
|
// src/database/drivers/kysely/base-model.ts
|
|
14
14
|
var _inflection = require('inflection'); var _inflection2 = _interopRequireDefault(_inflection);
|
|
15
|
-
var BaseModelClass = class extends
|
|
15
|
+
var BaseModelClass = class extends _chunkIDNBP4MHjs.BaseModelClassAbstract {
|
|
16
16
|
getDB(which) {
|
|
17
|
-
return
|
|
17
|
+
return _chunk2VEHSKNAjs.DB.getDB(which);
|
|
18
18
|
}
|
|
19
19
|
async destroy() {
|
|
20
|
-
return
|
|
20
|
+
return _chunk2VEHSKNAjs.DB.destroy();
|
|
21
21
|
}
|
|
22
22
|
getUpsertBuilder() {
|
|
23
|
-
return new (0,
|
|
23
|
+
return new (0, _chunkGHF56FO6js.UpsertBuilder)();
|
|
24
24
|
}
|
|
25
25
|
applyJoins(clonedQb, joins) {
|
|
26
26
|
for (const join of joins) {
|
|
27
|
-
if (
|
|
27
|
+
if (_chunk2VEHSKNAjs.isCustomJoinClause.call(void 0, join)) {
|
|
28
28
|
throw new Error("Custom join clause is not supported in Kysely");
|
|
29
29
|
}
|
|
30
30
|
if (join.join === "inner") {
|
|
@@ -48,7 +48,7 @@ var BaseModelClass = class extends _chunkIEXW7P6Ajs.BaseModelClassAbstract {
|
|
|
48
48
|
if (!column) {
|
|
49
49
|
throw new Error("parseOrderBy: Invalid column");
|
|
50
50
|
}
|
|
51
|
-
const entity =
|
|
51
|
+
const entity = _chunk2VEHSKNAjs.EntityManager.get(_inflection2.default.classify(table));
|
|
52
52
|
if (!entity.props.find((p) => p.name === column)) {
|
|
53
53
|
throw new Error("parseOrderBy: \uD604\uC7AC \uC5D4\uD2F0\uD2F0\uC5D0 \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uCEEC\uB7FC\uC785\uB2C8\uB2E4: ");
|
|
54
54
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseModelClassAbstract
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-L3RJSG2K.mjs";
|
|
4
4
|
import {
|
|
5
5
|
UpsertBuilder
|
|
6
|
-
} from "../../../chunk-
|
|
6
|
+
} from "../../../chunk-AK547YMV.mjs";
|
|
7
7
|
import {
|
|
8
8
|
DB,
|
|
9
9
|
EntityManager,
|
|
10
10
|
isCustomJoinClause
|
|
11
|
-
} from "../../../chunk-
|
|
11
|
+
} from "../../../chunk-IV7ZWWBN.mjs";
|
|
12
12
|
import "../../../chunk-PTFDTOJU.mjs";
|
|
13
13
|
|
|
14
14
|
// src/database/drivers/kysely/base-model.ts
|
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkLD7OHPVKjs = require('./chunk-LD7OHPVK.js');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkGHF56FO6js = require('./chunk-GHF56FO6.js');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -88,13 +88,13 @@ var _chunkWZJODZL6js = require('./chunk-WZJODZL6.js');
|
|
|
88
88
|
|
|
89
89
|
|
|
90
90
|
|
|
91
|
-
var
|
|
91
|
+
var _chunk2VEHSKNAjs = require('./chunk-2VEHSKNA.js');
|
|
92
92
|
|
|
93
93
|
// src/exceptions/error-handler.ts
|
|
94
94
|
function setupErrorHandler(server) {
|
|
95
95
|
server.setErrorHandler((error, request, reply) => {
|
|
96
96
|
error.statusCode ??= 400;
|
|
97
|
-
if (
|
|
97
|
+
if (_chunk2VEHSKNAjs.isSoException.call(void 0, error) && error.payload && Array.isArray(error.payload)) {
|
|
98
98
|
const issues = error.payload;
|
|
99
99
|
const [issue] = issues;
|
|
100
100
|
const message = `${issue.message} (${issue.path.join("/")})`;
|
|
@@ -316,13 +316,13 @@ var i = {
|
|
|
316
316
|
function index(columns) {
|
|
317
317
|
return {
|
|
318
318
|
type: "index",
|
|
319
|
-
columns:
|
|
319
|
+
columns: _chunk2VEHSKNAjs.asArray.call(void 0, columns)
|
|
320
320
|
};
|
|
321
321
|
}
|
|
322
322
|
function unique(columns) {
|
|
323
323
|
return {
|
|
324
324
|
type: "unique",
|
|
325
|
-
columns:
|
|
325
|
+
columns: _chunk2VEHSKNAjs.asArray.call(void 0, columns)
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
|
|
@@ -414,5 +414,5 @@ function unique(columns) {
|
|
|
414
414
|
|
|
415
415
|
|
|
416
416
|
|
|
417
|
-
exports.AlreadyProcessedException =
|
|
417
|
+
exports.AlreadyProcessedException = _chunk2VEHSKNAjs.AlreadyProcessedException; exports.ApiParamType = _chunk2VEHSKNAjs.ApiParamType; exports.BadRequestException = _chunk2VEHSKNAjs.BadRequestException; exports.DB = _chunk2VEHSKNAjs.DB; exports.DBKnexClass = _chunk2VEHSKNAjs.DBKnexClass; exports.DBKyselyClass = _chunk2VEHSKNAjs.DBKyselyClass; exports.DuplicateRowException = _chunk2VEHSKNAjs.DuplicateRowException; exports.Entity = _chunk2VEHSKNAjs.Entity; exports.EntityManager = _chunk2VEHSKNAjs.EntityManager; exports.FixtureManager = _chunkLD7OHPVKjs.FixtureManager; exports.FixtureManagerClass = _chunkLD7OHPVKjs.FixtureManagerClass; exports.GenerateOptions = _chunk2VEHSKNAjs.GenerateOptions; exports.InternalServerErrorException = _chunk2VEHSKNAjs.InternalServerErrorException; exports.Migrator = _chunkLD7OHPVKjs.Migrator; exports.NotFoundException = _chunk2VEHSKNAjs.NotFoundException; exports.PathAndCode = _chunk2VEHSKNAjs.PathAndCode; exports.RenderingNode = _chunk2VEHSKNAjs.RenderingNode; exports.SQLDateTimeString = _chunk2VEHSKNAjs.SQLDateTimeString; exports.ServiceUnavailableException = _chunk2VEHSKNAjs.ServiceUnavailableException; exports.SoException = _chunk2VEHSKNAjs.SoException; exports.Sonamu = _chunk2VEHSKNAjs.Sonamu; exports.SonamuQueryMode = _chunk2VEHSKNAjs.SonamuQueryMode; exports.Syncer = _chunk2VEHSKNAjs.Syncer; exports.TargetNotFoundException = _chunk2VEHSKNAjs.TargetNotFoundException; exports.TemplateKey = _chunk2VEHSKNAjs.TemplateKey; exports.TemplateOptions = _chunk2VEHSKNAjs.TemplateOptions; exports.UnauthorizedException = _chunk2VEHSKNAjs.UnauthorizedException; exports.UpsertBuilder = _chunkGHF56FO6js.UpsertBuilder; exports.api = _chunk2VEHSKNAjs.api; exports.apiParamToTsCode = _chunk2VEHSKNAjs.apiParamToTsCode; exports.apiParamTypeToTsType = _chunk2VEHSKNAjs.apiParamTypeToTsType; exports.asArray = _chunk2VEHSKNAjs.asArray; exports.findApiRootPath = _chunk2VEHSKNAjs.findApiRootPath; exports.findAppRootPath = _chunk2VEHSKNAjs.findAppRootPath; exports.getTextTypeLength = _chunk2VEHSKNAjs.getTextTypeLength; exports.getZodObjectFromApi = _chunk2VEHSKNAjs.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunk2VEHSKNAjs.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunk2VEHSKNAjs.getZodTypeFromApiParamType; exports.globAsync = _chunk2VEHSKNAjs.globAsync; exports.hydrate = _chunk2VEHSKNAjs.hydrate; exports.i = i; exports.importMultiple = _chunk2VEHSKNAjs.importMultiple; exports.isBelongsToOneRelationProp = _chunk2VEHSKNAjs.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunk2VEHSKNAjs.isBigIntegerProp; exports.isBooleanProp = _chunk2VEHSKNAjs.isBooleanProp; exports.isCustomJoinClause = _chunk2VEHSKNAjs.isCustomJoinClause; exports.isDaemonServer = _chunk2VEHSKNAjs.isDaemonServer; exports.isDateProp = _chunk2VEHSKNAjs.isDateProp; exports.isDateTimeProp = _chunk2VEHSKNAjs.isDateTimeProp; exports.isDecimalProp = _chunk2VEHSKNAjs.isDecimalProp; exports.isDevelopment = _chunk2VEHSKNAjs.isDevelopment; exports.isDoubleProp = _chunk2VEHSKNAjs.isDoubleProp; exports.isEnumProp = _chunk2VEHSKNAjs.isEnumProp; exports.isFloatProp = _chunk2VEHSKNAjs.isFloatProp; exports.isHasManyRelationProp = _chunk2VEHSKNAjs.isHasManyRelationProp; exports.isInDocker = _chunk2VEHSKNAjs.isInDocker; exports.isIntegerProp = _chunk2VEHSKNAjs.isIntegerProp; exports.isJsonProp = _chunk2VEHSKNAjs.isJsonProp; exports.isKnexError = _chunk2VEHSKNAjs.isKnexError; exports.isKyselyError = _chunk2VEHSKNAjs.isKyselyError; exports.isLocal = _chunk2VEHSKNAjs.isLocal; exports.isManyToManyRelationProp = _chunk2VEHSKNAjs.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunk2VEHSKNAjs.isOneToOneRelationProp; exports.isProduction = _chunk2VEHSKNAjs.isProduction; exports.isRefField = _chunkGHF56FO6js.isRefField; exports.isRelationProp = _chunk2VEHSKNAjs.isRelationProp; exports.isRemote = _chunk2VEHSKNAjs.isRemote; exports.isSoException = _chunk2VEHSKNAjs.isSoException; exports.isStaging = _chunk2VEHSKNAjs.isStaging; exports.isStringProp = _chunk2VEHSKNAjs.isStringProp; exports.isTest = _chunk2VEHSKNAjs.isTest; exports.isTextProp = _chunk2VEHSKNAjs.isTextProp; exports.isTimeProp = _chunk2VEHSKNAjs.isTimeProp; exports.isTimestampProp = _chunk2VEHSKNAjs.isTimestampProp; exports.isUuidProp = _chunk2VEHSKNAjs.isUuidProp; exports.isVirtualProp = _chunk2VEHSKNAjs.isVirtualProp; exports.nonNullable = _chunk2VEHSKNAjs.nonNullable; exports.objToMap = _chunk2VEHSKNAjs.objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunk2VEHSKNAjs.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunk2VEHSKNAjs.propToZodTypeDef; exports.registeredApis = _chunk2VEHSKNAjs.registeredApis; exports.serializeZodType = _chunk2VEHSKNAjs.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunk2VEHSKNAjs.unwrapPromiseOnce; exports.zArrayable = _chunk2VEHSKNAjs.zArrayable; exports.zodTypeToTsTypeDef = _chunk2VEHSKNAjs.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunk2VEHSKNAjs.zodTypeToZodCode;
|
|
418
418
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
FixtureManager,
|
|
3
3
|
FixtureManagerClass,
|
|
4
4
|
Migrator
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-OTL37JQ4.mjs";
|
|
6
6
|
import {
|
|
7
7
|
UpsertBuilder,
|
|
8
8
|
isRefField
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AK547YMV.mjs";
|
|
10
10
|
import {
|
|
11
11
|
AlreadyProcessedException,
|
|
12
12
|
ApiParamType,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
zArrayable,
|
|
89
89
|
zodTypeToTsTypeDef,
|
|
90
90
|
zodTypeToZodCode
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-IV7ZWWBN.mjs";
|
|
92
92
|
import "./chunk-PTFDTOJU.mjs";
|
|
93
93
|
|
|
94
94
|
// src/exceptions/error-handler.ts
|
package/package.json
CHANGED
|
@@ -72,7 +72,7 @@ export class Template__generated extends Template {
|
|
|
72
72
|
}
|
|
73
73
|
return {
|
|
74
74
|
lines: [...result!.lines, `// ${ts.label}`, ...ts.lines, ""],
|
|
75
|
-
importKeys: _.uniq([...result!.importKeys, ...ts.importKeys]),
|
|
75
|
+
importKeys: _.uniq([...result!.importKeys, ...ts.importKeys].sort()),
|
|
76
76
|
};
|
|
77
77
|
},
|
|
78
78
|
{
|