backfarm 1.0.4 → 1.0.6

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.
Files changed (176) hide show
  1. package/dist/chunk-22GJTNKR.js +47 -0
  2. package/dist/chunk-22GJTNKR.js.map +1 -0
  3. package/dist/{chunk-XBJ3SJ26.js → chunk-2QNCQ5L5.js} +3 -3
  4. package/dist/chunk-2QNCQ5L5.js.map +1 -0
  5. package/dist/chunk-3DJ6GERS.js +17 -0
  6. package/dist/chunk-3DJ6GERS.js.map +1 -0
  7. package/dist/chunk-452DWS46.js +88 -0
  8. package/dist/chunk-452DWS46.js.map +1 -0
  9. package/dist/{chunk-UWIMSKL5.js → chunk-4L35JPDH.js} +2 -2
  10. package/dist/chunk-4L35JPDH.js.map +1 -0
  11. package/dist/{chunk-VFF4YFA3.js → chunk-5AJKFCEE.js} +3 -3
  12. package/dist/chunk-5AJKFCEE.js.map +1 -0
  13. package/dist/chunk-6BNQOIVA.js +34 -0
  14. package/dist/chunk-6BNQOIVA.js.map +1 -0
  15. package/dist/{chunk-P5XJG7OG.js → chunk-A7GR4LD2.js} +1 -1
  16. package/dist/chunk-A7GR4LD2.js.map +1 -0
  17. package/dist/chunk-EEQ2SXDE.js +32 -0
  18. package/dist/chunk-EEQ2SXDE.js.map +1 -0
  19. package/dist/chunk-EUWCMMGI.js +35 -0
  20. package/dist/chunk-EUWCMMGI.js.map +1 -0
  21. package/dist/chunk-HC4IDQP6.js +89 -0
  22. package/dist/chunk-HC4IDQP6.js.map +1 -0
  23. package/dist/{chunk-QVTKG7FD.js → chunk-HV3IQJH3.js} +3 -3
  24. package/dist/chunk-HV3IQJH3.js.map +1 -0
  25. package/dist/{chunk-X3R3RLXY.js → chunk-IZEPCXYK.js} +1 -1
  26. package/dist/chunk-IZEPCXYK.js.map +1 -0
  27. package/dist/{chunk-YTBSGKGF.js → chunk-J3P6W53K.js} +2 -2
  28. package/dist/chunk-J3P6W53K.js.map +1 -0
  29. package/dist/{chunk-EWQYVPOL.js → chunk-LE2SDA4O.js} +1 -1
  30. package/dist/chunk-LE2SDA4O.js.map +1 -0
  31. package/dist/chunk-M7PVDT2D.js +60 -0
  32. package/dist/chunk-M7PVDT2D.js.map +1 -0
  33. package/dist/chunk-O2ZDXQ2Z.js +44 -0
  34. package/dist/chunk-O2ZDXQ2Z.js.map +1 -0
  35. package/dist/{chunk-MNSQSU7T.js → chunk-O5ILFRFV.js} +2 -2
  36. package/dist/chunk-O5ILFRFV.js.map +1 -0
  37. package/dist/chunk-O76OK6Y7.js +40 -0
  38. package/dist/chunk-O76OK6Y7.js.map +1 -0
  39. package/dist/{chunk-W3W3X2OE.js → chunk-QW2GGDEG.js} +54 -19
  40. package/dist/chunk-QW2GGDEG.js.map +1 -0
  41. package/dist/chunk-RZ7XHAUV.js +74 -0
  42. package/dist/chunk-RZ7XHAUV.js.map +1 -0
  43. package/dist/{chunk-TP3K7DMH.js → chunk-U7BCM2WN.js} +2 -2
  44. package/dist/chunk-U7BCM2WN.js.map +1 -0
  45. package/dist/chunk-UPP2FW3G.js +336 -0
  46. package/dist/chunk-UPP2FW3G.js.map +1 -0
  47. package/dist/chunk-YA3MW2CJ.js +33 -0
  48. package/dist/chunk-YA3MW2CJ.js.map +1 -0
  49. package/dist/{chunk-SSFPGDA3.js → chunk-ZC33GE2U.js} +5 -5
  50. package/dist/chunk-ZC33GE2U.js.map +1 -0
  51. package/dist/{chunk-D7A4TEXY.js → chunk-ZC6ZFZ2J.js} +2 -2
  52. package/dist/chunk-ZC6ZFZ2J.js.map +1 -0
  53. package/dist/{chunk-ZMDJ45KH.js → chunk-ZGOMCU4T.js} +7 -7
  54. package/dist/chunk-ZGOMCU4T.js.map +1 -0
  55. package/dist/chunk-ZTTB4NMA.js +18 -0
  56. package/dist/chunk-ZTTB4NMA.js.map +1 -0
  57. package/dist/engine/cloudBucket/r2Storage.js +3 -3
  58. package/dist/engine/mondoDb/mongoDB.js +3 -3
  59. package/dist/engine/multer/multer_configs.js +2 -2
  60. package/dist/engine/server/server.d.ts +5 -3
  61. package/dist/engine/server/server.js +30 -9
  62. package/dist/engine/sql/mySql.d.ts +2 -2
  63. package/dist/engine/sql/mySql.js +3 -3
  64. package/dist/engine/sql/pgSql.js +3 -3
  65. package/dist/utility/libs/env.js +1 -1
  66. package/dist/utility/libs/index.d.ts +1772 -0
  67. package/dist/utility/libs/index.js +101 -0
  68. package/dist/utility/libs/interface.d.ts +5 -7
  69. package/dist/utility/libs/run-all.js +46 -0
  70. package/dist/utility/libs/run-all.js.map +1 -0
  71. package/dist/{chunk-LFRKRR7G.js → utility/libs/run-bucket.js} +4 -7
  72. package/dist/utility/libs/run-bucket.js.map +1 -0
  73. package/dist/utility/libs/run-node-server.js +35 -0
  74. package/dist/utility/libs/run-node-server.js.map +1 -0
  75. package/dist/utility/libs/types.d.ts +11 -31
  76. package/dist/utility/libs/types.js +1 -1
  77. package/dist/utility/libs/types.js.map +1 -1
  78. package/dist/utility/utilis/cloud_storage/deleteFile.js +7 -54
  79. package/dist/utility/utilis/cloud_storage/deleteFile.js.map +1 -1
  80. package/dist/utility/utilis/cloud_storage/deleteFiles.js +7 -83
  81. package/dist/utility/utilis/cloud_storage/deleteFiles.js.map +1 -1
  82. package/dist/utility/utilis/cloud_storage/downloadFile.js +8 -68
  83. package/dist/utility/utilis/cloud_storage/downloadFile.js.map +1 -1
  84. package/dist/utility/utilis/cloud_storage/downloadFiles.js +8 -82
  85. package/dist/utility/utilis/cloud_storage/downloadFiles.js.map +1 -1
  86. package/dist/utility/utilis/cloud_storage/uploadFile.js +6 -6
  87. package/dist/utility/utilis/cloud_storage/uploadFiles.d.ts +0 -64
  88. package/dist/utility/utilis/cloud_storage/uploadFiles.js +9 -43
  89. package/dist/utility/utilis/cloud_storage/uploadFiles.js.map +1 -1
  90. package/dist/utility/utilis/general/error_handler.js +1 -1
  91. package/dist/utility/utilis/general/file-operations.d.ts +7 -132
  92. package/dist/utility/utilis/general/file-operations.js +6 -4
  93. package/dist/utility/utilis/general/sqlDb.js.d.ts +0 -141
  94. package/dist/utility/utilis/general/sqlDb.js.js +2 -2
  95. package/dist/utility/utilis/general/uuids.d.ts +0 -43
  96. package/dist/utility/utilis/general/uuids.js +1 -1
  97. package/dist/utility/utilis/general/web.d.ts +2 -238
  98. package/dist/utility/utilis/general/web.js +4 -4
  99. package/dist/utility/utilis/mongoDb/buldWrite.d.ts +0 -44
  100. package/dist/utility/utilis/mongoDb/buldWrite.js +6 -28
  101. package/dist/utility/utilis/mongoDb/buldWrite.js.map +1 -1
  102. package/dist/utility/utilis/mongoDb/deleteDocument.d.ts +0 -45
  103. package/dist/utility/utilis/mongoDb/deleteDocument.js +6 -30
  104. package/dist/utility/utilis/mongoDb/deleteDocument.js.map +1 -1
  105. package/dist/utility/utilis/mongoDb/insertField.d.ts +2 -33
  106. package/dist/utility/utilis/mongoDb/insertField.js +7 -30
  107. package/dist/utility/utilis/mongoDb/insertField.js.map +1 -1
  108. package/dist/utility/utilis/mongoDb/insertFields.d.ts +2 -41
  109. package/dist/utility/utilis/mongoDb/insertFields.js +7 -32
  110. package/dist/utility/utilis/mongoDb/insertFields.js.map +1 -1
  111. package/dist/utility/utilis/mongoDb/updateFiled.d.ts +0 -56
  112. package/dist/utility/utilis/mongoDb/updateFiled.js +6 -36
  113. package/dist/utility/utilis/mongoDb/updateFiled.js.map +1 -1
  114. package/dist/utility/utilis/multer/upload_batch.js +5 -12
  115. package/dist/utility/utilis/multer/upload_batch.js.map +1 -1
  116. package/dist/utility/utilis/multer/upload_single.d.ts +41 -0
  117. package/dist/utility/utilis/multer/upload_single.js +5 -11
  118. package/dist/utility/utilis/multer/upload_single.js.map +1 -1
  119. package/dist/utility/utilis/postgres/executeQuery.d.ts +2 -205
  120. package/dist/utility/utilis/postgres/executeQuery.js +11 -41
  121. package/dist/utility/utilis/postgres/executeQuery.js.map +1 -1
  122. package/dist/utility/utilis/postgres/subSqlfiles/executeMySqlQuery.js +4 -4
  123. package/dist/utility/utilis/postgres/subSqlfiles/executePgQuery.js +4 -4
  124. package/dist/utility/utilis/server/app.js +30 -12
  125. package/dist/utility/utilis/server/app.js.map +1 -1
  126. package/dist/utility/utilis/server/server.d.ts +2 -2
  127. package/dist/utility/utilis/server/server.js +30 -20
  128. package/dist/utility/utilis/server/server.js.map +1 -1
  129. package/package.json +55 -56
  130. package/dist/chunk-5A3RVJNT.js +0 -19
  131. package/dist/chunk-5A3RVJNT.js.map +0 -1
  132. package/dist/chunk-D7A4TEXY.js.map +0 -1
  133. package/dist/chunk-EWQYVPOL.js.map +0 -1
  134. package/dist/chunk-ICFMWIIJ.js +0 -53
  135. package/dist/chunk-ICFMWIIJ.js.map +0 -1
  136. package/dist/chunk-LFRKRR7G.js.map +0 -1
  137. package/dist/chunk-MNSQSU7T.js.map +0 -1
  138. package/dist/chunk-NIOLLLJJ.js +0 -44
  139. package/dist/chunk-NIOLLLJJ.js.map +0 -1
  140. package/dist/chunk-P5XJG7OG.js.map +0 -1
  141. package/dist/chunk-QVTKG7FD.js.map +0 -1
  142. package/dist/chunk-SSFPGDA3.js.map +0 -1
  143. package/dist/chunk-TP3K7DMH.js.map +0 -1
  144. package/dist/chunk-UWIMSKL5.js.map +0 -1
  145. package/dist/chunk-VFF4YFA3.js.map +0 -1
  146. package/dist/chunk-W3W3X2OE.js.map +0 -1
  147. package/dist/chunk-X3R3RLXY.js.map +0 -1
  148. package/dist/chunk-XBJ3SJ26.js.map +0 -1
  149. package/dist/chunk-YTBSGKGF.js.map +0 -1
  150. package/dist/chunk-YWFCWT6R.js +0 -23
  151. package/dist/chunk-YWFCWT6R.js.map +0 -1
  152. package/dist/chunk-ZMDJ45KH.js.map +0 -1
  153. package/dist/engine/script/run-all.d.ts +0 -3
  154. package/dist/engine/script/run-all.js +0 -8
  155. package/dist/engine/script/run-bucket.d.ts +0 -3
  156. package/dist/engine/script/run-bucket.js +0 -8
  157. package/dist/engine/script/run-bucket.js.map +0 -1
  158. package/dist/engine/script/run-node-server.d.ts +0 -3
  159. package/dist/engine/script/run-node-server.js +0 -8
  160. package/dist/engine/script/run-node-server.js.map +0 -1
  161. package/dist/engine/server/app.d.ts +0 -5
  162. package/dist/engine/server/app.js +0 -10
  163. package/dist/engine/server/app.js.map +0 -1
  164. package/dist/utility/script/run-all.js +0 -8
  165. package/dist/utility/script/run-all.js.map +0 -1
  166. package/dist/utility/script/run-bucket.js +0 -8
  167. package/dist/utility/script/run-bucket.js.map +0 -1
  168. package/dist/utility/script/run-node-server.js +0 -8
  169. package/dist/utility/script/run-node-server.js.map +0 -1
  170. package/dist/utility/utilis/cloud_storage/s3Client.d.ts +0 -5
  171. package/dist/utility/utilis/cloud_storage/s3Client.js +0 -17
  172. package/dist/utility/utilis/cloud_storage/s3Client.js.map +0 -1
  173. /package/dist/{engine/script/run-all.js.map → utility/libs/index.js.map} +0 -0
  174. /package/dist/utility/{script → libs}/run-all.d.ts +0 -0
  175. /package/dist/utility/{script → libs}/run-bucket.d.ts +0 -0
  176. /package/dist/utility/{script → libs}/run-node-server.d.ts +0 -0
