sonamu 0.2.53 → 0.2.54
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 +48 -48
- package/dist/bin/cli.mjs +1 -1
- package/dist/{chunk-5UCV2JP3.js → chunk-JOHF7PK4.js} +14 -1
- package/dist/chunk-JOHF7PK4.js.map +1 -0
- package/dist/{chunk-XTNCGTDO.mjs → chunk-L4KELCY7.mjs} +14 -1
- package/dist/chunk-L4KELCY7.mjs.map +1 -0
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/api/code-converters.ts +19 -0
- package/dist/chunk-5UCV2JP3.js.map +0 -1
- package/dist/chunk-XTNCGTDO.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
var
|
|
83
|
+
var _chunkJOHF7PK4js = require('./chunk-JOHF7PK4.js');
|
|
84
84
|
|
|
85
85
|
// src/exceptions/error-handler.ts
|
|
86
86
|
function setupErrorHandler(server) {
|
|
87
87
|
server.setErrorHandler((error, request, reply) => {
|
|
88
88
|
_nullishCoalesce(error.statusCode, () => ( (error.statusCode = 400)));
|
|
89
|
-
if (
|
|
89
|
+
if (_chunkJOHF7PK4js.isSoException.call(void 0, error) && error.payload && Array.isArray(error.payload)) {
|
|
90
90
|
const issues = error.payload;
|
|
91
91
|
const [issue] = issues;
|
|
92
92
|
const message = `${issue.message} (${issue.path.join("/")})`;
|
|
@@ -423,5 +423,5 @@ function unique(columns) {
|
|
|
423
423
|
|
|
424
424
|
|
|
425
425
|
|
|
426
|
-
exports.AlreadyProcessedException =
|
|
426
|
+
exports.AlreadyProcessedException = _chunkJOHF7PK4js.AlreadyProcessedException; exports.ApiParamType = _chunkJOHF7PK4js.ApiParamType; exports.BadRequestException = _chunkJOHF7PK4js.BadRequestException; exports.BaseModel = _chunkJOHF7PK4js.BaseModel; exports.BaseModelClass = _chunkJOHF7PK4js.BaseModelClass; exports.DB = _chunkJOHF7PK4js.DB; exports.DuplicateRowException = _chunkJOHF7PK4js.DuplicateRowException; exports.Entity = _chunkJOHF7PK4js.Entity; exports.EntityManager = _chunkJOHF7PK4js.EntityManager; exports.FixtureManager = _chunkJOHF7PK4js.FixtureManager; exports.FixtureManagerClass = _chunkJOHF7PK4js.FixtureManagerClass; exports.GenerateOptions = _chunkJOHF7PK4js.GenerateOptions; exports.InternalServerErrorException = _chunkJOHF7PK4js.InternalServerErrorException; exports.Migrator = _chunkJOHF7PK4js.Migrator; exports.NotFoundException = _chunkJOHF7PK4js.NotFoundException; exports.PathAndCode = _chunkJOHF7PK4js.PathAndCode; exports.RenderingNode = _chunkJOHF7PK4js.RenderingNode; exports.SQLDateTimeString = _chunkJOHF7PK4js.SQLDateTimeString; exports.ServiceUnavailableException = _chunkJOHF7PK4js.ServiceUnavailableException; exports.SoException = _chunkJOHF7PK4js.SoException; exports.Sonamu = _chunkJOHF7PK4js.Sonamu; exports.SonamuQueryMode = _chunkJOHF7PK4js.SonamuQueryMode; exports.Syncer = _chunkJOHF7PK4js.Syncer; exports.TargetNotFoundException = _chunkJOHF7PK4js.TargetNotFoundException; exports.TemplateKey = _chunkJOHF7PK4js.TemplateKey; exports.TemplateOptions = _chunkJOHF7PK4js.TemplateOptions; exports.UnauthorizedException = _chunkJOHF7PK4js.UnauthorizedException; exports.UpsertBuilder = _chunkJOHF7PK4js.UpsertBuilder; exports.api = _chunkJOHF7PK4js.api; exports.apiParamToTsCode = _chunkJOHF7PK4js.apiParamToTsCode; exports.apiParamTypeToTsType = _chunkJOHF7PK4js.apiParamTypeToTsType; exports.asArray = asArray; exports.findApiRootPath = _chunkJOHF7PK4js.findApiRootPath; exports.findAppRootPath = _chunkJOHF7PK4js.findAppRootPath; exports.getTextTypeLength = _chunkJOHF7PK4js.getTextTypeLength; exports.getZodObjectFromApi = _chunkJOHF7PK4js.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunkJOHF7PK4js.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunkJOHF7PK4js.getZodTypeFromApiParamType; exports.globAsync = _chunkJOHF7PK4js.globAsync; exports.i = i; exports.importMultiple = _chunkJOHF7PK4js.importMultiple; exports.isBelongsToOneRelationProp = _chunkJOHF7PK4js.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunkJOHF7PK4js.isBigIntegerProp; exports.isBooleanProp = _chunkJOHF7PK4js.isBooleanProp; exports.isCustomJoinClause = _chunkJOHF7PK4js.isCustomJoinClause; exports.isDaemonServer = _chunkJOHF7PK4js.isDaemonServer; exports.isDateProp = _chunkJOHF7PK4js.isDateProp; exports.isDateTimeProp = _chunkJOHF7PK4js.isDateTimeProp; exports.isDecimalProp = _chunkJOHF7PK4js.isDecimalProp; exports.isDevelopment = _chunkJOHF7PK4js.isDevelopment; exports.isDoubleProp = _chunkJOHF7PK4js.isDoubleProp; exports.isEnumProp = _chunkJOHF7PK4js.isEnumProp; exports.isFloatProp = _chunkJOHF7PK4js.isFloatProp; exports.isHasManyRelationProp = _chunkJOHF7PK4js.isHasManyRelationProp; exports.isInDocker = _chunkJOHF7PK4js.isInDocker; exports.isIntegerProp = _chunkJOHF7PK4js.isIntegerProp; exports.isJsonProp = _chunkJOHF7PK4js.isJsonProp; exports.isKnexError = _chunkJOHF7PK4js.isKnexError; exports.isLocal = _chunkJOHF7PK4js.isLocal; exports.isManyToManyRelationProp = _chunkJOHF7PK4js.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunkJOHF7PK4js.isOneToOneRelationProp; exports.isProduction = _chunkJOHF7PK4js.isProduction; exports.isRefField = _chunkJOHF7PK4js.isRefField; exports.isRelationProp = _chunkJOHF7PK4js.isRelationProp; exports.isRemote = _chunkJOHF7PK4js.isRemote; exports.isSoException = _chunkJOHF7PK4js.isSoException; exports.isStaging = _chunkJOHF7PK4js.isStaging; exports.isStringProp = _chunkJOHF7PK4js.isStringProp; exports.isTest = _chunkJOHF7PK4js.isTest; exports.isTextProp = _chunkJOHF7PK4js.isTextProp; exports.isTimeProp = _chunkJOHF7PK4js.isTimeProp; exports.isTimestampProp = _chunkJOHF7PK4js.isTimestampProp; exports.isUuidProp = _chunkJOHF7PK4js.isUuidProp; exports.isVirtualProp = _chunkJOHF7PK4js.isVirtualProp; exports.nonNullable = _chunkJOHF7PK4js.nonNullable; exports.objToMap = objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunkJOHF7PK4js.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunkJOHF7PK4js.propToZodTypeDef; exports.registeredApis = _chunkJOHF7PK4js.registeredApis; exports.serializeZodType = _chunkJOHF7PK4js.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunkJOHF7PK4js.unwrapPromiseOnce; exports.zArrayable = _chunkJOHF7PK4js.zArrayable; exports.zodTypeToTsTypeDef = _chunkJOHF7PK4js.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunkJOHF7PK4js.zodTypeToZodCode;
|
|
427
427
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -174,6 +174,25 @@ export function getZodTypeFromApiParamType(
|
|
|
174
174
|
t: string;
|
|
175
175
|
types: ApiParamType[];
|
|
176
176
|
};
|
|
177
|
+
// nullable 유니온
|
|
178
|
+
if (
|
|
179
|
+
unionType.types.length === 2 &&
|
|
180
|
+
unionType.types.some((type) => type === "null")
|
|
181
|
+
) {
|
|
182
|
+
if (unionType.types[0] === "null") {
|
|
183
|
+
return getZodTypeFromApiParamType(
|
|
184
|
+
unionType.types[1],
|
|
185
|
+
references
|
|
186
|
+
).nullable();
|
|
187
|
+
} else {
|
|
188
|
+
return getZodTypeFromApiParamType(
|
|
189
|
+
unionType.types[0],
|
|
190
|
+
references
|
|
191
|
+
).nullable();
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// 일반 유니온
|
|
177
196
|
return z.union(
|
|
178
197
|
unionType.types.map((type) =>
|
|
179
198
|
getZodTypeFromApiParamType(type, references)
|