sonamu 0.2.54 → 0.2.56

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/index.d.mts CHANGED
@@ -250,7 +250,7 @@ type KnexError = {
250
250
  sqlState: string;
251
251
  };
252
252
  declare function isKnexError(e: any): e is KnexError;
253
- type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "date" | "time" | "dateTime";
253
+ type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "set" | "date" | "time" | "dateTime";
254
254
  type MigrationColumn = {
255
255
  name: string;
256
256
  type: KnexColumnType;
package/dist/index.d.ts CHANGED
@@ -250,7 +250,7 @@ type KnexError = {
250
250
  sqlState: string;
251
251
  };
252
252
  declare function isKnexError(e: any): e is KnexError;
253
- type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "date" | "time" | "dateTime";
253
+ type KnexColumnType = "string" | "text" | "smalltext" | "mediumtext" | "longtext" | "integer" | "bigInteger" | "decimal" | "timestamp" | "boolean" | "foreign" | "uuid" | "json" | "float" | "set" | "date" | "time" | "dateTime";
254
254
  type MigrationColumn = {
255
255
  name: string;
256
256
  type: KnexColumnType;
package/dist/index.js CHANGED
@@ -80,13 +80,13 @@
80
80
 
81
81
 
82
82
 
83
- var _chunkJOHF7PK4js = require('./chunk-JOHF7PK4.js');
83
+ var _chunkV6CWU5VDjs = require('./chunk-V6CWU5VD.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 (_chunkJOHF7PK4js.isSoException.call(void 0, error) && error.payload && Array.isArray(error.payload)) {
89
+ if (_chunkV6CWU5VDjs.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 = _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;
426
+ exports.AlreadyProcessedException = _chunkV6CWU5VDjs.AlreadyProcessedException; exports.ApiParamType = _chunkV6CWU5VDjs.ApiParamType; exports.BadRequestException = _chunkV6CWU5VDjs.BadRequestException; exports.BaseModel = _chunkV6CWU5VDjs.BaseModel; exports.BaseModelClass = _chunkV6CWU5VDjs.BaseModelClass; exports.DB = _chunkV6CWU5VDjs.DB; exports.DuplicateRowException = _chunkV6CWU5VDjs.DuplicateRowException; exports.Entity = _chunkV6CWU5VDjs.Entity; exports.EntityManager = _chunkV6CWU5VDjs.EntityManager; exports.FixtureManager = _chunkV6CWU5VDjs.FixtureManager; exports.FixtureManagerClass = _chunkV6CWU5VDjs.FixtureManagerClass; exports.GenerateOptions = _chunkV6CWU5VDjs.GenerateOptions; exports.InternalServerErrorException = _chunkV6CWU5VDjs.InternalServerErrorException; exports.Migrator = _chunkV6CWU5VDjs.Migrator; exports.NotFoundException = _chunkV6CWU5VDjs.NotFoundException; exports.PathAndCode = _chunkV6CWU5VDjs.PathAndCode; exports.RenderingNode = _chunkV6CWU5VDjs.RenderingNode; exports.SQLDateTimeString = _chunkV6CWU5VDjs.SQLDateTimeString; exports.ServiceUnavailableException = _chunkV6CWU5VDjs.ServiceUnavailableException; exports.SoException = _chunkV6CWU5VDjs.SoException; exports.Sonamu = _chunkV6CWU5VDjs.Sonamu; exports.SonamuQueryMode = _chunkV6CWU5VDjs.SonamuQueryMode; exports.Syncer = _chunkV6CWU5VDjs.Syncer; exports.TargetNotFoundException = _chunkV6CWU5VDjs.TargetNotFoundException; exports.TemplateKey = _chunkV6CWU5VDjs.TemplateKey; exports.TemplateOptions = _chunkV6CWU5VDjs.TemplateOptions; exports.UnauthorizedException = _chunkV6CWU5VDjs.UnauthorizedException; exports.UpsertBuilder = _chunkV6CWU5VDjs.UpsertBuilder; exports.api = _chunkV6CWU5VDjs.api; exports.apiParamToTsCode = _chunkV6CWU5VDjs.apiParamToTsCode; exports.apiParamTypeToTsType = _chunkV6CWU5VDjs.apiParamTypeToTsType; exports.asArray = asArray; exports.findApiRootPath = _chunkV6CWU5VDjs.findApiRootPath; exports.findAppRootPath = _chunkV6CWU5VDjs.findAppRootPath; exports.getTextTypeLength = _chunkV6CWU5VDjs.getTextTypeLength; exports.getZodObjectFromApi = _chunkV6CWU5VDjs.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunkV6CWU5VDjs.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunkV6CWU5VDjs.getZodTypeFromApiParamType; exports.globAsync = _chunkV6CWU5VDjs.globAsync; exports.i = i; exports.importMultiple = _chunkV6CWU5VDjs.importMultiple; exports.isBelongsToOneRelationProp = _chunkV6CWU5VDjs.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunkV6CWU5VDjs.isBigIntegerProp; exports.isBooleanProp = _chunkV6CWU5VDjs.isBooleanProp; exports.isCustomJoinClause = _chunkV6CWU5VDjs.isCustomJoinClause; exports.isDaemonServer = _chunkV6CWU5VDjs.isDaemonServer; exports.isDateProp = _chunkV6CWU5VDjs.isDateProp; exports.isDateTimeProp = _chunkV6CWU5VDjs.isDateTimeProp; exports.isDecimalProp = _chunkV6CWU5VDjs.isDecimalProp; exports.isDevelopment = _chunkV6CWU5VDjs.isDevelopment; exports.isDoubleProp = _chunkV6CWU5VDjs.isDoubleProp; exports.isEnumProp = _chunkV6CWU5VDjs.isEnumProp; exports.isFloatProp = _chunkV6CWU5VDjs.isFloatProp; exports.isHasManyRelationProp = _chunkV6CWU5VDjs.isHasManyRelationProp; exports.isInDocker = _chunkV6CWU5VDjs.isInDocker; exports.isIntegerProp = _chunkV6CWU5VDjs.isIntegerProp; exports.isJsonProp = _chunkV6CWU5VDjs.isJsonProp; exports.isKnexError = _chunkV6CWU5VDjs.isKnexError; exports.isLocal = _chunkV6CWU5VDjs.isLocal; exports.isManyToManyRelationProp = _chunkV6CWU5VDjs.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunkV6CWU5VDjs.isOneToOneRelationProp; exports.isProduction = _chunkV6CWU5VDjs.isProduction; exports.isRefField = _chunkV6CWU5VDjs.isRefField; exports.isRelationProp = _chunkV6CWU5VDjs.isRelationProp; exports.isRemote = _chunkV6CWU5VDjs.isRemote; exports.isSoException = _chunkV6CWU5VDjs.isSoException; exports.isStaging = _chunkV6CWU5VDjs.isStaging; exports.isStringProp = _chunkV6CWU5VDjs.isStringProp; exports.isTest = _chunkV6CWU5VDjs.isTest; exports.isTextProp = _chunkV6CWU5VDjs.isTextProp; exports.isTimeProp = _chunkV6CWU5VDjs.isTimeProp; exports.isTimestampProp = _chunkV6CWU5VDjs.isTimestampProp; exports.isUuidProp = _chunkV6CWU5VDjs.isUuidProp; exports.isVirtualProp = _chunkV6CWU5VDjs.isVirtualProp; exports.nonNullable = _chunkV6CWU5VDjs.nonNullable; exports.objToMap = objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunkV6CWU5VDjs.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunkV6CWU5VDjs.propToZodTypeDef; exports.registeredApis = _chunkV6CWU5VDjs.registeredApis; exports.serializeZodType = _chunkV6CWU5VDjs.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunkV6CWU5VDjs.unwrapPromiseOnce; exports.zArrayable = _chunkV6CWU5VDjs.zArrayable; exports.zodTypeToTsTypeDef = _chunkV6CWU5VDjs.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunkV6CWU5VDjs.zodTypeToZodCode;
427
427
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -80,7 +80,7 @@ import {
80
80
  zArrayable,
81
81
  zodTypeToTsTypeDef,
82
82
  zodTypeToZodCode
83
- } from "./chunk-L4KELCY7.mjs";
83
+ } from "./chunk-RHSTOLSM.mjs";
84
84
  import "./chunk-PTFDTOJU.mjs";
85
85
 
86
86
  // src/exceptions/error-handler.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sonamu",
3
- "version": "0.2.54",
3
+ "version": "0.2.56",
4
4
  "description": "Sonamu — TypeScript Fullstack API Framework",
5
5
  "keywords": [
6
6
  "typescript",
@@ -318,7 +318,7 @@ export function propToZodTypeDef(
318
318
  return `// ${prop.name}: ${prop.relationType} ${prop.with}`;
319
319
  }
320
320
  } else {
321
- return "// unable to resolve";
321
+ return `// unable to resolve: ${JSON.stringify(prop)}`;
322
322
  }
323
323
 
324
324
  if ((prop as { unsigned?: boolean }).unsigned) {
@@ -1039,6 +1039,9 @@ export class Migrator {
1039
1039
  unsigned: true,
1040
1040
  }),
1041
1041
  };
1042
+ } else if (rawType.startsWith("set")) {
1043
+ const [, _rest] = rawType.match(/set\((.*)\)/) ?? [];
1044
+ return { type: "set" };
1042
1045
  }
1043
1046
  throw new Error(`resolve 불가능한 DB컬럼 타입 ${colType} ${rawType}`);
1044
1047
  }
@@ -392,6 +392,7 @@ export type KnexColumnType =
392
392
  | "uuid"
393
393
  | "json"
394
394
  | "float"
395
+ | "set"
395
396
  | "date"
396
397
  | "time"
397
398
  | "dateTime";