@@ -1,86 +1,12 @@
1
1
  import {
2
- generateUniqueValue
3
- } from "../../../chunk-X3R3RLXY.js";
4
- import {
5
- getKeyFromUrl
6
- } from "../../../chunk-SSFPGDA3.js";
7
- import {
8
- s3Client
9
- } from "../../../chunk-YTBSGKGF.js";
10
- import {
11
- downloadedFilePath,
12
- getFileExtension
13
- } from "../../../chunk-W3W3X2OE.js";
14
- import {
15
- ENV
16
- } from "../../../chunk-EWQYVPOL.js";
17
- import {
18
- __name
19
- } from "../../../chunk-7QVYU63E.js";
20
-
21
- // src/utility/utilis/cloud_storage/downloadFiles.ts
22
- import { GetObjectCommand } from "@aws-sdk/client-s3";
23
- import path from "path";
24
- import fsPromises from "fs/promises";
25
- import * as fs from "fs";
26
- import { pipeline } from "stream/promises";
27
- var downloadFiles = /* @__PURE__ */ __name(async ({
28
- files,
29
- globalPath
30
- }) => {
31
- const hasIndividualOutputPath = files.some(
32
- (file) => file.outputPath && file.outputPath.length > 0
33
- );
34
- if (globalPath && hasIndividualOutputPath) {
35
- throw new Error(
36
- "Conflict: Cannot specify both 'globalPath' and individual 'outputPath' on files."
37
- );
38
- }
39
- const downloadPromises = files.map(async (file) => {
40
- const { url, outputPath } = file;
41
- try {
42
- const key = getKeyFromUrl(url);
43
- const command = new GetObjectCommand({
44
- Bucket: ENV.BUCKET_NAME,
45
- Key: key
46
- });
47
- const response = await s3Client.send(command);
48
- if (!response.Body) {
49
- return {
50
- status: false,
51
- url,
52
- error: new Error(`Empty response body received for key: ${key}`)
53
- };
54
- }
55
- const fileExtension = getFileExtension(url);
56
- const fileName = generateUniqueValue(16);
57
- const finalFileName = `${fileName}.${fileExtension}`;
58
- const resolvedPathSegments = outputPath || (globalPath ? [globalPath] : []);
59
- const targetPath = downloadedFilePath({
60
- path: resolvedPathSegments,
61
- fileName: finalFileName
62
- });
63
- const dir = path.dirname(targetPath);
64
- if (!fs.existsSync(dir)) {
65
- await fsPromises.mkdir(dir, { recursive: true });
66
- }
67
- const stream = response.Body;
68
- await pipeline(stream, fs.createWriteStream(targetPath));
69
- return {
70
- status: true,
71
- url,
72
- path: targetPath
73
- };
74
- } catch (error) {
75
- return {
76
- status: false,
77
- url,
78
- error: error instanceof Error ? error : new Error(String(error))
79
- };
80
- }
81
- });
82
- return Promise.all(downloadPromises);
83
- }, "downloadFiles");
2
+ downloadFiles
3
+ } from "../../../chunk-452DWS46.js";
4
+ import "../../../chunk-IZEPCXYK.js";
5
+ import "../../../chunk-ZC33GE2U.js";
6
+ import "../../../chunk-J3P6W53K.js";
7
+ import "../../../chunk-QW2GGDEG.js";
8
+ import "../../../chunk-LE2SDA4O.js";
9
+ import "../../../chunk-7QVYU63E.js";
84
10
  export {
85
11
  downloadFiles
86
12
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/utility/utilis/cloud_storage/downloadFiles.ts"],"sourcesContent":["import type {DownloadedFile, DownloadFilesParams} from \"../../libs/interface.js\";\r\nimport {getKeyFromUrl} from \"../general/web.js\";\r\nimport {GetObjectCommand} from \"@aws-sdk/client-s3\";\r\nimport {ENV} from \"../../libs/env.js\";\r\nimport {downloadedFilePath, getFileExtension} from \"../general/file-operations.js\";\r\nimport path from \"node:path\";\r\nimport fsPromises from \"fs/promises\";\r\nimport * as fs from \"node:fs\";\r\nimport {pipeline} from \"stream/promises\";\r\nimport {generateUniqueValue} from \"../general/uuids.js\";\r\nimport {s3Client} from \"../../../engine/cloudBucket/r2Storage.js\";\r\n\r\nexport const downloadFiles = async ({\r\n files,\r\n globalPath,\r\n }: DownloadFilesParams): Promise<DownloadedFile[]> => {\r\n // 1. Validate path conflict rule upfront\r\n const hasIndividualOutputPath = files.some(\r\n (file) => file.outputPath && file.outputPath.length > 0\r\n );\r\n\r\n if (globalPath && hasIndividualOutputPath) {\r\n throw new Error(\r\n \"Conflict: Cannot specify both 'globalPath' and individual 'outputPath' on files.\"\r\n );\r\n }\r\n\r\n // 2. Process all files independently in parallel\r\n const downloadPromises = files.map(async (file): Promise<DownloadedFile> => {\r\n const { url, outputPath } = file;\r\n\r\n try {\r\n const key = getKeyFromUrl(url);\r\n\r\n const command = new GetObjectCommand({\r\n Bucket: ENV.BUCKET_NAME,\r\n Key: key,\r\n });\r\n\r\n const response = await s3Client.send(command);\r\n\r\n if (!response.Body) {\r\n return {\r\n status: false,\r\n url: url,\r\n error: new Error(`Empty response body received for key: ${key}`),\r\n };\r\n }\r\n\r\n const fileExtension = getFileExtension(url);\r\n const fileName = generateUniqueValue(16);\r\n const finalFileName = `${fileName}.${fileExtension}`;\r\n\r\n // Resolve target path using either file's outputPath or globalPath\r\n const resolvedPathSegments = outputPath || (globalPath ? [globalPath] : []);\r\n const targetPath = downloadedFilePath({\r\n path: resolvedPathSegments,\r\n fileName: finalFileName,\r\n });\r\n\r\n // Ensure output folder structure exists\r\n const dir = path.dirname(targetPath);\r\n if (!fs.existsSync(dir)) {\r\n await fsPromises.mkdir(dir, { recursive: true });\r\n }\r\n\r\n // Stream response body directly to file\r\n const stream = response.Body as NodeJS.ReadableStream;\r\n await pipeline(stream, fs.createWriteStream(targetPath));\r\n\r\n return {\r\n status: true,\r\n url: url,\r\n path: targetPath,\r\n };\r\n } catch (error) {\r\n return {\r\n status: false,\r\n url: url,\r\n error: error instanceof Error ? error : new Error(String(error)),\r\n };\r\n }\r\n });\r\n\r\n return Promise.all(downloadPromises);\r\n};\r\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,mBAAmB;AAAA,QAClC,MAAM;AAAA,QACN,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
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  upload_file
3
- } from "../../../chunk-ZMDJ45KH.js";
4
- import "../../../chunk-X3R3RLXY.js";
5
- import "../../../chunk-SSFPGDA3.js";
6
- import "../../../chunk-YTBSGKGF.js";
7
- import "../../../chunk-W3W3X2OE.js";
8
- import "../../../chunk-EWQYVPOL.js";
3
+ } from "../../../chunk-ZGOMCU4T.js";
4
+ import "../../../chunk-IZEPCXYK.js";
5
+ import "../../../chunk-ZC33GE2U.js";
6
+ import "../../../chunk-J3P6W53K.js";
7
+ import "../../../chunk-QW2GGDEG.js";
8
+ import "../../../chunk-LE2SDA4O.js";
9
9
  import "../../../chunk-7QVYU63E.js";
