sonamu 0.5.0 → 0.5.2
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/api/context.d.ts +4 -1
- package/dist/api/context.d.ts.map +1 -1
- package/dist/api/decorators.d.ts.map +1 -1
- package/dist/api/decorators.js +1 -1
- package/dist/api/decorators.js.map +1 -1
- package/dist/api/sonamu.d.ts +7 -6
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +1 -1
- package/dist/api/sonamu.js.map +1 -1
- package/dist/bin/build-config.d.ts +4 -0
- package/dist/bin/build-config.d.ts.map +1 -1
- package/dist/bin/build-config.js +1 -1
- package/dist/bin/build-config.js.map +1 -1
- package/dist/bin/cli-wrapper.js +1 -1
- package/dist/bin/cli-wrapper.js.map +1 -1
- package/dist/bin/cli.js +1 -1
- package/dist/bin/cli.js.map +1 -1
- package/dist/database/base-model.d.ts +8 -1
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +1 -1
- package/dist/database/base-model.js.map +1 -1
- package/dist/database/db.d.ts +1 -0
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +1 -1
- package/dist/database/db.js.map +1 -1
- package/dist/file-storage/driver.d.ts +3 -0
- package/dist/file-storage/driver.d.ts.map +1 -1
- package/dist/file-storage/driver.js +1 -1
- package/dist/file-storage/driver.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/stream/index.d.ts +2 -0
- package/dist/stream/index.d.ts.map +1 -0
- package/dist/stream/index.js +2 -0
- package/dist/stream/index.js.map +1 -0
- package/dist/stream/sse.d.ts +13 -0
- package/dist/stream/sse.d.ts.map +1 -0
- package/dist/stream/sse.js +2 -0
- package/dist/stream/sse.js.map +1 -0
- package/dist/types/types.d.ts +5 -3
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js.map +1 -1
- package/package.json +5 -3
- package/src/api/context.ts +10 -5
- package/src/api/decorators.ts +1 -3
- package/src/api/sonamu.ts +60 -26
- package/src/bin/build-config.ts +5 -0
- package/src/bin/cli-wrapper.ts +20 -6
- package/src/bin/cli.ts +16 -21
- package/src/database/base-model.ts +29 -3
- package/src/database/db.ts +3 -2
- package/src/file-storage/driver.ts +10 -0
- package/src/index.ts +1 -0
- package/src/stream/index.ts +1 -0
- package/src/stream/sse.ts +49 -0
- package/src/types/types.ts +10 -4
- package/tsconfig.json +4 -0
- package/dist/api/sonamu.types.d.ts +0 -30
- package/dist/api/sonamu.types.d.ts.map +0 -1
- package/dist/api/sonamu.types.js +0 -2
- package/dist/api/sonamu.types.js.map +0 -1
- package/dist/base-model-CEB0H0aO.d.mts +0 -43
- package/dist/base-model-CrqDMYhI.d.ts +0 -43
- package/dist/bin/cli-wrapper.d.mts +0 -1
- package/dist/bin/cli-wrapper.mjs +0 -43
- package/dist/bin/cli-wrapper.mjs.map +0 -1
- package/dist/bin/cli.d.mts +0 -2
- package/dist/bin/cli.mjs +0 -907
- package/dist/bin/cli.mjs.map +0 -1
- package/dist/chunk-2WAC2GER.js +0 -7625
- package/dist/chunk-2WAC2GER.js.map +0 -1
- package/dist/chunk-C3IPIF6O.mjs +0 -1581
- package/dist/chunk-C3IPIF6O.mjs.map +0 -1
- package/dist/chunk-EXHKSVTE.js +0 -280
- package/dist/chunk-EXHKSVTE.js.map +0 -1
- package/dist/chunk-FCERKIIF.mjs +0 -7623
- package/dist/chunk-FCERKIIF.mjs.map +0 -1
- package/dist/chunk-HGIBJYOU.mjs +0 -231
- package/dist/chunk-HGIBJYOU.mjs.map +0 -1
- package/dist/chunk-JKSOJRQA.mjs +0 -280
- package/dist/chunk-JKSOJRQA.mjs.map +0 -1
- package/dist/chunk-OTKKFP3Y.js +0 -1581
- package/dist/chunk-OTKKFP3Y.js.map +0 -1
- package/dist/chunk-PTFDTOJU.mjs +0 -19
- package/dist/chunk-PTFDTOJU.mjs.map +0 -1
- package/dist/chunk-UZ2IY5VE.js +0 -231
- package/dist/chunk-UZ2IY5VE.js.map +0 -1
- package/dist/database/drivers/knex/base-model.d.mts +0 -16
- package/dist/database/drivers/knex/base-model.d.ts +0 -16
- package/dist/database/drivers/knex/base-model.js +0 -55
- package/dist/database/drivers/knex/base-model.js.map +0 -1
- package/dist/database/drivers/knex/base-model.mjs +0 -56
- package/dist/database/drivers/knex/base-model.mjs.map +0 -1
- package/dist/database/drivers/kysely/base-model.d.mts +0 -22
- package/dist/database/drivers/kysely/base-model.d.ts +0 -22
- package/dist/database/drivers/kysely/base-model.js +0 -64
- package/dist/database/drivers/kysely/base-model.js.map +0 -1
- package/dist/database/drivers/kysely/base-model.mjs +0 -65
- package/dist/database/drivers/kysely/base-model.mjs.map +0 -1
- package/dist/database/types.d.ts +0 -39
- package/dist/database/types.d.ts.map +0 -1
- package/dist/database/types.js +0 -2
- package/dist/database/types.js.map +0 -1
- package/dist/index.d.mts +0 -813
- package/dist/index.mjs +0 -435
- package/dist/index.mjs.map +0 -1
- package/dist/model-aFgomcdc.d.mts +0 -1112
- package/dist/model-aFgomcdc.d.ts +0 -1112
- package/dist/smd/smd-manager.d.ts +0 -28
- package/dist/smd/smd-manager.d.ts.map +0 -1
- package/dist/smd/smd-manager.js +0 -2
- package/dist/smd/smd-manager.js.map +0 -1
- package/dist/smd/smd.d.ts +0 -40
- package/dist/smd/smd.d.ts.map +0 -1
- package/dist/smd/smd.js +0 -2
- package/dist/smd/smd.js.map +0 -1
package/dist/database/db.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/database/db.ts"],"sourcesContent":["export type DBPreset = \"w\" | \"r\";\nimport knex, { Knex } from \"knex\";\nimport path from \"path\";\nimport _ from \"lodash\";\nimport { Sonamu } from \"../api\";\nimport { ServiceUnavailableException } from \"../exceptions/so-exceptions\";\nimport { AsyncLocalStorage } from \"async_hooks\";\nimport { TransactionContext } from \"./transaction-context\";\n\ntype MySQLConfig = Omit<Knex.Config, \"connection\"> & {\n connection?: Knex.MySql2ConnectionConfig;\n};\n\nexport type SonamuDBBaseConfig = {\n // 기본 데이터베이스 이름\n database: string;\n\n // 모든 환경에 적용될 기본 Knex 옵션\n defaultOptions?: MySQLConfig;\n\n // 환경별 설정\n environments?: {\n development?: MySQLConfig;\n development_slave?: MySQLConfig;\n production?: MySQLConfig;\n production_slave?: MySQLConfig;\n };\n};\n\nexport type SonamuDBConfig = {\n development_master: Knex.Config;\n development_slave: Knex.Config;\n test: Knex.Config;\n fixture_local: Knex.Config;\n fixture_remote: Knex.Config;\n production_master: Knex.Config;\n production_slave: Knex.Config;\n};\n\nclass DBClass {\n private wdb?: Knex;\n private rdb?: Knex;\n\n public transactionStorage = new AsyncLocalStorage<TransactionContext>();\n\n public runWithTransaction<T>(callback: () => Promise<T>): Promise<T> {\n return this.transactionStorage.run(new TransactionContext(), callback);\n }\n\n public getTransactionContext(): TransactionContext {\n return this.transactionStorage.getStore() ?? new TransactionContext();\n }\n\n async readKnexfile(): Promise<SonamuDBConfig> {\n const dbConfigPath: string = path.join(\n Sonamu.apiRootPath,\n \"/dist/configs/db.js\"\n );\n try {\n const knexfileModule = await import(dbConfigPath);\n const config =\n knexfileModule.default?.default ??\n knexfileModule.default ??\n knexfileModule;\n return this.generateDBConfig(config);\n } catch {}\n\n throw new ServiceUnavailableException(\n `다음 경로에서 DB설정 파일을 찾을 수 없습니다: ${dbConfigPath}. 먼저 빌드(yarn build)를 수행해주세요.`\n );\n }\n\n getDB(which: DBPreset): Knex {\n const dbConfig = Sonamu.dbConfig;\n\n const instanceName = which === \"w\" ? \"wdb\" : \"rdb\";\n\n if (!this[instanceName]) {\n let config: Knex.Config;\n switch (process.env.NODE_ENV ?? \"development\") {\n case \"development\":\n case \"staging\":\n config =\n which === \"w\"\n ? dbConfig[\"development_master\"]\n : dbConfig[\"development_slave\"] ?? dbConfig[\"development_master\"];\n break;\n case \"production\":\n config =\n which === \"w\"\n ? dbConfig[\"production_master\"]\n : dbConfig[\"production_slave\"] ?? dbConfig[\"production_master\"];\n break;\n case \"test\":\n config = dbConfig[\"test\"];\n break;\n default:\n throw new Error(\n `현재 ENV ${process.env.NODE_ENV}에는 설정 가능한 DB설정이 없습니다.`\n );\n }\n this[instanceName] = knex(config);\n }\n\n return this[instanceName]!;\n }\n\n async destroy(): Promise<void> {\n if (this.wdb !== undefined) {\n await this.wdb.destroy();\n this.wdb = undefined;\n }\n if (this.rdb !== undefined) {\n await this.rdb.destroy();\n this.rdb = undefined;\n }\n }\n\n private generateDBConfig(config: SonamuDBBaseConfig): SonamuDBConfig {\n const defaultKnexConfig: Partial<MySQLConfig> = _.merge(\n {\n client: \"mysql2\",\n pool: {\n min: 1,\n max: 5,\n },\n migrations: {\n extension: \"js\",\n directory: \"./dist/migrations\",\n },\n connection: {\n database: config.database,\n ...config.defaultOptions?.connection,\n },\n },\n config.defaultOptions\n );\n\n // 로컬 환경 설정\n const test: MySQLConfig = _.merge({}, defaultKnexConfig, {\n connection: {\n database: `${config.database}_test`,\n ...config.defaultOptions?.connection,\n },\n });\n\n const fixture_local = _.merge({}, defaultKnexConfig, {\n connection: {\n database: `${config.database}_fixture_local`,\n ...config.defaultOptions?.connection,\n },\n });\n\n // 개발 환경 설정\n const devMasterOptions = config.environments?.development;\n const devSlaveOptions = config.environments?.development_slave;\n const development_master = _.merge({}, defaultKnexConfig, devMasterOptions);\n const development_slave = _.merge(\n {},\n defaultKnexConfig,\n devMasterOptions,\n devSlaveOptions\n );\n const fixture_remote = _.merge({}, defaultKnexConfig, devMasterOptions, {\n connection: {\n database: `${config.database}_fixture_remote`,\n ...config.defaultOptions?.connection,\n },\n });\n\n // 프로덕션 환경 설정\n const prodMasterOptions = config.environments?.production ?? {};\n const prodSlaveOptions = config.environments?.production_slave ?? {};\n const production_master = _.merge({}, defaultKnexConfig, prodMasterOptions);\n const production_slave = _.merge(\n {},\n defaultKnexConfig,\n prodMasterOptions,\n prodSlaveOptions\n );\n\n return {\n test,\n fixture_local,\n fixture_remote,\n development_master,\n development_slave,\n production_master,\n production_slave,\n };\n }\n}\nexport const DB = new DBClass();\n"],"names":["DB","DBClass","wdb","rdb","transactionStorage","AsyncLocalStorage","runWithTransaction","callback","run","TransactionContext","getTransactionContext","getStore","readKnexfile","dbConfigPath","knexfileModule","config","path","join","Sonamu","apiRootPath","default","generateDBConfig","ServiceUnavailableException","getDB","which","dbConfig","instanceName","process","env","NODE_ENV","Error","knex","destroy","undefined","defaultKnexConfig","_","merge","client","pool","min","max","migrations","extension","directory","connection","database","defaultOptions","test","fixture_local","devMasterOptions","environments","development","devSlaveOptions","development_slave","development_master","fixture_remote","prodMasterOptions","production","prodSlaveOptions","production_slave","production_master"],"mappings":"oGAgMaA,4CAAAA,8DA/Lc,iEACV,mEACH,4BACS,oCACqB,wDACV,+CACC,klIAgCnC,IAAA,AAAMC,qBAAN,iCAAMA,iCAAAA,SACJ,sBAAQC,MAAR,KAAA,GACA,sBAAQC,MAAR,KAAA,GAEA,sBAAOC,qBAAqB,IAAIC,8BAAiB,gBAJ7CJ,UAMGK,IAAAA,2BAAP,SAAOA,mBAAsBC,QAA0B,EACrD,OAAO,IAAI,CAACH,kBAAkB,CAACI,GAAG,CAAC,IAAIC,sCAAkB,CAAIF,SAC/D,IAEOG,IAAAA,8BAAP,SAAOA,4BACE,kCAAP,MAAO,CAAA,kCAAA,IAAI,CAACN,kBAAkB,CAACO,QAAQ,YAAhC,2CAAA,kCAAsC,IAAIF,sCAAkB,AACrE,IAEMG,IAAAA,qBAAN,SAAMA,yDACEC,aAOFC,wBAFIA,eAEJA,gCAAAA,KADIC,gFANFF,aAAuBG,aAAI,CAACC,IAAI,CACpCC,WAAM,CAACC,WAAW,CAClB,wEAGuB,SAAM,gBAAON,6EAAP,sBAAvBC,eAAiB,cACjBC,OACJD,CAAAA,KAAAA,CAAAA,iCAAAA,wBAAAA,eAAeM,OAAO,UAAtBN,wCAAAA,wBAAwBM,OAAO,UAA/BN,yCAAA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G,iBAEF,IAAMG,eAAiBpB,eAAC,CAACC,KAAK,CAAC,CAAC,EAAGF,kBAAmBe,iBAAkB,CACtEL,WAAY,gBACVC,SAAU,AAAC,GAAkB,OAAhB9B,OAAO8B,QAAQ,CAAC,qBAC1B9B,wBAAAA,OAAO+B,cAAc,UAArB/B,wCAAAA,wBAAuB6B,UAAU,CAExC,OAG0B7B,gCAA1B,IAAMyC,kBAAoBzC,CAAAA,iCAAAA,sBAAAA,OAAOmC,YAAY,UAAnBnC,sCAAAA,sBAAqB0C,UAAU,UAA/B1C,yCAAAA,gCAAmC,CAAC,MACrCA,sCAAzB,IAAM2C,iBAAmB3C,CAAAA,uCAAAA,sBAAAA,OAAOmC,YAAY,UAAnBnC,sCAAAA,sBAAqB4C,gBAAgB,UAArC5C,+CAAAA,sCAAyC,CAAC,EACnE,IAAM6C,kBAAoBzB,eAAC,CAACC,KAAK,CAAC,CAAC,EAAGF,kBAAmBsB,mBACzD,IAAMG,iBAAmBxB,eAAC,CAACC,KAAK,CAC9B,CAAC,EACDF,kBACAsB,kBACAE,kBAGF,MAAO,CACLX,KAAAA,KACAC,cAAAA,cACAO,eAAAA,eACAD,mBAAAA,mBACAD,kBAAAA,kBACAO,kBAAAA,kBACAD,iBAAAA,gBACF,CACF,YAvJI1D,WAyJC,IAAMD,GAAK,IAAIC"}
|
|
1
|
+
{"version":3,"sources":["../../src/database/db.ts"],"sourcesContent":["export type DBPreset = \"w\" | \"r\";\nimport knex, { Knex } from \"knex\";\nimport path from \"path\";\nimport _ from \"lodash\";\nimport { Sonamu } from \"../api\";\nimport { ServiceUnavailableException } from \"../exceptions/so-exceptions\";\nimport { AsyncLocalStorage } from \"async_hooks\";\nimport { TransactionContext } from \"./transaction-context\";\n\ntype MySQLConfig = Omit<Knex.Config, \"connection\"> & {\n connection?: Knex.MySql2ConnectionConfig;\n};\n\nexport type SonamuDBBaseConfig = {\n // 기본 데이터베이스 이름\n database: string;\n\n // 모든 환경에 적용될 기본 Knex 옵션\n defaultOptions?: MySQLConfig;\n\n // 환경별 설정\n environments?: {\n development?: MySQLConfig;\n development_slave?: MySQLConfig;\n production?: MySQLConfig;\n production_slave?: MySQLConfig;\n remote_fixture?: MySQLConfig;\n };\n};\n\nexport type SonamuDBConfig = {\n development_master: Knex.Config;\n development_slave: Knex.Config;\n test: Knex.Config;\n fixture_local: Knex.Config;\n fixture_remote: Knex.Config;\n production_master: Knex.Config;\n production_slave: Knex.Config;\n};\n\nclass DBClass {\n private wdb?: Knex;\n private rdb?: Knex;\n\n public transactionStorage = new AsyncLocalStorage<TransactionContext>();\n\n public runWithTransaction<T>(callback: () => Promise<T>): Promise<T> {\n return this.transactionStorage.run(new TransactionContext(), callback);\n }\n\n public getTransactionContext(): TransactionContext {\n return this.transactionStorage.getStore() ?? new TransactionContext();\n }\n\n async readKnexfile(): Promise<SonamuDBConfig> {\n const dbConfigPath: string = path.join(\n Sonamu.apiRootPath,\n \"/dist/configs/db.js\"\n );\n try {\n const knexfileModule = await import(dbConfigPath);\n const config =\n knexfileModule.default?.default ??\n knexfileModule.default ??\n knexfileModule;\n return this.generateDBConfig(config);\n } catch {}\n\n throw new ServiceUnavailableException(\n `다음 경로에서 DB설정 파일을 찾을 수 없습니다: ${dbConfigPath}. 먼저 빌드(yarn build)를 수행해주세요.`\n );\n }\n\n getDB(which: DBPreset): Knex {\n const dbConfig = Sonamu.dbConfig;\n\n const instanceName = which === \"w\" ? \"wdb\" : \"rdb\";\n\n if (!this[instanceName]) {\n let config: Knex.Config;\n switch (process.env.NODE_ENV ?? \"development\") {\n case \"development\":\n case \"staging\":\n config =\n which === \"w\"\n ? dbConfig[\"development_master\"]\n : dbConfig[\"development_slave\"] ?? dbConfig[\"development_master\"];\n break;\n case \"production\":\n config =\n which === \"w\"\n ? dbConfig[\"production_master\"]\n : dbConfig[\"production_slave\"] ?? dbConfig[\"production_master\"];\n break;\n case \"test\":\n config = dbConfig[\"test\"];\n break;\n default:\n throw new Error(\n `현재 ENV ${process.env.NODE_ENV}에는 설정 가능한 DB설정이 없습니다.`\n );\n }\n this[instanceName] = knex(config);\n }\n\n return this[instanceName]!;\n }\n\n async destroy(): Promise<void> {\n if (this.wdb !== undefined) {\n await this.wdb.destroy();\n this.wdb = undefined;\n }\n if (this.rdb !== undefined) {\n await this.rdb.destroy();\n this.rdb = undefined;\n }\n }\n\n private generateDBConfig(config: SonamuDBBaseConfig): SonamuDBConfig {\n const defaultKnexConfig: Partial<MySQLConfig> = _.merge(\n {\n client: \"mysql2\",\n pool: {\n min: 1,\n max: 5,\n },\n migrations: {\n extension: \"js\",\n directory: \"./dist/migrations\",\n },\n connection: {\n database: config.database,\n ...config.defaultOptions?.connection,\n },\n },\n config.defaultOptions\n );\n\n // 로컬 환경 설정\n const test: MySQLConfig = _.merge({}, defaultKnexConfig, {\n connection: {\n database: `${config.database}_test`,\n ...config.defaultOptions?.connection,\n },\n });\n\n const fixture_local = _.merge({}, defaultKnexConfig, {\n connection: {\n database: `${config.database}_fixture_local`,\n ...config.defaultOptions?.connection,\n },\n });\n\n // 개발 환경 설정\n const devMasterOptions = config.environments?.development;\n const devSlaveOptions = config.environments?.development_slave;\n const development_master = _.merge({}, defaultKnexConfig, devMasterOptions);\n const development_slave = _.merge(\n {},\n defaultKnexConfig,\n devMasterOptions,\n devSlaveOptions\n );\n // NOTE: fixture remote는 default connection의 DB를 override해선 안됨.\n const fixture_remote = _.merge({}, defaultKnexConfig, devMasterOptions, {\n connection: {\n database: `${config.database}_fixture_remote`,\n },\n }, config.environments?.remote_fixture);\n\n // 프로덕션 환경 설정\n const prodMasterOptions = config.environments?.production ?? {};\n const prodSlaveOptions = config.environments?.production_slave ?? {};\n const production_master = _.merge({}, defaultKnexConfig, prodMasterOptions);\n const production_slave = _.merge(\n {},\n defaultKnexConfig,\n prodMasterOptions,\n prodSlaveOptions\n );\n\n return {\n test,\n fixture_local,\n fixture_remote,\n development_master,\n development_slave,\n production_master,\n production_slave,\n };\n }\n}\nexport const DB = new DBClass();\n"],"names":["DB","DBClass","wdb","rdb","transactionStorage","AsyncLocalStorage","runWithTransaction","callback","run","TransactionContext","getTransactionContext","getStore","readKnexfile","dbConfigPath","knexfileModule","config","path","join","Sonamu","apiRootPath","default","generateDBConfig","ServiceUnavailableException","getDB","which","dbConfig","instanceName","process","env","NODE_ENV","Error","knex","destroy","undefined","defaultKnexConfig","_","merge","client","pool","min","max","migrations","extension","directory","connection","database","defaultOptions","test","fixture_local","devMasterOptions","environments","development","devSlaveOptions","development_slave","development_master","fixture_remote","remote_fixture","prodMasterOptions","production","prodSlaveOptions","production_slave","production_master"],"mappings":"oGAiMaA,4CAAAA,8DAhMc,iEACV,mEACH,4BACS,oCACqB,wDACV,+CACC,klIAiCnC,IAAA,AAAMC,qBAAN,iCAAMA,iCAAAA,SACJ,sBAAQC,MAAR,KAAA,GACA,sBAAQC,MAAR,KAAA,GAEA,sBAAOC,qBAAqB,IAAIC,8BAAiB,gBAJ7CJ,UAMGK,IAAAA,2BAAP,SAAOA,mBAAsBC,QAA0B,EACrD,OAAO,IAAI,CAACH,kBAAkB,CAACI,GAAG,CAAC,IAAIC,sCAAkB,CAAIF,SAC/D,IAEOG,IAAAA,8BAAP,SAAOA,4BACE,kCAAP,MAAO,CAAA,kCAAA,IAAI,CAACN,kBAAkB,CAACO,QAAQ,YAAhC,2CAAA,kCAAsC,IAAIF,sCAAkB,AACrE,IAEMG,IAAAA,qBAAN,SAAMA,yDACEC,aAOFC,wBAFIA,eAEJA,gCAAAA,KADIC,gFANFF,aAAuBG,aAAI,CAACC,IAAI,CACpCC,WAAM,CAACC,WAAW,CAClB,wEAGuB,SAAM,gBAAON,6EAAP,sBAAvBC,eAAiB,cACjBC,OACJD,CAAAA,KAAAA,CAAAA,iCAAAA,wBAAAA,eAAeM,OAAO,UAAtBN,wCAAAA,wBAAwBM,OAAO,UAA/BN,yCAAAA,gCACAA,eAAeM,OAAO,UADtBN,cAAAA,KAEAA,eACF,SAAO,IAAI,CAACO,gBAAgB,CAACN,m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tEL,WAAY,CACVC,SAAU,AAAC,GAAkB,OAAhB9B,OAAO8B,QAAQ,CAAC,kBAC/B,CACF,GAAG9B,sBAAAA,OAAOmC,YAAY,UAAnBnC,sCAAAA,sBAAqByC,cAAc,MAGZzC,gCAA1B,IAAM0C,kBAAoB1C,CAAAA,iCAAAA,sBAAAA,OAAOmC,YAAY,UAAnBnC,sCAAAA,sBAAqB2C,UAAU,UAA/B3C,yCAAAA,gCAAmC,CAAC,MACrCA,sCAAzB,IAAM4C,iBAAmB5C,CAAAA,uCAAAA,sBAAAA,OAAOmC,YAAY,UAAnBnC,sCAAAA,sBAAqB6C,gBAAgB,UAArC7C,+CAAAA,sCAAyC,CAAC,EACnE,IAAM8C,kBAAoB1B,eAAC,CAACC,KAAK,CAAC,CAAC,EAAGF,kBAAmBuB,mBACzD,IAAMG,iBAAmBzB,eAAC,CAACC,KAAK,CAC9B,CAAC,EACDF,kBACAuB,kBACAE,kBAGF,MAAO,CACLZ,KAAAA,KACAC,cAAAA,cACAO,eAAAA,eACAD,mBAAAA,mBACAD,kBAAAA,kBACAQ,kBAAAA,kBACAD,iBAAAA,gBACF,CACF,YAvJI3D,WAyJC,IAAMD,GAAK,IAAIC"}
|
|
@@ -10,6 +10,7 @@ export interface Driver {
|
|
|
10
10
|
del(key: string): Promise<void>;
|
|
11
11
|
getUrl(key: string): string;
|
|
12
12
|
getSignedUrl(key: string, expiresIn?: number): Promise<string>;
|
|
13
|
+
destroy(): void;
|
|
13
14
|
}
|
|
14
15
|
export type FSDriverConfig = {
|
|
15
16
|
location: string;
|
|
@@ -25,6 +26,7 @@ export declare class FSDriver implements Driver {
|
|
|
25
26
|
del(key: string): Promise<void>;
|
|
26
27
|
getUrl(key: string): string;
|
|
27
28
|
getSignedUrl(key: string, _expiresIn?: number): Promise<string>;
|
|
29
|
+
destroy(): void;
|
|
28
30
|
}
|
|
29
31
|
export type S3DriverConfig = S3ClientConfig & {
|
|
30
32
|
bucket: string;
|
|
@@ -41,5 +43,6 @@ export declare class S3Driver implements Driver {
|
|
|
41
43
|
getUrl(key: string): string;
|
|
42
44
|
getSignedUrl(key: string, expiresIn?: number): Promise<string>;
|
|
43
45
|
private getAcl;
|
|
46
|
+
destroy(): void;
|
|
44
47
|
}
|
|
45
48
|
//# sourceMappingURL=driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/file-storage/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,cAAc,EACf,MAAM,oBAAoB,CAAC;AAK5B;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,GAAG,CACD,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;KAAE,GACpE,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../src/file-storage/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,cAAc,EACf,MAAM,oBAAoB,CAAC;AAK5B;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,GAAG,CACD,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;KAAE,GACpE,OAAO,CAAC,IAAI,CAAC,CAAC;I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rC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAIrB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWpE,OAAO,CAAC,MAAM;IAQd,OAAO;CAGR"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get FSDriver(){return FSDriver},get S3Driver(){return S3Driver}});var _clients3=require("@aws-sdk/client-s3");var _s3requestpresigner=require("@aws-sdk/s3-request-presigner");var _promises=/*#__PURE__*/_interop_require_default(require("fs/promises"));var _path=/*#__PURE__*/_interop_require_default(require("path"));function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done){resolve(value)}else{Promise.resolve(value).then(_next,_throw)}}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(undefined)})}}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},g=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return g.next=verb(0),g["throw"]=verb(1),g["return"]=verb(2),typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}var FSDriver=/*#__PURE__*/function(){"use strict";function FSDriver(config){_class_call_check(this,FSDriver);_define_property(this,"config",void 0);this.config=config}_create_class(FSDriver,[{key:"put",value:function put(key,contents){return _async_to_generator(function(){var filePath,dir;return _ts_generator(this,function(_state){switch(_state.label){case 0:filePath=_path.default.join(this.config.location,key);dir=_path.default.dirname(filePath);return[4,_promises.default.mkdir(dir,{recursive:true})];case 1:_state.sent();return[4,_promises.default.writeFile(filePath,contents)];case 2:_state.sent();return[2]}})}).call(this)}},{key:"del",value:function del(key){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,_promises.default.rm(_path.default.join(this.config.location,key))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"getUrl",value:function getUrl(key){return"".concat(this.config.urlPrefix,"/").concat(key)}},{key:"getSignedUrl",value:function getSignedUrl(key,_expiresIn){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.getUrl(key)]})}).call(this)}}]);return FSDriver}();var S3Driver=/*#__PURE__*/function(){"use strict";function S3Driver(config){_class_call_check(this,S3Driver);_define_property(this,"config",void 0);_define_property(this,"s3",void 0);this.config=config;this.s3=new _clients3.S3Client(config)}_create_class(S3Driver,[{key:"put",value:function put(key,contents,options){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.s3.send(new _clients3.PutObjectCommand({Bucket:this.config.bucket,Key:key,Body:contents,ContentType:options===null||options===void 0?void 0:options.contentType,ACL:this.getAcl(options===null||options===void 0?void 0:options.visibility)}))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"del",value:function del(key){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.s3.send(new _clients3.DeleteObjectCommand({Bucket:this.config.bucket,Key:key}))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"getUrl",value:function getUrl(key){return"https://".concat(this.config.bucket,".s3.").concat(this.config.region,".amazonaws.com/").concat(key)}},{key:"getSignedUrl",value:function getSignedUrl(key,expiresIn){return _async_to_generator(function(){var command;return _ts_generator(this,function(_state){command=new _clients3.GetObjectCommand({Bucket:this.config.bucket,Key:key});return[2,(0,_s3requestpresigner.getSignedUrl)(this.s3,command,{expiresIn:expiresIn!==null&&expiresIn!==void 0?expiresIn:60*60*24*7})]})}).call(this)}},{key:"getAcl",value:function getAcl(visibility){if(visibility==="public"){return"public-read"}return visibility}}]);return S3Driver}();
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:Object.getOwnPropertyDescriptor(all,name).get})}_export(exports,{get FSDriver(){return FSDriver},get S3Driver(){return S3Driver}});var _clients3=require("@aws-sdk/client-s3");var _s3requestpresigner=require("@aws-sdk/s3-request-presigner");var _promises=/*#__PURE__*/_interop_require_default(require("fs/promises"));var _path=/*#__PURE__*/_interop_require_default(require("path"));function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done){resolve(value)}else{Promise.resolve(value).then(_next,_throw)}}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(undefined)})}}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interop_require_default(obj){return obj&&obj.__esModule?obj:{default:obj}}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},g=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return g.next=verb(0),g["throw"]=verb(1),g["return"]=verb(2),typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}var FSDriver=/*#__PURE__*/function(){"use strict";function FSDriver(config){_class_call_check(this,FSDriver);_define_property(this,"config",void 0);this.config=config}_create_class(FSDriver,[{key:"put",value:function put(key,contents){return _async_to_generator(function(){var filePath,dir;return _ts_generator(this,function(_state){switch(_state.label){case 0:filePath=_path.default.join(this.config.location,key);dir=_path.default.dirname(filePath);return[4,_promises.default.mkdir(dir,{recursive:true})];case 1:_state.sent();return[4,_promises.default.writeFile(filePath,contents)];case 2:_state.sent();return[2]}})}).call(this)}},{key:"del",value:function del(key){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,_promises.default.rm(_path.default.join(this.config.location,key))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"getUrl",value:function getUrl(key){return"".concat(this.config.urlPrefix,"/").concat(key)}},{key:"getSignedUrl",value:function getSignedUrl(key,_expiresIn){return _async_to_generator(function(){return _ts_generator(this,function(_state){return[2,this.getUrl(key)]})}).call(this)}},{key:"destroy",value:function destroy(){}}]);return FSDriver}();var S3Driver=/*#__PURE__*/function(){"use strict";function S3Driver(config){_class_call_check(this,S3Driver);_define_property(this,"config",void 0);_define_property(this,"s3",void 0);this.config=config;this.s3=new _clients3.S3Client(config)}_create_class(S3Driver,[{key:"put",value:function put(key,contents,options){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.s3.send(new _clients3.PutObjectCommand({Bucket:this.config.bucket,Key:key,Body:contents,ContentType:options===null||options===void 0?void 0:options.contentType,ACL:this.getAcl(options===null||options===void 0?void 0:options.visibility)}))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"del",value:function del(key){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,this.s3.send(new _clients3.DeleteObjectCommand({Bucket:this.config.bucket,Key:key}))];case 1:_state.sent();return[2]}})}).call(this)}},{key:"getUrl",value:function getUrl(key){return"https://".concat(this.config.bucket,".s3.").concat(this.config.region,".amazonaws.com/").concat(key)}},{key:"getSignedUrl",value:function getSignedUrl(key,expiresIn){return _async_to_generator(function(){var command;return _ts_generator(this,function(_state){command=new _clients3.GetObjectCommand({Bucket:this.config.bucket,Key:key});return[2,(0,_s3requestpresigner.getSignedUrl)(this.s3,command,{expiresIn:expiresIn!==null&&expiresIn!==void 0?expiresIn:60*60*24*7})]})}).call(this)}},{key:"getAcl",value:function getAcl(visibility){if(visibility==="public"){return"public-read"}return visibility}},{key:"destroy",value:function destroy(){this.s3.destroy()}}]);return S3Driver}();
|
|
2
2
|
//# sourceMappingURL=driver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/file-storage/driver.ts"],"sourcesContent":["import {\n DeleteObjectCommand,\n GetObjectCommand,\n PutObjectCommand,\n S3Client,\n S3ClientConfig,\n} from \"@aws-sdk/client-s3\";\nimport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\nimport fs from \"fs/promises\";\nimport path from \"path\";\n\n/**\n * 파일 저장소의 공통 인터페이스\n */\nexport interface Driver {\n put(\n key: string,\n contents: Buffer,\n options?: { contentType?: string; visibility?: \"public\" | \"private\" }\n ): Promise<void>;\n\n del(key: string): Promise<void>;\n\n getUrl(key: string): string;\n\n getSignedUrl(key: string, expiresIn?: number): Promise<string>;\n}\n\nexport type FSDriverConfig = {\n location: string;\n urlPrefix: string;\n};\n\n/**\n * 로컬 파일시스템\n */\nexport class FSDriver implements Driver {\n constructor(private config: FSDriverConfig) {}\n\n async put(key: string, contents: Buffer): Promise<void> {\n const filePath = path.join(this.config.location, key);\n const dir = path.dirname(filePath);\n\n await fs.mkdir(dir, { recursive: true });\n\n await fs.writeFile(filePath, contents);\n }\n\n async del(key: string) {\n await fs.rm(path.join(this.config.location, key));\n }\n\n getUrl(key: string): string {\n return `${this.config.urlPrefix}/${key}`;\n }\n\n // 로컬 파일시스템은 signed URL을 지원하지 않으므로 일반 URL 반환\n async getSignedUrl(key: string, _expiresIn?: number): Promise<string> {\n return this.getUrl(key);\n }\n}\n\nexport type S3DriverConfig = S3ClientConfig & {\n bucket: string;\n};\n\nexport class S3Driver implements Driver {\n s3: S3Client;\n\n constructor(private config: S3DriverConfig) {\n this.s3 = new S3Client(config);\n }\n\n async put(\n key: string,\n contents: Buffer,\n options?: { contentType?: string; visibility?: \"public\" | \"private\" }\n ): Promise<void> {\n await this.s3.send(\n new PutObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n Body: contents,\n ContentType: options?.contentType,\n ACL: this.getAcl(options?.visibility),\n })\n );\n }\n\n async del(key: string): Promise<void> {\n await this.s3.send(\n new DeleteObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n })\n );\n }\n\n getUrl(key: string): string {\n return `https://${this.config.bucket}.s3.${this.config.region}.amazonaws.com/${key}`;\n }\n\n async getSignedUrl(key: string, expiresIn?: number): Promise<string> {\n const command = new GetObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n });\n\n return getSignedUrl(this.s3, command, {\n expiresIn: expiresIn ?? 60 * 60 * 24 * 7,\n });\n }\n\n private getAcl(visibility?: \"public\" | \"private\") {\n if (visibility === \"public\") {\n return \"public-read\";\n }\n\n return visibility;\n }\n}\n"],"names":["FSDriver","S3Driver","config","put","key","contents","filePath","dir","path","join","location","dirname","fs","mkdir","recursive","writeFile","del","rm","getUrl","urlPrefix","getSignedUrl","_expiresIn","s3","S3Client","options","send","PutObjectCommand","Bucket","bucket","Key","Body","ContentType","contentType","ACL","getAcl","visibility","DeleteObjectCommand","region","expiresIn","command","GetObjectCommand"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/file-storage/driver.ts"],"sourcesContent":["import {\n DeleteObjectCommand,\n GetObjectCommand,\n PutObjectCommand,\n S3Client,\n S3ClientConfig,\n} from \"@aws-sdk/client-s3\";\nimport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\nimport fs from \"fs/promises\";\nimport path from \"path\";\n\n/**\n * 파일 저장소의 공통 인터페이스\n */\nexport interface Driver {\n put(\n key: string,\n contents: Buffer,\n options?: { contentType?: string; visibility?: \"public\" | \"private\" }\n ): Promise<void>;\n\n del(key: string): Promise<void>;\n\n getUrl(key: string): string;\n\n getSignedUrl(key: string, expiresIn?: number): Promise<string>;\n\n destroy(): void;\n}\n\nexport type FSDriverConfig = {\n location: string;\n urlPrefix: string;\n};\n\n/**\n * 로컬 파일시스템\n */\nexport class FSDriver implements Driver {\n constructor(private config: FSDriverConfig) {}\n\n async put(key: string, contents: Buffer): Promise<void> {\n const filePath = path.join(this.config.location, key);\n const dir = path.dirname(filePath);\n\n await fs.mkdir(dir, { recursive: true });\n\n await fs.writeFile(filePath, contents);\n }\n\n async del(key: string) {\n await fs.rm(path.join(this.config.location, key));\n }\n\n getUrl(key: string): string {\n return `${this.config.urlPrefix}/${key}`;\n }\n\n // 로컬 파일시스템은 signed URL을 지원하지 않으므로 일반 URL 반환\n async getSignedUrl(key: string, _expiresIn?: number): Promise<string> {\n return this.getUrl(key);\n }\n\n destroy() {\n // 아무것도 하지 않음\n }\n}\n\nexport type S3DriverConfig = S3ClientConfig & {\n bucket: string;\n};\n\nexport class S3Driver implements Driver {\n s3: S3Client;\n\n constructor(private config: S3DriverConfig) {\n this.s3 = new S3Client(config);\n }\n\n async put(\n key: string,\n contents: Buffer,\n options?: { contentType?: string; visibility?: \"public\" | \"private\" }\n ): Promise<void> {\n await this.s3.send(\n new PutObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n Body: contents,\n ContentType: options?.contentType,\n ACL: this.getAcl(options?.visibility),\n })\n );\n }\n\n async del(key: string): Promise<void> {\n await this.s3.send(\n new DeleteObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n })\n );\n }\n\n getUrl(key: string): string {\n return `https://${this.config.bucket}.s3.${this.config.region}.amazonaws.com/${key}`;\n }\n\n async getSignedUrl(key: string, expiresIn?: number): Promise<string> {\n const command = new GetObjectCommand({\n Bucket: this.config.bucket,\n Key: key,\n });\n\n return getSignedUrl(this.s3, command, {\n expiresIn: expiresIn ?? 60 * 60 * 24 * 7,\n });\n }\n\n private getAcl(visibility?: \"public\" | \"private\") {\n if (visibility === \"public\") {\n return \"public-read\";\n }\n\n return visibility;\n }\n\n destroy() {\n this.s3.destroy();\n }\n}\n"],"names":["FSDriver","S3Driver","config","put","key","contents","filePath","dir","path","join","location","dirname","fs","mkdir","recursive","writeFile","del","rm","getUrl","urlPrefix","getSignedUrl","_expiresIn","destroy","s3","S3Client","options","send","PutObjectCommand","Bucket","bucket","Key","Body","ContentType","contentType","ACL","getAcl","visibility","DeleteObjectCommand","region","expiresIn","command","GetObjectCommand"],"mappings":"mPAsCaA,kBAAAA,cAkCAC,kBAAAA,kCAlEN,sDACsB,6FACd,wEACE,8qFA6BV,IAAA,AAAMD,sBAAN,iCAAMA,SACC,AAAQE,MAAsB,yBAD/BF,sDACSE,OAAAA,qBADTF,WAGLG,IAAAA,YAAN,SAAMA,IAAIC,GAAW,CAAEC,QAAgB,4CAC/BC,SACAC,2EADAD,SAAWE,aAAI,CAACC,IAAI,CAAC,IAAI,CAACP,MAAM,CAACQ,QAAQ,CAAEN,KAC3CG,IAAMC,aAAI,CAACG,OAAO,CAACL,UAEzB,SAAMM,iB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AAI,CAAC1B,MAAM,CAAC2B,MAAM,CAC1BC,IAAK1B,GACP,YAJF,0BAMF,iBAEAc,IAAAA,eAAAA,SAAAA,OAAOd,GAAW,EAChB,MAAO,AAAC,WAAmC,OAAzB,IAAI,CAACF,MAAM,CAAC2B,MAAM,CAAC,QAA0CzB,OAApC,IAAI,CAACF,MAAM,CAACoC,MAAM,CAAC,mBAAqB,OAAJlC,IACjF,IAEMgB,IAAAA,qBAAN,SAAMA,aAAahB,GAAW,CAAEmC,SAAkB,4CAC1CC,mDAAAA,QAAU,IAAIC,0BAAgB,CAAC,CACnCb,OAAQ,IAAI,CAAC1B,MAAM,CAAC2B,MAAM,CAC1BC,IAAK1B,GACP,GAEA,SAAOgB,GAAAA,gCAAY,EAAC,IAAI,CAACG,EAAE,CAAEiB,QAAS,CACpCD,UAAWA,kBAAAA,mBAAAA,UAAa,GAAK,GAAK,GAAK,CACzC,KACF,iBAEQJ,IAAAA,eAAR,SAAQA,OAAOC,UAAiC,EAC9C,GAAIA,aAAe,SAAU,CAC3B,MAAO,aACT,CAEA,OAAOA,UACT,IAEAd,IAAAA,gBAAAA,SAAAA,UACE,IAAI,CAACC,EAAE,CAACD,OAAO,EACjB,YAzDWrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from "./database/puri-wrapper";
|
|
|
10
10
|
export * from "./database/puri.types";
|
|
11
11
|
export * from "./exceptions/error-handler";
|
|
12
12
|
export * from "./exceptions/so-exceptions";
|
|
13
|
+
export * from "./stream/sse";
|
|
13
14
|
export * from "./types/types";
|
|
14
15
|
export * from "./utils/controller";
|
|
15
16
|
export * from "./utils/model";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,eAAe,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,eAAe,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./api/decorators"),exports);_export_star(require("./api/sonamu"),exports);_export_star(require("./database/base-model"),exports);_export_star(require("./api/base-frame"),exports);_export_star(require("./database/db"),exports);_export_star(require("./database/upsert-builder"),exports);_export_star(require("./database/puri"),exports);_export_star(require("./database/puri-wrapper"),exports);_export_star(require("./database/puri.types"),exports);_export_star(require("./exceptions/error-handler"),exports);_export_star(require("./exceptions/so-exceptions"),exports);_export_star(require("./types/types"),exports);_export_star(require("./utils/controller"),exports);_export_star(require("./utils/model"),exports);_export_star(require("./utils/utils"),exports);_export_star(require("./testing/fixture-manager"),exports);_export_star(require("./migration/migrator"),exports);_export_star(require("./entity/entity-manager"),exports);_export_star(require("./entity/entity"),exports);_export_star(require("./file-storage/driver"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./api/decorators"),exports);_export_star(require("./api/sonamu"),exports);_export_star(require("./database/base-model"),exports);_export_star(require("./api/base-frame"),exports);_export_star(require("./database/db"),exports);_export_star(require("./database/upsert-builder"),exports);_export_star(require("./database/puri"),exports);_export_star(require("./database/puri-wrapper"),exports);_export_star(require("./database/puri.types"),exports);_export_star(require("./exceptions/error-handler"),exports);_export_star(require("./exceptions/so-exceptions"),exports);_export_star(require("./stream/sse"),exports);_export_star(require("./types/types"),exports);_export_star(require("./utils/controller"),exports);_export_star(require("./utils/model"),exports);_export_star(require("./utils/utils"),exports);_export_star(require("./testing/fixture-manager"),exports);_export_star(require("./migration/migrator"),exports);_export_star(require("./entity/entity-manager"),exports);_export_star(require("./entity/entity"),exports);_export_star(require("./file-storage/driver"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type * from \"./api/context\";\nexport * from \"./api/decorators\";\nexport * from \"./api/sonamu\";\nexport * from \"./database/base-model\";\nexport * from \"./api/base-frame\";\nexport * from \"./database/db\";\nexport * from \"./database/upsert-builder\";\nexport * from \"./database/puri\";\nexport * from \"./database/puri-wrapper\";\nexport * from \"./database/puri.types\";\nexport * from \"./exceptions/error-handler\";\nexport * from \"./exceptions/so-exceptions\";\nexport * from \"./types/types\";\nexport * from \"./utils/controller\";\nexport * from \"./utils/model\";\nexport * from \"./utils/utils\";\nexport * from \"./testing/fixture-manager\";\nexport * from \"./migration/migrator\";\nexport * from \"./entity/entity-manager\";\nexport * from \"./entity/entity\";\nexport * from \"./file-storage/driver\";\n\n// export * from \"./api/code-converters\";\n// export * from \"./entity/entity-utils\";\n// export * from \"./syncer/syncer\";\n"],"names":[],"mappings":"2FACc,kDACA,8CACA,uDACA,kDACA,+CACA,2DACA,iDACA,yDACA,uDACA,4DACA,4DACA,+CACA,oDACA,+CACA,+CACA,2DACA,sDACA,yDACA,iDACA"}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["export type * from \"./api/context\";\nexport * from \"./api/decorators\";\nexport * from \"./api/sonamu\";\nexport * from \"./database/base-model\";\nexport * from \"./api/base-frame\";\nexport * from \"./database/db\";\nexport * from \"./database/upsert-builder\";\nexport * from \"./database/puri\";\nexport * from \"./database/puri-wrapper\";\nexport * from \"./database/puri.types\";\nexport * from \"./exceptions/error-handler\";\nexport * from \"./exceptions/so-exceptions\";\nexport * from \"./stream/sse\";\nexport * from \"./types/types\";\nexport * from \"./utils/controller\";\nexport * from \"./utils/model\";\nexport * from \"./utils/utils\";\nexport * from \"./testing/fixture-manager\";\nexport * from \"./migration/migrator\";\nexport * from \"./entity/entity-manager\";\nexport * from \"./entity/entity\";\nexport * from \"./file-storage/driver\";\n\n// export * from \"./api/code-converters\";\n// export * from \"./entity/entity-utils\";\n// export * from \"./syncer/syncer\";\n"],"names":[],"mappings":"2FACc,kDACA,8CACA,uDACA,kDACA,+CACA,2DACA,iDACA,yDACA,uDACA,4DACA,4DACA,8CACA,+CACA,oDACA,+CACA,+CACA,2DACA,sDACA,yDACA,iDACA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stream/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});_export_star(require("./sse"),exports);function _export_star(from,to){Object.keys(from).forEach(function(k){if(k!=="default"&&!Object.prototype.hasOwnProperty.call(to,k)){Object.defineProperty(to,k,{enumerable:true,get:function(){return from[k]}})}});return from}
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/stream/index.ts"],"sourcesContent":["export * from \"./sse\";\n"],"names":[],"mappings":"2FAAc"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { FastifyRequest, FastifyReply } from "fastify";
|
|
3
|
+
export declare function createSSEFactory<T extends z.ZodObject>(socket: FastifyRequest["socket"], reply: FastifyReply, _events: T): SSEConnection<T>;
|
|
4
|
+
declare class SSEConnection<T extends z.ZodObject> {
|
|
5
|
+
private readonly socket;
|
|
6
|
+
private readonly reply;
|
|
7
|
+
private _closed;
|
|
8
|
+
constructor(socket: FastifyRequest["socket"], reply: FastifyReply);
|
|
9
|
+
publish<K extends keyof z.infer<T>>(event: K, data: z.infer<T>[K]): void;
|
|
10
|
+
end(): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=sse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sse.d.ts","sourceRoot":"","sources":["../../src/stream/sse.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,EACpD,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,CAAC,oBAGX;AAED,cAAM,aAAa,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS;IAIrC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,OAAO,CAAC,OAAO,CAAS;gBAGL,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,EAChC,KAAK,EAAE,YAAY;IAOtC,OAAO,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI;IAWlE,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAa3B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});Object.defineProperty(exports,"createSSEFactory",{enumerable:true,get:function(){return createSSEFactory}});function asyncGeneratorStep(gen,resolve,reject,_next,_throw,key,arg){try{var info=gen[key](arg);var value=info.value}catch(error){reject(error);return}if(info.done){resolve(value)}else{Promise.resolve(value).then(_next,_throw)}}function _async_to_generator(fn){return function(){var self=this,args=arguments;return new Promise(function(resolve,reject){var gen=fn.apply(self,args);function _next(value){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"next",value)}function _throw(err){asyncGeneratorStep(gen,resolve,reject,_next,_throw,"throw",err)}_next(undefined)})}}function _class_call_check(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor)}}function _create_class(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);return Constructor}function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _ts_generator(thisArg,body){var f,y,t,_={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},g=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return g.next=verb(0),g["throw"]=verb(1),g["return"]=verb(2),typeof Symbol==="function"&&(g[Symbol.iterator]=function(){return this}),g;function verb(n){return function(v){return step([n,v])}}function step(op){if(f)throw new TypeError("Generator is already executing.");while(g&&(g=0,op[0]&&(_=0)),_)try{if(f=1,y&&(t=op[0]&2?y["return"]:op[0]?y["throw"]||((t=y["return"])&&t.call(y),0):y.next)&&!(t=t.call(y,op[1])).done)return t;if(y=0,t)op=[op[0]&2,t.value];switch(op[0]){case 0:case 1:t=op;break;case 4:_.label++;return{value:op[1],done:false};case 5:_.label++;y=op[1];op=[0];continue;case 7:op=_.ops.pop();_.trys.pop();continue;default:if(!(t=_.trys,t=t.length>0&&t[t.length-1])&&(op[0]===6||op[0]===2)){_=0;continue}if(op[0]===3&&(!t||op[1]>t[0]&&op[1]<t[3])){_.label=op[1];break}if(op[0]===6&&_.label<t[1]){_.label=t[1];t=op;break}if(t&&_.label<t[2]){_.label=t[2];_.ops.push(op);break}if(t[2])_.ops.pop();_.trys.pop();continue}op=body.call(thisArg,_)}catch(e){op=[6,e];y=0}finally{f=t=0}if(op[0]&5)throw op[1];return{value:op[0]?op[1]:void 0,done:true}}}function createSSEFactory(socket,reply,_events){return new SSEConnection(socket,reply)}var SSEConnection=/*#__PURE__*/function(){"use strict";function SSEConnection(socket,reply){var _this=this;_class_call_check(this,SSEConnection);_define_property(this,"socket",void 0);_define_property(this,"reply",void 0);_define_property(this,"_closed",void 0);this.socket=socket;this.reply=reply;this._closed=false;this.socket.on("close",function(){_this._closed=true})}_create_class(SSEConnection,[{key:"publish",value:function publish(event,data){if(this._closed){return}this.reply.sse({event:event,data:JSON.stringify(data)})}},{key:"end",value:function end(){return _async_to_generator(function(){return _ts_generator(this,function(_state){switch(_state.label){case 0:if(this._closed){return[2]}this.reply.sse({event:"end",data:"END"});return[4,new Promise(function(resolve){return setTimeout(resolve,200)})];case 1:_state.sent();this.reply.raw.end();return[2]}})}).call(this)}}]);return SSEConnection}();
|
|
2
|
+
//# sourceMappingURL=sse.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/stream/sse.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { FastifyRequest, FastifyReply } from \"fastify\";\n\n// NOTE(Haze, 251106): context provider에서 인자를 채워주면 createSSE(events)만으로 사용 가능\nexport function createSSEFactory<T extends z.ZodObject>(\n socket: FastifyRequest[\"socket\"],\n reply: FastifyReply,\n _events: T\n) {\n return new SSEConnection<T>(socket, reply);\n}\n\nclass SSEConnection<T extends z.ZodObject> {\n private _closed = false;\n\n constructor(\n private readonly socket: FastifyRequest[\"socket\"],\n private readonly reply: FastifyReply\n ) {\n this.socket.on(\"close\", () => {\n this._closed = true;\n });\n }\n\n publish<K extends keyof z.infer<T>>(event: K, data: z.infer<T>[K]): void {\n if (this._closed) {\n return;\n }\n\n this.reply.sse({\n event: event as string,\n data: JSON.stringify(data),\n });\n }\n\n async end(): Promise<void> {\n if (this._closed) {\n return;\n }\n\n this.reply.sse({\n event: \"end\",\n data: \"END\",\n });\n \n await new Promise((resolve) => setTimeout(resolve, 200));\n this.reply.raw.end();\n }\n}\n"],"names":["createSSEFactory","socket","reply","_events","SSEConnection","_closed","on","publish","event","data","sse","JSON","stringify","end","Promise","resolve","setTimeout","raw"],"mappings":"oGAIgBA,0DAAAA,qmFAAT,SAASA,iBACdC,MAAgC,CAChCC,KAAmB,CACnBC,OAAU,EAEV,OAAO,IAAIC,cAAiBH,OAAQC,MACtC,CAEA,IAAA,AAAME,2BAAN,iCAAMA,cAIF,AAAiBH,MAAgC,CACjD,AAAiBC,KAAmB,wCALlCE,4FACJ,sBAAQC,UAAR,KAAA,QAGmBJ,OAAAA,YACAC,MAAAA,WAJXG,QAAU,MAMhB,IAAI,CAACJ,MAAM,CAACK,EAAE,CAAC,QAAS,WACtB,MAAKD,OAAO,CAAG,IACjB,iBATED,gBAYJG,IAAAA,gBAAAA,SAAAA,QAAoCC,KAAQ,CAAEC,IAAmB,EAC/D,GAAI,IAAI,CAACJ,OAAO,CAAE,CAChB,MACF,CAEA,IAAI,CAACH,KAAK,CAACQ,GAAG,CAAC,CACbF,MAAOA,MACPC,KAAME,KAAKC,SAAS,CAACH,KACvB,EACF,IAEMI,IAAAA,YAAN,SAAMA,mHACJ,GAAI,IAAI,CAACR,OAAO,CAAE,CAChB,SACF,CAEA,IAAI,CAACH,KAAK,CAACQ,GAAG,CAAC,CACbF,MAAO,MACPC,KAAM,KACR,GAEA,SAAM,IAAIK,QAAQ,SAACC,gBAAYC,WAAWD,QAAS,eAAnD,cACA,IAAI,CAACb,KAAK,CAACe,GAAG,CAACJ,GAAG,eACpB,yBAnCIT"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { z } from "zod";
|
|
|
7
7
|
import type { Context, ApiDecoratorOptions } from "../api";
|
|
8
8
|
import type { FastifyMultipartOptions } from "@fastify/multipart";
|
|
9
9
|
import type { Driver } from "../file-storage/driver";
|
|
10
|
+
import type { SsePluginOptions } from "fastify-sse-v2/lib/types";
|
|
10
11
|
export type EnumsLabel<T extends string, L extends "ko" | "en"> = {
|
|
11
12
|
[key in T]: {
|
|
12
13
|
[lang in L]: string;
|
|
@@ -560,7 +561,7 @@ export type ManyToManyBaseSchema<FromIdKey extends string, ToIdKey extends strin
|
|
|
560
561
|
[K in `${ToIdKey}_id`]: number;
|
|
561
562
|
};
|
|
562
563
|
export type SonamuFastifyConfig = {
|
|
563
|
-
contextProvider: (defaultContext: Pick<Context, "request" | "reply" | "headers">, request: FastifyRequest, reply: FastifyReply) => Context;
|
|
564
|
+
contextProvider: (defaultContext: Pick<Context, "request" | "reply" | "headers" | "createSSE">, request: FastifyRequest, reply: FastifyReply) => Context;
|
|
564
565
|
guardHandler: (guard: GuardKey, request: FastifyRequest, api: {
|
|
565
566
|
typeParameters: ApiParamType.TypeParam[];
|
|
566
567
|
parameters: ApiParam[];
|
|
@@ -591,10 +592,11 @@ export type SonamuServerOptions = {
|
|
|
591
592
|
host?: string;
|
|
592
593
|
};
|
|
593
594
|
plugins?: {
|
|
594
|
-
formbody?: boolean | FastifyFormbodyOptions;
|
|
595
|
-
qs?: boolean | QsPluginOptions;
|
|
596
595
|
cors?: boolean | FastifyCorsOptions;
|
|
596
|
+
formbody?: boolean | FastifyFormbodyOptions;
|
|
597
597
|
multipart?: boolean | FastifyMultipartOptions;
|
|
598
|
+
qs?: boolean | QsPluginOptions;
|
|
599
|
+
sse?: boolean | SsePluginOptions;
|
|
598
600
|
custom?: (server: FastifyInstance) => void;
|
|
599
601
|
};
|
|
600
602
|
apiConfig: SonamuFastifyConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AACjB,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jB,SAAS,CAAC,EAAE;QACV,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC5D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;QAC/D,OAAO,CAAC,EAAE,CACR,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,YAAY,KAChB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;KAC3B,CAAC;CACH,CAAC"}
|
package/dist/types/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/types.ts"],"sourcesContent":["import type { GuardKey } from \"./../api/decorators\";\nimport type { FastifyCorsOptions } from \"@fastify/cors\";\nimport type { FastifyFormbodyOptions } from \"@fastify/formbody\";\nimport type {\n FastifyInstance,\n FastifyReply,\n FastifyRequest,\n FastifyServerOptions,\n} from \"fastify\";\nimport type { QsPluginOptions } from \"fastify-qs\";\nimport { z } from \"zod\";\nimport type { Context, ApiDecoratorOptions } from \"../api\";\nimport type { FastifyMultipartOptions } from \"@fastify/multipart\";\nimport type { Driver } from \"../file-storage/driver\";\n\n/*\n Enums\n*/\nexport type EnumsLabel<T extends string, L extends \"ko\" | \"en\"> = {\n [key in T]: { [lang in L]: string };\n};\nexport type EnumsLabelKo<T extends string> = EnumsLabel<T, \"ko\">;\n\n/*\n Custom Scalars\n*/\nexport const SQLDateTimeString = z\n .string()\n .regex(/([0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*)$/, {\n message: \"잘못된 SQLDate 타입\",\n })\n .min(10)\n .max(19)\n .describe(\"SQLDateTimeString\");\nexport type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;\n\n/*\n Utility Types\n*/\nexport function zArrayable<T extends z.ZodTypeAny>(\n shape: T\n): z.ZodUnion<[T, z.ZodArray<T>]> {\n return z.union([shape, shape.array()]);\n}\nexport type DistributiveOmit<T, K extends keyof any> = T extends any\n ? Omit<T, K>\n : never;\n\n/*\n Model-Defintion\n*/\nexport type CommonProp = {\n name: string;\n nullable?: boolean;\n toFilter?: true;\n desc?: string;\n dbDefault?: string;\n};\nexport type IntegerProp = CommonProp & {\n type: \"integer\";\n unsigned?: true;\n};\nexport type BigIntegerProp = CommonProp & {\n type: \"bigInteger\";\n unsigned?: true;\n};\nexport type TextProp = CommonProp & {\n type: \"text\";\n textType: \"text\" | \"mediumtext\" | \"longtext\";\n};\nexport type StringProp = CommonProp & {\n type: \"string\";\n length: number;\n};\nexport type EnumProp = CommonProp & {\n type: \"enum\";\n length: number;\n id: string;\n};\nexport type FloatProp = CommonProp & {\n type: \"float\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DoubleProp = CommonProp & {\n type: \"double\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DecimalProp = CommonProp & {\n type: \"decimal\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type BooleanProp = CommonProp & {\n type: \"boolean\";\n};\nexport type DateProp = CommonProp & {\n type: \"date\";\n};\nexport type DateTimeProp = CommonProp & {\n type: \"datetime\";\n};\nexport type TimeProp = CommonProp & {\n type: \"time\";\n};\nexport type TimestampProp = CommonProp & {\n type: \"timestamp\";\n};\nexport type JsonProp = CommonProp & {\n type: \"json\";\n id: string;\n};\nexport type UuidProp = CommonProp & {\n type: \"uuid\";\n};\nexport type VirtualProp = CommonProp & {\n type: \"virtual\";\n id: string;\n};\n\nexport type RelationType =\n | \"HasMany\"\n | \"BelongsToOne\"\n | \"ManyToMany\"\n | \"OneToOne\";\nexport type RelationOn =\n | \"CASCADE\"\n | \"SET NULL\"\n | \"NO ACTION\"\n | \"SET DEFAULT\"\n | \"RESTRICT\";\ntype _RelationProp = {\n type: \"relation\";\n name: string;\n with: string;\n nullable?: boolean; // DEFAULT: false\n toFilter?: true; // DEFAULT: false\n desc?: string;\n};\nexport type OneToOneRelationProp = _RelationProp & {\n relationType: \"OneToOne\";\n customJoinClause?: string;\n} & (\n | {\n hasJoinColumn: true;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n }\n | {\n hasJoinColumn: false;\n }\n );\nexport type BelongsToOneRelationProp = _RelationProp & {\n relationType: \"BelongsToOne\";\n customJoinClause?: string;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n};\nexport type HasManyRelationProp = _RelationProp & {\n relationType: \"HasMany\";\n joinColumn: string;\n fromColumn?: string;\n};\nexport type ManyToManyRelationProp = _RelationProp & {\n relationType: \"ManyToMany\";\n joinTable: `${string}__${string}`;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type RelationProp =\n | OneToOneRelationProp\n | BelongsToOneRelationProp\n | HasManyRelationProp\n | ManyToManyRelationProp;\n\nexport type EntityProp =\n | IntegerProp\n | BigIntegerProp\n | TextProp\n | StringProp\n | FloatProp\n | DoubleProp\n | DecimalProp\n | BooleanProp\n | DateProp\n | DateTimeProp\n | TimeProp\n | TimestampProp\n | JsonProp\n | UuidProp\n | EnumProp\n | VirtualProp\n | RelationProp;\n\nexport type EntityIndex = {\n type: \"index\" | \"unique\" | \"fulltext\";\n columns: string[];\n name?: string;\n parser?: \"built-in\" | \"ngram\";\n};\nexport type EntityJson = {\n id: string;\n parentId?: string;\n table: string;\n title?: string;\n props: EntityProp[];\n indexes: EntityIndex[];\n subsets: {\n [subset: string]: string[];\n };\n enums: {\n [enumId: string]: {\n [key: string]: string;\n };\n };\n};\nexport type EntitySubsetRow = {\n field: string;\n has: {\n [key: string]: boolean;\n };\n children: EntitySubsetRow[];\n prefixes: string[];\n relationEntity?: string;\n isOpen?: boolean;\n};\nexport type FlattenSubsetRow = Omit<EntitySubsetRow, \"children\">;\n\n// SMD Legacy\nexport type SMDInput<T extends string> = {\n id: string;\n parentId?: string;\n table?: string;\n title?: string;\n props?: EntityProp[];\n indexes?: EntityIndex[];\n subsets?: {\n [subset: string]: T[];\n };\n};\n\n/*\n PropNode\n*/\n\nexport type EntityPropNode =\n | {\n nodeType: \"plain\";\n prop: EntityProp;\n }\n | {\n nodeType: \"object\" | \"array\";\n prop?: EntityProp;\n children: EntityPropNode[];\n };\n\n/*\n Prop Type Guards\n*/\nexport function isIntegerProp(p: any): p is IntegerProp {\n return p?.type === \"integer\";\n}\nexport function isBigIntegerProp(p: any): p is BigIntegerProp {\n return p?.type === \"bigInteger\";\n}\nexport function isTextProp(p: any): p is TextProp {\n return p?.type === \"text\";\n}\nexport function isStringProp(p: any): p is StringProp {\n return p?.type === \"string\";\n}\nexport function isEnumProp(p: any): p is EnumProp {\n return p?.type === \"enum\";\n}\nexport function isFloatProp(p: any): p is FloatProp {\n return p?.type === \"float\";\n}\nexport function isDoubleProp(p: any): p is DoubleProp {\n return p?.type === \"double\";\n}\nexport function isDecimalProp(p: any): p is DecimalProp {\n return p?.type === \"decimal\";\n}\nexport function isBooleanProp(p: any): p is BooleanProp {\n return p?.type === \"boolean\";\n}\nexport function isDateProp(p: any): p is DateProp {\n return p?.type === \"date\";\n}\nexport function isDateTimeProp(p: any): p is DateTimeProp {\n return p?.type === \"datetime\";\n}\nexport function isTimeProp(p: any): p is TimeProp {\n return p?.type === \"time\";\n}\nexport function isTimestampProp(p: any): p is TimestampProp {\n return p?.type === \"timestamp\";\n}\nexport function isJsonProp(p: any): p is JsonProp {\n return p?.type === \"json\";\n}\nexport function isUuidProp(p: any): p is UuidProp {\n return p?.type === \"uuid\";\n}\nexport function isVirtualProp(p: any): p is VirtualProp {\n return p?.type === \"virtual\";\n}\nexport function isRelationProp(p: any): p is RelationProp {\n return p?.type === \"relation\";\n}\nexport function isOneToOneRelationProp(p: any): p is OneToOneRelationProp {\n return p?.relationType === \"OneToOne\";\n}\nexport function isBelongsToOneRelationProp(\n p: any\n): p is BelongsToOneRelationProp {\n return p?.relationType === \"BelongsToOne\";\n}\nexport function isHasManyRelationProp(p: any): p is HasManyRelationProp {\n return p?.relationType === \"HasMany\";\n}\nexport function isManyToManyRelationProp(p: any): p is ManyToManyRelationProp {\n return p?.relationType === \"ManyToMany\";\n}\n\ntype JoinClause =\n | {\n from: string;\n to: string;\n }\n | {\n custom: string;\n };\nexport function isCustomJoinClause(p: any): p is { custom: string } {\n return p?.custom;\n}\n\n/* 서브셋 */\n// type SubsetLoader = {\n// as: string;\n// table: string;\n// manyJoin: {\n// fromTable: string;\n// fromCol: string;\n// idField: string;\n// toTable: string;\n// toCol: string;\n// through?: {\n// table: string;\n// fromCol: string;\n// toCol: string;\n// };\n// };\n// oneJoins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// select: (string | Knex.Raw)[];\n// loaders?: SubsetLoader[];\n// };\n// export type SubsetQuery = {\n// select: (string | Knex.Raw)[];\n// virtual: string[];\n// joins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// loaders: SubsetLoader[];\n// };\n\ntype SubsetLoader = {\n as: string;\n table: string;\n manyJoin: {\n fromTable: string;\n fromCol: string;\n idField: string;\n toTable: string;\n toCol: string;\n through?: {\n table: string;\n fromCol: string;\n toCol: string;\n };\n };\n oneJoins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n select: string[];\n loaders?: SubsetLoader[];\n};\n\nexport type SubsetQuery = {\n select: string[];\n virtual: string[];\n joins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n loaders: SubsetLoader[];\n};\n\n/* BaseModel */\nexport const SonamuQueryMode = z.enum([\"both\", \"list\", \"count\"]);\nexport type SonamuQueryMode = z.infer<typeof SonamuQueryMode>;\n\n/* Knex Migration */\nexport type KnexError = {\n code: string;\n errno: number;\n sql: string;\n sqlMessage: string;\n sqlState: string;\n};\nexport function isKnexError(e: any): e is KnexError {\n return e.code && e.sqlMessage && e.sqlState;\n}\n\nexport type KnexColumnType =\n | \"string\"\n | \"text\"\n | \"smalltext\"\n | \"mediumtext\"\n | \"longtext\"\n | \"integer\"\n | \"bigInteger\"\n | \"decimal\"\n | \"timestamp\"\n | \"boolean\"\n | \"foreign\"\n | \"uuid\"\n | \"json\"\n | \"float\"\n | \"date\"\n | \"time\"\n | \"datetime\";\nexport type MigrationColumn = {\n name: string;\n type: KnexColumnType;\n nullable: boolean;\n unsigned?: boolean;\n length?: number;\n defaultTo?: string;\n precision?: number;\n scale?: number;\n};\nexport type MigrationIndex = {\n columns: string[];\n type: \"unique\" | \"index\" | \"fulltext\";\n parser?: \"built-in\" | \"ngram\";\n};\nexport type MigrationForeign = {\n columns: string[];\n to: string;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type MigrationJoinTable = {\n table: string;\n indexes: MigrationIndex[];\n columns: MigrationColumn[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSet = {\n table: string;\n columns: MigrationColumn[];\n indexes: MigrationIndex[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSetAndJoinTable = MigrationSet & {\n joinTables: MigrationJoinTable[];\n};\nexport type GenMigrationCode = {\n title: string;\n table: string;\n type: \"normal\" | \"foreign\";\n formatted: string | null;\n};\n\n/* Api */\nexport type ApiParam = {\n name: string;\n type: ApiParamType;\n optional: boolean;\n defaultDef?: string;\n};\nexport namespace ApiParamType {\n export type Object = {\n t: \"object\";\n props: ApiParam[];\n };\n export type Union = {\n t: \"union\";\n types: ApiParamType[];\n };\n export type Intersection = {\n t: \"intersection\";\n types: ApiParamType[];\n };\n export type StringLiteral = {\n t: \"string-literal\";\n value: string;\n };\n export type NumericLiteral = {\n t: \"numeric-literal\";\n value: number;\n };\n export type Array = {\n t: \"array\";\n elementsType: ApiParamType;\n };\n export type Ref = {\n t: \"ref\";\n id: string;\n args?: ApiParamType[];\n };\n export type IndexedAccess = {\n t: \"indexed-access\";\n object: ApiParamType;\n index: ApiParamType;\n };\n export type TupleType = {\n t: \"tuple-type\";\n elements: ApiParamType[];\n };\n export type Pick = Ref & {\n t: \"ref\";\n id: \"Pick\";\n };\n export type Omit = Ref & {\n t: \"ref\";\n id: \"Omit\";\n };\n export type Partial = Ref & {\n t: \"ref\";\n id: \"Partial\";\n };\n export type Promise = Ref & {\n t: \"ref\";\n id: \"Promise\";\n };\n export type Context = Ref & {\n t: \"ref\";\n id: \"Context\";\n };\n export type TypeParam = {\n t: \"type-param\";\n id: string;\n constraint?: ApiParamType;\n };\n\n export function isObject(v: any): v is ApiParamType.Object {\n return v?.t === \"object\";\n }\n export function isUnion(v: any): v is ApiParamType.Union {\n return v?.t === \"union\";\n }\n export function isIntersection(v: any): v is ApiParamType.Intersection {\n return v?.t === \"intersection\";\n }\n export function isStringLiteral(v: any): v is ApiParamType.StringLiteral {\n return v?.t === \"string-literal\";\n }\n export function isNumericLiteral(v: any): v is ApiParamType.NumericLiteral {\n return v?.t === \"numeric-literal\";\n }\n export function isArray(v: any): v is ApiParamType.Array {\n return v?.t === \"array\";\n }\n export function isRef(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\";\n }\n export function isIndexedAccess(v: any): v is ApiParamType.IndexedAccess {\n return v?.t === \"indexed-access\";\n }\n export function isTupleType(v: any): v is ApiParamType.TupleType {\n return v?.t === \"tuple-type\";\n }\n export function isPick(v: any): v is ApiParamType.Pick {\n return v?.t === \"ref\" && v.id === \"Pick\";\n }\n export function isOmit(v: any): v is ApiParamType.Omit {\n return v?.t === \"ref\" && v.id === \"Omit\";\n }\n export function isPartial(v: any): v is ApiParamType.Partial {\n return v?.t === \"ref\" && v.id === \"Partial\";\n }\n export function isPromise(v: any): v is ApiParamType.Promise {\n return v?.t === \"ref\" && v.id === \"Promise\";\n }\n export function isContext(v: any): v is ApiParamType.Context {\n return v?.t === \"ref\" && v.id === \"Context\";\n }\n export function isRefKnex(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\" && v.id === \"Knex\";\n }\n export function isTypeParam(v: any): v is ApiParamType.TypeParam {\n return v?.t === \"type-param\";\n }\n}\nexport type ApiParamType =\n | \"string\"\n | \"number\"\n | \"boolean\"\n | \"null\"\n | \"undefined\"\n | \"void\"\n | \"any\"\n | \"unknown\"\n | \"true\"\n | \"false\"\n | ApiParamType.StringLiteral\n | ApiParamType.NumericLiteral\n | ApiParamType.Object\n | ApiParamType.Union\n | ApiParamType.Intersection\n | ApiParamType.Array\n | ApiParamType.Ref\n | ApiParamType.IndexedAccess\n | ApiParamType.TypeParam\n | ApiParamType.TupleType;\n\n/* Template */\n// 셀프 참조 타입이므로 Zod 생략하고 직접 정의\nexport const RenderingNode = z.any();\nexport type RenderingNode = {\n name: string;\n label: string;\n renderType:\n | \"string-plain\"\n | \"string-image\"\n | \"string-datetime\"\n | \"string-date\"\n | \"datetime\"\n | \"number-plain\"\n | \"number-id\"\n | \"number-fk_id\"\n | \"boolean\"\n | \"enums\"\n | \"array\"\n | \"array-images\"\n | \"object\"\n | \"object-pick\"\n | \"record\";\n zodType: z.ZodTypeAny;\n element?: RenderingNode;\n children?: RenderingNode[];\n config?: {\n picked: string;\n };\n optional?: boolean;\n nullable?: boolean;\n};\n\nexport const TemplateOptions = z.object({\n entity: z.object({\n entityId: z.string(),\n parentId: z.string().optional(),\n title: z.string(),\n table: z.string().optional(),\n props: z.array(z.object({})).optional(),\n indexes: z.array(z.object({})).optional(),\n subsets: z.object({}).optional(),\n enums: z.object({}).optional(),\n }),\n init_types: z.object({\n entityId: z.string(),\n }),\n generated: z.object({}),\n generated_sso: z.object({}),\n generated_http: z.object({\n entityId: z.string(),\n }),\n model: z.object({\n entityId: z.string(),\n defaultSearchField: z.string(),\n defaultOrderBy: z.string(),\n }),\n model_test: z.object({\n entityId: z.string(),\n }),\n bridge: z.object({\n entityId: z.string(),\n }),\n service: z.object({\n namesRecord: z.object({\n fs: z.string(),\n fsPlural: z.string(),\n camel: z.string(),\n camelPlural: z.string(),\n capital: z.string(),\n capitalPlural: z.string(),\n upper: z.string(),\n constant: z.string(),\n }),\n modelTsPath: z.string(),\n }),\n view_list: z.object({\n entityId: z.string(),\n extra: z.unknown(),\n }),\n view_list_columns: z.object({\n entityId: z.string(),\n columns: z\n .object({\n name: z.string(),\n label: z.string(),\n tc: z.string(),\n })\n .array(),\n columnImports: z.string(),\n }),\n view_search_input: z.object({\n entityId: z.string(),\n }),\n view_form: z.object({\n entityId: z.string(),\n }),\n view_id_all_select: z.object({\n entityId: z.string(),\n }),\n view_id_async_select: z.object({\n entityId: z.string(),\n textField: z.string(),\n }),\n view_enums_select: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_dropdown: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_buttonset: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n});\nexport type TemplateOptions = z.infer<typeof TemplateOptions>;\n\nexport const TemplateKey = z.enum([\n \"entity\",\n \"init_types\",\n \"generated\",\n \"generated_sso\",\n \"generated_http\",\n \"model\",\n \"model_test\",\n \"bridge\",\n \"service\",\n \"view_list\",\n \"view_list_columns\",\n \"view_search_input\",\n \"view_form\",\n \"view_id_all_select\",\n \"view_id_async_select\",\n \"view_enums_select\",\n \"view_enums_dropdown\",\n \"view_enums_buttonset\",\n]);\nexport type TemplateKey = z.infer<typeof TemplateKey>;\n\nexport const GenerateOptions = z.object({\n overwrite: z.boolean().optional(),\n});\nexport type GenerateOptions = z.infer<typeof GenerateOptions>;\n\nexport const PathAndCode = z.object({\n path: z.string(),\n code: z.string(),\n});\nexport type PathAndCode = z.infer<typeof PathAndCode>;\n\nexport type FixtureSearchOptions = {\n entityId: string;\n field: string;\n value: string;\n searchType: \"equals\" | \"like\";\n};\n\nexport type FixtureRecord = {\n fixtureId: string;\n entityId: string;\n id: number;\n columns: {\n [key: string]: {\n prop: EntityProp;\n value: any;\n };\n };\n fetchedRecords: string[];\n belongsRecords: string[];\n target?: FixtureRecord; // Import 대상 DB 레코드(id가 같은)\n unique?: FixtureRecord; // Import 대상 DB 레코드(unique key가 같은)\n override?: boolean;\n};\n\nexport type FixtureImportResult = {\n entityId: string;\n data: {\n [key: string]: any;\n };\n};\n\nexport type RelationNode = {\n fixtureId: string;\n entityId: string;\n related: Set<string>;\n};\n\nexport interface DatabaseSchemaExtend {}\nexport type ManyToManyBaseSchema<\n FromIdKey extends string,\n ToIdKey extends string\n> = {\n id: number;\n} & {\n [K in `${FromIdKey}_id`]: number;\n} & {\n [K in `${ToIdKey}_id`]: number;\n};\n\nexport type SonamuFastifyConfig = {\n contextProvider: (\n defaultContext: Pick<Context, \"request\" | \"reply\" | \"headers\">,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Context;\n guardHandler: (\n guard: GuardKey,\n request: FastifyRequest,\n api: {\n typeParameters: ApiParamType.TypeParam[];\n parameters: ApiParam[];\n returnType: ApiParamType;\n modelName: string;\n methodName: string;\n path: string;\n options: ApiDecoratorOptions;\n }\n ) => void;\n cache?: {\n get: (key: string) => Promise<unknown | null>;\n put: (key: string, value: unknown, ttl?: number) => Promise<void>;\n resolveKey: (\n path: string,\n reqBody: {\n [key: string]: unknown;\n }\n ) =>\n | {\n cache: false;\n }\n | {\n cache: true;\n key: string;\n ttl?: number;\n };\n };\n};\n\nexport type SonamuServerOptions = {\n fastify?: FastifyServerOptions;\n\n listen?: {\n port: number;\n host?: string;\n };\n\n plugins?: {\n formbody?: boolean | FastifyFormbodyOptions;\n qs?: boolean | QsPluginOptions;\n cors?: boolean | FastifyCorsOptions;\n multipart?: boolean | FastifyMultipartOptions;\n custom?: (server: FastifyInstance) => void;\n };\n\n apiConfig: SonamuFastifyConfig;\n\n storage?: Driver;\n\n lifecycle?: {\n onStart?: (server: FastifyInstance) => Promise<void> | void;\n onShutdown?: (server: FastifyInstance) => Promise<void> | void;\n onError?: (\n error: Error,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Promise<void> | void;\n };\n};\n"],"names":["GenerateOptions","PathAndCode","RenderingNode","SQLDateTimeString","SonamuQueryMode","TemplateKey","TemplateOptions","isBelongsToOneRelationProp","isBigIntegerProp","isBooleanProp","isCustomJoinClause","isDateProp","isDateTimeProp","isDecimalProp","isDoubleProp","isEnumProp","isFloatProp","isHasManyRelationProp","isIntegerProp","isJsonProp","isKnexError","isManyToManyRelationProp","isOneToOneRelationProp","isRelationProp","isStringProp","isTextProp","isTimeProp","isTimestampProp","isUuidProp","isVirtualProp","zArrayable","z","string","regex","message","min","max","describe","shape","union","array","p","type","relationType","custom","enum","e","code","sqlMessage","sqlState","ApiParamType","isObject","v","t","isUnion","isIntersection","isStringLiteral","isNumericLiteral","isArray","isRef","isIndexedAccess","isTupleType","isPick","id","isOmit","isPartial","isPromise","isContext","isRefKnex","isTypeParam","any","object","entity","entityId","parentId","optional","title","table","props","indexes","subsets","enums","init_types","generated","generated_sso","generated_http","model","defaultSearchField","defaultOrderBy","model_test","bridge","service","namesRecord","fs","fsPlural","camel","camelPlural","capital","capitalPlural","upper","constant","modelTsPath","view_list","extra","unknown","view_list_columns","columns","name","label","tc","columnImports","view_search_input","view_form","view_id_all_select","view_id_async_select","textField","view_enums_select","enumId","view_enums_dropdown","view_enums_buttonset","overwrite","boolean","path"],"mappings":"2RAqwBaA,yBAAAA,qBAKAC,qBAAAA,iBA/IAC,uBAAAA,mBAjmBAC,2BAAAA,uBAoYAC,yBAAAA,qBAiVAC,qBAAAA,iBAtFAC,yBAAAA,qBA1VGC,oCAAAA,gCAnDAC,0BAAAA,sBAqBAC,uBAAAA,mBAkDAC,4BAAAA,wBA/CAC,oBAAAA,gBAGAC,wBAAAA,oBATAC,uBAAAA,mBAHAC,sBAAAA,kBANAC,oBAAAA,gBAGAC,qBAAAA,iBA4CAC,+BAAAA,2BA3DAC,uBAAAA,mBAuCAC,oBAAAA,gBAyHAC,qBAAAA,iBAlGAC,kCAAAA,8BAXAC,gCAAAA,4BAHAC,wBAAA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AM3F,MAAC,CAACC,MAAM,GACde,KAAMhB,MAAC,CAACC,MAAM,EAChB"}
|
|
1
|
+
{"version":3,"sources":["../../src/types/types.ts"],"sourcesContent":["import type { GuardKey } from \"./../api/decorators\";\nimport type { FastifyCorsOptions } from \"@fastify/cors\";\nimport type { FastifyFormbodyOptions } from \"@fastify/formbody\";\nimport type {\n FastifyInstance,\n FastifyReply,\n FastifyRequest,\n FastifyServerOptions,\n} from \"fastify\";\nimport type { QsPluginOptions } from \"fastify-qs\";\nimport { z } from \"zod\";\nimport type { Context, ApiDecoratorOptions } from \"../api\";\nimport type { FastifyMultipartOptions } from \"@fastify/multipart\";\nimport type { Driver } from \"../file-storage/driver\";\nimport type { SsePluginOptions } from \"fastify-sse-v2/lib/types\";\n\n/*\n Enums\n*/\nexport type EnumsLabel<T extends string, L extends \"ko\" | \"en\"> = {\n [key in T]: { [lang in L]: string };\n};\nexport type EnumsLabelKo<T extends string> = EnumsLabel<T, \"ko\">;\n\n/*\n Custom Scalars\n*/\nexport const SQLDateTimeString = z\n .string()\n .regex(/([0-9]{4}-[0-9]{2}-[0-9]{2}( [0-9]{2}:[0-9]{2}:[0-9]{2})*)$/, {\n message: \"잘못된 SQLDate 타입\",\n })\n .min(10)\n .max(19)\n .describe(\"SQLDateTimeString\");\nexport type SQLDateTimeString = z.infer<typeof SQLDateTimeString>;\n\n/*\n Utility Types\n*/\nexport function zArrayable<T extends z.ZodTypeAny>(\n shape: T\n): z.ZodUnion<[T, z.ZodArray<T>]> {\n return z.union([shape, shape.array()]);\n}\nexport type DistributiveOmit<T, K extends keyof any> = T extends any\n ? Omit<T, K>\n : never;\n\n/*\n Model-Defintion\n*/\nexport type CommonProp = {\n name: string;\n nullable?: boolean;\n toFilter?: true;\n desc?: string;\n dbDefault?: string;\n};\nexport type IntegerProp = CommonProp & {\n type: \"integer\";\n unsigned?: true;\n};\nexport type BigIntegerProp = CommonProp & {\n type: \"bigInteger\";\n unsigned?: true;\n};\nexport type TextProp = CommonProp & {\n type: \"text\";\n textType: \"text\" | \"mediumtext\" | \"longtext\";\n};\nexport type StringProp = CommonProp & {\n type: \"string\";\n length: number;\n};\nexport type EnumProp = CommonProp & {\n type: \"enum\";\n length: number;\n id: string;\n};\nexport type FloatProp = CommonProp & {\n type: \"float\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DoubleProp = CommonProp & {\n type: \"double\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type DecimalProp = CommonProp & {\n type: \"decimal\";\n unsigned?: true;\n precision: number;\n scale: number;\n};\nexport type BooleanProp = CommonProp & {\n type: \"boolean\";\n};\nexport type DateProp = CommonProp & {\n type: \"date\";\n};\nexport type DateTimeProp = CommonProp & {\n type: \"datetime\";\n};\nexport type TimeProp = CommonProp & {\n type: \"time\";\n};\nexport type TimestampProp = CommonProp & {\n type: \"timestamp\";\n};\nexport type JsonProp = CommonProp & {\n type: \"json\";\n id: string;\n};\nexport type UuidProp = CommonProp & {\n type: \"uuid\";\n};\nexport type VirtualProp = CommonProp & {\n type: \"virtual\";\n id: string;\n};\n\nexport type RelationType =\n | \"HasMany\"\n | \"BelongsToOne\"\n | \"ManyToMany\"\n | \"OneToOne\";\nexport type RelationOn =\n | \"CASCADE\"\n | \"SET NULL\"\n | \"NO ACTION\"\n | \"SET DEFAULT\"\n | \"RESTRICT\";\ntype _RelationProp = {\n type: \"relation\";\n name: string;\n with: string;\n nullable?: boolean; // DEFAULT: false\n toFilter?: true; // DEFAULT: false\n desc?: string;\n};\nexport type OneToOneRelationProp = _RelationProp & {\n relationType: \"OneToOne\";\n customJoinClause?: string;\n} & (\n | {\n hasJoinColumn: true;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n }\n | {\n hasJoinColumn: false;\n }\n );\nexport type BelongsToOneRelationProp = _RelationProp & {\n relationType: \"BelongsToOne\";\n customJoinClause?: string;\n useConstraint?: boolean; // DEFAULT: true\n onUpdate?: RelationOn; // DEFAULT: RESTRICT\n onDelete?: RelationOn; // DEFAULT: RESTRICT\n};\nexport type HasManyRelationProp = _RelationProp & {\n relationType: \"HasMany\";\n joinColumn: string;\n fromColumn?: string;\n};\nexport type ManyToManyRelationProp = _RelationProp & {\n relationType: \"ManyToMany\";\n joinTable: `${string}__${string}`;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type RelationProp =\n | OneToOneRelationProp\n | BelongsToOneRelationProp\n | HasManyRelationProp\n | ManyToManyRelationProp;\n\nexport type EntityProp =\n | IntegerProp\n | BigIntegerProp\n | TextProp\n | StringProp\n | FloatProp\n | DoubleProp\n | DecimalProp\n | BooleanProp\n | DateProp\n | DateTimeProp\n | TimeProp\n | TimestampProp\n | JsonProp\n | UuidProp\n | EnumProp\n | VirtualProp\n | RelationProp;\n\nexport type EntityIndex = {\n type: \"index\" | \"unique\" | \"fulltext\";\n columns: string[];\n name?: string;\n parser?: \"built-in\" | \"ngram\";\n};\nexport type EntityJson = {\n id: string;\n parentId?: string;\n table: string;\n title?: string;\n props: EntityProp[];\n indexes: EntityIndex[];\n subsets: {\n [subset: string]: string[];\n };\n enums: {\n [enumId: string]: {\n [key: string]: string;\n };\n };\n};\nexport type EntitySubsetRow = {\n field: string;\n has: {\n [key: string]: boolean;\n };\n children: EntitySubsetRow[];\n prefixes: string[];\n relationEntity?: string;\n isOpen?: boolean;\n};\nexport type FlattenSubsetRow = Omit<EntitySubsetRow, \"children\">;\n\n// SMD Legacy\nexport type SMDInput<T extends string> = {\n id: string;\n parentId?: string;\n table?: string;\n title?: string;\n props?: EntityProp[];\n indexes?: EntityIndex[];\n subsets?: {\n [subset: string]: T[];\n };\n};\n\n/*\n PropNode\n*/\n\nexport type EntityPropNode =\n | {\n nodeType: \"plain\";\n prop: EntityProp;\n }\n | {\n nodeType: \"object\" | \"array\";\n prop?: EntityProp;\n children: EntityPropNode[];\n };\n\n/*\n Prop Type Guards\n*/\nexport function isIntegerProp(p: any): p is IntegerProp {\n return p?.type === \"integer\";\n}\nexport function isBigIntegerProp(p: any): p is BigIntegerProp {\n return p?.type === \"bigInteger\";\n}\nexport function isTextProp(p: any): p is TextProp {\n return p?.type === \"text\";\n}\nexport function isStringProp(p: any): p is StringProp {\n return p?.type === \"string\";\n}\nexport function isEnumProp(p: any): p is EnumProp {\n return p?.type === \"enum\";\n}\nexport function isFloatProp(p: any): p is FloatProp {\n return p?.type === \"float\";\n}\nexport function isDoubleProp(p: any): p is DoubleProp {\n return p?.type === \"double\";\n}\nexport function isDecimalProp(p: any): p is DecimalProp {\n return p?.type === \"decimal\";\n}\nexport function isBooleanProp(p: any): p is BooleanProp {\n return p?.type === \"boolean\";\n}\nexport function isDateProp(p: any): p is DateProp {\n return p?.type === \"date\";\n}\nexport function isDateTimeProp(p: any): p is DateTimeProp {\n return p?.type === \"datetime\";\n}\nexport function isTimeProp(p: any): p is TimeProp {\n return p?.type === \"time\";\n}\nexport function isTimestampProp(p: any): p is TimestampProp {\n return p?.type === \"timestamp\";\n}\nexport function isJsonProp(p: any): p is JsonProp {\n return p?.type === \"json\";\n}\nexport function isUuidProp(p: any): p is UuidProp {\n return p?.type === \"uuid\";\n}\nexport function isVirtualProp(p: any): p is VirtualProp {\n return p?.type === \"virtual\";\n}\nexport function isRelationProp(p: any): p is RelationProp {\n return p?.type === \"relation\";\n}\nexport function isOneToOneRelationProp(p: any): p is OneToOneRelationProp {\n return p?.relationType === \"OneToOne\";\n}\nexport function isBelongsToOneRelationProp(\n p: any\n): p is BelongsToOneRelationProp {\n return p?.relationType === \"BelongsToOne\";\n}\nexport function isHasManyRelationProp(p: any): p is HasManyRelationProp {\n return p?.relationType === \"HasMany\";\n}\nexport function isManyToManyRelationProp(p: any): p is ManyToManyRelationProp {\n return p?.relationType === \"ManyToMany\";\n}\n\ntype JoinClause =\n | {\n from: string;\n to: string;\n }\n | {\n custom: string;\n };\nexport function isCustomJoinClause(p: any): p is { custom: string } {\n return p?.custom;\n}\n\n/* 서브셋 */\n// type SubsetLoader = {\n// as: string;\n// table: string;\n// manyJoin: {\n// fromTable: string;\n// fromCol: string;\n// idField: string;\n// toTable: string;\n// toCol: string;\n// through?: {\n// table: string;\n// fromCol: string;\n// toCol: string;\n// };\n// };\n// oneJoins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// select: (string | Knex.Raw)[];\n// loaders?: SubsetLoader[];\n// };\n// export type SubsetQuery = {\n// select: (string | Knex.Raw)[];\n// virtual: string[];\n// joins: ({\n// as: string;\n// join: \"inner\" | \"outer\";\n// table: string;\n// } & JoinClause)[];\n// loaders: SubsetLoader[];\n// };\n\ntype SubsetLoader = {\n as: string;\n table: string;\n manyJoin: {\n fromTable: string;\n fromCol: string;\n idField: string;\n toTable: string;\n toCol: string;\n through?: {\n table: string;\n fromCol: string;\n toCol: string;\n };\n };\n oneJoins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n select: string[];\n loaders?: SubsetLoader[];\n};\n\nexport type SubsetQuery = {\n select: string[];\n virtual: string[];\n joins: ({\n as: string;\n join: \"inner\" | \"outer\";\n table: string;\n } & JoinClause)[];\n loaders: SubsetLoader[];\n};\n\n/* BaseModel */\nexport const SonamuQueryMode = z.enum([\"both\", \"list\", \"count\"]);\nexport type SonamuQueryMode = z.infer<typeof SonamuQueryMode>;\n\n/* Knex Migration */\nexport type KnexError = {\n code: string;\n errno: number;\n sql: string;\n sqlMessage: string;\n sqlState: string;\n};\nexport function isKnexError(e: any): e is KnexError {\n return e.code && e.sqlMessage && e.sqlState;\n}\n\nexport type KnexColumnType =\n | \"string\"\n | \"text\"\n | \"smalltext\"\n | \"mediumtext\"\n | \"longtext\"\n | \"integer\"\n | \"bigInteger\"\n | \"decimal\"\n | \"timestamp\"\n | \"boolean\"\n | \"foreign\"\n | \"uuid\"\n | \"json\"\n | \"float\"\n | \"date\"\n | \"time\"\n | \"datetime\";\nexport type MigrationColumn = {\n name: string;\n type: KnexColumnType;\n nullable: boolean;\n unsigned?: boolean;\n length?: number;\n defaultTo?: string;\n precision?: number;\n scale?: number;\n};\nexport type MigrationIndex = {\n columns: string[];\n type: \"unique\" | \"index\" | \"fulltext\";\n parser?: \"built-in\" | \"ngram\";\n};\nexport type MigrationForeign = {\n columns: string[];\n to: string;\n onUpdate: RelationOn;\n onDelete: RelationOn;\n};\nexport type MigrationJoinTable = {\n table: string;\n indexes: MigrationIndex[];\n columns: MigrationColumn[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSet = {\n table: string;\n columns: MigrationColumn[];\n indexes: MigrationIndex[];\n foreigns: MigrationForeign[];\n};\nexport type MigrationSetAndJoinTable = MigrationSet & {\n joinTables: MigrationJoinTable[];\n};\nexport type GenMigrationCode = {\n title: string;\n table: string;\n type: \"normal\" | \"foreign\";\n formatted: string | null;\n};\n\n/* Api */\nexport type ApiParam = {\n name: string;\n type: ApiParamType;\n optional: boolean;\n defaultDef?: string;\n};\nexport namespace ApiParamType {\n export type Object = {\n t: \"object\";\n props: ApiParam[];\n };\n export type Union = {\n t: \"union\";\n types: ApiParamType[];\n };\n export type Intersection = {\n t: \"intersection\";\n types: ApiParamType[];\n };\n export type StringLiteral = {\n t: \"string-literal\";\n value: string;\n };\n export type NumericLiteral = {\n t: \"numeric-literal\";\n value: number;\n };\n export type Array = {\n t: \"array\";\n elementsType: ApiParamType;\n };\n export type Ref = {\n t: \"ref\";\n id: string;\n args?: ApiParamType[];\n };\n export type IndexedAccess = {\n t: \"indexed-access\";\n object: ApiParamType;\n index: ApiParamType;\n };\n export type TupleType = {\n t: \"tuple-type\";\n elements: ApiParamType[];\n };\n export type Pick = Ref & {\n t: \"ref\";\n id: \"Pick\";\n };\n export type Omit = Ref & {\n t: \"ref\";\n id: \"Omit\";\n };\n export type Partial = Ref & {\n t: \"ref\";\n id: \"Partial\";\n };\n export type Promise = Ref & {\n t: \"ref\";\n id: \"Promise\";\n };\n export type Context = Ref & {\n t: \"ref\";\n id: \"Context\";\n };\n export type TypeParam = {\n t: \"type-param\";\n id: string;\n constraint?: ApiParamType;\n };\n\n export function isObject(v: any): v is ApiParamType.Object {\n return v?.t === \"object\";\n }\n export function isUnion(v: any): v is ApiParamType.Union {\n return v?.t === \"union\";\n }\n export function isIntersection(v: any): v is ApiParamType.Intersection {\n return v?.t === \"intersection\";\n }\n export function isStringLiteral(v: any): v is ApiParamType.StringLiteral {\n return v?.t === \"string-literal\";\n }\n export function isNumericLiteral(v: any): v is ApiParamType.NumericLiteral {\n return v?.t === \"numeric-literal\";\n }\n export function isArray(v: any): v is ApiParamType.Array {\n return v?.t === \"array\";\n }\n export function isRef(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\";\n }\n export function isIndexedAccess(v: any): v is ApiParamType.IndexedAccess {\n return v?.t === \"indexed-access\";\n }\n export function isTupleType(v: any): v is ApiParamType.TupleType {\n return v?.t === \"tuple-type\";\n }\n export function isPick(v: any): v is ApiParamType.Pick {\n return v?.t === \"ref\" && v.id === \"Pick\";\n }\n export function isOmit(v: any): v is ApiParamType.Omit {\n return v?.t === \"ref\" && v.id === \"Omit\";\n }\n export function isPartial(v: any): v is ApiParamType.Partial {\n return v?.t === \"ref\" && v.id === \"Partial\";\n }\n export function isPromise(v: any): v is ApiParamType.Promise {\n return v?.t === \"ref\" && v.id === \"Promise\";\n }\n export function isContext(v: any): v is ApiParamType.Context {\n return v?.t === \"ref\" && v.id === \"Context\";\n }\n export function isRefKnex(v: any): v is ApiParamType.Ref {\n return v?.t === \"ref\" && v.id === \"Knex\";\n }\n export function isTypeParam(v: any): v is ApiParamType.TypeParam {\n return v?.t === \"type-param\";\n }\n}\nexport type ApiParamType =\n | \"string\"\n | \"number\"\n | \"boolean\"\n | \"null\"\n | \"undefined\"\n | \"void\"\n | \"any\"\n | \"unknown\"\n | \"true\"\n | \"false\"\n | ApiParamType.StringLiteral\n | ApiParamType.NumericLiteral\n | ApiParamType.Object\n | ApiParamType.Union\n | ApiParamType.Intersection\n | ApiParamType.Array\n | ApiParamType.Ref\n | ApiParamType.IndexedAccess\n | ApiParamType.TypeParam\n | ApiParamType.TupleType;\n\n/* Template */\n// 셀프 참조 타입이므로 Zod 생략하고 직접 정의\nexport const RenderingNode = z.any();\nexport type RenderingNode = {\n name: string;\n label: string;\n renderType:\n | \"string-plain\"\n | \"string-image\"\n | \"string-datetime\"\n | \"string-date\"\n | \"datetime\"\n | \"number-plain\"\n | \"number-id\"\n | \"number-fk_id\"\n | \"boolean\"\n | \"enums\"\n | \"array\"\n | \"array-images\"\n | \"object\"\n | \"object-pick\"\n | \"record\";\n zodType: z.ZodTypeAny;\n element?: RenderingNode;\n children?: RenderingNode[];\n config?: {\n picked: string;\n };\n optional?: boolean;\n nullable?: boolean;\n};\n\nexport const TemplateOptions = z.object({\n entity: z.object({\n entityId: z.string(),\n parentId: z.string().optional(),\n title: z.string(),\n table: z.string().optional(),\n props: z.array(z.object({})).optional(),\n indexes: z.array(z.object({})).optional(),\n subsets: z.object({}).optional(),\n enums: z.object({}).optional(),\n }),\n init_types: z.object({\n entityId: z.string(),\n }),\n generated: z.object({}),\n generated_sso: z.object({}),\n generated_http: z.object({\n entityId: z.string(),\n }),\n model: z.object({\n entityId: z.string(),\n defaultSearchField: z.string(),\n defaultOrderBy: z.string(),\n }),\n model_test: z.object({\n entityId: z.string(),\n }),\n bridge: z.object({\n entityId: z.string(),\n }),\n service: z.object({\n namesRecord: z.object({\n fs: z.string(),\n fsPlural: z.string(),\n camel: z.string(),\n camelPlural: z.string(),\n capital: z.string(),\n capitalPlural: z.string(),\n upper: z.string(),\n constant: z.string(),\n }),\n modelTsPath: z.string(),\n }),\n view_list: z.object({\n entityId: z.string(),\n extra: z.unknown(),\n }),\n view_list_columns: z.object({\n entityId: z.string(),\n columns: z\n .object({\n name: z.string(),\n label: z.string(),\n tc: z.string(),\n })\n .array(),\n columnImports: z.string(),\n }),\n view_search_input: z.object({\n entityId: z.string(),\n }),\n view_form: z.object({\n entityId: z.string(),\n }),\n view_id_all_select: z.object({\n entityId: z.string(),\n }),\n view_id_async_select: z.object({\n entityId: z.string(),\n textField: z.string(),\n }),\n view_enums_select: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_dropdown: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n view_enums_buttonset: z.object({\n entityId: z.string(),\n enumId: z.string(),\n }),\n});\nexport type TemplateOptions = z.infer<typeof TemplateOptions>;\n\nexport const TemplateKey = z.enum([\n \"entity\",\n \"init_types\",\n \"generated\",\n \"generated_sso\",\n \"generated_http\",\n \"model\",\n \"model_test\",\n \"bridge\",\n \"service\",\n \"view_list\",\n \"view_list_columns\",\n \"view_search_input\",\n \"view_form\",\n \"view_id_all_select\",\n \"view_id_async_select\",\n \"view_enums_select\",\n \"view_enums_dropdown\",\n \"view_enums_buttonset\",\n]);\nexport type TemplateKey = z.infer<typeof TemplateKey>;\n\nexport const GenerateOptions = z.object({\n overwrite: z.boolean().optional(),\n});\nexport type GenerateOptions = z.infer<typeof GenerateOptions>;\n\nexport const PathAndCode = z.object({\n path: z.string(),\n code: z.string(),\n});\nexport type PathAndCode = z.infer<typeof PathAndCode>;\n\nexport type FixtureSearchOptions = {\n entityId: string;\n field: string;\n value: string;\n searchType: \"equals\" | \"like\";\n};\n\nexport type FixtureRecord = {\n fixtureId: string;\n entityId: string;\n id: number;\n columns: {\n [key: string]: {\n prop: EntityProp;\n value: any;\n };\n };\n fetchedRecords: string[];\n belongsRecords: string[];\n target?: FixtureRecord; // Import 대상 DB 레코드(id가 같은)\n unique?: FixtureRecord; // Import 대상 DB 레코드(unique key가 같은)\n override?: boolean;\n};\n\nexport type FixtureImportResult = {\n entityId: string;\n data: {\n [key: string]: any;\n };\n};\n\nexport type RelationNode = {\n fixtureId: string;\n entityId: string;\n related: Set<string>;\n};\n\nexport interface DatabaseSchemaExtend {}\nexport type ManyToManyBaseSchema<\n FromIdKey extends string,\n ToIdKey extends string,\n> = {\n id: number;\n} & {\n [K in `${FromIdKey}_id`]: number;\n} & {\n [K in `${ToIdKey}_id`]: number;\n};\n\nexport type SonamuFastifyConfig = {\n contextProvider: (\n defaultContext: Pick<\n Context,\n \"request\" | \"reply\" | \"headers\" | \"createSSE\"\n >,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Context;\n guardHandler: (\n guard: GuardKey,\n request: FastifyRequest,\n api: {\n typeParameters: ApiParamType.TypeParam[];\n parameters: ApiParam[];\n returnType: ApiParamType;\n modelName: string;\n methodName: string;\n path: string;\n options: ApiDecoratorOptions;\n }\n ) => void;\n cache?: {\n get: (key: string) => Promise<unknown | null>;\n put: (key: string, value: unknown, ttl?: number) => Promise<void>;\n resolveKey: (\n path: string,\n reqBody: {\n [key: string]: unknown;\n }\n ) =>\n | {\n cache: false;\n }\n | {\n cache: true;\n key: string;\n ttl?: number;\n };\n };\n};\n\nexport type SonamuServerOptions = {\n fastify?: FastifyServerOptions;\n\n listen?: {\n port: number;\n host?: string;\n };\n\n plugins?: {\n cors?: boolean | FastifyCorsOptions;\n formbody?: boolean | FastifyFormbodyOptions;\n multipart?: boolean | FastifyMultipartOptions;\n qs?: boolean | QsPluginOptions;\n sse?: boolean | SsePluginOptions;\n\n custom?: (server: FastifyInstance) => void;\n };\n\n apiConfig: SonamuFastifyConfig;\n\n storage?: Driver;\n\n lifecycle?: {\n onStart?: (server: FastifyInstance) => Promise<void> | void;\n onShutdown?: (server: FastifyInstance) => Promise<void> | void;\n onError?: (\n error: Error,\n request: FastifyRequest,\n reply: FastifyReply\n ) => Promise<void> | void;\n };\n};\n"],"names":["GenerateOptions","PathAndCode","RenderingNode","SQLDateTimeString","SonamuQueryMode","TemplateKey","TemplateOptions","isBelongsToOneRelationProp","isBigIntegerProp","isBooleanProp","isCustomJoinClause","isDateProp","isDateTimeProp","isDecimalProp","isDoubleProp","isEnumProp","isFloatProp","isHasManyRelationProp","isIntegerProp","isJsonProp","isKnexError","isManyToManyRelationProp","isOneToOneRelationProp","isRelationProp","isStringProp","isTextProp","isTimeProp","isTimestampProp","isUuidProp","isVirtualProp","zArrayable","z","string","regex","message","min","max","describe","shape","union","array","p","type","relationType","custom","enum","e","code","sqlMessage","sqlState","ApiParamType","isObject","v","t","isUnion","isIntersection","isStringLiteral","isNumericLiteral","isArray","isRef","isIndexedAccess","isTupleType","isPick","id","isOmit","isPartial","isPromise","isContext","isRefKnex","isTypeParam","any","object","entity","entityId","parentId","optional","title","table","props","indexes","subsets","enums","init_types","generated","generated_sso","generated_http","model","defaultSearchField","defaultOrderBy","model_test","bridge","service","namesRecord","fs","fsPlural","camel","camelPlural","capital","capitalPlural","upper","constant","modelTsPath","view_list","extra","unknown","view_list_columns","columns","name","label","tc","columnImports","view_search_input","view_form","view_id_all_select","view_id_async_select","textField","view_enums_select","enumId","view_enums_dropdown","view_enums_buttonset","overwrite","boolean","path"],"mappings":"2RAswBaA,yBAAAA,qBAKAC,qBAAAA,iBA/IAC,uBAAAA,mBAjmBAC,2BAAAA,uBAoYAC,yBAAAA,qBAiVAC,qBAAAA,iBAtFAC,yBAAAA,qBA1VGC,oCAAAA,gCAnDAC,0BAAAA,sBAqBAC,uBAAAA,mBAkDAC,4BAAAA,wBA/CAC,oBAAAA,gBAGAC,wBAAAA,oBATAC,uBAAAA,mBAHAC,sBAAAA,kBANAC,oBAAAA,gBAGAC,qBAAAA,iBA4CAC,+BAAAA,2BA3DAC,uBAAAA,mBAuCAC,oBAAAA,gBAyHAC,qBAAAA,iBAlGAC,kCAAAA,8BAXAC,gCAAAA,4BAHAC,wBAAAA,oBAvCAC,sBAAAA,kBAHAC,oBAAAA,gBA2BAC,oBAAAA,gBAGAC,yBAAAA,qBAMAC,oBAAAA,gBAGAC,uBAAAA,mBA/QAC,oBAAAA,+BA9BE,OAiBX,IAAM3B,kBAAoB4B,MAAC,CAC/BC,MAAM,GACNC,KAAK,CAAC,8DAA+D,CACpEC,QAAS,gBACX,GACCC,GAAG,CAAC,IACJC,GAAG,CAAC,IACJC,QAAQ,CAAC,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F,MAAC,CAACwC,MAAM,CAAC,CAClBE,SAAU1C,MAAC,CAACC,MAAM,EACpB,GACAiF,mBAAoBlF,MAAC,CAACwC,MAAM,CAAC,CAC3BE,SAAU1C,MAAC,CAACC,MAAM,EACpB,GACAkF,qBAAsBnF,MAAC,CAACwC,MAAM,CAAC,CAC7BE,SAAU1C,MAAC,CAACC,MAAM,GAClBmF,UAAWpF,MAAC,CAACC,MAAM,EACrB,GACAoF,kBAAmBrF,MAAC,CAACwC,MAAM,CAAC,CAC1BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,GACAsF,oBAAqBvF,MAAC,CAACwC,MAAM,CAAC,CAC5BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,GACAuF,qBAAsBxF,MAAC,CAACwC,MAAM,CAAC,CAC7BE,SAAU1C,MAAC,CAACC,MAAM,GAClBqF,OAAQtF,MAAC,CAACC,MAAM,EAClB,EACF,GAGO,IAAM3B,YAAc0B,MAAC,CAACc,IAAI,CAAC,CAChC,SACA,aACA,YACA,gBACA,iBACA,QACA,aACA,SACA,UACA,YACA,oBACA,oBACA,YACA,qBACA,uBACA,oBACA,sBACA,uBACD,EAGM,IAAM7C,gBAAkB+B,MAAC,CAACwC,MAAM,CAAC,CACtCiD,UAAWzF,MAAC,CAAC0F,OAAO,GAAG9C,QAAQ,EACjC,GAGO,IAAM1E,YAAc8B,MAAC,CAACwC,MAAM,CAAC,CAClCmD,KAAM3F,MAAC,CAACC,MAAM,GACde,KAAMhB,MAAC,CAACC,MAAM,EAChB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sonamu",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "Sonamu — TypeScript Fullstack API Framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"fast-deep-equal": "^3.1.3",
|
|
40
40
|
"fastify": "^4.23.2",
|
|
41
41
|
"fastify-qs": "^4.0.0",
|
|
42
|
+
"fastify-sse-v2": "^4.2.1",
|
|
42
43
|
"flydrive": "^1.3.0",
|
|
43
44
|
"inflection": "^1.13.2",
|
|
44
45
|
"knex": "^3.1.0",
|
|
@@ -56,7 +57,7 @@
|
|
|
56
57
|
"zod": "^4.1.12"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@sonamu-kit/ui": "
|
|
60
|
+
"@sonamu-kit/ui": "^0.5.1",
|
|
60
61
|
"@swc/cli": "^0.7.8",
|
|
61
62
|
"@types/inflection": "^1.13.0",
|
|
62
63
|
"@types/lodash": "^4.14.198",
|
|
@@ -71,10 +72,11 @@
|
|
|
71
72
|
"typescript": "^5.2.2"
|
|
72
73
|
},
|
|
73
74
|
"peerDependencies": {
|
|
75
|
+
"@sonamu-kit/react-sui": "^0.1.14",
|
|
74
76
|
"fastify": "^4.23.2",
|
|
75
77
|
"knex": "^3.1.0",
|
|
76
78
|
"mysql2": "^3.6.1",
|
|
77
79
|
"nodemon": "3.1.10",
|
|
78
80
|
"source-map-support": "^0.5.21"
|
|
79
81
|
}
|
|
80
|
-
}
|
|
82
|
+
}
|
package/src/api/context.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { FastifyReply, FastifyRequest } from "fastify";
|
|
2
2
|
import type { RouteGenericInterface } from "fastify/types/route";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
import type {
|
|
4
|
+
Server,
|
|
5
|
+
IncomingMessage,
|
|
6
|
+
ServerResponse,
|
|
7
|
+
IncomingHttpHeaders,
|
|
8
8
|
} from "http";
|
|
9
9
|
import type { FileStorage } from "../file-storage/file-storage";
|
|
10
|
+
import type { ZodObject } from "zod";
|
|
11
|
+
import type { createSSEFactory } from "../stream/sse";
|
|
10
12
|
|
|
11
13
|
export interface ContextExtend {}
|
|
12
14
|
export type Context = {
|
|
@@ -19,6 +21,9 @@ export type Context = {
|
|
|
19
21
|
unknown
|
|
20
22
|
>;
|
|
21
23
|
headers: IncomingHttpHeaders;
|
|
24
|
+
createSSE: <T extends ZodObject>(
|
|
25
|
+
events: T
|
|
26
|
+
) => ReturnType<typeof createSSEFactory<T>>;
|
|
22
27
|
} & ContextExtend;
|
|
23
28
|
|
|
24
29
|
export type UploadContext = {
|