backfarm 1.0.3 → 1.0.5
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/{chunk-HZ4GLSOO.js → chunk-2RFTNIPS.js} +11 -7
- package/dist/chunk-2RFTNIPS.js.map +1 -0
- package/dist/{chunk-X3R3RLXY.js → chunk-3IO4NPP3.js} +1 -1
- package/dist/chunk-3IO4NPP3.js.map +1 -0
- package/dist/chunk-ATY3REI3.js +89 -0
- package/dist/chunk-ATY3REI3.js.map +1 -0
- package/dist/{chunk-FMCW72HO.js → chunk-CBTP2HOO.js} +64 -18
- package/dist/chunk-CBTP2HOO.js.map +1 -0
- package/dist/chunk-CPECHQJJ.js +18 -0
- package/dist/chunk-CPECHQJJ.js.map +1 -0
- package/dist/{chunk-BMPUYKJJ.js → chunk-DRLEV7OW.js} +2 -2
- package/dist/chunk-E2NNDV4O.js +40 -0
- package/dist/chunk-E2NNDV4O.js.map +1 -0
- package/dist/{chunk-EB35KLDE.js → chunk-ECIP24BN.js} +9 -3
- package/dist/chunk-ECIP24BN.js.map +1 -0
- package/dist/chunk-ES6AHESH.js +17 -0
- package/dist/chunk-ES6AHESH.js.map +1 -0
- package/dist/chunk-FNFFY5LD.js +44 -0
- package/dist/chunk-FNFFY5LD.js.map +1 -0
- package/dist/chunk-IAQMTSGP.js +19 -0
- package/dist/chunk-IAQMTSGP.js.map +1 -0
- package/dist/chunk-LNFYUCA3.js +32 -0
- package/dist/chunk-LNFYUCA3.js.map +1 -0
- package/dist/chunk-LW246RDT.js +33 -0
- package/dist/chunk-LW246RDT.js.map +1 -0
- package/dist/chunk-M2C6HHRK.js +34 -0
- package/dist/chunk-M2C6HHRK.js.map +1 -0
- package/dist/chunk-MKS3GPZY.js +74 -0
- package/dist/chunk-MKS3GPZY.js.map +1 -0
- package/dist/chunk-O42S6QIG.js +88 -0
- package/dist/chunk-O42S6QIG.js.map +1 -0
- package/dist/chunk-OHDZYSL3.js +60 -0
- package/dist/chunk-OHDZYSL3.js.map +1 -0
- package/dist/chunk-P4FWSZ43.js +47 -0
- package/dist/chunk-P4FWSZ43.js.map +1 -0
- package/dist/{chunk-SSFPGDA3.js → chunk-QBBF6LZZ.js} +4 -4
- package/dist/chunk-QBBF6LZZ.js.map +1 -0
- package/dist/chunk-QS4MDB5H.js +336 -0
- package/dist/chunk-QS4MDB5H.js.map +1 -0
- package/dist/{chunk-MEQAHLW6.js → chunk-QUZPQJRE.js} +2 -2
- package/dist/chunk-RIBTACPE.js +35 -0
- package/dist/chunk-RIBTACPE.js.map +1 -0
- package/dist/{chunk-NMNAPTVV.js → chunk-SOZL76ZM.js} +7 -3
- package/dist/chunk-SOZL76ZM.js.map +1 -0
- package/dist/{chunk-MNSQSU7T.js → chunk-T4KN3FCF.js} +1 -1
- package/dist/chunk-T4KN3FCF.js.map +1 -0
- package/dist/{chunk-AATAYCEY.js → chunk-WLJV5O6C.js} +10 -10
- package/dist/chunk-WLJV5O6C.js.map +1 -0
- package/dist/engine/cloudBucket/r2Storage.js +3 -1
- package/dist/engine/mondoDb/mongoDB.js +2 -1
- package/dist/engine/server/server.d.ts +5 -3
- package/dist/engine/server/server.js +28 -6
- package/dist/engine/sql/mySql.d.ts +2 -2
- package/dist/engine/sql/mySql.js +2 -1
- package/dist/engine/sql/pgSql.js +2 -1
- package/dist/utility/libs/index.d.ts +1772 -0
- package/dist/utility/libs/index.js +101 -0
- package/dist/utility/libs/interface.d.ts +5 -7
- package/dist/utility/libs/run-all.js +46 -0
- package/dist/utility/libs/run-all.js.map +1 -0
- package/dist/{chunk-LFRKRR7G.js → utility/libs/run-bucket.js} +4 -7
- package/dist/utility/libs/run-bucket.js.map +1 -0
- package/dist/utility/libs/run-node-server.js +35 -0
- package/dist/utility/libs/run-node-server.js.map +1 -0
- package/dist/utility/libs/types.d.ts +11 -31
- package/dist/utility/libs/types.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/deleteFile.js +7 -54
- package/dist/utility/utilis/cloud_storage/deleteFile.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/deleteFiles.js +7 -83
- package/dist/utility/utilis/cloud_storage/deleteFiles.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/downloadFile.js +8 -68
- package/dist/utility/utilis/cloud_storage/downloadFile.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/downloadFiles.js +8 -82
- package/dist/utility/utilis/cloud_storage/downloadFiles.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/uploadFile.js +5 -5
- package/dist/utility/utilis/cloud_storage/uploadFiles.d.ts +0 -64
- package/dist/utility/utilis/cloud_storage/uploadFiles.js +8 -42
- package/dist/utility/utilis/cloud_storage/uploadFiles.js.map +1 -1
- package/dist/utility/utilis/general/file-operations.d.ts +8 -132
- package/dist/utility/utilis/general/file-operations.js +7 -3
- package/dist/utility/utilis/general/sqlDb.js.d.ts +0 -141
- package/dist/utility/utilis/general/sqlDb.js.js +1 -1
- package/dist/utility/utilis/general/uuids.d.ts +0 -43
- package/dist/utility/utilis/general/uuids.js +1 -1
- package/dist/utility/utilis/general/web.d.ts +2 -238
- package/dist/utility/utilis/general/web.js +3 -3
- package/dist/utility/utilis/mongoDb/buldWrite.d.ts +0 -44
- package/dist/utility/utilis/mongoDb/buldWrite.js +5 -26
- package/dist/utility/utilis/mongoDb/buldWrite.js.map +1 -1
- package/dist/utility/utilis/mongoDb/deleteDocument.d.ts +0 -45
- package/dist/utility/utilis/mongoDb/deleteDocument.js +5 -28
- package/dist/utility/utilis/mongoDb/deleteDocument.js.map +1 -1
- package/dist/utility/utilis/mongoDb/insertField.d.ts +2 -33
- package/dist/utility/utilis/mongoDb/insertField.js +6 -28
- package/dist/utility/utilis/mongoDb/insertField.js.map +1 -1
- package/dist/utility/utilis/mongoDb/insertFields.d.ts +2 -41
- package/dist/utility/utilis/mongoDb/insertFields.js +6 -30
- package/dist/utility/utilis/mongoDb/insertFields.js.map +1 -1
- package/dist/utility/utilis/mongoDb/updateFiled.d.ts +0 -56
- package/dist/utility/utilis/mongoDb/updateFiled.js +5 -34
- package/dist/utility/utilis/mongoDb/updateFiled.js.map +1 -1
- package/dist/utility/utilis/multer/upload_batch.js +5 -12
- package/dist/utility/utilis/multer/upload_batch.js.map +1 -1
- package/dist/utility/utilis/multer/upload_single.d.ts +41 -0
- package/dist/utility/utilis/multer/upload_single.js +5 -11
- package/dist/utility/utilis/multer/upload_single.js.map +1 -1
- package/dist/utility/utilis/postgres/executeQuery.d.ts +2 -205
- package/dist/utility/utilis/postgres/executeQuery.js +11 -40
- package/dist/utility/utilis/postgres/executeQuery.js.map +1 -1
- package/dist/utility/utilis/postgres/subSqlfiles/executeMySqlQuery.js +3 -2
- package/dist/utility/utilis/postgres/subSqlfiles/executePgQuery.js +3 -2
- package/dist/utility/utilis/server/app.js +30 -10
- package/dist/utility/utilis/server/app.js.map +1 -1
- package/dist/utility/utilis/server/server.d.ts +2 -2
- package/dist/utility/utilis/server/server.js +28 -17
- package/dist/utility/utilis/server/server.js.map +1 -1
- package/package.json +7 -8
- package/dist/chunk-3AP6JARL.js +0 -12
- package/dist/chunk-3AP6JARL.js.map +0 -1
- package/dist/chunk-5A3RVJNT.js +0 -19
- package/dist/chunk-5A3RVJNT.js.map +0 -1
- package/dist/chunk-AATAYCEY.js.map +0 -1
- package/dist/chunk-EB35KLDE.js.map +0 -1
- package/dist/chunk-FMCW72HO.js.map +0 -1
- package/dist/chunk-HZ4GLSOO.js.map +0 -1
- package/dist/chunk-LFRKRR7G.js.map +0 -1
- package/dist/chunk-MNSQSU7T.js.map +0 -1
- package/dist/chunk-NMNAPTVV.js.map +0 -1
- package/dist/chunk-SSFPGDA3.js.map +0 -1
- package/dist/chunk-W2745SOE.js +0 -38
- package/dist/chunk-W2745SOE.js.map +0 -1
- package/dist/chunk-WDQJPBUK.js +0 -53
- package/dist/chunk-WDQJPBUK.js.map +0 -1
- package/dist/chunk-X3R3RLXY.js.map +0 -1
- package/dist/chunk-YWFCWT6R.js +0 -23
- package/dist/chunk-YWFCWT6R.js.map +0 -1
- package/dist/engine/script/run-all.d.ts +0 -3
- package/dist/engine/script/run-all.js +0 -8
- package/dist/engine/script/run-bucket.d.ts +0 -3
- package/dist/engine/script/run-bucket.js +0 -8
- package/dist/engine/script/run-bucket.js.map +0 -1
- package/dist/engine/script/run-node-server.d.ts +0 -3
- package/dist/engine/script/run-node-server.js +0 -8
- package/dist/engine/script/run-node-server.js.map +0 -1
- package/dist/engine/server/app.d.ts +0 -5
- package/dist/engine/server/app.js +0 -8
- package/dist/engine/server/app.js.map +0 -1
- package/dist/utility/script/run-all.js +0 -8
- package/dist/utility/script/run-all.js.map +0 -1
- package/dist/utility/script/run-bucket.js +0 -8
- package/dist/utility/script/run-bucket.js.map +0 -1
- package/dist/utility/script/run-node-server.js +0 -8
- package/dist/utility/script/run-node-server.js.map +0 -1
- package/dist/utility/utilis/cloud_storage/s3Client.d.ts +0 -5
- package/dist/utility/utilis/cloud_storage/s3Client.js +0 -15
- package/dist/utility/utilis/cloud_storage/s3Client.js.map +0 -1
- /package/dist/{chunk-BMPUYKJJ.js.map → chunk-DRLEV7OW.js.map} +0 -0
- /package/dist/{chunk-MEQAHLW6.js.map → chunk-QUZPQJRE.js.map} +0 -0
- /package/dist/{engine/script/run-all.js.map → utility/libs/index.js.map} +0 -0
- /package/dist/utility/{script → libs}/run-all.d.ts +0 -0
- /package/dist/utility/{script → libs}/run-bucket.d.ts +0 -0
- /package/dist/utility/{script → libs}/run-node-server.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/general/sqlDb.js.ts"],"sourcesContent":["// constants.ts or at top of file\r\nimport type {DatabaseType} from \"../../libs/types.js\";\r\nimport { URL } from 'url';\r\nimport {ENV} from \"../../libs/env.js\";\r\n\r\n\r\n\r\nexport function detectSQLDatabase(url: string): DatabaseType {\r\n try {\r\n // Parse the URL\r\n const parsedUrl = new URL(url);\r\n const scheme = parsedUrl.protocol.replace(':', '').toLowerCase();\r\n\r\n // MySQL schemes\r\n const mysqlSchemes = [\r\n 'mysql',\r\n 'mysql+pymysql',\r\n 'mysql+mysqldb',\r\n 'mysql+mysqlconnector',\r\n 'mysql2',\r\n 'mysql+mysql2'\r\n ];\r\n\r\n // PostgreSQL schemes\r\n const postgresSchemes = [\r\n 'postgresql',\r\n 'postgres',\r\n 'postgresql+psycopg2',\r\n 'postgres+psycopg2',\r\n 'postgresql+pg8000',\r\n 'postgres+pg8000',\r\n 'postgresql+asyncpg',\r\n 'postgresql+pg',\r\n 'postgres+pg'\r\n ];\r\n\r\n // Check for MySQL\r\n if (mysqlSchemes.includes(scheme)) {\r\n return ENV.MY_SQL;\r\n }\r\n\r\n // Check for PostgreSQL\r\n if (postgresSchemes.includes(scheme)) {\r\n return ENV.POSTGRES_SQL;\r\n }\r\n\r\n // If it's a generic URL without protocol, try to detect from connection string\r\n // This handles cases like \"localhost:5432/mydb\" or \"127.0.0.1:3306/mydb\"\r\n if (scheme === '' && !parsedUrl.protocol) {\r\n // Try parsing as a generic connection string\r\n const connectionString = url.toLowerCase();\r\n if (connectionString.includes('mysql') ||\r\n connectionString.includes('my-sql') ||\r\n parsedUrl.port === '3306') {\r\n return ENV.MY_SQL;\r\n }\r\n if (connectionString.includes('postgres') ||\r\n connectionString.includes('postgre') ||\r\n parsedUrl.port === '5432') {\r\n return ENV.POSTGRES_SQL;\r\n }\r\n }\r\n\r\n // If we reach here, we couldn't detect the database type\r\n throw new Error(\r\n `Unsupported or unrecognized database type. URL: ${url}. ` +\r\n `Detected scheme: ${scheme || 'none'}`\r\n );\r\n\r\n } catch (error) {\r\n if (error instanceof Error && error.message.includes('Invalid URL')) {\r\n // Try to detect from raw connection string without protocol\r\n const lowerUrl = url.toLowerCase();\r\n if (lowerUrl.includes('mysql') || lowerUrl.includes('my-sql')) {\r\n return ENV.MY_SQL;\r\n }\r\n if (lowerUrl.includes('postgres') || lowerUrl.includes('postgre')) {\r\n return ENV.POSTGRES_SQL;\r\n }\r\n // Check ports as fallback\r\n if (url.includes(':3306')) return ENV.MY_SQL;\r\n if (url.includes(':5432')) return ENV.POSTGRES_SQL;\r\n\r\n throw new Error(`Invalid URL format: ${url}`);\r\n }\r\n throw error;\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\nexport function isMySQL(url: string): boolean {\r\n try {\r\n return detectSQLDatabase(url) === ENV.MY_SQL;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nexport function isPostgreSQL(url: string): boolean {\r\n try {\r\n return detectSQLDatabase(url) === ENV.POSTGRES_SQL;\r\n } catch {\r\n return false;\r\n }\r\n}\r\n"],"mappings":";;;;;;;;AAEA,SAAS,WAAW;AAKb,SAAS,kBAAkB,KAA2B;AACzD,MAAI;AAEA,UAAM,YAAY,IAAI,IAAI,GAAG;AAC7B,UAAM,SAAS,UAAU,SAAS,QAAQ,KAAK,EAAE,EAAE,YAAY;AAG/D,UAAM,eAAe;AAAA,MACjB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAGA,UAAM,kBAAkB;AAAA,MACpB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACJ;AAGA,QAAI,aAAa,SAAS,MAAM,GAAG;AAC/B,aAAO,IAAI;AAAA,IACf;AAGA,QAAI,gBAAgB,SAAS,MAAM,GAAG;AAClC,aAAO,IAAI;AAAA,IACf;AAIA,QAAI,WAAW,MAAM,CAAC,UAAU,UAAU;AAEtC,YAAM,mBAAmB,IAAI,YAAY;AACzC,UAAI,iBAAiB,SAAS,OAAO,KACjC,iBAAiB,SAAS,QAAQ,KAClC,UAAU,SAAS,QAAQ;AAC3B,eAAO,IAAI;AAAA,MACf;AACA,UAAI,iBAAiB,SAAS,UAAU,KACpC,iBAAiB,SAAS,SAAS,KACnC,UAAU,SAAS,QAAQ;AAC3B,eAAO,IAAI;AAAA,MACf;AAAA,IACJ;AAGA,UAAM,IAAI;AAAA,MACN,mDAAmD,GAAG,sBAClC,UAAU,MAAM;AAAA,IACxC;AAAA,EAEJ,SAAS,OAAO;AACZ,QAAI,iBAAiB,SAAS,MAAM,QAAQ,SAAS,aAAa,GAAG;AAEjE,YAAM,WAAW,IAAI,YAAY;AACjC,UAAI,SAAS,SAAS,OAAO,KAAK,SAAS,SAAS,QAAQ,GAAG;AAC3D,eAAO,IAAI;AAAA,MACf;AACA,UAAI,SAAS,SAAS,UAAU,KAAK,SAAS,SAAS,SAAS,GAAG;AAC/D,eAAO,IAAI;AAAA,MACf;AAEA,UAAI,IAAI,SAAS,OAAO,EAAG,QAAO,IAAI;AACtC,UAAI,IAAI,SAAS,OAAO,EAAG,QAAO,IAAI;AAEtC,YAAM,IAAI,MAAM,uBAAuB,GAAG,EAAE;AAAA,IAChD;AACA,UAAM;AAAA,EACV;AACJ;AAhFgB;AAuFT,SAAS,QAAQ,KAAsB;AAC1C,MAAI;AACA,WAAO,kBAAkB,GAAG,MAAM,IAAI;AAAA,EAC1C,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AANgB;AAcT,SAAS,aAAa,KAAsB;AAC/C,MAAI;AACA,WAAO,kBAAkB,GAAG,MAAM,IAAI;AAAA,EAC1C,QAAQ;AACJ,WAAO;AAAA,EACX;AACJ;AANgB;","names":[]}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUniqueValue
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3IO4NPP3.js";
|
|
4
|
+
import {
|
|
5
|
+
buildURL
|
|
6
|
+
} from "./chunk-QBBF6LZZ.js";
|
|
7
|
+
import {
|
|
8
|
+
s3Client
|
|
9
|
+
} from "./chunk-IAQMTSGP.js";
|
|
4
10
|
import {
|
|
5
11
|
buildPath,
|
|
6
12
|
getFileContentType,
|
|
7
13
|
getFileExtension,
|
|
8
14
|
toUint8Array
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
buildURL
|
|
12
|
-
} from "./chunk-SSFPGDA3.js";
|
|
13
|
-
import {
|
|
14
|
-
s3Client
|
|
15
|
-
} from "./chunk-3AP6JARL.js";
|
|
15
|
+
} from "./chunk-CBTP2HOO.js";
|
|
16
16
|
import {
|
|
17
17
|
ENV
|
|
18
18
|
} from "./chunk-EWQYVPOL.js";
|
|
@@ -34,7 +34,7 @@ var upload_file = /* @__PURE__ */ __name(async ({ file, path }) => {
|
|
|
34
34
|
const fileName = fileExtension ? `${baseFileName}.${fileExtension}` : baseFileName;
|
|
35
35
|
const body = { fileName };
|
|
36
36
|
if (path && path.length) {
|
|
37
|
-
body.
|
|
37
|
+
body.segments = path;
|
|
38
38
|
}
|
|
39
39
|
const finalFileName = buildPath(body);
|
|
40
40
|
const fileBuffer = await toUint8Array(file);
|
|
@@ -69,4 +69,4 @@ var upload_file = /* @__PURE__ */ __name(async ({ file, path }) => {
|
|
|
69
69
|
export {
|
|
70
70
|
upload_file
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-WLJV5O6C.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/cloud_storage/uploadFile.ts"],"sourcesContent":["import {ENV} from \"../../libs/env.js\";\r\nimport type {UploadFileInput} from \"../../libs/interface.js\";\r\nimport {PutObjectCommand} from \"@aws-sdk/client-s3\";\r\nimport {buildPath, getFileContentType, getFileExtension, toUint8Array} from \"../general/file-operations.js\";\r\nimport {buildURL} from \"../general/web.js\";\r\nimport {generateUniqueValue} from \"../general/uuids.js\";\r\nimport {s3Client} from \"../../../engine/cloudBucket/r2Storage.js\";\r\nimport type {FileUploadedResponseData, PathOptions} from \"../../libs/types.js\";\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Uploads a single file to the configured S3-compatible storage bucket.\r\n *\r\n * The function accepts a Multer file, Web API `File`, raw `Buffer`, or file\r\n * path/URL. A unique file name is generated while preserving the original\r\n * file extension. The file is then converted to a byte array, its content\r\n * type is detected, and it is uploaded to the configured bucket.\r\n *\r\n * On successful upload, the function returns the generated storage path and\r\n * public URL along with the original file data when applicable. If the upload\r\n * fails, it returns the encountered error and the original file data when\r\n * available.\r\n *\r\n * @param params - The file and optional storage path used for the upload.\r\n * @param params.file - The file, buffer, or file path/URL to upload.\r\n * @param params.path - Optional array of path segments under which the file\r\n * should be stored.\r\n * @returns A promise resolving to a `FileUploadedResponseData` containing\r\n * either the uploaded file information or the encountered error.\r\n *\r\n * @example\r\n * const result = await upload_file({\r\n * file: req.file,\r\n * path: ['temporary_files'],\r\n * });\r\n *\r\n * if ('error' in result) {\r\n * console.error('Upload failed:', result.error);\r\n * } else {\r\n * console.log('File uploaded:', result.url);\r\n * }\r\n *\r\n * @example\r\n * const result = await upload_file({\r\n * file: buffer,\r\n * path: ['documents', 'reports'],\r\n * });\r\n *\r\n * if (!result.error) {\r\n * console.log('Uploaded to:', result.path);\r\n * }\r\n */\r\nexport const upload_file = async ({ file, path }: UploadFileInput): Promise<FileUploadedResponseData> => {\r\n // 1. Inspect input type\r\n const isMulterFile = file && typeof file === 'object' && 'buffer' in file && 'originalname' in file;\r\n const multerFile = isMulterFile ? (file as Express.Multer.File) : undefined;\r\n const rawBuffer = Buffer.isBuffer(file) ? file : undefined;\r\n const rawFile = (typeof File !== 'undefined' && file instanceof File) ? file : undefined;\r\n const filePath = typeof file === 'string' ? file : undefined;\r\n\r\n try {\r\n const baseFileName = generateUniqueValue(16);\r\n const fileExtension = getFileExtension(file);\r\n\r\n const fileName: string = fileExtension ? `${baseFileName}.${fileExtension}` : baseFileName;\r\n\r\n const body: PathOptions = { fileName };\r\n if (path && path.length) {\r\n body.segments = path;\r\n }\r\n\r\n const finalFileName = buildPath(body);\r\n const fileBuffer = await toUint8Array(file);\r\n const contentType = await getFileContentType(file);\r\n\r\n await s3Client.send(new PutObjectCommand({\r\n Bucket: ENV.BUCKET_NAME,\r\n Key: finalFileName,\r\n Body: fileBuffer,\r\n ContentType: contentType\r\n }));\r\n\r\n const generatedUrl = buildURL({\r\n path: [ENV.BUCKET_END_POINT as string, ENV.BUCKET_NAME as string, finalFileName]\r\n });\r\n\r\n // 2. Build success object omitting undefined keys\r\n return {\r\n path: filePath || finalFileName,\r\n url: generatedUrl,\r\n ...(rawFile && {file: rawFile}),\r\n ...(rawBuffer && {buffer: rawBuffer}),\r\n ...(multerFile && {multerFile: multerFile}),\r\n };\r\n\r\n } catch (error: any | unknown | Error) {\r\n // 3. Build error object omitting undefined keys\r\n return {\r\n error: error,\r\n ...(filePath && {path: filePath}),\r\n ...(rawFile && {file: rawFile}),\r\n ...(rawBuffer && {buffer: rawBuffer}),\r\n ...(multerFile && {multerFile: multerFile}),\r\n };\r\n }\r\n};\r\n\r\n\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAQ,wBAAuB;AAsDxB,IAAM,cAAc,8BAAO,EAAE,MAAM,KAAK,MAA0D;AAErG,QAAM,eAAe,QAAQ,OAAO,SAAS,YAAY,YAAY,QAAQ,kBAAkB;AAC/F,QAAM,aAAa,eAAgB,OAA+B;AAClE,QAAM,YAAY,OAAO,SAAS,IAAI,IAAI,OAAO;AACjD,QAAM,UAAW,OAAO,SAAS,eAAe,gBAAgB,OAAQ,OAAO;AAC/E,QAAM,WAAW,OAAO,SAAS,WAAW,OAAO;AAEnD,MAAI;AACA,UAAM,eAAe,oBAAoB,EAAE;AAC3C,UAAM,gBAAgB,iBAAiB,IAAI;AAE3C,UAAM,WAAmB,gBAAgB,GAAG,YAAY,IAAI,aAAa,KAAK;AAE9E,UAAM,OAAoB,EAAE,SAAS;AACrC,QAAI,QAAQ,KAAK,QAAQ;AACrB,WAAK,WAAW;AAAA,IACpB;AAEA,UAAM,gBAAgB,UAAU,IAAI;AACpC,UAAM,aAAa,MAAM,aAAa,IAAI;AAC1C,UAAM,cAAc,MAAM,mBAAmB,IAAI;AAEjD,UAAM,SAAS,KAAK,IAAI,iBAAiB;AAAA,MACrC,QAAQ,IAAI;AAAA,MACZ,KAAK;AAAA,MACL,MAAM;AAAA,MACN,aAAa;AAAA,IACjB,CAAC,CAAC;AAEF,UAAM,eAAe,SAAS;AAAA,MAC1B,MAAM,CAAC,IAAI,kBAA4B,IAAI,aAAuB,aAAa;AAAA,IACnF,CAAC;AAGD,WAAO;AAAA,MACH,MAAM,YAAY;AAAA,MAClB,KAAK;AAAA,MACL,GAAI,WAAW,EAAC,MAAM,QAAO;AAAA,MAC7B,GAAI,aAAa,EAAC,QAAQ,UAAS;AAAA,MACnC,GAAI,cAAc,EAAC,WAAsB;AAAA,IAC7C;AAAA,EAEJ,SAAS,OAA8B;AAEnC,WAAO;AAAA,MACH;AAAA,MACA,GAAI,YAAY,EAAC,MAAM,SAAQ;AAAA,MAC/B,GAAI,WAAW,EAAC,MAAM,QAAO;AAAA,MAC7B,GAAI,aAAa,EAAC,QAAQ,UAAS;AAAA,MACnC,GAAI,cAAc,EAAC,WAAsB;AAAA,IAC7C;AAAA,EACJ;AACJ,GArD2B;","names":[]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Application } from 'express';
|
|
2
|
+
import * as node_http from 'node:http';
|
|
2
3
|
|
|
3
|
-
declare const
|
|
4
|
+
declare const EXPRESS_APP: Application;
|
|
5
|
+
declare const HTTP_SERVER: node_http.Server<typeof node_http.IncomingMessage, typeof node_http.ServerResponse>;
|
|
4
6
|
declare const startServer: () => Promise<void>;
|
|
5
7
|
|
|
6
|
-
export { HTTP_SERVER, startServer };
|
|
8
|
+
export { EXPRESS_APP, HTTP_SERVER, startServer };
|
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
|
+
EXPRESS_APP,
|
|
2
3
|
HTTP_SERVER,
|
|
3
4
|
startServer
|
|
4
|
-
} from "../../chunk-
|
|
5
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-QS4MDB5H.js";
|
|
6
|
+
import "../../chunk-LNFYUCA3.js";
|
|
7
|
+
import "../../chunk-M2C6HHRK.js";
|
|
8
|
+
import "../../chunk-LW246RDT.js";
|
|
9
|
+
import "../../chunk-RIBTACPE.js";
|
|
10
|
+
import "../../chunk-E2NNDV4O.js";
|
|
11
|
+
import "../../chunk-CPECHQJJ.js";
|
|
12
|
+
import "../../chunk-ES6AHESH.js";
|
|
13
|
+
import "../../chunk-P4FWSZ43.js";
|
|
14
|
+
import "../../chunk-DRLEV7OW.js";
|
|
15
|
+
import "../../chunk-QUZPQJRE.js";
|
|
16
|
+
import "../../chunk-O42S6QIG.js";
|
|
17
|
+
import "../../chunk-FNFFY5LD.js";
|
|
18
|
+
import "../../chunk-WLJV5O6C.js";
|
|
6
19
|
import "../../chunk-P5XJG7OG.js";
|
|
7
|
-
import "../../chunk-
|
|
8
|
-
import "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-T4KN3FCF.js";
|
|
21
|
+
import "../../chunk-OHDZYSL3.js";
|
|
22
|
+
import "../../chunk-ATY3REI3.js";
|
|
23
|
+
import "../../chunk-MKS3GPZY.js";
|
|
24
|
+
import "../../chunk-3IO4NPP3.js";
|
|
25
|
+
import "../../chunk-QBBF6LZZ.js";
|
|
26
|
+
import "../../chunk-IAQMTSGP.js";
|
|
27
|
+
import "../../chunk-UWIMSKL5.js";
|
|
28
|
+
import "../../chunk-2RFTNIPS.js";
|
|
29
|
+
import "../../chunk-SOZL76ZM.js";
|
|
30
|
+
import "../../chunk-ECIP24BN.js";
|
|
31
|
+
import "../../chunk-CBTP2HOO.js";
|
|
11
32
|
import "../../chunk-EWQYVPOL.js";
|
|
12
33
|
import "../../chunk-7QVYU63E.js";
|
|
13
34
|
export {
|
|
35
|
+
EXPRESS_APP,
|
|
14
36
|
HTTP_SERVER,
|
|
15
37
|
startServer
|
|
16
38
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import mysql2_promise__default from 'mysql2/promise';
|
|
2
2
|
|
|
3
|
-
declare function getMySqlPool(): Promise<
|
|
3
|
+
declare function getMySqlPool(): Promise<mysql2_promise__default.Pool>;
|
|
4
4
|
declare const runMySqlScript: () => Promise<void>;
|
|
5
5
|
declare const closePool: () => Promise<void>;
|
|
6
6
|
|
package/dist/engine/sql/mySql.js
CHANGED
package/dist/engine/sql/pgSql.js
CHANGED