10
10
  export {
11
11
  upload_file
@@ -4,70 +4,6 @@ import '../../libs/types.js';
4
4
  import 'express';
5
5
  import '../../libs/env.js';
6
6
 
7
- /**
8
- * Uploads multiple files to the configured S3-compatible storage bucket
9
- * concurrently with a configurable concurrency limit.
10
- *
11
- * Each file is uploaded using the `upload_file` function. A global path can
12
- * be applied to all files, or each file can specify its own individual path,
13
- * but both options cannot be used at the same time.
14
- *
15
- * Failed uploads are collected separately from successful uploads, allowing
16
- * the caller to inspect the result of every individual file without stopping
17
- * the entire batch operation.
18
- *
19
- * @param params - Configuration options for the batch upload.
20
- * @param params.files - The files to upload along with their optional paths.
21
- * @param params.globalPath - An optional path applied to all files that do
22
- * not specify an individual path.
23
- * @param params.concurrency - The maximum number of files uploaded
24
- * concurrently. Defaults to `5`.
25
- * @returns A promise resolving to a `FilesUploadedResponseData` containing
26
- * separate arrays of successfully uploaded and failed files.
27
- * @throws {Error} If both `globalPath` and an individual file `path` are
28
- * provided.
29
- *
30
- * @example
31
- * const result = await upload_files({
32
- * files: [
33
- * { file: file1 },
34
- * { file: file2 },
35
- * { file: file3 },
36
- * ],
37
- * globalPath: ['temporary_files'],
38
- * concurrency: 5,
39
- * });
40
- *
41
- * console.log('Successful uploads:', result.successFiles);
42
- * console.log('Failed uploads:', result.failedFiles);
43
- *
44
- * @example
45
- * const result = await upload_files({
46
- * files: [
47
- * {
48
- * file: file1,
49
- * path: ['documents', 'reports'],
50
- * },
51
- * {
52
- * file: file2,
53
- * path: ['documents', 'images'],
54
- * },
55
- * ],
56
- * concurrency: 10,
57
- * });
58
- *
59
- * @example
60
- * // This throws because globalPath and an individual path cannot be used together.
61
- * const result = await upload_files({
62
- * files: [
63
- * {
64
- * file: file1,
65
- * path: ['documents'],
66
- * },
67
- * ],
68
- * globalPath: ['temporary_files'],
69
- * });
70
- */
71
7
  declare const upload_files: ({ files, globalPath, concurrency }: UploadFilesInput) => Promise<FilesUploadedResponseData>;
72
8
 
73
9
  export { upload_files };
@@ -1,47 +1,13 @@
1
1
  import {
2
- upload_file
3
- } from "../../../chunk-ZMDJ45KH.js";
4
- import "../../../chunk-X3R3RLXY.js";
5
- import "../../../chunk-SSFPGDA3.js";
6
- import "../../../chunk-YTBSGKGF.js";
7
- import "../../../chunk-W3W3X2OE.js";
8
- import "../../../chunk-EWQYVPOL.js";
9
- import {
10
- __name
11
- } from "../../../chunk-7QVYU63E.js";
12
-
13
- // src/utility/utilis/cloud_storage/uploadFiles.ts
14
- import pLimit from "p-limit";
15
- var upload_files = /* @__PURE__ */ __name(async ({
16
- files,
17
- globalPath,
18
- concurrency = 5
19
- }) => {
20
- if (globalPath && files.some((item) => item.path && item.path.length > 0)) {
21
- throw new Error("Invalid options: 'globalPath' and individual 'path' cannot both exist.");
22
- }
23
- const limiter = pLimit(concurrency);
24
- const returnData = {
25
- successFiles: [],
26
- failedFiles: []
27
- };
28
- const uploadTasks = files.map(
29
- ({ file, path }) => limiter(async () => {
30
- const resolvedPath = path ?? (globalPath?.length ? globalPath : void 0);
31
- const result = await upload_file({
32
- file,
33
- path: resolvedPath
34
- });
35
- if ("error" in result && result.error) {
36
- returnData.failedFiles.push(result);
37
- } else {
38
- returnData.successFiles.push(result);
39
- }
40
- })
41
- );
42
- await Promise.all(uploadTasks);
43
- return returnData;
44
- }, "upload_files");
2
+ upload_files
3
+ } from "../../../chunk-O2ZDXQ2Z.js";
4
+ import "../../../chunk-ZGOMCU4T.js";
5
+ import "../../../chunk-IZEPCXYK.js";
6
+ import "../../../chunk-ZC33GE2U.js";
7
+ import "../../../chunk-J3P6W53K.js";
8
+ import "../../../chunk-QW2GGDEG.js";
9
+ import "../../../chunk-LE2SDA4O.js";
10
+ import "../../../chunk-7QVYU63E.js";
45
11
  export {
46
12
  upload_files
47
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/utility/utilis/cloud_storage/uploadFiles.ts"],"sourcesContent":["import type {FilesUploadedResponseData, UploadFilesInput} from \"../../libs/interface.js\";\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nimport pLimit from 'p-limit';\r\nimport {upload_file} from \"./uploadFile.js\";\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n/**\r\n * Uploads multiple files to the configured S3-compatible storage bucket\r\n * concurrently with a configurable concurrency limit.\r\n *\r\n * Each file is uploaded using the `upload_file` function. A global path can\r\n * be applied to all files, or each file can specify its own individual path,\r\n * but both options cannot be used at the same time.\r\n *\r\n * Failed uploads are collected separately from successful uploads, allowing\r\n * the caller to inspect the result of every individual file without stopping\r\n * the entire batch operation.\r\n *\r\n * @param params - Configuration options for the batch upload.\r\n * @param params.files - The files to upload along with their optional paths.\r\n * @param params.globalPath - An optional path applied to all files that do\r\n * not specify an individual path.\r\n * @param params.concurrency - The maximum number of files uploaded\r\n * concurrently. Defaults to `5`.\r\n * @returns A promise resolving to a `FilesUploadedResponseData` containing\r\n * separate arrays of successfully uploaded and failed files.\r\n * @throws {Error} If both `globalPath` and an individual file `path` are\r\n * provided.\r\n *\r\n * @example\r\n * const result = await upload_files({\r\n * files: [\r\n * { file: file1 },\r\n * { file: file2 },\r\n * { file: file3 },\r\n * ],\r\n * globalPath: ['temporary_files'],\r\n * concurrency: 5,\r\n * });\r\n *\r\n * console.log('Successful uploads:', result.successFiles);\r\n * console.log('Failed uploads:', result.failedFiles);\r\n *\r\n * @example\r\n * const result = await upload_files({\r\n * files: [\r\n * {\r\n * file: file1,\r\n * path: ['documents', 'reports'],\r\n * },\r\n * {\r\n * file: file2,\r\n * path: ['documents', 'images'],\r\n * },\r\n * ],\r\n * concurrency: 10,\r\n * });\r\n *\r\n * @example\r\n * // This throws because globalPath and an individual path cannot be used together.\r\n * const result = await upload_files({\r\n * files: [\r\n * {\r\n * file: file1,\r\n * path: ['documents'],\r\n * },\r\n * ],\r\n * globalPath: ['temporary_files'],\r\n * });\r\n */\r\nexport const upload_files = async ({\r\n files,\r\n globalPath,\r\n concurrency = 5\r\n }: UploadFilesInput): Promise<FilesUploadedResponseData> => {\r\n\r\n // 1. Validate: Throw error immediately if globalPath coexists with any item's individual path\r\n if (globalPath && files.some((item) => item.path && item.path.length > 0)) {\r\n throw new Error(\"Invalid options: 'globalPath' and individual 'path' cannot both exist.\");\r\n }\r\n\r\n const limiter = pLimit(concurrency);\r\n const returnData: FilesUploadedResponseData = {\r\n successFiles: [],\r\n failedFiles: []\r\n };\r\n\r\n // 2. Map and run concurrent uploads inside limiter tasks\r\n const uploadTasks = files.map(({ file, path }) =>\r\n limiter(async () => {\r\n // Resolve target path (use item's path if available, otherwise globalPath array)\r\n const resolvedPath = path ?? (globalPath?.length ? globalPath : undefined);\r\n\r\n // Delegate single file upload logic to upload_file function\r\n const result = await upload_file({\r\n file,\r\n path: resolvedPath\r\n });\r\n\r\n // Aggregate results based on whether an error occurred on the single file upload\r\n if ('error' in result && result.error) {\r\n returnData.failedFiles.push(result);\r\n } else {\r\n returnData.successFiles.push(result);\r\n }\r\n })\r\n );\r\n\r\n // 3. Wait for all concurrent uploads to settle\r\n await Promise.all(uploadTasks);\r\n\r\n return returnData;\r\n};\r\n"],"mappings":";;;;;;;;;;;;;AAQA,OAAO,YAAY;AAyEZ,IAAM,eAAe,8BAAO;AAAA,EACI;AAAA,EACA;AAAA,EACA,cAAc;AAClB,MAA4D;AAG3F,MAAI,cAAc,MAAM,KAAK,CAAC,SAAS,KAAK,QAAQ,KAAK,KAAK,SAAS,CAAC,GAAG;AACvE,UAAM,IAAI,MAAM,wEAAwE;AAAA,EAC5F;AAEA,QAAM,UAAU,OAAO,WAAW;AAClC,QAAM,aAAwC;AAAA,IAC1C,cAAc,CAAC;AAAA,IACf,aAAa,CAAC;AAAA,EAClB;AAGA,QAAM,cAAc,MAAM;AAAA,IAAI,CAAC,EAAE,MAAM,KAAK,MACxC,QAAQ,YAAY;AAEhB,YAAM,eAAe,SAAS,YAAY,SAAS,aAAa;AAGhE,YAAM,SAAS,MAAM,YAAY;AAAA,QAC7B;AAAA,QACA,MAAM;AAAA,MACV,CAAC;AAGD,UAAI,WAAW,UAAU,OAAO,OAAO;AACnC,mBAAW,YAAY,KAAK,MAAM;AAAA,MACtC,OAAO;AACH,mBAAW,aAAa,KAAK,MAAM;AAAA,MACvC;AAAA,IACJ,CAAC;AAAA,EACL;AAGA,QAAM,QAAQ,IAAI,WAAW;AAE7B,SAAO;AACX,GA1C4B;","names":[]}
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  handleError
3
- } from "../../../chunk-P5XJG7OG.js";
3
+ } from "../../../chunk-A7GR4LD2.js";
4
4
  import "../../../chunk-7QVYU63E.js";
