sonamu 0.2.44 → 0.2.46
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/.pnp.cjs +12 -12
- package/dist/bin/cli.js +48 -48
- package/dist/{chunk-EYNTBWQC.js → chunk-77XBF27L.js} +1 -2
- package/dist/chunk-77XBF27L.js.map +1 -0
- package/dist/index.js +3 -3
- package/package.json +6 -19
- package/tsup.config.js +4 -1
- package/dist/bin/cli-wrapper.d.mts +0 -1
- package/dist/bin/cli-wrapper.mjs +0 -34
- package/dist/bin/cli-wrapper.mjs.map +0 -1
- package/dist/bin/cli.d.mts +0 -2
- package/dist/bin/cli.mjs +0 -887
- package/dist/bin/cli.mjs.map +0 -1
- package/dist/chunk-EYNTBWQC.js.map +0 -1
- package/dist/chunk-FOD6BJQJ.mjs +0 -7447
- package/dist/chunk-FOD6BJQJ.mjs.map +0 -1
- package/dist/chunk-JXJTFHF7.mjs +0 -20
- package/dist/chunk-JXJTFHF7.mjs.map +0 -1
- package/dist/index.d.mts +0 -1419
- package/dist/index.mjs +0 -427
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
var
|
|
82
|
+
var _chunk77XBF27Ljs = require('./chunk-77XBF27L.js');
|
|
83
83
|
|
|
84
84
|
// src/exceptions/error-handler.ts
|
|
85
85
|
function setupErrorHandler(server) {
|
|
86
86
|
server.setErrorHandler((error, request, reply) => {
|
|
87
87
|
_nullishCoalesce(error.statusCode, () => ( (error.statusCode = 400)));
|
|
88
|
-
if (
|
|
88
|
+
if (_chunk77XBF27Ljs.isSoException.call(void 0, error) && error.payload && Array.isArray(error.payload)) {
|
|
89
89
|
const issues = error.payload;
|
|
90
90
|
const [issue] = issues;
|
|
91
91
|
const message = `${issue.message} (${issue.path.join("/")})`;
|
|
@@ -421,5 +421,5 @@ function unique(columns) {
|
|
|
421
421
|
|
|
422
422
|
|
|
423
423
|
|
|
424
|
-
exports.AlreadyProcessedException =
|
|
424
|
+
exports.AlreadyProcessedException = _chunk77XBF27Ljs.AlreadyProcessedException; exports.ApiParamType = _chunk77XBF27Ljs.ApiParamType; exports.BadRequestException = _chunk77XBF27Ljs.BadRequestException; exports.BaseModel = _chunk77XBF27Ljs.BaseModel; exports.BaseModelClass = _chunk77XBF27Ljs.BaseModelClass; exports.DB = _chunk77XBF27Ljs.DB; exports.DuplicateRowException = _chunk77XBF27Ljs.DuplicateRowException; exports.EntityManager = _chunk77XBF27Ljs.EntityManager; exports.FixtureManager = _chunk77XBF27Ljs.FixtureManager; exports.FixtureManagerClass = _chunk77XBF27Ljs.FixtureManagerClass; exports.GenerateOptions = _chunk77XBF27Ljs.GenerateOptions; exports.InternalServerErrorException = _chunk77XBF27Ljs.InternalServerErrorException; exports.Migrator = _chunk77XBF27Ljs.Migrator; exports.NotFoundException = _chunk77XBF27Ljs.NotFoundException; exports.PathAndCode = _chunk77XBF27Ljs.PathAndCode; exports.RenderingNode = _chunk77XBF27Ljs.RenderingNode; exports.SQLDateTimeString = _chunk77XBF27Ljs.SQLDateTimeString; exports.ServiceUnavailableException = _chunk77XBF27Ljs.ServiceUnavailableException; exports.SoException = _chunk77XBF27Ljs.SoException; exports.Sonamu = _chunk77XBF27Ljs.Sonamu; exports.SonamuQueryMode = _chunk77XBF27Ljs.SonamuQueryMode; exports.Syncer = _chunk77XBF27Ljs.Syncer; exports.TargetNotFoundException = _chunk77XBF27Ljs.TargetNotFoundException; exports.TemplateKey = _chunk77XBF27Ljs.TemplateKey; exports.TemplateOptions = _chunk77XBF27Ljs.TemplateOptions; exports.UnauthorizedException = _chunk77XBF27Ljs.UnauthorizedException; exports.UpsertBuilder = _chunk77XBF27Ljs.UpsertBuilder; exports.api = _chunk77XBF27Ljs.api; exports.apiParamToTsCode = _chunk77XBF27Ljs.apiParamToTsCode; exports.apiParamTypeToTsType = _chunk77XBF27Ljs.apiParamTypeToTsType; exports.asArray = asArray; exports.findApiRootPath = _chunk77XBF27Ljs.findApiRootPath; exports.findAppRootPath = _chunk77XBF27Ljs.findAppRootPath; exports.getTextTypeLength = _chunk77XBF27Ljs.getTextTypeLength; exports.getZodObjectFromApi = _chunk77XBF27Ljs.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunk77XBF27Ljs.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunk77XBF27Ljs.getZodTypeFromApiParamType; exports.globAsync = _chunk77XBF27Ljs.globAsync; exports.i = i; exports.importMultiple = _chunk77XBF27Ljs.importMultiple; exports.isBelongsToOneRelationProp = _chunk77XBF27Ljs.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunk77XBF27Ljs.isBigIntegerProp; exports.isBooleanProp = _chunk77XBF27Ljs.isBooleanProp; exports.isCustomJoinClause = _chunk77XBF27Ljs.isCustomJoinClause; exports.isDaemonServer = _chunk77XBF27Ljs.isDaemonServer; exports.isDateProp = _chunk77XBF27Ljs.isDateProp; exports.isDateTimeProp = _chunk77XBF27Ljs.isDateTimeProp; exports.isDecimalProp = _chunk77XBF27Ljs.isDecimalProp; exports.isDevelopment = _chunk77XBF27Ljs.isDevelopment; exports.isDoubleProp = _chunk77XBF27Ljs.isDoubleProp; exports.isEnumProp = _chunk77XBF27Ljs.isEnumProp; exports.isFloatProp = _chunk77XBF27Ljs.isFloatProp; exports.isHasManyRelationProp = _chunk77XBF27Ljs.isHasManyRelationProp; exports.isInDocker = _chunk77XBF27Ljs.isInDocker; exports.isIntegerProp = _chunk77XBF27Ljs.isIntegerProp; exports.isJsonProp = _chunk77XBF27Ljs.isJsonProp; exports.isKnexError = _chunk77XBF27Ljs.isKnexError; exports.isLocal = _chunk77XBF27Ljs.isLocal; exports.isManyToManyRelationProp = _chunk77XBF27Ljs.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunk77XBF27Ljs.isOneToOneRelationProp; exports.isProduction = _chunk77XBF27Ljs.isProduction; exports.isRefField = _chunk77XBF27Ljs.isRefField; exports.isRelationProp = _chunk77XBF27Ljs.isRelationProp; exports.isRemote = _chunk77XBF27Ljs.isRemote; exports.isSoException = _chunk77XBF27Ljs.isSoException; exports.isStaging = _chunk77XBF27Ljs.isStaging; exports.isStringProp = _chunk77XBF27Ljs.isStringProp; exports.isTest = _chunk77XBF27Ljs.isTest; exports.isTextProp = _chunk77XBF27Ljs.isTextProp; exports.isTimeProp = _chunk77XBF27Ljs.isTimeProp; exports.isTimestampProp = _chunk77XBF27Ljs.isTimestampProp; exports.isUuidProp = _chunk77XBF27Ljs.isUuidProp; exports.isVirtualProp = _chunk77XBF27Ljs.isVirtualProp; exports.nonNullable = _chunk77XBF27Ljs.nonNullable; exports.objToMap = objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunk77XBF27Ljs.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunk77XBF27Ljs.propToZodTypeDef; exports.registeredApis = _chunk77XBF27Ljs.registeredApis; exports.serializeZodType = _chunk77XBF27Ljs.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunk77XBF27Ljs.unwrapPromiseOnce; exports.zArrayable = _chunk77XBF27Ljs.zArrayable; exports.zodTypeToTsTypeDef = _chunk77XBF27Ljs.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunk77XBF27Ljs.zodTypeToZodCode;
|
|
425
425
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonamu",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.46",
|
|
4
4
|
"description": "Sonamu — TypeScript Fullstack API Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
7
7
|
"framework",
|
|
8
8
|
"orm"
|
|
9
9
|
],
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"import": {
|
|
13
|
-
"types": "./dist/index.d.mts",
|
|
14
|
-
"default": "./dist/index.mjs"
|
|
15
|
-
},
|
|
16
|
-
"require": {
|
|
17
|
-
"types": "./dist/index.d.ts",
|
|
18
|
-
"default": "./dist/index.js"
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
10
|
"main": "./dist/index.js",
|
|
23
|
-
"module": "./dist/index.mjs",
|
|
24
11
|
"scripts": {
|
|
25
12
|
"dev": "yarn tsc -w -p ./tsconfig.json",
|
|
26
13
|
"build": "tsup --config ./tsup.config.js"
|
|
@@ -35,7 +22,7 @@
|
|
|
35
22
|
"type": "git",
|
|
36
23
|
"url": "https://github.com/ping-alive/sonamu.git"
|
|
37
24
|
},
|
|
38
|
-
"bin": "./dist/bin/cli
|
|
25
|
+
"bin": "./dist/bin/cli.js",
|
|
39
26
|
"dependencies": {
|
|
40
27
|
"chalk": "^4.1.2",
|
|
41
28
|
"dotenv": "^16.0.2",
|
|
@@ -44,7 +31,7 @@
|
|
|
44
31
|
"fs-extra": "^10.1.0",
|
|
45
32
|
"glob": "^8.0.3",
|
|
46
33
|
"inflection": "^1.13.2",
|
|
47
|
-
"knex": "^
|
|
34
|
+
"knex": "^3.1.0",
|
|
48
35
|
"lodash": "^4.17.21",
|
|
49
36
|
"luxon": "^3.0.3",
|
|
50
37
|
"mysql2": "^3.6.1",
|
|
@@ -72,9 +59,9 @@
|
|
|
72
59
|
"typescript": "^5.2.2"
|
|
73
60
|
},
|
|
74
61
|
"peerDependencies": {
|
|
75
|
-
"fastify": "^4.
|
|
76
|
-
"knex": "^
|
|
77
|
-
"mysql2": "^
|
|
62
|
+
"fastify": "^4.23.2",
|
|
63
|
+
"knex": "^3.1.0",
|
|
64
|
+
"mysql2": "^3.6.1"
|
|
78
65
|
},
|
|
79
66
|
"packageManager": "yarn@3.6.3"
|
|
80
67
|
}
|
package/tsup.config.js
CHANGED
|
@@ -4,7 +4,10 @@ import { defineConfig } from "tsup";
|
|
|
4
4
|
export default defineConfig({
|
|
5
5
|
entry: ["src/index.ts", "src/bin/cli.ts", "src/bin/cli-wrapper.ts"],
|
|
6
6
|
dts: true,
|
|
7
|
-
format: [
|
|
7
|
+
format: [
|
|
8
|
+
// "esm",
|
|
9
|
+
"cjs",
|
|
10
|
+
],
|
|
8
11
|
target: "es2020",
|
|
9
12
|
clean: true,
|
|
10
13
|
sourcemap: true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ts-node
|
package/dist/bin/cli-wrapper.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ts-node
|
|
2
|
-
const require = (await import('module')).createRequire(import.meta.url);
|
|
3
|
-
import {
|
|
4
|
-
__dirname
|
|
5
|
-
} from "../chunk-JXJTFHF7.mjs";
|
|
6
|
-
|
|
7
|
-
// src/bin/cli-wrapper.ts
|
|
8
|
-
import { spawnSync } from "child_process";
|
|
9
|
-
import { resolve } from "path";
|
|
10
|
-
import { existsSync, readFileSync } from "fs";
|
|
11
|
-
var cjsPath = resolve(__dirname, "bin/cli.js");
|
|
12
|
-
var esmPath = resolve(__dirname, "bin/cli.mjs");
|
|
13
|
-
var isESM = () => {
|
|
14
|
-
const packageJsonPath = resolve(process.cwd(), "package.json");
|
|
15
|
-
if (existsSync(packageJsonPath)) {
|
|
16
|
-
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
17
|
-
return packageJson.type === "module";
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
};
|
|
21
|
-
var scriptPath = isESM() ? esmPath : cjsPath;
|
|
22
|
-
if (!existsSync(scriptPath)) {
|
|
23
|
-
console.error(`Error: Script not found at ${scriptPath}`);
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
var result = spawnSync(
|
|
27
|
-
process.execPath,
|
|
28
|
-
[scriptPath, ...process.argv.slice(2)],
|
|
29
|
-
{
|
|
30
|
-
stdio: "inherit"
|
|
31
|
-
}
|
|
32
|
-
);
|
|
33
|
-
process.exit(result.status ?? 1);
|
|
34
|
-
//# sourceMappingURL=cli-wrapper.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/bin/cli-wrapper.ts"],"sourcesContent":["#!/usr/bin/env ts-node\n\nimport { spawnSync } from \"child_process\";\nimport { resolve } from \"path\";\nimport { existsSync, readFileSync } from \"fs\";\n\nconst cjsPath = resolve(__dirname, \"bin/cli.js\");\nconst esmPath = resolve(__dirname, \"bin/cli.mjs\");\n\nconst isESM = () => {\n const packageJsonPath = resolve(process.cwd(), \"package.json\");\n if (existsSync(packageJsonPath)) {\n const packageJson = JSON.parse(readFileSync(packageJsonPath, \"utf-8\"));\n return packageJson.type === \"module\";\n }\n return false;\n};\n\nconst scriptPath = isESM() ? esmPath : cjsPath;\n\nif (!existsSync(scriptPath)) {\n console.error(`Error: Script not found at ${scriptPath}`);\n process.exit(1);\n}\n\nconst result = spawnSync(\n process.execPath,\n [scriptPath, ...process.argv.slice(2)],\n {\n stdio: \"inherit\",\n }\n);\n\nprocess.exit(result.status ?? 1);\n"],"mappings":";;;;;;;AAEA,SAAS,iBAAiB;AAC1B,SAAS,eAAe;AACxB,SAAS,YAAY,oBAAoB;AAEzC,IAAM,UAAU,QAAQ,WAAW,YAAY;AAC/C,IAAM,UAAU,QAAQ,WAAW,aAAa;AAEhD,IAAM,QAAQ,MAAM;AAClB,QAAM,kBAAkB,QAAQ,QAAQ,IAAI,GAAG,cAAc;AAC7D,MAAI,WAAW,eAAe,GAAG;AAC/B,UAAM,cAAc,KAAK,MAAM,aAAa,iBAAiB,OAAO,CAAC;AACrE,WAAO,YAAY,SAAS;AAAA,EAC9B;AACA,SAAO;AACT;AAEA,IAAM,aAAa,MAAM,IAAI,UAAU;AAEvC,IAAI,CAAC,WAAW,UAAU,GAAG;AAC3B,UAAQ,MAAM,8BAA8B,UAAU,EAAE;AACxD,UAAQ,KAAK,CAAC;AAChB;AAEA,IAAM,SAAS;AAAA,EACb,QAAQ;AAAA,EACR,CAAC,YAAY,GAAG,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,EACrC;AAAA,IACE,OAAO;AAAA,EACT;AACF;AAEA,QAAQ,KAAK,OAAO,UAAU,CAAC;","names":[]}
|
package/dist/bin/cli.d.mts
DELETED