sonamu 0.2.41 → 0.2.43

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.js CHANGED
@@ -79,13 +79,13 @@
79
79
 
80
80
 
81
81
 
82
- var _chunkBNFMNGGYjs = require('./chunk-BNFMNGGY.js');
82
+ var _chunkCOTJCJ2Ojs = require('./chunk-COTJCJ2O.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 (_chunkBNFMNGGYjs.isSoException.call(void 0, error) && error.payload && Array.isArray(error.payload)) {
88
+ if (_chunkCOTJCJ2Ojs.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 = _chunkBNFMNGGYjs.AlreadyProcessedException; exports.ApiParamType = _chunkBNFMNGGYjs.ApiParamType; exports.BadRequestException = _chunkBNFMNGGYjs.BadRequestException; exports.BaseModel = _chunkBNFMNGGYjs.BaseModel; exports.BaseModelClass = _chunkBNFMNGGYjs.BaseModelClass; exports.DB = _chunkBNFMNGGYjs.DB; exports.DuplicateRowException = _chunkBNFMNGGYjs.DuplicateRowException; exports.EntityManager = _chunkBNFMNGGYjs.EntityManager; exports.FixtureManager = _chunkBNFMNGGYjs.FixtureManager; exports.FixtureManagerClass = _chunkBNFMNGGYjs.FixtureManagerClass; exports.GenerateOptions = _chunkBNFMNGGYjs.GenerateOptions; exports.InternalServerErrorException = _chunkBNFMNGGYjs.InternalServerErrorException; exports.Migrator = _chunkBNFMNGGYjs.Migrator; exports.NotFoundException = _chunkBNFMNGGYjs.NotFoundException; exports.PathAndCode = _chunkBNFMNGGYjs.PathAndCode; exports.RenderingNode = _chunkBNFMNGGYjs.RenderingNode; exports.SQLDateTimeString = _chunkBNFMNGGYjs.SQLDateTimeString; exports.ServiceUnavailableException = _chunkBNFMNGGYjs.ServiceUnavailableException; exports.SoException = _chunkBNFMNGGYjs.SoException; exports.Sonamu = _chunkBNFMNGGYjs.Sonamu; exports.SonamuQueryMode = _chunkBNFMNGGYjs.SonamuQueryMode; exports.Syncer = _chunkBNFMNGGYjs.Syncer; exports.TargetNotFoundException = _chunkBNFMNGGYjs.TargetNotFoundException; exports.TemplateKey = _chunkBNFMNGGYjs.TemplateKey; exports.TemplateOptions = _chunkBNFMNGGYjs.TemplateOptions; exports.UnauthorizedException = _chunkBNFMNGGYjs.UnauthorizedException; exports.UpsertBuilder = _chunkBNFMNGGYjs.UpsertBuilder; exports.api = _chunkBNFMNGGYjs.api; exports.apiParamToTsCode = _chunkBNFMNGGYjs.apiParamToTsCode; exports.apiParamTypeToTsType = _chunkBNFMNGGYjs.apiParamTypeToTsType; exports.asArray = asArray; exports.findApiRootPath = _chunkBNFMNGGYjs.findApiRootPath; exports.findAppRootPath = _chunkBNFMNGGYjs.findAppRootPath; exports.getTextTypeLength = _chunkBNFMNGGYjs.getTextTypeLength; exports.getZodObjectFromApi = _chunkBNFMNGGYjs.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunkBNFMNGGYjs.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunkBNFMNGGYjs.getZodTypeFromApiParamType; exports.globAsync = _chunkBNFMNGGYjs.globAsync; exports.i = i; exports.importMultiple = _chunkBNFMNGGYjs.importMultiple; exports.isBelongsToOneRelationProp = _chunkBNFMNGGYjs.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunkBNFMNGGYjs.isBigIntegerProp; exports.isBooleanProp = _chunkBNFMNGGYjs.isBooleanProp; exports.isCustomJoinClause = _chunkBNFMNGGYjs.isCustomJoinClause; exports.isDaemonServer = _chunkBNFMNGGYjs.isDaemonServer; exports.isDateProp = _chunkBNFMNGGYjs.isDateProp; exports.isDateTimeProp = _chunkBNFMNGGYjs.isDateTimeProp; exports.isDecimalProp = _chunkBNFMNGGYjs.isDecimalProp; exports.isDevelopment = _chunkBNFMNGGYjs.isDevelopment; exports.isDoubleProp = _chunkBNFMNGGYjs.isDoubleProp; exports.isEnumProp = _chunkBNFMNGGYjs.isEnumProp; exports.isFloatProp = _chunkBNFMNGGYjs.isFloatProp; exports.isHasManyRelationProp = _chunkBNFMNGGYjs.isHasManyRelationProp; exports.isInDocker = _chunkBNFMNGGYjs.isInDocker; exports.isIntegerProp = _chunkBNFMNGGYjs.isIntegerProp; exports.isJsonProp = _chunkBNFMNGGYjs.isJsonProp; exports.isKnexError = _chunkBNFMNGGYjs.isKnexError; exports.isLocal = _chunkBNFMNGGYjs.isLocal; exports.isManyToManyRelationProp = _chunkBNFMNGGYjs.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunkBNFMNGGYjs.isOneToOneRelationProp; exports.isProduction = _chunkBNFMNGGYjs.isProduction; exports.isRefField = _chunkBNFMNGGYjs.isRefField; exports.isRelationProp = _chunkBNFMNGGYjs.isRelationProp; exports.isRemote = _chunkBNFMNGGYjs.isRemote; exports.isSoException = _chunkBNFMNGGYjs.isSoException; exports.isStaging = _chunkBNFMNGGYjs.isStaging; exports.isStringProp = _chunkBNFMNGGYjs.isStringProp; exports.isTest = _chunkBNFMNGGYjs.isTest; exports.isTextProp = _chunkBNFMNGGYjs.isTextProp; exports.isTimeProp = _chunkBNFMNGGYjs.isTimeProp; exports.isTimestampProp = _chunkBNFMNGGYjs.isTimestampProp; exports.isUuidProp = _chunkBNFMNGGYjs.isUuidProp; exports.isVirtualProp = _chunkBNFMNGGYjs.isVirtualProp; exports.nonNullable = _chunkBNFMNGGYjs.nonNullable; exports.objToMap = objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunkBNFMNGGYjs.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunkBNFMNGGYjs.propToZodTypeDef; exports.registeredApis = _chunkBNFMNGGYjs.registeredApis; exports.serializeZodType = _chunkBNFMNGGYjs.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunkBNFMNGGYjs.unwrapPromiseOnce; exports.zArrayable = _chunkBNFMNGGYjs.zArrayable; exports.zodTypeToTsTypeDef = _chunkBNFMNGGYjs.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunkBNFMNGGYjs.zodTypeToZodCode;
424
+ exports.AlreadyProcessedException = _chunkCOTJCJ2Ojs.AlreadyProcessedException; exports.ApiParamType = _chunkCOTJCJ2Ojs.ApiParamType; exports.BadRequestException = _chunkCOTJCJ2Ojs.BadRequestException; exports.BaseModel = _chunkCOTJCJ2Ojs.BaseModel; exports.BaseModelClass = _chunkCOTJCJ2Ojs.BaseModelClass; exports.DB = _chunkCOTJCJ2Ojs.DB; exports.DuplicateRowException = _chunkCOTJCJ2Ojs.DuplicateRowException; exports.EntityManager = _chunkCOTJCJ2Ojs.EntityManager; exports.FixtureManager = _chunkCOTJCJ2Ojs.FixtureManager; exports.FixtureManagerClass = _chunkCOTJCJ2Ojs.FixtureManagerClass; exports.GenerateOptions = _chunkCOTJCJ2Ojs.GenerateOptions; exports.InternalServerErrorException = _chunkCOTJCJ2Ojs.InternalServerErrorException; exports.Migrator = _chunkCOTJCJ2Ojs.Migrator; exports.NotFoundException = _chunkCOTJCJ2Ojs.NotFoundException; exports.PathAndCode = _chunkCOTJCJ2Ojs.PathAndCode; exports.RenderingNode = _chunkCOTJCJ2Ojs.RenderingNode; exports.SQLDateTimeString = _chunkCOTJCJ2Ojs.SQLDateTimeString; exports.ServiceUnavailableException = _chunkCOTJCJ2Ojs.ServiceUnavailableException; exports.SoException = _chunkCOTJCJ2Ojs.SoException; exports.Sonamu = _chunkCOTJCJ2Ojs.Sonamu; exports.SonamuQueryMode = _chunkCOTJCJ2Ojs.SonamuQueryMode; exports.Syncer = _chunkCOTJCJ2Ojs.Syncer; exports.TargetNotFoundException = _chunkCOTJCJ2Ojs.TargetNotFoundException; exports.TemplateKey = _chunkCOTJCJ2Ojs.TemplateKey; exports.TemplateOptions = _chunkCOTJCJ2Ojs.TemplateOptions; exports.UnauthorizedException = _chunkCOTJCJ2Ojs.UnauthorizedException; exports.UpsertBuilder = _chunkCOTJCJ2Ojs.UpsertBuilder; exports.api = _chunkCOTJCJ2Ojs.api; exports.apiParamToTsCode = _chunkCOTJCJ2Ojs.apiParamToTsCode; exports.apiParamTypeToTsType = _chunkCOTJCJ2Ojs.apiParamTypeToTsType; exports.asArray = asArray; exports.findApiRootPath = _chunkCOTJCJ2Ojs.findApiRootPath; exports.findAppRootPath = _chunkCOTJCJ2Ojs.findAppRootPath; exports.getTextTypeLength = _chunkCOTJCJ2Ojs.getTextTypeLength; exports.getZodObjectFromApi = _chunkCOTJCJ2Ojs.getZodObjectFromApi; exports.getZodObjectFromApiParams = _chunkCOTJCJ2Ojs.getZodObjectFromApiParams; exports.getZodTypeFromApiParamType = _chunkCOTJCJ2Ojs.getZodTypeFromApiParamType; exports.globAsync = _chunkCOTJCJ2Ojs.globAsync; exports.i = i; exports.importMultiple = _chunkCOTJCJ2Ojs.importMultiple; exports.isBelongsToOneRelationProp = _chunkCOTJCJ2Ojs.isBelongsToOneRelationProp; exports.isBigIntegerProp = _chunkCOTJCJ2Ojs.isBigIntegerProp; exports.isBooleanProp = _chunkCOTJCJ2Ojs.isBooleanProp; exports.isCustomJoinClause = _chunkCOTJCJ2Ojs.isCustomJoinClause; exports.isDaemonServer = _chunkCOTJCJ2Ojs.isDaemonServer; exports.isDateProp = _chunkCOTJCJ2Ojs.isDateProp; exports.isDateTimeProp = _chunkCOTJCJ2Ojs.isDateTimeProp; exports.isDecimalProp = _chunkCOTJCJ2Ojs.isDecimalProp; exports.isDevelopment = _chunkCOTJCJ2Ojs.isDevelopment; exports.isDoubleProp = _chunkCOTJCJ2Ojs.isDoubleProp; exports.isEnumProp = _chunkCOTJCJ2Ojs.isEnumProp; exports.isFloatProp = _chunkCOTJCJ2Ojs.isFloatProp; exports.isHasManyRelationProp = _chunkCOTJCJ2Ojs.isHasManyRelationProp; exports.isInDocker = _chunkCOTJCJ2Ojs.isInDocker; exports.isIntegerProp = _chunkCOTJCJ2Ojs.isIntegerProp; exports.isJsonProp = _chunkCOTJCJ2Ojs.isJsonProp; exports.isKnexError = _chunkCOTJCJ2Ojs.isKnexError; exports.isLocal = _chunkCOTJCJ2Ojs.isLocal; exports.isManyToManyRelationProp = _chunkCOTJCJ2Ojs.isManyToManyRelationProp; exports.isOneToOneRelationProp = _chunkCOTJCJ2Ojs.isOneToOneRelationProp; exports.isProduction = _chunkCOTJCJ2Ojs.isProduction; exports.isRefField = _chunkCOTJCJ2Ojs.isRefField; exports.isRelationProp = _chunkCOTJCJ2Ojs.isRelationProp; exports.isRemote = _chunkCOTJCJ2Ojs.isRemote; exports.isSoException = _chunkCOTJCJ2Ojs.isSoException; exports.isStaging = _chunkCOTJCJ2Ojs.isStaging; exports.isStringProp = _chunkCOTJCJ2Ojs.isStringProp; exports.isTest = _chunkCOTJCJ2Ojs.isTest; exports.isTextProp = _chunkCOTJCJ2Ojs.isTextProp; exports.isTimeProp = _chunkCOTJCJ2Ojs.isTimeProp; exports.isTimestampProp = _chunkCOTJCJ2Ojs.isTimestampProp; exports.isUuidProp = _chunkCOTJCJ2Ojs.isUuidProp; exports.isVirtualProp = _chunkCOTJCJ2Ojs.isVirtualProp; exports.nonNullable = _chunkCOTJCJ2Ojs.nonNullable; exports.objToMap = objToMap; exports.p = p; exports.propNodeToZodTypeDef = _chunkCOTJCJ2Ojs.propNodeToZodTypeDef; exports.propToZodTypeDef = _chunkCOTJCJ2Ojs.propToZodTypeDef; exports.registeredApis = _chunkCOTJCJ2Ojs.registeredApis; exports.serializeZodType = _chunkCOTJCJ2Ojs.serializeZodType; exports.setupErrorHandler = setupErrorHandler; exports.unwrapPromiseOnce = _chunkCOTJCJ2Ojs.unwrapPromiseOnce; exports.zArrayable = _chunkCOTJCJ2Ojs.zArrayable; exports.zodTypeToTsTypeDef = _chunkCOTJCJ2Ojs.zodTypeToTsTypeDef; exports.zodTypeToZodCode = _chunkCOTJCJ2Ojs.zodTypeToZodCode;
425
425
  //# 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-D7R7DOVD.mjs";
83
+ } from "./chunk-5B6LB6JU.mjs";
84
84
  import "./chunk-JXJTFHF7.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.41",
3
+ "version": "0.2.43",
4
4
  "description": "Sonamu — TypeScript Fullstack API Framework",
5
5
  "keywords": [
6
6
  "typescript",
package/src/api/sonamu.ts CHANGED
@@ -16,6 +16,7 @@ import { findApiRootPath } from "../utils/utils";
16
16
  import path from "path";
17
17
  import fs from "fs-extra";
18
18
  import { ApiDecoratorOptions } from "./decorators";
19
+ import { attachOnDuplicateUpdate } from "../database/knex-plugins/knex-on-duplicate-update";
19
20
 
20
21
  export type SonamuConfig = {
21
22
  api: {
@@ -138,6 +139,7 @@ class SonamuClass {
138
139
  // DB 로드
139
140
  this.dbConfig = await DB.readKnexfile();
140
141
  !doSilent && console.log(chalk.green("DB Config Loaded!"));
142
+ attachOnDuplicateUpdate();
141
143
 
142
144
  // Entity 로드
143
145
  await EntityManager.autoload(doSilent);
@@ -1,8 +1,6 @@
1
1
  import { DateTime } from "luxon";
2
2
  import { Knex } from "knex";
3
- import _, { once } from "lodash";
4
- import { attachOnDuplicateUpdate } from "./knex-plugins/knex-on-duplicate-update";
5
- once(() => attachOnDuplicateUpdate());
3
+ import _ from "lodash";
6
4
  import { DBPreset, DB } from "./db";
7
5
  import { isCustomJoinClause, SubsetQuery } from "../types/types";
8
6
  import { BaseListParams } from "../utils/model";