5
5
  export {
6
6
  handleError
@@ -1,141 +1,16 @@
1
- import { PathOptions } from '../../libs/interface.js';
1
+ import { PathOptions } from '../../libs/types.js';
2
+ import { DownloadablePath } from '../../libs/interface.js';
2
3
  import 'mongodb';
3
- import '../../libs/types.js';
4
4
  import 'express';
5
5
  import '../../libs/env.js';
6
6
 
7
7
  declare function fileExistsAsync(filePath: string): Promise<boolean>;
8
- /**
9
- * Extracts the file extension from a supported file input.
10
- *
11
- * Supports Express Multer files, Web API `File` objects, raw `Buffer` values,
12
- * and file paths or URLs. For URLs and paths, query parameters and hash
13
- * fragments are ignored when determining the extension.
14
- *
15
- * @param input - The file, buffer, path, or URL from which to extract the extension.
16
- * @returns The file extension without the leading dot, converted to lowercase.
17
- * Returns an empty string if no extension can be determined.
18
- *
19
- * @example
20
- * const extension = getFileExtension('https://example.com/files/image.PNG');
21
- * // Returns: "png"
22
- *
23
- * @example
24
- * const extension = getFileExtension(req.file);
25
- * // Returns: "pdf"
26
- *
27
- * @example
28
- * const extension = getFileExtension('documents/report.pdf?download=true');
29
- * // Returns: "pdf"
30
- *
31
- * @example
32
- * const extension = getFileExtension(buffer);
33
- * // Returns: ""
34
- */
8
+ declare function fileExistsSync(filePath: string): boolean;
35
9
  declare function getFileExtension(input: Express.Multer.File | File | Buffer | string): string;
36
- /**
37
- * Builds a normalized file path from the provided path components.
38
- *
39
- * Combines the path prefix, path segments, path postfix, and file name,
40
- * while removing empty values and normalizing redundant slashes.
41
- *
42
- * If `fileName` is a Web API `File` object, its `name` property is used.
43
- *
44
- * @param options - The path components used to construct the final path.
45
- * @param options.path_prefix - An optional prefix to prepend to the path.
46
- * @param options.path - An array of path segments.
47
- * @param options.path_postfix - An optional postfix to append before the file name.
48
- * @param options.fileName - The file name or a Web API `File` object.
49
- * @returns A normalized path with components separated by a single slash.
50
- *
51
- * @example
52
- * const filePath = buildPath({
53
- * path_prefix: 'uploads',
54
- * path: ['documents', 'reports'],
55
- * fileName: 'report.pdf',
56
- * });
57
- * // Returns: "uploads/documents/reports/report.pdf"
58
- *
59
- * @example
60
- * const filePath = buildPath({
61
- * path: ['documents//', '/reports/'],
62
- * fileName: 'report.pdf',
63
- * });
64
- * // Returns: "documents/reports/report.pdf"
65
- */
66
- declare function buildPath({ path_prefix, path, path_postfix, fileName, }: PathOptions): string;
67
- /**
68
- * Builds the local file path for a downloaded file.
69
- *
70
- * Removes any occurrence of the configured in-app bucket from the provided
71
- * path to prevent duplicating the bucket name, then constructs the final
72
- * path using the configured in-app bucket as the path prefix.
73
- *
74
- * @param options - The path and file name options used to build the downloaded file path.
75
- * @param options.path - The path segments leading to the file.
76
- * @param options.fileName - The name of the file or a Web API `File` object.
77
- * @returns The complete local path for the downloaded file.
78
- *
79
- * @example
80
- * const filePath = downloadedFilePath({
81
- * path: ['documents', 'reports'],
82
- * fileName: 'report.pdf',
83
- * });
84
- * // Returns a path prefixed with ENV.IN_APP_BUCKET.
85
- *
86
- * @example
87
- * const filePath = downloadedFilePath({
88
- * path: [ENV.IN_APP_BUCKET, 'documents'],
89
- * fileName: file,
90
- * });
91
- * // The duplicate bucket segment is removed before building the path.
92
- */
93
- declare function downloadedFilePath({ path, fileName }: PathOptions): string;
94
- /**
95
- * Determines the MIME content type of a file from its available metadata
96
- * or, when given a file path or URL, from its file extension.
97
- *
98
- * Supports Express Multer files, Web API `File` objects, raw `Buffer` values,
99
- * and file paths or URLs.
100
- *
101
- * @param file - The file, buffer, path, or URL whose content type should be determined.
102
- * @returns A promise resolving to the detected MIME content type.
103
- *
104
- * @example
105
- * const contentType = await getFileContentType(req.file);
106
- * // Returns something like: "image/jpeg"
107
- *
108
- * @example
109
- * const contentType = await getFileContentType('/uploads/document.pdf');
110
- * // Returns: "application/pdf"
111
- *
112
- * @example
113
- * const contentType = await getFileContentType(buffer);
114
- * // Returns: "application/octet-stream"
115
- */
10
+ declare function buildPath(options: PathOptions): string;
11
+ declare function getInAppBucketDownloadPath({ segments, fileName, }?: DownloadablePath): string;
116
12
  declare const getFileContentType: (file: Express.Multer.File | File | Buffer | string) => Promise<string>;
117
- /**
118
- * Determines whether the provided value is a URL or a local/server based file path.
119
- *
120
- * If the value is a valid HTTP/HTTPS URL, the configured URL environment
121
- * value is returned. Otherwise, the configured local path environment value
122
- * is returned.
123
- *
124
- * @param val - The URL or local file path to evaluate.
125
- * @returns The configured URL or local path based on the input type.
126
- *
127
- * @example
128
- * const basePath = url_or_path('https://example.com/file.png');
129
- * // Returns ENV.URL
130
- *
131
- * @example
132
- * const basePath = url_or_path('/uploads/file.png');
133
- * // Returns ENV.PATH
134
- */
135
- declare const url_or_path: (val: string) => string;
136
- /**
137
- * Safely normalizes Buffer, Express.Multer.File, Web File, or File Path into Uint8Array
138
- */
13
+ declare const url_or_path: (val: string) => "url" | "path";
139
14
  declare function toUint8Array(file: Express.Multer.File | File | Buffer | string): Promise<Uint8Array>;
140
15
 
141
- export { buildPath, downloadedFilePath, fileExistsAsync, getFileContentType, getFileExtension, toUint8Array, url_or_path };
16
+ export { buildPath, fileExistsAsync, fileExistsSync, getFileContentType, getFileExtension, getInAppBucketDownloadPath, toUint8Array, url_or_path };
@@ -1,20 +1,22 @@
1
1
  import {
2
2
  buildPath,
3
- downloadedFilePath,
4
3
  fileExistsAsync,
4
+ fileExistsSync,
5
5
  getFileContentType,
6
6
  getFileExtension,
7
+ getInAppBucketDownloadPath,
7
8
  toUint8Array,
8
9
  url_or_path
9
- } from "../../../chunk-W3W3X2OE.js";
10
- import "../../../chunk-EWQYVPOL.js";
10
+ } from "../../../chunk-QW2GGDEG.js";
11
+ import "../../../chunk-LE2SDA4O.js";
11
12
  import "../../../chunk-7QVYU63E.js";
