backfarm 1.0.5 → 1.0.8
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-E2NNDV4O.js → chunk-237SVWEU.js} +2 -2
- package/dist/chunk-237SVWEU.js.map +1 -0
- package/dist/{chunk-RIBTACPE.js → chunk-346ZYI6W.js} +2 -2
- package/dist/chunk-346ZYI6W.js.map +1 -0
- package/dist/{chunk-ES6AHESH.js → chunk-3DJ6GERS.js} +3 -3
- package/dist/chunk-3DJ6GERS.js.map +1 -0
- package/dist/{chunk-UWIMSKL5.js → chunk-4L35JPDH.js} +2 -2
- package/dist/chunk-4L35JPDH.js.map +1 -0
- package/dist/{chunk-MKS3GPZY.js → chunk-5NVPS6PC.js} +6 -6
- package/dist/chunk-5NVPS6PC.js.map +1 -0
- package/dist/{chunk-P5XJG7OG.js → chunk-A7GR4LD2.js} +1 -1
- package/dist/chunk-A7GR4LD2.js.map +1 -0
- package/dist/{chunk-ECIP24BN.js → chunk-AS7JRX2N.js} +5 -5
- package/dist/chunk-AS7JRX2N.js.map +1 -0
- package/dist/{chunk-P4FWSZ43.js → chunk-AYXJEOSW.js} +7 -7
- package/dist/chunk-AYXJEOSW.js.map +1 -0
- package/dist/{chunk-O42S6QIG.js → chunk-DKFDGYXS.js} +6 -6
- package/dist/chunk-DKFDGYXS.js.map +1 -0
- package/dist/{chunk-QS4MDB5H.js → chunk-DWODHIWI.js} +41 -41
- package/dist/chunk-DWODHIWI.js.map +1 -0
- package/dist/{chunk-IAQMTSGP.js → chunk-EKT74VDD.js} +4 -4
- package/dist/chunk-EKT74VDD.js.map +1 -0
- package/dist/{chunk-OHDZYSL3.js → chunk-GMQU3OAU.js} +5 -5
- package/dist/chunk-GMQU3OAU.js.map +1 -0
- package/dist/{chunk-M2C6HHRK.js → chunk-GWPLCPRW.js} +2 -2
- package/dist/chunk-GWPLCPRW.js.map +1 -0
- package/dist/{chunk-QUZPQJRE.js → chunk-H3RM55WC.js} +2 -2
- package/dist/chunk-H3RM55WC.js.map +1 -0
- package/dist/{chunk-DRLEV7OW.js → chunk-IM22RSF7.js} +2 -2
- package/dist/chunk-IM22RSF7.js.map +1 -0
- package/dist/{chunk-SOZL76ZM.js → chunk-IT6LYD4L.js} +5 -5
- package/dist/chunk-IT6LYD4L.js.map +1 -0
- package/dist/{chunk-3IO4NPP3.js → chunk-IZEPCXYK.js} +1 -1
- package/dist/chunk-IZEPCXYK.js.map +1 -0
- package/dist/{chunk-WLJV5O6C.js → chunk-KYX4HMIY.js} +6 -6
- package/dist/chunk-KYX4HMIY.js.map +1 -0
- package/dist/{chunk-EWQYVPOL.js → chunk-LE2SDA4O.js} +1 -1
- package/dist/chunk-LE2SDA4O.js.map +1 -0
- package/dist/{chunk-T4KN3FCF.js → chunk-O5ILFRFV.js} +2 -2
- package/dist/chunk-O5ILFRFV.js.map +1 -0
- package/dist/{chunk-CBTP2HOO.js → chunk-QW2GGDEG.js} +2 -2
- package/dist/chunk-QW2GGDEG.js.map +1 -0
- package/dist/{chunk-LW246RDT.js → chunk-T4PLUOW3.js} +2 -2
- package/dist/chunk-T4PLUOW3.js.map +1 -0
- package/dist/{chunk-LNFYUCA3.js → chunk-VFJV227G.js} +2 -2
- package/dist/chunk-VFJV227G.js.map +1 -0
- package/dist/{chunk-2RFTNIPS.js → chunk-W2KVW35Y.js} +5 -5
- package/dist/chunk-W2KVW35Y.js.map +1 -0
- package/dist/{chunk-FNFFY5LD.js → chunk-XMWRNOBE.js} +2 -2
- package/dist/chunk-XMWRNOBE.js.map +1 -0
- package/dist/{chunk-ATY3REI3.js → chunk-XPJKMJBD.js} +5 -5
- package/dist/chunk-XPJKMJBD.js.map +1 -0
- package/dist/{chunk-QBBF6LZZ.js → chunk-ZC33GE2U.js} +2 -2
- package/dist/chunk-ZC33GE2U.js.map +1 -0
- package/dist/{chunk-CPECHQJJ.js → chunk-ZTTB4NMA.js} +3 -3
- package/dist/chunk-ZTTB4NMA.js.map +1 -0
- package/dist/engine/cloudBucket/r2Storage.js +3 -3
- package/dist/engine/mondoDb/mongoDB.js +3 -3
- package/dist/engine/multer/multer_configs.js +2 -2
- package/dist/engine/server/server.js +28 -28
- package/dist/engine/sql/mySql.js +3 -3
- package/dist/engine/sql/pgSql.js +3 -3
- package/dist/utility/libs/env.js +1 -1
- package/dist/utility/libs/index.js +28 -28
- package/dist/utility/libs/run-all.js +28 -28
- package/dist/utility/libs/run-bucket.js.map +1 -1
- package/dist/utility/libs/run-node-server.js +28 -28
- package/dist/utility/libs/run-node-server.js.map +1 -1
- package/dist/utility/libs/types.js +1 -1
- package/dist/utility/libs/types.js.map +1 -1
- package/dist/utility/utilis/cloud_storage/deleteFile.js +5 -5
- package/dist/utility/utilis/cloud_storage/deleteFiles.js +5 -5
- package/dist/utility/utilis/cloud_storage/downloadFile.js +6 -6
- package/dist/utility/utilis/cloud_storage/downloadFiles.js +6 -6
- package/dist/utility/utilis/cloud_storage/uploadFile.js +6 -6
- package/dist/utility/utilis/cloud_storage/uploadFiles.js +7 -7
- package/dist/utility/utilis/general/error_handler.js +1 -1
- package/dist/utility/utilis/general/file-operations.js +2 -2
- package/dist/utility/utilis/general/sqlDb.js.js +2 -2
- package/dist/utility/utilis/general/uuids.js +1 -1
- package/dist/utility/utilis/general/web.js +2 -2
- package/dist/utility/utilis/mongoDb/buldWrite.js +4 -4
- package/dist/utility/utilis/mongoDb/deleteDocument.js +4 -4
- package/dist/utility/utilis/mongoDb/insertField.js +4 -4
- package/dist/utility/utilis/mongoDb/insertFields.js +4 -4
- package/dist/utility/utilis/mongoDb/updateFiled.js +4 -4
- package/dist/utility/utilis/multer/upload_batch.js +3 -3
- package/dist/utility/utilis/multer/upload_single.js +3 -3
- package/dist/utility/utilis/postgres/executeQuery.js +8 -8
- package/dist/utility/utilis/postgres/subSqlfiles/executeMySqlQuery.js +4 -4
- package/dist/utility/utilis/postgres/subSqlfiles/executePgQuery.js +4 -4
- package/dist/utility/utilis/server/app.js +28 -28
- package/dist/utility/utilis/server/server.js +28 -28
- package/package.json +55 -55
- package/dist/chunk-2RFTNIPS.js.map +0 -1
- package/dist/chunk-3IO4NPP3.js.map +0 -1
- package/dist/chunk-ATY3REI3.js.map +0 -1
- package/dist/chunk-CBTP2HOO.js.map +0 -1
- package/dist/chunk-CPECHQJJ.js.map +0 -1
- package/dist/chunk-DRLEV7OW.js.map +0 -1
- package/dist/chunk-E2NNDV4O.js.map +0 -1
- package/dist/chunk-ECIP24BN.js.map +0 -1
- package/dist/chunk-ES6AHESH.js.map +0 -1
- package/dist/chunk-EWQYVPOL.js.map +0 -1
- package/dist/chunk-FNFFY5LD.js.map +0 -1
- package/dist/chunk-IAQMTSGP.js.map +0 -1
- package/dist/chunk-LNFYUCA3.js.map +0 -1
- package/dist/chunk-LW246RDT.js.map +0 -1
- package/dist/chunk-M2C6HHRK.js.map +0 -1
- package/dist/chunk-MKS3GPZY.js.map +0 -1
- package/dist/chunk-O42S6QIG.js.map +0 -1
- package/dist/chunk-OHDZYSL3.js.map +0 -1
- package/dist/chunk-P4FWSZ43.js.map +0 -1
- package/dist/chunk-P5XJG7OG.js.map +0 -1
- package/dist/chunk-QBBF6LZZ.js.map +0 -1
- package/dist/chunk-QS4MDB5H.js.map +0 -1
- package/dist/chunk-QUZPQJRE.js.map +0 -1
- package/dist/chunk-RIBTACPE.js.map +0 -1
- package/dist/chunk-SOZL76ZM.js.map +0 -1
- package/dist/chunk-T4KN3FCF.js.map +0 -1
- package/dist/chunk-UWIMSKL5.js.map +0 -1
- package/dist/chunk-WLJV5O6C.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMongoServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AS7JRX2N.js";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -37,4 +37,4 @@ var mongoUpdateField = /* @__PURE__ */ __name(async (params) => {
|
|
|
37
37
|
export {
|
|
38
38
|
mongoUpdateField
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=chunk-
|
|
40
|
+
//# sourceMappingURL=chunk-237SVWEU.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/mongoDb/updateFiled.ts"],"sourcesContent":["import type {CustomUpdateResult} from \"../../libs/types.js\";\nimport {getMongoServer} from \"../../../engine/mondoDb/mongoDB.js\";\nimport type {UpdateDocument} from \"../../libs/interface.js\";\n\n\n\nexport const mongoUpdateField = async (\n params: UpdateDocument\n): Promise<CustomUpdateResult> => {\n const {\n dbName,\n collectionName,\n query,\n updatable,\n updateMany = false,\n options\n } = params;\n\n try {\n const db = getMongoServer().db(dbName);\n const collection = db.collection(collectionName);\n\n // Perform update with await\n const result = updateMany\n ? await collection.updateMany(query, updatable, options)\n : await collection.updateOne(query, updatable, options);\n\n return {\n status: true,\n result,\n error: null,\n };\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n\n return {\n status: false,\n result: null,\n error,\n };\n }\n};\n"],"mappings":";;;;;;;;AAMO,IAAM,mBAAmB,8BAC5B,WAC8B;AAC9B,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,aAAa;AAAA,IACb;AAAA,EACJ,IAAI;AAEJ,MAAI;AACA,UAAM,KAAK,eAAe,EAAE,GAAG,MAAM;AACrC,UAAM,aAAa,GAAG,WAAW,cAAc;AAG/C,UAAM,SAAS,aACT,MAAM,WAAW,WAAW,OAAO,WAAW,OAAO,IACrD,MAAM,WAAW,UAAU,OAAO,WAAW,OAAO;AAE1D,WAAO;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,OAAO;AAAA,IACX;AAAA,EACJ,SAAS,KAAK;AACV,UAAM,QAAQ,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC;AAEhE,WAAO;AAAA,MACH,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR;AAAA,IACJ;AAAA,EACJ;AACJ,GAnCgC;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getMongoServer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AS7JRX2N.js";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -32,4 +32,4 @@ var mongoInsertFields = /* @__PURE__ */ __name(async (params) => {
|
|
|
32
32
|
export {
|
|
33
33
|
mongoInsertFields
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-346ZYI6W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/mongoDb/insertFields.ts"],"sourcesContent":["import type {InsertManyInterface} from \"../../libs/interface.js\";\nimport type {CustomInsertManyResult} from \"../../libs/types.js\";\nimport {getMongoServer} from \"../../../engine/mondoDb/mongoDB.js\";\nimport type {Document} from \"mongodb\";\n\n\n\n\n\n\n\nexport const mongoInsertFields = async <T>(\n params: InsertManyInterface<T>\n): Promise<CustomInsertManyResult<T>> => {\n const { dbName, collectionName, fields, options } = params;\n\n try {\n const db = getMongoServer().db(dbName);\n const collection = db.collection<T & Document>(collectionName);\n\n const result = await collection.insertMany(fields, options);\n\n return {\n status: true,\n result,\n insertedCount: result.insertedCount,\n error: null,\n };\n }\n catch (err) {\n const error = err instanceof Error ? err : new Error(String(err));\n return {\n status: false,\n result: null,\n insertedCount: 0,\n error,\n };\n }\n};\n"],"mappings":";;;;;;;;AAWO,IAAM,oBAAoB,8BAC7B,WACqC;AACrC,QAAM,EAAE,QAAQ,gBAAgB,QAAQ,QAAQ,IAAI;AAEpD,MAAI;AACA,UAAM,KAAK,eAAe,EAAE,GAAG,MAAM;AACrC,UAAM,aAAa,GAAG,WAAyB,cAAc;AAE7D,UAAM,SAAS,MAAM,WAAW,WAAW,QAAQ,OAAO;AAE1D,WAAO;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,eAAe,OAAO;AAAA,MACtB,OAAO;AAAA,IACX;AAAA,EACJ,SACO,KAAK;AACR,UAAM,QAAQ,eAAe,QAAQ,MAAM,IAAI,MAAM,OAAO,GAAG,CAAC;AAChE,WAAO;AAAA,MACH,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,eAAe;AAAA,MACf;AAAA,IACJ;AAAA,EACJ;AACJ,GA3BiC;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
multerInstance
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4L35JPDH.js";
|
|
4
4
|
import {
|
|
5
5
|
ENV
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LE2SDA4O.js";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -14,4 +14,4 @@ var upload_single = /* @__PURE__ */ __name((fieldName = ENV.FILE) => multerInsta
|
|
|
14
14
|
export {
|
|
15
15
|
upload_single
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-3DJ6GERS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/multer/upload_single.ts"],"sourcesContent":["import {multerInstance} from \"../../../engine/multer/multer_configs.js\";\nimport {ENV} from \"../../libs/env.js\";\n\n\n/**\n * Creates Multer middleware for handling a single file upload.\n *\n * The middleware expects one uploaded file from the specified\n * `multipart/form-data` field and makes the uploaded file available through\n * `req.file`.\n *\n * If no field name is provided, `ENV.FILE` is used as the default field name.\n *\n * @param fieldName - Name of the multipart/form-data field containing the\n * uploaded file.\n *\n * @returns Multer middleware configured to process a single uploaded file.\n *\n * @example\n * // Use the default field name.\n * router.post(\n * '/upload',\n * upload_single(),\n * uploadSingleFileApi\n * );\n *\n * @example\n * // Accept a single file from the \"file\" field.\n * router.post(\n * '/upload',\n * upload_single('file'),\n * uploadSingleFileApi\n * );\n *\n * @example\n * // Use a custom field name.\n * router.post(\n * '/profile-picture',\n * upload_single('profilePicture'),\n * uploadSingleFileApi\n * );\n *\n * // The uploaded file will be available as:\n * // req.file\n */\nexport const upload_single = (fieldName: string = ENV.FILE) =>\n multerInstance.single(fieldName);\n"],"mappings":";;;;;;;;;;;AA6CO,IAAM,gBAAgB,wBAAC,YAAoB,IAAI,SAClD,eAAe,OAAO,SAAS,GADN;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ENV
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LE2SDA4O.js";
|
|
4
4
|
import {
|
|
5
5
|
__name
|
|
6
6
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
MAX_BATCH_FILES,
|
|
33
33
|
multerInstance
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
35
|
+
//# sourceMappingURL=chunk-4L35JPDH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/engine/multer/multer_configs.ts"],"sourcesContent":["import {type FileFilterCallback } from 'multer';\nimport type {Request} from 'express';\nimport {ENV} from \"../../utility/libs/env.js\";\nimport multer from \"multer\";\n// 1. Production Limits (Fallback to defaults if env variables aren't set)\n\nconst MAX_FILE_SIZE = ENV.MAX_FILE_SIZE_IN_MB\n ? parseInt(ENV.MAX_FILE_SIZE_IN_MB, 10) * 1024 * 1024 // ✅ 10 MB = 10,485,760 Bytes\n : 50 * 1024 * 1024; // 50 MB\n\n\n\n\nexport const MAX_BATCH_FILES = ENV.MAX_BATCH_FILES\n ? parseInt(ENV.MAX_BATCH_FILES, 10)\n : 10; // Max 10 files per request\n\n\n\n// 2. Optional: Production File Type Filter (Prevent malicious executable uploads)\nconst fileFilter = (\n req: Request,\n file: Express.Multer.File,\n cb: FileFilterCallback\n) => {\n // Exclude executable and script extensions\n const forbiddenExtensions = /\\.(exe|sh|bat|cmd|dll|dmg|so|jar|php|py|js)$/i;\n\n if (file.originalname.match(forbiddenExtensions)) {\n return cb(new Error(`File type not allowed: ${file.originalname}`));\n }\n\n cb(null, true);\n};\n\n\n\n\n// 3. Main Multer Instance\nexport const multerInstance = multer({\n storage: multer.memoryStorage(),\n limits: {\n fileSize: MAX_FILE_SIZE,\n files: MAX_BATCH_FILES,\n fieldSize: parseInt(ENV.MAX_BATCH_FILES, 2) * 1024 * 1024, // 2MB max for standard form fields\n },\n fileFilter: fileFilter,\n});\n\n\n\n\n// 4. Pre-configured Helper Middlewares for Export\n\n\n\n\n\n\n"],"mappings":";;;;;;;;AAAA,OAAuC;AAGvC,OAAO,YAAY;AAGnB,IAAM,gBAAgB,IAAI,sBACpB,SAAS,IAAI,qBAAqB,EAAE,IAAI,OAAO,OAC/C,KAAK,OAAO;AAKX,IAAM,kBAAkB,IAAI,kBAC7B,SAAS,IAAI,iBAAiB,EAAE,IAChC;AAKN,IAAM,aAAa,wBACf,KACA,MACA,OACC;AAED,QAAM,sBAAsB;AAE5B,MAAI,KAAK,aAAa,MAAM,mBAAmB,GAAG;AAC9C,WAAO,GAAG,IAAI,MAAM,0BAA0B,KAAK,YAAY,EAAE,CAAC;AAAA,EACtE;AAEA,KAAG,MAAM,IAAI;AACjB,GAbmB;AAmBZ,IAAM,iBAAiB,OAAO;AAAA,EACjC,SAAS,OAAO,cAAc;AAAA,EAC9B,QAAQ;AAAA,IACJ,UAAU;AAAA,IACV,OAAO;AAAA,IACP,WAAW,SAAS,IAAI,iBAAiB,CAAC,IAAI,OAAO;AAAA;AAAA,EACzD;AAAA,EACA;AACJ,CAAC;","names":[]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUniqueValue
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IZEPCXYK.js";
|
|
4
4
|
import {
|
|
5
5
|
getKeyFromUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZC33GE2U.js";
|
|
7
7
|
import {
|
|
8
8
|
s3Client
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EKT74VDD.js";
|
|
10
10
|
import {
|
|
11
11
|
getFileExtension,
|
|
12
12
|
getInAppBucketDownloadPath
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QW2GGDEG.js";
|
|
14
14
|
import {
|
|
15
15
|
ENV
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LE2SDA4O.js";
|
|
17
17
|
import {
|
|
18
18
|
__name
|
|
19
19
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -71,4 +71,4 @@ var downloadFile = /* @__PURE__ */ __name(async ({
|
|
|
71
71
|
export {
|
|
72
72
|
downloadFile
|
|
73
73
|
};
|
|
74
|
-
//# sourceMappingURL=chunk-
|
|
74
|
+
//# sourceMappingURL=chunk-5NVPS6PC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/cloud_storage/downloadFile.ts"],"sourcesContent":["import {GetObjectCommand} from \"@aws-sdk/client-s3\";\nimport {getKeyFromUrl} from \"../general/web.js\";\nimport { pipeline } from \"stream/promises\";\nimport path from 'node:path'\nimport fsPromises from 'fs/promises';\nimport * as fs from \"node:fs\";\nimport type {DownloadedFile, DownloadFileParams} from \"../../libs/interface.js\";\nimport {ENV} from \"../../libs/env.js\";\nimport {getFileExtension, getInAppBucketDownloadPath} from \"../general/file-operations.js\";\nimport {generateUniqueValue} from \"../general/uuids.js\";\nimport {s3Client} from \"../../../engine/cloudBucket/r2Storage.js\";\n\n\n\nexport const downloadFile = async ({\n url,\n outputPath,\n }: DownloadFileParams): Promise<DownloadedFile> => {\n try {\n const key = getKeyFromUrl(url);\n\n const command = new GetObjectCommand({\n Bucket: ENV.BUCKET_NAME,\n Key: key,\n });\n\n const response = await s3Client.send(command);\n\n if (!response.Body) {\n console.log(response);\n return {\n status: true,\n url: url,\n error: new Error(`Empty response body received for key: ${key}`),\n };\n }\n\n const fileExtension = getFileExtension(url);\n const fileName = generateUniqueValue(16);\n const finalFileName = `${fileName}.${fileExtension}`;\n const targetPath = getInAppBucketDownloadPath({ segments: outputPath || [], fileName: finalFileName });\n\n // Ensure directory structure exists for targetPath\n const dir = path.dirname(targetPath);\n if (!fs.existsSync(dir)) {\n await fsPromises.mkdir(dir, { recursive: true });\n }\n\n // Cast stream to NodeJS.ReadableStream for pipeline overload\n const stream = response.Body as NodeJS.ReadableStream;\n await pipeline(stream, fs.createWriteStream(targetPath));\n\n return {\n status: true,\n url: url,\n path: targetPath,\n };\n\n } catch (error) {\n console.error(error);\n return {\n status: false,\n url: url,\n error: error instanceof Error ? error : new Error(String(error)),\n };\n }\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAQ,wBAAuB;AAE/B,SAAS,gBAAgB;AACzB,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,YAAY,QAAQ;AASb,IAAM,eAAe,8BAAO;AAAA,EACI;AAAA,EACA;AACJ,MAAmD;AAClF,MAAI;AACA,UAAM,MAAM,cAAc,GAAG;AAE7B,UAAM,UAAU,IAAI,iBAAiB;AAAA,MACjC,QAAQ,IAAI;AAAA,MACZ,KAAK;AAAA,IACT,CAAC;AAED,UAAM,WAAW,MAAM,SAAS,KAAK,OAAO;AAE5C,QAAI,CAAC,SAAS,MAAM;AAChB,cAAQ,IAAI,QAAQ;AACpB,aAAO;AAAA,QACH,QAAQ;AAAA,QACR;AAAA,QACA,OAAO,IAAI,MAAM,yCAAyC,GAAG,EAAE;AAAA,MACnE;AAAA,IACJ;AAEA,UAAM,gBAAgB,iBAAiB,GAAG;AAC1C,UAAM,WAAW,oBAAoB,EAAE;AACvC,UAAM,gBAAgB,GAAG,QAAQ,IAAI,aAAa;AAClD,UAAM,aAAa,2BAA2B,EAAE,UAAU,cAAc,CAAC,GAAG,UAAU,cAAc,CAAC;AAGrG,UAAM,MAAM,KAAK,QAAQ,UAAU;AACnC,QAAI,CAAI,cAAW,GAAG,GAAG;AACrB,YAAM,WAAW,MAAM,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,IACnD;AAGA,UAAM,SAAS,SAAS;AACxB,UAAM,SAAS,QAAW,qBAAkB,UAAU,CAAC;AAEvD,WAAO;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,MAAM;AAAA,IACV;AAAA,EAEJ,SAAS,OAAO;AACZ,YAAQ,MAAM,KAAK;AACnB,WAAO;AAAA,MACH,QAAQ;AAAA,MACR;AAAA,MACA,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AAAA,IACnE;AAAA,EACJ;AACJ,GApD4B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/general/error_handler.ts"],"sourcesContent":["import type {CustomErrorTemplate} from \"../../libs/interface.js\";\n\nfunction normalizeError(err: unknown): CustomErrorTemplate {\n const timestamp = new Date().toISOString();\n\n if (err instanceof Error) {\n return {\n timestamp,\n type: err.name || 'Error',\n message: err.message || 'An unknown error occurred.',\n ...(err.stack !== undefined && { stack: err.stack }),\n rawError: err,\n };\n }\n\n if (typeof err === 'string') {\n return {\n timestamp,\n type: 'StringError',\n message: err,\n rawError: err,\n };\n }\n\n if (typeof err === 'object' && err !== null) {\n return {\n timestamp,\n type: 'ObjectError',\n message: JSON.stringify(err),\n rawError: err,\n };\n }\n\n return {\n timestamp,\n type: 'UnknownError',\n message: String(err),\n rawError: err,\n };\n}\n\n/**\n * Normalizes and logs an error with optional contextual information.\n *\n * Formats the error for both terminal and browser environments, displaying\n * its type, message, timestamp, context, stack trace, and raw error object.\n * The normalized error is returned after being logged.\n *\n * @param err - The unknown error value to normalize and handle.\n * @param context - Optional context describing where the error occurred.\n * @returns The normalized error as a `CustomErrorTemplate`.\n *\n * @example\n * const error = handleError(error, 'File Upload');\n * // Logs the normalized error and returns a CustomErrorTemplate.\n *\n * @example\n * try {\n * await upload_file(file);\n * } catch (error) {\n * handleError(error, 'MinIO Upload');\n * }\n */\nexport function handleError(\n err: unknown,\n context?: string\n): CustomErrorTemplate {\n const normalized = normalizeError(err);\n const contextLabel = context ? ` [${context.toUpperCase()}]` : '';\n\n // Terminal/Browser styling rules\n const titleStyle = 'color: #ff4d4f; font-weight: bold; font-size: 12px;';\n const labelStyle = 'color: #999; font-weight: normal;';\n\n console.groupCollapsed(\n `%c🚨 ERROR${contextLabel}: ${normalized.type} — ${normalized.message}`,\n titleStyle\n );\n\n console.log(`%cTimestamp:%c ${normalized.timestamp}`, labelStyle, 'color: inherit;');\n\n if (context) {\n console.log(`%cContext:%c ${context}`, labelStyle, 'color: inherit;');\n }\n\n console.log(`%cMessage:%c ${normalized.message}`, labelStyle, 'color: #ff7875;');\n\n if (normalized.stack) {\n console.group('Stack Trace');\n console.log(normalized.stack);\n console.groupEnd();\n }\n\n console.group('Raw Error Object');\n console.dir(normalized.rawError);\n console.groupEnd();\n\n console.groupEnd();\n\n return normalized;\n}\n"],"mappings":";;;;;AAEA,SAAS,eAAe,KAAmC;AACvD,QAAM,aAAY,oBAAI,KAAK,GAAE,YAAY;AAEzC,MAAI,eAAe,OAAO;AACtB,WAAO;AAAA,MACH;AAAA,MACA,MAAM,IAAI,QAAQ;AAAA,MAClB,SAAS,IAAI,WAAW;AAAA,MACxB,GAAI,IAAI,UAAU,UAAa,EAAE,OAAO,IAAI,MAAM;AAAA,MAClD,UAAU;AAAA,IACd;AAAA,EACJ;AAEA,MAAI,OAAO,QAAQ,UAAU;AACzB,WAAO;AAAA,MACH;AAAA,MACA,MAAM;AAAA,MACN,SAAS;AAAA,MACT,UAAU;AAAA,IACd;AAAA,EACJ;AAEA,MAAI,OAAO,QAAQ,YAAY,QAAQ,MAAM;AACzC,WAAO;AAAA,MACH;AAAA,MACA,MAAM;AAAA,MACN,SAAS,KAAK,UAAU,GAAG;AAAA,MAC3B,UAAU;AAAA,IACd;AAAA,EACJ;AAEA,SAAO;AAAA,IACH;AAAA,IACA,MAAM;AAAA,IACN,SAAS,OAAO,GAAG;AAAA,IACnB,UAAU;AAAA,EACd;AACJ;AArCS;AA6DF,SAAS,YACZ,KACA,SACmB;AACnB,QAAM,aAAa,eAAe,GAAG;AACrC,QAAM,eAAe,UAAU,KAAK,QAAQ,YAAY,CAAC,MAAM;AAG/D,QAAM,aAAa;AACnB,QAAM,aAAa;AAEnB,UAAQ;AAAA,IACJ,oBAAa,YAAY,KAAK,WAAW,IAAI,WAAM,WAAW,OAAO;AAAA,IACrE;AAAA,EACJ;AAEA,UAAQ,IAAI,kBAAkB,WAAW,SAAS,IAAI,YAAY,iBAAiB;AAEnF,MAAI,SAAS;AACT,YAAQ,IAAI,gBAAgB,OAAO,IAAI,YAAY,iBAAiB;AAAA,EACxE;AAEA,UAAQ,IAAI,gBAAgB,WAAW,OAAO,IAAI,YAAY,iBAAiB;AAE/E,MAAI,WAAW,OAAO;AAClB,YAAQ,MAAM,aAAa;AAC3B,YAAQ,IAAI,WAAW,KAAK;AAC5B,YAAQ,SAAS;AAAA,EACrB;AAEA,UAAQ,MAAM,kBAAkB;AAChC,UAAQ,IAAI,WAAW,QAAQ;AAC/B,UAAQ,SAAS;AAEjB,UAAQ,SAAS;AAEjB,SAAO;AACX;AArCgB;","names":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fileExistsAsync
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QW2GGDEG.js";
|
|
4
4
|
import {
|
|
5
5
|
ENV
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LE2SDA4O.js";
|
|
7
7
|
import {
|
|
8
8
|
__name
|
|
9
9
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -20,8 +20,8 @@ async function connectToMongo() {
|
|
|
20
20
|
if (!client) {
|
|
21
21
|
let options;
|
|
22
22
|
try {
|
|
23
|
-
const mongoConfigFileTs = path.join(process.cwd(), "src
|
|
24
|
-
const mongoConfigFileJs = path.join(process.cwd(), "src
|
|
23
|
+
const mongoConfigFileTs = path.join(process.cwd(), "src", "config", "mongo.config.ts");
|
|
24
|
+
const mongoConfigFileJs = path.join(process.cwd(), "src", "config", "mongo.config.js");
|
|
25
25
|
const { MONGO_CLIENT_OPTIONS } = await import(pathToFileURL(
|
|
26
26
|
await fileExistsAsync(mongoConfigFileJs) ? mongoConfigFileJs : mongoConfigFileTs
|
|
27
27
|
).href);
|
|
@@ -52,4 +52,4 @@ export {
|
|
|
52
52
|
connectToMongo,
|
|
53
53
|
getMongoServer
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-AS7JRX2N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/engine/mondoDb/mongoDB.ts"],"sourcesContent":["import { ENV } from \"../../utility/libs/env.js\";\nimport { MongoClient, type MongoClientOptions } from 'mongodb';\nimport path from \"node:path\"\nimport {pathToFileURL} from \"node:url\";\nimport {fileExistsAsync} from \"../../utility/utilis/general/file-operations.js\";\n\n\nconst uri = ENV.MONGO_SERVER_URL;\nlet client: MongoClient | null = null;\n\n\nasync function connectToMongo(): Promise<MongoClient|undefined> {\n if (!uri) return;\n try {\n if (!client) {\n\n let options: MongoClientOptions;\n\n try {\n const mongoConfigFileTs = path.join(process.cwd(), \"src\", \"config\", \"mongo.config.ts\");\n const mongoConfigFileJs = path.join(process.cwd(), \"src\", \"config\", \"mongo.config.js\");\n\n const { MONGO_CLIENT_OPTIONS } = await import(\n pathToFileURL(\n (await fileExistsAsync(mongoConfigFileJs)) ? mongoConfigFileJs : mongoConfigFileTs\n ).href\n );\n options = MONGO_CLIENT_OPTIONS || {};\n }\n catch (error) {\n options = {}\n }\n\n\n client = new MongoClient(uri, options);\n await client.connect();\n console.log(\"✅ Connected to MongoDB Cluster\");\n\n }\n return client;\n } catch (error) {\n console.error(\"❌ MongoDB Connection Error:\", error);\n throw error;\n }\n}\n\n\n\nfunction getMongoServer(): MongoClient {\n if (!client) {\n throw new Error(\"Call connectToMongo first!\");\n }\n return client;\n}\n\n\n\nexport { connectToMongo, getMongoServer };\n"],"mappings":";;;;;;;;;;;AACA,SAAS,mBAA4C;AACrD,OAAO,UAAU;AACjB,SAAQ,qBAAoB;AAI5B,IAAM,MAAM,IAAI;AAChB,IAAI,SAA6B;AAGjC,eAAe,iBAAiD;AAC9D,MAAI,CAAC,IAAK;AACV,MAAI;AACF,QAAI,CAAC,QAAQ;AAEX,UAAI;AAEJ,UAAI;AACF,cAAM,oBAAoB,KAAK,KAAK,QAAQ,IAAI,GAAG,OAAO,UAAU,iBAAiB;AACrF,cAAM,oBAAoB,KAAK,KAAK,QAAQ,IAAI,GAAG,OAAO,UAAU,iBAAiB;AAErF,cAAM,EAAE,qBAAqB,IAAI,MAAM,OACnC;AAAA,UACK,MAAM,gBAAgB,iBAAiB,IAAK,oBAAoB;AAAA,QACrE,EAAE;AAEN,kBAAU,wBAAwB,CAAC;AAAA,MACrC,SACO,OAAO;AACZ,kBAAU,CAAC;AAAA,MACb;AAGA,eAAS,IAAI,YAAY,KAAK,OAAO;AACrC,YAAM,OAAO,QAAQ;AACrB,cAAQ,IAAI,qCAAgC;AAAA,IAE9C;AACA,WAAO;AAAA,EACT,SAAS,OAAO;AACd,YAAQ,MAAM,oCAA+B,KAAK;AAClD,UAAM;AAAA,EACR;AACF;AAjCe;AAqCf,SAAS,iBAA8B;AACrC,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI,MAAM,4BAA4B;AAAA,EAC9C;AACA,SAAO;AACT;AALS;","names":[]}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeMySqlQuery
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IM22RSF7.js";
|
|
4
4
|
import {
|
|
5
5
|
executePgSqlQuery
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-H3RM55WC.js";
|
|
7
7
|
import {
|
|
8
8
|
isMySQL,
|
|
9
9
|
isPostgreSQL
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-O5ILFRFV.js";
|
|
11
11
|
import {
|
|
12
12
|
getMySqlPool
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-W2KVW35Y.js";
|
|
14
14
|
import {
|
|
15
15
|
getPgSqlPool
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IT6LYD4L.js";
|
|
17
17
|
import {
|
|
18
18
|
ENV
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LE2SDA4O.js";
|
|
20
20
|
import {
|
|
21
21
|
__name
|
|
22
22
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
executeQuery,
|
|
45
45
|
getPool
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-AYXJEOSW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/postgres/executeQuery.ts"],"sourcesContent":["import type {QueryItems} from \"../../libs/interface.js\";\nimport {isMySQL, isPostgreSQL} from \"../general/sqlDb.js.js\";\nimport {ENV} from \"../../libs/env.js\";\nimport {executePgSqlQuery} from \"./subSqlfiles/executePgQuery.js\";\nimport {executeMySqlQuery} from \"./subSqlfiles/executeMySqlQuery.js\";\nimport {getMySqlPool} from \"../../../engine/sql/mySql.js\";\nimport {getPgSqlPool} from \"../../../engine/sql/pgSql.js\";\n\n\n\n\n\nexport const executeQuery = async (query: QueryItems) => {\n\n if (isPostgreSQL(ENV.SQL_DB_URL)) {\n return await executePgSqlQuery(query)\n }\n else if (isMySQL(ENV.SQL_DB_URL)) {\n return await executeMySqlQuery(query)\n }\n else {\n return new Error(`Unable to execute query. Please check the SQL_DB_URL in .env file and the db.sql file.`);\n }\n\n}\n\n\n\n\n\nexport const getPool = async () => {\n if (isPostgreSQL(ENV.SQL_DB_URL)) {\n return getPgSqlPool()\n }\n if (isMySQL(ENV.SQL_DB_URL)) {\n return getMySqlPool()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYO,IAAM,eAAe,8BAAO,UAAsB;AAErD,MAAI,aAAa,IAAI,UAAU,GAAG;AAC9B,WAAO,MAAM,kBAAkB,KAAK;AAAA,EACxC,WACS,QAAQ,IAAI,UAAU,GAAG;AAC9B,WAAO,MAAM,kBAAkB,KAAK;AAAA,EACxC,OACK;AACD,WAAO,IAAI,MAAM,wFAAwF;AAAA,EAC7G;AAEJ,GAZ4B;AAkBrB,IAAM,UAAU,mCAAY;AAC/B,MAAI,aAAa,IAAI,UAAU,GAAG;AAC9B,WAAO,aAAa;AAAA,EACxB;AACA,MAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,WAAO,aAAa;AAAA,EACxB;AACJ,GAPuB;","names":[]}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generateUniqueValue
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IZEPCXYK.js";
|
|
4
4
|
import {
|
|
5
5
|
getKeyFromUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZC33GE2U.js";
|
|
7
7
|
import {
|
|
8
8
|
s3Client
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EKT74VDD.js";
|
|
10
10
|
import {
|
|
11
11
|
getFileExtension,
|
|
12
12
|
getInAppBucketDownloadPath
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QW2GGDEG.js";
|
|
14
14
|
import {
|
|
15
15
|
ENV
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LE2SDA4O.js";
|
|
17
17
|
import {
|
|
18
18
|
__name
|
|
19
19
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -85,4 +85,4 @@ var downloadFiles = /* @__PURE__ */ __name(async ({
|
|
|
85
85
|
export {
|
|
86
86
|
downloadFiles
|
|
87
87
|
};
|
|
88
|
-
//# sourceMappingURL=chunk-
|
|
88
|
+
//# sourceMappingURL=chunk-DKFDGYXS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utility/utilis/cloud_storage/downloadFiles.ts"],"sourcesContent":["import type {DownloadedFile, DownloadFilesParams} from \"../../libs/interface.js\";\nimport {getKeyFromUrl} from \"../general/web.js\";\nimport {GetObjectCommand} from \"@aws-sdk/client-s3\";\nimport {ENV} from \"../../libs/env.js\";\nimport {getInAppBucketDownloadPath, getFileExtension} from \"../general/file-operations.js\";\nimport path from \"node:path\";\nimport fsPromises from \"fs/promises\";\nimport * as fs from \"node:fs\";\nimport {pipeline} from \"stream/promises\";\nimport {generateUniqueValue} from \"../general/uuids.js\";\nimport {s3Client} from \"../../../engine/cloudBucket/r2Storage.js\";\n\nexport const downloadFiles = async ({\n files,\n globalPath,\n }: DownloadFilesParams): Promise<DownloadedFile[]> => {\n // 1. Validate path conflict rule upfront\n const hasIndividualOutputPath = files.some(\n (file) => file.outputPath && file.outputPath.length > 0\n );\n\n if (globalPath && hasIndividualOutputPath) {\n throw new Error(\n \"Conflict: Cannot specify both 'globalPath' and individual 'outputPath' on files.\"\n );\n }\n\n // 2. Process all files independently in parallel\n const downloadPromises = files.map(async (file): Promise<DownloadedFile> => {\n const { url, outputPath } = file;\n\n try {\n const key = getKeyFromUrl(url);\n\n const command = new GetObjectCommand({\n Bucket: ENV.BUCKET_NAME,\n Key: key,\n });\n\n const response = await s3Client.send(command);\n\n if (!response.Body) {\n return {\n status: false,\n url: url,\n error: new Error(`Empty response body received for key: ${key}`),\n };\n }\n\n const fileExtension = getFileExtension(url);\n const fileName = generateUniqueValue(16);\n const finalFileName = `${fileName}.${fileExtension}`;\n\n // Resolve target path using either file's outputPath or globalPath\n const resolvedPathSegments = outputPath || (globalPath ? [globalPath] : []);\n const targetPath = getInAppBucketDownloadPath({\n segments: resolvedPathSegments,\n fileName: finalFileName,\n });\n\n // Ensure output folder structure exists\n const dir = path.dirname(targetPath);\n if (!fs.existsSync(dir)) {\n await fsPromises.mkdir(dir, { recursive: true });\n }\n\n // Stream response body directly to file\n const stream = response.Body as NodeJS.ReadableStream;\n await pipeline(stream, fs.createWriteStream(targetPath));\n\n return {\n status: true,\n url: url,\n path: targetPath,\n };\n } catch (error) {\n return {\n status: false,\n url: url,\n error: error instanceof Error ? error : new Error(String(error)),\n };\n }\n });\n\n return Promise.all(downloadPromises);\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,SAAQ,wBAAuB;AAG/B,OAAO,UAAU;AACjB,OAAO,gBAAgB;AACvB,YAAY,QAAQ;AACpB,SAAQ,gBAAe;AAIhB,IAAM,gBAAgB,8BAAO;AAAA,EACI;AAAA,EACA;AACJ,MAAsD;AAEtF,QAAM,0BAA0B,MAAM;AAAA,IAClC,CAAC,SAAS,KAAK,cAAc,KAAK,WAAW,SAAS;AAAA,EAC1D;AAEA,MAAI,cAAc,yBAAyB;AACvC,UAAM,IAAI;AAAA,MACN;AAAA,IACJ;AAAA,EACJ;AAGA,QAAM,mBAAmB,MAAM,IAAI,OAAO,SAAkC;AACxE,UAAM,EAAE,KAAK,WAAW,IAAI;AAE5B,QAAI;AACA,YAAM,MAAM,cAAc,GAAG;AAE7B,YAAM,UAAU,IAAI,iBAAiB;AAAA,QACjC,QAAQ,IAAI;AAAA,QACZ,KAAK;AAAA,MACT,CAAC;AAED,YAAM,WAAW,MAAM,SAAS,KAAK,OAAO;AAE5C,UAAI,CAAC,SAAS,MAAM;AAChB,eAAO;AAAA,UACH,QAAQ;AAAA,UACR;AAAA,UACA,OAAO,IAAI,MAAM,yCAAyC,GAAG,EAAE;AAAA,QACnE;AAAA,MACJ;AAEA,YAAM,gBAAgB,iBAAiB,GAAG;AAC1C,YAAM,WAAW,oBAAoB,EAAE;AACvC,YAAM,gBAAgB,GAAG,QAAQ,IAAI,aAAa;AAGlD,YAAM,uBAAuB,eAAe,aAAa,CAAC,UAAU,IAAI,CAAC;AACzE,YAAM,aAAa,2BAA2B;AAAA,QAC1C,UAAU;AAAA,QACV,UAAU;AAAA,MACd,CAAC;AAGD,YAAM,MAAM,KAAK,QAAQ,UAAU;AACnC,UAAI,CAAI,cAAW,GAAG,GAAG;AACrB,cAAM,WAAW,MAAM,KAAK,EAAE,WAAW,KAAK,CAAC;AAAA,MACnD;AAGA,YAAM,SAAS,SAAS;AACxB,YAAM,SAAS,QAAW,qBAAkB,UAAU,CAAC;AAEvD,aAAO;AAAA,QACH,QAAQ;AAAA,QACR;AAAA,QACA,MAAM;AAAA,MACV;AAAA,IACJ,SAAS,OAAO;AACZ,aAAO;AAAA,QACH,QAAQ;AAAA,QACR;AAAA,QACA,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,KAAK,CAAC;AAAA,MACnE;AAAA,IACJ;AAAA,EACJ,CAAC;AAED,SAAO,QAAQ,IAAI,gBAAgB;AACvC,GAzE6B;","names":[]}
|
|
@@ -1,77 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
upload_batch
|
|
3
|
+
} from "./chunk-ZTTB4NMA.js";
|
|
4
|
+
import {
|
|
5
|
+
upload_single
|
|
6
|
+
} from "./chunk-3DJ6GERS.js";
|
|
7
|
+
import {
|
|
8
|
+
executeQuery,
|
|
9
|
+
getPool
|
|
10
|
+
} from "./chunk-AYXJEOSW.js";
|
|
1
11
|
import {
|
|
2
12
|
mongoBulkWrite
|
|
3
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VFJV227G.js";
|
|
4
14
|
import {
|
|
5
15
|
mongoDeleteDocument
|
|
6
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GWPLCPRW.js";
|
|
7
17
|
import {
|
|
8
18
|
mongoInsertField
|
|
9
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-T4PLUOW3.js";
|
|
10
20
|
import {
|
|
11
21
|
mongoInsertFields
|
|
12
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-346ZYI6W.js";
|
|
13
23
|
import {
|
|
14
24
|
mongoUpdateField
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
upload_batch
|
|
18
|
-
} from "./chunk-CPECHQJJ.js";
|
|
19
|
-
import {
|
|
20
|
-
upload_single
|
|
21
|
-
} from "./chunk-ES6AHESH.js";
|
|
22
|
-
import {
|
|
23
|
-
executeQuery,
|
|
24
|
-
getPool
|
|
25
|
-
} from "./chunk-P4FWSZ43.js";
|
|
25
|
+
} from "./chunk-237SVWEU.js";
|
|
26
26
|
import {
|
|
27
27
|
downloadFiles
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-DKFDGYXS.js";
|
|
29
29
|
import {
|
|
30
30
|
upload_files
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-XMWRNOBE.js";
|
|
32
32
|
import {
|
|
33
33
|
upload_file
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-KYX4HMIY.js";
|
|
35
35
|
import {
|
|
36
36
|
handleError
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-A7GR4LD2.js";
|
|
38
38
|
import {
|
|
39
39
|
detectSQLDatabase,
|
|
40
40
|
isMySQL,
|
|
41
41
|
isPostgreSQL
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-O5ILFRFV.js";
|
|
43
43
|
import {
|
|
44
44
|
deleteFile
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-GMQU3OAU.js";
|
|
46
46
|
import {
|
|
47
47
|
deleteFiles
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-XPJKMJBD.js";
|
|
49
49
|
import {
|
|
50
50
|
downloadFile
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-5NVPS6PC.js";
|
|
52
52
|
import {
|
|
53
53
|
generateUniqueValue
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-IZEPCXYK.js";
|
|
55
55
|
import {
|
|
56
56
|
buildURL,
|
|
57
57
|
getKeyFromUrl,
|
|
58
58
|
responseToClient
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ZC33GE2U.js";
|
|
60
60
|
import {
|
|
61
61
|
s3Client
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-EKT74VDD.js";
|
|
63
|
+
import {
|
|
64
|
+
connectToMongo
|
|
65
|
+
} from "./chunk-AS7JRX2N.js";
|
|
63
66
|
import {
|
|
64
67
|
MAX_BATCH_FILES
|
|
65
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-4L35JPDH.js";
|
|
66
69
|
import {
|
|
67
70
|
runMySqlScript
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-W2KVW35Y.js";
|
|
69
72
|
import {
|
|
70
73
|
runPgSqlScript
|
|
71
|
-
} from "./chunk-
|
|
72
|
-
import {
|
|
73
|
-
connectToMongo
|
|
74
|
-
} from "./chunk-ECIP24BN.js";
|
|
74
|
+
} from "./chunk-IT6LYD4L.js";
|
|
75
75
|
import {
|
|
76
76
|
buildPath,
|
|
77
77
|
fileExistsAsync,
|
|
@@ -81,10 +81,10 @@ import {
|
|
|
81
81
|
getInAppBucketDownloadPath,
|
|
82
82
|
toUint8Array,
|
|
83
83
|
url_or_path
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-QW2GGDEG.js";
|
|
85
85
|
import {
|
|
86
86
|
ENV
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-LE2SDA4O.js";
|
|
88
88
|
import {
|
|
89
89
|
__name
|
|
90
90
|
} from "./chunk-7QVYU63E.js";
|
|
@@ -237,13 +237,13 @@ var getServer2 = /* @__PURE__ */ __name(() => {
|
|
|
237
237
|
}, "getServer");
|
|
238
238
|
|
|
239
239
|
// src/engine/server/server.ts
|
|
240
|
+
var configPathTs = path.join(process.cwd(), "src", "config", "express.config.ts");
|
|
241
|
+
var configPathJs = path.join(process.cwd(), "src", "config", "express.config.js");
|
|
242
|
+
var EXPRESS_APP = express();
|
|
243
|
+
var apiPathTs = path.join(process.cwd(), "src", "apis", "apis.ts");
|
|
244
|
+
var apiPathJs = path.join(process.cwd(), "src", "apis", "apis.js");
|
|
240
245
|
var PORT = ENV.SERVER_PORT;
|
|
241
246
|
var SQL_URL = ENV.SQL_DB_URL;
|
|
242
|
-
var configPathTs = path.join(process.cwd(), "src/config/express.config.ts");
|
|
243
|
-
var configPathJs = path.join(process.cwd(), "src/config/express.config.js");
|
|
244
|
-
var apiPathTs = path.join(process.cwd(), "src/apis/apis.ts");
|
|
245
|
-
var apiPathJs = path.join(process.cwd(), "src/apis/apis.js");
|
|
246
|
-
var EXPRESS_APP = express();
|
|
247
247
|
var HTTP_SERVER = http.createServer(EXPRESS_APP);
|
|
248
248
|
var startServer = /* @__PURE__ */ __name(async () => {
|
|
249
249
|
try {
|
|
@@ -279,7 +279,7 @@ var startServer = /* @__PURE__ */ __name(async () => {
|
|
|
279
279
|
EXPRESS_APP.patch(api.patch.endpoint, ...middleware, api.patch.callable);
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
HTTP_SERVER.listen(PORT,
|
|
282
|
+
HTTP_SERVER.listen(PORT, () => {
|
|
283
283
|
console.log(`Server running on port ${PORT}`);
|
|
284
284
|
});
|
|
285
285
|
} catch (err) {
|
|
@@ -333,4 +333,4 @@ export {
|
|
|
333
333
|
HTTP_SERVER,
|
|
334
334
|
startServer
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=chunk-
|
|
336
|
+
//# sourceMappingURL=chunk-DWODHIWI.js.map
|