12
13
  export {
13
14
  buildPath,
14
- downloadedFilePath,
15
15
  fileExistsAsync,
16
+ fileExistsSync,
16
17
  getFileContentType,
17
18
  getFileExtension,
19
+ getInAppBucketDownloadPath,
18
20
  toUint8Array,
19
21
  url_or_path
20
22
  };
@@ -3,149 +3,8 @@ import 'mongodb';
3
3
  import 'express';
4
4
  import '../../libs/env.js';
5
5
 
6
- /**
7
- * Detects the SQL database type from a database connection URL.
8
- *
9
- * The function supports MySQL and PostgreSQL connection URL schemes,
10
- * including common driver-specific variants such as `mysql2`,
11
- * `mysql+pymysql`, `postgresql+psycopg2`, and `postgresql+asyncpg`.
12
- *
13
- * If the connection string does not contain a recognized protocol, the
14
- * function attempts to identify the database using keywords in the
15
- * connection string or the default database ports:
16
- *
17
- * - MySQL: `3306`
18
- * - PostgreSQL: `5432`
19
- *
20
- * Invalid URLs are also checked as raw connection strings before an error
21
- * is thrown. This allows common connection strings without a protocol to
22
- * still be detected.
23
- *
24
- * @param url - The SQL database connection URL or connection string.
25
- * @returns `ENV.MY_SQL` for MySQL connections or `ENV.POSTGRES_SQL` for
26
- * PostgreSQL connections.
27
- * @throws {Error} If the URL is invalid or the database type cannot be
28
- * identified as MySQL or PostgreSQL.
29
- *
30
- * @example
31
- * // Detect PostgreSQL from a standard connection URL.
32
- * const database = detectSQLDatabase(
33
- * 'postgresql://user:password@localhost:5432/my_database'
34
- * );
35
- *
36
- * // Returns: ENV.POSTGRES_SQL
37
- *
38
- * @example
39
- * // Detect MySQL from a standard connection URL.
40
- * const database = detectSQLDatabase(
41
- * 'mysql://user:password@localhost:3306/my_database'
42
- * );
43
- *
44
- * // Returns: ENV.MY_SQL
45
- *
46
- * @example
47
- * // Driver-specific PostgreSQL URLs are also supported.
48
- * const database = detectSQLDatabase(
49
- * 'postgresql+psycopg2://user:password@localhost:5432/my_database'
50
- * );
51
- *
52
- * // Returns: ENV.POSTGRES_SQL
53
- *
54
- * @example
55
- * // A connection string without a recognized protocol can be detected
56
- * // using the default PostgreSQL port.
57
- * const database = detectSQLDatabase(
58
- * 'localhost:5432/my_database'
59
- * );
60
- *
61
- * // Returns: ENV.POSTGRES_SQL
62
- *
63
- * @example
64
- * // Throws when the database type cannot be determined.
65
- * const database = detectSQLDatabase(
66
- * 'mongodb://localhost:27017/my_database'
67
- * );
68
- *
69
- * // Error: Unsupported or unrecognized database type.
70
- */
71
6
  declare function detectSQLDatabase(url: string): DatabaseType;
72
- /**
73
- * Determines whether a database connection URL represents a MySQL database.
74
- *
75
- * This function delegates database detection to `detectSQLDatabase()` and
76
- * compares the detected database type with the configured MySQL database
77
- * identifier.
78
- *
79
- * Any error encountered while parsing or detecting the database type is
80
- * handled internally, and the function returns `false` instead of throwing.
81
- * This makes the function safe to use when validating or conditionally
82
- * selecting a database implementation.
83
- *
84
- * @param url - The SQL database connection URL or connection string.
85
- * @returns `true` if the URL represents a MySQL database; otherwise `false`.
86
- *
87
- * @example
88
- * // Standard MySQL connection URL.
89
- * const result = isMySQL(
90
- * 'mysql://user:password@localhost:3306/my_database'
91
- * );
92
- *
93
- * // Returns: true
94
- *
95
- * @example
96
- * // PostgreSQL URL.
97
- * const result = isMySQL(
98
- * 'postgresql://user:password@localhost:5432/my_database'
99
- * );
100
- *
101
- * // Returns: false
102
- *
103
- * @example
104
- * // Invalid or unsupported connection URL.
105
- * const result = isMySQL('invalid-database-url');
106
- *
107
- * // Returns: false instead of throwing an error.
108
- */
109
7
  declare function isMySQL(url: string): boolean;
110
- /**
111
- * Determines whether a database connection URL represents a PostgreSQL
112
- * database.
113
- *
114
- * This function delegates database detection to `detectSQLDatabase()` and
115
- * compares the detected database type with the configured PostgreSQL
116
- * identifier.
117
- *
118
- * Any error encountered while parsing or detecting the database type is
119
- * handled internally, causing the function to return `false` instead of
120
- * throwing. This makes the function safe to use when conditionally selecting
121
- * PostgreSQL-specific database logic.
122
- *
123
- * @param url - The SQL database connection URL or connection string.
124
- * @returns `true` if the URL represents a PostgreSQL database; otherwise
125
- * `false`.
126
- *
127
- * @example
128
- * // Standard PostgreSQL connection URL.
129
- * const result = isPostgreSQL(
130
- * 'postgresql://user:password@localhost:5432/my_database'
131
- * );
132
- *
133
- * // Returns: true
134
- *
135
- * @example
136
- * // MySQL connection URL.
137
- * const result = isPostgreSQL(
138
- * 'mysql://user:password@localhost:3306/my_database'
139
- * );
140
- *
141
- * // Returns: false
142
- *
143
- * @example
144
- * // Invalid or unsupported connection URL.
145
- * const result = isPostgreSQL('invalid-database-url');
146
- *
147
- * // Returns: false instead of throwing an error.
148
- */
149
8
  declare function isPostgreSQL(url: string): boolean;
150
9
 
151
10
  export { detectSQLDatabase, isMySQL, isPostgreSQL };
@@ -2,8 +2,8 @@ import {
2
2
  detectSQLDatabase,
3
3
  isMySQL,
4
4
  isPostgreSQL
5
- } from "../../../chunk-MNSQSU7T.js";
6
- import "../../../chunk-EWQYVPOL.js";
5
+ } from "../../../chunk-O5ILFRFV.js";
6
+ import "../../../chunk-LE2SDA4O.js";
7
7
  import "../../../chunk-7QVYU63E.js";
8
8
  export {
9
9
  detectSQLDatabase,
@@ -4,49 +4,6 @@ import '../../libs/types.js';
4
4
  import 'express';
5
5
  import '../../libs/env.js';
6
6
 
7
- /**
8
- * Generates one or more cryptographically secure unique values.
9
- *
10
- * Values can be generated using hexadecimal characters or a custom
11
- * alphanumeric character set. Optional timestamps and prefixes can be
12
- * included in the generated values.
13
- *
14
- * When `count` is provided, multiple unique values are returned as an array.
15
- * Otherwise, a single string is returned.
16
- *
17
- * @param length - The length of the randomly generated portion of each value.
18
- * @param options - Optional configuration for generating the value(s).
19
- * @param options.useHex - Whether to generate the random portion using hexadecimal characters.
20
- * @param options.includeTimestamp - Whether to prepend a hexadecimal timestamp.
21
- * @param options.prefix - An optional prefix to prepend to the generated value.
22
- * @param options.count - The number of values to generate. If omitted, one value is returned.
23
- * @returns A single unique string when `count` is not provided, or an array of unique strings when `count` is specified.
24
- * @throws {Error} If `length` or `count` is less than or equal to zero.
25
- *
26
- * @example
27
- * const id = generateUniqueValue(16);
28
- * // Returns: "aZ7_kP2mQ9xL3nBc"
29
- *
30
- * @example
31
- * const id = generateUniqueValue(16, {
32
- * useHex: true,
33
- * prefix: 'file',
34
- * });
35
- * // Returns: "file-7f3a9c12d84e..."
36
- *
37
- * @example
38
- * const id = generateUniqueValue(12, {
39
- * includeTimestamp: true,
40
- * });
41
- * // Returns: "198a7f3c12a-7Kx9mP..."
42
- *
43
- * @example
44
- * const ids = generateUniqueValue(10, {
45
- * count: 5,
46
- * prefix: 'file',
47
- * });
48
- * // Returns: ["file-...", "file-...", "file-...", "file-...", "file-..."]
49
- */
50
7
  declare function generateUniqueValue(length: number, options?: GenerateIdOptions): string;
51
8
  declare function generateUniqueValue(length: number, options: GenerateIdOptions & {
52
9
  count: number;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  generateUniqueValue
3
- } from "../../../chunk-X3R3RLXY.js";
3
+ } from "../../../chunk-IZEPCXYK.js";
4
4
  import "../../../chunk-7QVYU63E.js";
5
5
  export {
6
6
  generateUniqueValue