@utilarium/dreadcabinet 0.0.16-dev.0

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 (128) hide show
  1. package/.nvmrc +2 -0
  2. package/LICENSE +190 -0
  3. package/README.md +95 -0
  4. package/dist/configure.d.ts +5 -0
  5. package/dist/configure.js +44 -0
  6. package/dist/configure.js.map +1 -0
  7. package/dist/constants.d.ts +36 -0
  8. package/dist/constants.js +53 -0
  9. package/dist/constants.js.map +1 -0
  10. package/dist/defaults.d.ts +2 -0
  11. package/dist/defaults.js +32 -0
  12. package/dist/defaults.js.map +1 -0
  13. package/dist/dreadcabinet.cjs +1793 -0
  14. package/dist/dreadcabinet.cjs.map +1 -0
  15. package/dist/dreadcabinet.d.ts +131 -0
  16. package/dist/dreadcabinet.js +111 -0
  17. package/dist/dreadcabinet.js.map +1 -0
  18. package/dist/error/ArgumentError.d.ts +5 -0
  19. package/dist/error/ArgumentError.js +26 -0
  20. package/dist/error/ArgumentError.js.map +1 -0
  21. package/dist/input/input.d.ts +7 -0
  22. package/dist/input/input.js +13 -0
  23. package/dist/input/input.js.map +1 -0
  24. package/dist/input/process.d.ts +5 -0
  25. package/dist/input/process.js +36 -0
  26. package/dist/input/process.js.map +1 -0
  27. package/dist/input/structured.d.ts +15 -0
  28. package/dist/input/structured.js +324 -0
  29. package/dist/input/structured.js.map +1 -0
  30. package/dist/input/unstructured.d.ts +2 -0
  31. package/dist/input/unstructured.js +45 -0
  32. package/dist/input/unstructured.js.map +1 -0
  33. package/dist/logger.d.ts +2 -0
  34. package/dist/logger.js +19 -0
  35. package/dist/logger.js.map +1 -0
  36. package/dist/operate.d.ts +2 -0
  37. package/dist/operate.js +27 -0
  38. package/dist/operate.js.map +1 -0
  39. package/dist/output.d.ts +7 -0
  40. package/dist/output.js +99 -0
  41. package/dist/output.js.map +1 -0
  42. package/dist/read.d.ts +4 -0
  43. package/dist/read.js +30 -0
  44. package/dist/read.js.map +1 -0
  45. package/dist/util/dates.d.ts +60 -0
  46. package/dist/util/dates.js +699 -0
  47. package/dist/util/dates.js.map +1 -0
  48. package/dist/util/storage.d.ts +33 -0
  49. package/dist/util/storage.js +140 -0
  50. package/dist/util/storage.js.map +1 -0
  51. package/dist/validate.d.ts +4 -0
  52. package/dist/validate.js +134 -0
  53. package/dist/validate.js.map +1 -0
  54. package/guide/architecture.md +60 -0
  55. package/guide/configuration.md +132 -0
  56. package/guide/development.md +110 -0
  57. package/guide/index.md +62 -0
  58. package/guide/usage.md +166 -0
  59. package/output/kodrdriv/250703-0645-commit-message.md +21 -0
  60. package/output/kodrdriv/250703-0653-commit-message.md +1 -0
  61. package/output/kodrdriv/250703-0654-commit-message.md +1 -0
  62. package/output/kodrdriv/250703-0655-release-notes.md +51 -0
  63. package/output/kodrdriv/250703-0700-commit-message.md +1 -0
  64. package/output/kodrdriv/250703-0700-release-notes.md +8 -0
  65. package/output/kodrdriv/250703-0706-commit-message.md +1 -0
  66. package/output/kodrdriv/250703-0706-release-notes.md +11 -0
  67. package/output/kodrdriv/250703-0717-commit-message.md +1 -0
  68. package/output/kodrdriv/250703-0719-commit-message.md +1 -0
  69. package/output/kodrdriv/250703-0719-release-notes.md +17 -0
  70. package/output/kodrdriv/250703-0730-commit-message.md +1 -0
  71. package/output/kodrdriv/250703-0730-release-notes.md +11 -0
  72. package/output/kodrdriv/250703-1510-commit-message.md +1 -0
  73. package/output/kodrdriv/250710-0805-commit-message.md +3 -0
  74. package/output/kodrdriv/250710-0815-commit-message.md +1 -0
  75. package/output/kodrdriv/250710-0815-release-notes.md +39 -0
  76. package/output/kodrdriv/260107-2021-commit-message.md +37 -0
  77. package/output/kodrdriv/260108-0432-commit-message.md +6 -0
  78. package/output/kodrdriv/260108-0435-commit-message.md +3 -0
  79. package/output/kodrdriv/260108-0436-commit-message.md +4 -0
  80. package/output/kodrdriv/260108-0439-release-notes.md +63 -0
  81. package/output/kodrdriv/260108-0543-commit-message.md +19 -0
  82. package/output/kodrdriv/260108-0550-commit-message.md +3 -0
  83. package/output/kodrdriv/260108-0550-release-notes.md +19 -0
  84. package/output/kodrdriv/260108-0600-commit-message.md +3 -0
  85. package/output/kodrdriv/260110-0717-commit-message.md +4 -0
  86. package/output/kodrdriv/260110-1152-commit-message.md +1 -0
  87. package/output/kodrdriv/260110-1850-commit-message.md +1 -0
  88. package/output/kodrdriv/260110-1852-release-notes.md +33 -0
  89. package/output/kodrdriv/260112-2257-commit-message.md +5 -0
  90. package/output/kodrdriv/260112-2317-commit-message.md +1 -0
  91. package/output/kodrdriv/260112-2318-release-notes.md +42 -0
  92. package/output/kodrdriv/260113-0053-commit-message.md +1 -0
  93. package/output/kodrdriv/260113-0054-commit-message.md +1 -0
  94. package/output/kodrdriv/260113-0054-release-notes.md +49 -0
  95. package/output/kodrdriv/260130-1132-commit-message.md +1 -0
  96. package/output/kodrdriv/260130-1135-commit-message.md +1 -0
  97. package/output/kodrdriv/260130-1335-commit-message.md +10 -0
  98. package/output/kodrdriv/RELEASE_NOTES.md +47 -0
  99. package/output/kodrdriv/RELEASE_TITLE.md +1 -0
  100. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T04-21-54-623Z.md +372 -0
  101. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T12-32-36-513Z.md +55 -0
  102. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T12-35-58-580Z.md +105 -0
  103. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T12-36-05-658Z.md +53 -0
  104. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T13-43-55-498Z.md +178 -0
  105. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T13-50-10-230Z.md +53 -0
  106. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T13-50-35-136Z.md +52 -0
  107. package/output/kodrdriv/agentic-reflection-commit-2026-01-08T14-00-30-772Z.md +52 -0
  108. package/output/kodrdriv/agentic-reflection-commit-2026-01-10T15-17-43-324Z.md +53 -0
  109. package/output/kodrdriv/agentic-reflection-commit-2026-01-10T19-52-47-424Z.md +97 -0
  110. package/output/kodrdriv/agentic-reflection-commit-2026-01-11T02-50-23-123Z.md +138 -0
  111. package/output/kodrdriv/agentic-reflection-commit-2026-01-11T02-50-45-038Z.md +114 -0
  112. package/output/kodrdriv/agentic-reflection-commit-2026-01-11T02-50-49-467Z.md +114 -0
  113. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T06-57-00-384Z.md +169 -0
  114. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T07-17-29-292Z.md +114 -0
  115. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T07-17-47-579Z.md +114 -0
  116. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T08-48-55-599Z.md +144 -0
  117. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T08-53-53-725Z.md +114 -0
  118. package/output/kodrdriv/agentic-reflection-commit-2026-01-13T08-54-11-600Z.md +97 -0
  119. package/output/kodrdriv/agentic-reflection-commit-2026-01-30T19-32-17-053Z.md +174 -0
  120. package/output/kodrdriv/agentic-reflection-commit-2026-01-30T19-35-00-887Z.md +152 -0
  121. package/output/kodrdriv/agentic-reflection-commit-2026-01-30T21-02-16-553Z.md +236 -0
  122. package/output/kodrdriv/agentic-reflection-commit-2026-01-30T21-17-22-227Z.md +347 -0
  123. package/output/kodrdriv/agentic-reflection-release-2026-01-08T12-39-08-279Z.md +507 -0
  124. package/output/kodrdriv/agentic-reflection-release-2026-01-08T13-50-57-683Z.md +183 -0
  125. package/output/kodrdriv/agentic-reflection-release-2026-01-11T02-52-39-082Z.md +347 -0
  126. package/output/kodrdriv/agentic-reflection-release-2026-01-13T07-18-21-218Z.md +315 -0
  127. package/output/kodrdriv/agentic-reflection-release-2026-01-13T08-54-59-340Z.md +354 -0
  128. package/package.json +80 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstructured.js","sources":["../../src/input/unstructured.ts"],"sourcesContent":["import { Logger } from 'dreadcabinet';\nimport * as Storage from \"../util/storage\";\n\n// Process files with unstructured input pattern\nexport const process = async (\n inputDirectory: string,\n recursive: boolean,\n extensions: string[],\n limit: number | undefined,\n logger: Logger,\n callback: (file: string) => Promise<void>,\n concurrency?: number\n): Promise<number> => {\n const storage = Storage.create({ log: logger.debug });\n\n let fileCount = 0;\n let filePattern = `${recursive ? '**/' : ''}*`;\n\n if (extensions && extensions.length > 0) {\n // Ensure the pattern correctly handles extensions with or without recursion\n if (recursive) {\n filePattern = `**/*.{${extensions.join(',')}}`;\n } else {\n filePattern = `*.{${extensions.join(',')}}`;\n }\n logger.debug(`Applying extension filter: ${extensions.join(',')}`);\n } else if (!recursive) {\n // Non-recursive without extension filter: only files in the top directory\n filePattern = `*.*`; // Adjust if files without extensions need matching\n }\n\n logger.info('Processing unstructured files %s in %s with pattern %s',\n recursive ? 'recursively' : 'non-recursively', inputDirectory, filePattern);\n\n await storage.forEachFileIn(inputDirectory, async (file: string) => {\n try {\n logger.debug('Processing file %s', file);\n // Call callback without date for unstructured input\n await callback(file); // Pass undefined for the date parameter\n fileCount++;\n } catch (error) {\n if (error instanceof Error) {\n logger.error('Error processing file %s: %s\\n%s', file, error.message, error.stack);\n } else {\n logger.error('Error processing file %s: %s', file, error);\n }\n }\n }, { pattern: filePattern, limit, concurrency } as { pattern: string, limit?: number, concurrency?: number });\n\n return fileCount;\n};\n\n"],"names":["process","inputDirectory","recursive","extensions","limit","logger","callback","concurrency","storage","Storage","log","debug","fileCount","filePattern","length","join","info","forEachFileIn","file","error","Error","message","stack","pattern"],"mappings":";;AAGA;AACO,MAAMA,UAAU,OACnBC,cAAAA,EACAC,WACAC,UAAAA,EACAC,KAAAA,EACAC,QACAC,QAAAA,EACAC,WAAAA,GAAAA;IAEA,MAAMC,OAAAA,GAAUC,MAAc,CAAC;AAAEC,QAAAA,GAAAA,EAAKL,OAAOM;AAAM,KAAA,CAAA;AAEnD,IAAA,IAAIC,SAAAA,GAAY,CAAA;AAChB,IAAA,IAAIC,cAAc,CAAA,EAAGX,SA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A;AACJ,QAAA;IACJ,CAAA,EAAG;QAAEI,OAAAA,EAASV,WAAAA;AAAaT,QAAAA,KAAAA;AAAOG,QAAAA;AAAY,KAAA,CAAA;IAE9C,OAAOK,SAAAA;AACX;;;;"}
@@ -0,0 +1,2 @@
1
+ import { Logger } from './dreadcabinet';
2
+ export declare const wrapLogger: (toWrap: Logger) => Logger;
package/dist/logger.js ADDED
@@ -0,0 +1,19 @@
1
+ import { PROGRAM_NAME } from './constants.js';
2
+
3
+ const wrapLogger = (toWrap)=>{
4
+ const log = (level, message, ...args)=>{
5
+ message = `[${PROGRAM_NAME}] ${message}`;
6
+ toWrap[level](message, ...args);
7
+ };
8
+ return {
9
+ debug: (message, ...args)=>log('debug', message, ...args),
10
+ info: (message, ...args)=>log('info', message, ...args),
11
+ warn: (message, ...args)=>log('warn', message, ...args),
12
+ error: (message, ...args)=>log('error', message, ...args),
13
+ verbose: (message, ...args)=>log('verbose', message, ...args),
14
+ silly: (message, ...args)=>log('silly', message, ...args)
15
+ };
16
+ };
17
+
18
+ export { wrapLogger };
19
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sources":["../src/logger.ts"],"sourcesContent":["import { Logger } from \"dreadcabinet\";\nimport { PROGRAM_NAME } from \"./constants\";\n\nexport const wrapLogger = (toWrap: Logger): Logger => {\n\n const log = (level: keyof Logger, message: string, ...args: any[]) => {\n\n message = `[${PROGRAM_NAME}] ${message}`;\n toWrap[level](message, ...args);\n }\n\n return {\n debug: (message: string, ...args: any[]) => log('debug', message, ...args),\n info: (message: string, ...args: any[]) => log('info', message, ...args),\n warn: (message: string, ...args: any[]) => log('warn', message, ...args),\n error: (message: string, ...args: any[]) => log('error', message, ...args),\n verbose: (message: string, ...args: any[]) => log('verbose', message, ...args),\n silly: (message: string, ...args: any[]) => log('silly', message, ...args),\n }\n}"],"names":["wrapLogger","toWrap","log","level","message","args","PROGRAM_NAME","debug","info","warn","error","verbose","silly"],"mappings":";;AAGO,MAAMA,aAAa,CAACC,MAAAA,GAAAA;AAEvB,IAAA,MAAMC,GAAAA,GAAM,CAACC,KAAAA,EAAqBC,OAAAA,EAAiB,GAAGC,IAAAA,GAAAA;AAElDD,QAAAA,OAAAA,GAAU,CAAC,CAAC,EAAEE,YAAAA,CAAa,EAAE,EAAEF,OAAAA,CAAAA,CAAS;QACxCH,MAAM,CAACE,KAAAA,CAAM,CAACC,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AAC9B,IAAA,CAAA;IAEA,OAAO;AACHE,QAAAA,KAAAA,EAAO,CAACH,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,SAASE,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AACrEG,QAAAA,IAAAA,EAAM,CAACJ,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,QAAQE,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AACnEI,QAAAA,IAAAA,EAAM,CAACL,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,QAAQE,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AACnEK,QAAAA,KAAAA,EAAO,CAACN,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,SAASE,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AACrEM,QAAAA,OAAAA,EAAS,CAACP,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,WAAWE,OAAAA,EAAAA,GAAYC,IAAAA,CAAAA;AACzEO,QAAAA,KAAAA,EAAO,CAACR,OAAAA,EAAiB,GAAGC,IAAAA,GAAgBH,GAAAA,CAAI,SAASE,OAAAA,EAAAA,GAAYC,IAAAA;AACzE,KAAA;AACJ;;;;"}
@@ -0,0 +1,2 @@
1
+ import { Args, Operator, Options, Config } from './dreadcabinet';
2
+ export declare const create: (config: Config, args: Args, options: Options) => Promise<Operator>;
@@ -0,0 +1,27 @@
1
+ import { create as create$2 } from './input/input.js';
2
+ import { create as create$1 } from './output.js';
3
+
4
+ const create = async (config, args, options)=>{
5
+ const output = create$1(config, options);
6
+ const input = create$2(config, options);
7
+ const constructFilename = async (createDate, type, hash, context)=>{
8
+ if (!options.features.includes('output')) {
9
+ throw new Error('Output feature is not enabled, skipping output construction');
10
+ }
11
+ return output.constructFilename(createDate, type, hash, context);
12
+ };
13
+ const constructOutputDirectory = async (createDate)=>{
14
+ if (!options.features.includes('output')) {
15
+ throw new Error('Output feature is not enabled, skipping output construction');
16
+ }
17
+ return output.constructOutputDirectory(createDate);
18
+ };
19
+ return {
20
+ process: input.process,
21
+ constructFilename,
22
+ constructOutputDirectory
23
+ };
24
+ };
25
+
26
+ export { create };
27
+ //# sourceMappingURL=operate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operate.js","sources":["../src/operate.ts"],"sourcesContent":["import { Args, Operator, Options } from 'dreadcabinet';\nimport { Config } from './dreadcabinet';\nimport * as Input from './input/input';\nimport * as Output from './output';\n\nexport const create = async (config: Config, args: Args, options: Options): Promise<Operator> => {\n\n const output = Output.create(config, options);\n const input = Input.create(config, options);\n\n const constructFilename = async (createDate: Date, type: string, hash: string, context?: { subject?: string }): Promise<string> => {\n if (!options.features.includes('output')) {\n throw new Error('Output feature is not enabled, skipping output construction');\n }\n return output.constructFilename(createDate, type, hash, context);\n }\n\n const constructOutputDirectory = async (createDate: Date): Promise<string> => {\n if (!options.features.includes('output')) {\n throw new Error('Output feature is not enabled, skipping output construction');\n }\n return output.constructOutputDirectory(createDate);\n }\n\n return {\n process: input.process,\n constructFilename,\n constructOutputDirectory,\n }\n\n}\n\n\n\n\n\n\n"],"names":["create","config","args","options","output","Output","input","Input","constructFilename","createDate","type","hash","context","features","includes","Error","constructOutputDirectory","process"],"mappings":";;;AAKO,MAAMA,MAAAA,GAAS,OAAOC,MAAAA,EAAgBC,IAAAA,EAAYC,OAAAA,GAAAA;AAErD,IAAA,MAAMC,MAAAA,GAASC,QAAa,CAACJ,MAAAA,EAAQE,OAAAA,CAAAA;AACrC,IAAA,MAAMG,KAAAA,GAAQC,QAAY,CAACN,MAAAA,EAAQE,OAAAA,CAAAA;AAEnC,IAAA,MAAMK,iBAAAA,GAAoB,OAAOC,UAAAA,EAAkBC,IAAAA,EAAcC,IAAAA,EAAcC,OAAAA,GAAAA;AAC3E,QAAA,IAAI,CAACT,OAAAA,CAAQU,QAAQ,CAACC,QAAQ,CAAC,QAAA,CAAA,EAAW;AACtC,YAAA,MAAM,IAAIC,KAAAA,CAAM,6DAAA,CAAA;AACpB,QAAA;AACA,QAAA,OAAOX,MAAAA,CAAOI,iBAAiB,CAACC,UAAAA,EAAYC,MAAMC,IAAAA,EAAMC,OAAAA,CAAAA;AAC5D,IAAA,CAAA;AAEA,IAAA,MAAMI,2BAA2B,OAAOP,UAAAA,GAAAA;AACpC,QAAA,IAAI,CAACN,OAAAA,CAAQU,QAAQ,CAACC,QAAQ,CAAC,QAAA,CAAA,EAAW;AACtC,YAAA,MAAM,IAAIC,KAAAA,CAAM,6DAAA,CAAA;AACpB,QAAA;QACA,OAAOX,MAAAA,CAAOY,wBAAwB,CAACP,UAAAA,CAAAA;AAC3C,IAAA,CAAA;IAEA,OAAO;AACHQ,QAAAA,OAAAA,EAASX,MAAMW,OAAO;AACtBT,QAAAA,iBAAAA;AACAQ,QAAAA;AACJ,KAAA;AAEJ;;;;"}
@@ -0,0 +1,7 @@
1
+ import { Config, Options } from './dreadcabinet';
2
+ export declare const create: (config: Config, options: Options) => {
3
+ constructFilename: (date: Date, type: string, hash: string, options?: {
4
+ subject?: string;
5
+ }) => string;
6
+ constructOutputDirectory: (creationTime: Date) => string;
7
+ };
package/dist/output.js ADDED
@@ -0,0 +1,99 @@
1
+ import * as path from 'node:path';
2
+ import { DATE_FORMAT_YEAR, DATE_FORMAT_MONTH, DATE_FORMAT_DAY, DATE_FORMAT_MONTH_DAY, DATE_FORMAT_YEAR_MONTH_DAY } from './constants.js';
3
+ import { create as create$2 } from './util/dates.js';
4
+ import { create as create$1 } from './util/storage.js';
5
+
6
+ const create = (config, options)=>{
7
+ const logger = options.logger;
8
+ const timezone = (config === null || config === void 0 ? void 0 : config.timezone) || 'UTC';
9
+ const dates = create$2({
10
+ timezone
11
+ });
12
+ const storage = create$1({
13
+ log: logger.debug
14
+ });
15
+ const { outputDirectory, outputStructure, outputFilenameOptions } = config;
16
+ function formatDate(date, outputStructure) {
17
+ if (!outputStructure) {
18
+ throw new Error('Unable to Create Output: Output structure is not set');
19
+ }
20
+ switch(outputStructure){
21
+ case 'none':
22
+ return dates.format(date, DATE_FORMAT_YEAR_MONTH_DAY);
23
+ case 'year':
24
+ return dates.format(date, DATE_FORMAT_MONTH_DAY);
25
+ case 'month':
26
+ return dates.format(date, DATE_FORMAT_DAY);
27
+ case 'day':
28
+ throw new Error('Cannot use date in filename when output structure is "day"');
29
+ }
30
+ }
31
+ function sanitizeFilenameString(str) {
32
+ // Replace any character that is not alphanumeric, hyphen, underscore, or dot with an underscore
33
+ return str.replace(/[^a-zA-Z0-9\-_.]/g, '_')// Replace multiple consecutive underscores with a single underscore
34
+ .replace(/_+/g, '_')// Remove leading and trailing underscores
35
+ .replace(/^_+|_+$/g, '')// Ensure the string is not empty
36
+ .replace(/^$/, 'untitled');
37
+ }
38
+ function constructFilename(date, type, hash, options = {}) {
39
+ const parts = [];
40
+ // Add date if requested
41
+ if (outputFilenameOptions === null || outputFilenameOptions === void 0 ? void 0 : outputFilenameOptions.includes('date')) {
42
+ const dateStr = formatDate(date, outputStructure);
43
+ parts.push(dateStr);
44
+ }
45
+ // Add time if requested
46
+ if (outputFilenameOptions === null || outputFilenameOptions === void 0 ? void 0 : outputFilenameOptions.includes('time')) {
47
+ const dates = create$2({
48
+ timezone
49
+ });
50
+ const timeStr = dates.format(date, 'HHmm');
51
+ parts.push(timeStr);
52
+ }
53
+ // Add message ID
54
+ parts.push(hash);
55
+ parts.push(type);
56
+ // Add subject if requested
57
+ if (outputFilenameOptions === null || outputFilenameOptions === void 0 ? void 0 : outputFilenameOptions.includes('subject')) {
58
+ // Sanitize the provided subject, defaulting to empty string if undefined/null
59
+ parts.push(sanitizeFilenameString(options.subject || ''));
60
+ }
61
+ return parts.join('-');
62
+ }
63
+ function constructOutputDirectory(creationTime) {
64
+ // Throw this error to ensure that we don't success if outputDirectory or outputStructure are not set
65
+ if (!outputDirectory) {
66
+ throw new Error('Unable to Create Output: Output directory is not set');
67
+ }
68
+ if (!outputStructure) {
69
+ throw new Error('Unable to Create Output: Output structure is not set');
70
+ }
71
+ const date = dates.date(creationTime);
72
+ const year = dates.format(date, DATE_FORMAT_YEAR);
73
+ const month = dates.format(date, DATE_FORMAT_MONTH);
74
+ const day = dates.format(date, DATE_FORMAT_DAY);
75
+ let outputPath;
76
+ switch(outputStructure){
77
+ case 'year':
78
+ outputPath = path.join(outputDirectory, year);
79
+ break;
80
+ case 'month':
81
+ outputPath = path.join(outputDirectory, year, month);
82
+ break;
83
+ case 'day':
84
+ outputPath = path.join(outputDirectory, year, month, day);
85
+ break;
86
+ default:
87
+ outputPath = outputDirectory;
88
+ }
89
+ storage.createDirectory(outputPath);
90
+ return outputPath;
91
+ }
92
+ return {
93
+ constructFilename,
94
+ constructOutputDirectory
95
+ };
96
+ };
97
+
98
+ export { create };
99
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sources":["../src/output.ts"],"sourcesContent":["import * as path from 'node:path';\nimport { DATE_FORMAT_DAY, DATE_FORMAT_MONTH, DATE_FORMAT_MONTH_DAY, DATE_FORMAT_YEAR, DATE_FORMAT_YEAR_MONTH_DAY } from './constants';\nimport { Config } from './dreadcabinet';\nimport * as Dates from './util/dates';\nimport * as Storage from './util/storage';\nimport { Options } from 'dreadcabinet';\n\nexport const create = (config: Config, options: Options): {\n constructFilename: (date: Date, type: string, hash: string, options?: { subject?: string }) => string;\n constructOutputDirectory: (creationTime: Date) => string;\n} => {\n const logger = options.logger;\n const timezone = config?.timezone || 'UTC';\n const dates = Dates.create({ timezone });\n const storage: Storage.Utility = Storage.create({ log: logger.debug });\n\n const { outputDirectory, outputStructure, outputFilenameOptions } = config;\n\n function formatDate(date: Date, outputStructure: 'none' | 'year' | 'month' | 'day'): string {\n\n if (!outputStructure) {\n throw new Error('Unable to Create Output: Output structure is not set');\n }\n\n switch (outputStructure) {\n case 'none':\n return dates.format(date, DATE_FORMAT_YEAR_MONTH_DAY);\n case 'year':\n return dates.format(date, DATE_FORMAT_MONTH_DAY);\n case 'month':\n return dates.format(date, DATE_FORMAT_DAY);\n case 'day':\n throw new Error('Cannot use date in filename when output structure is \"day\"');\n }\n }\n\n function sanitizeFilenameString(str: string): string {\n // Replace any character that is not alphanumeric, hyphen, underscore, or dot with an underscore\n return str.replace(/[^a-zA-Z0-9\\-_.]/g, '_')\n // Replace multiple consecutive underscores with a single underscore\n .replace(/_+/g, '_')\n // Remove leading and trailing underscores\n .replace(/^_+|_+$/g, '')\n // Ensure the string is not empty\n .replace(/^$/, 'untitled');\n }\n\n function constructFilename(\n date: Date,\n type: string,\n hash: string,\n options: {\n subject?: string;\n } = {}\n ): string {\n const parts: string[] = [];\n\n // Add date if requested\n if (outputFilenameOptions?.includes('date')) {\n const dateStr = formatDate(date, outputStructure!);\n parts.push(dateStr);\n }\n\n // Add time if requested\n if (outputFilenameOptions?.includes('time')) {\n const dates = Dates.create({ timezone });\n const timeStr = dates.format(date, 'HHmm');\n parts.push(timeStr);\n }\n\n // Add message ID\n parts.push(hash);\n parts.push(type);\n\n // Add subject if requested\n if (outputFilenameOptions?.includes('subject')) {\n // Sanitize the provided subject, defaulting to empty string if undefined/null\n parts.push(sanitizeFilenameString(options.subject || ''));\n }\n\n return parts.join('-');\n }\n\n function constructOutputDirectory(creationTime: Date) {\n\n // Throw this error to ensure that we don't success if outputDirectory or outputStructure are not set\n if (!outputDirectory) {\n throw new Error('Unable to Create Output: Output directory is not set');\n }\n\n\n if (!outputStructure) {\n throw new Error('Unable to Create Output: Output structure is not set');\n }\n\n\n const date = dates.date(creationTime);\n const year = dates.format(date, DATE_FORMAT_YEAR);\n const month = dates.format(date, DATE_FORMAT_MONTH);\n const day = dates.format(date, DATE_FORMAT_DAY);\n\n let outputPath: string;\n switch (outputStructure) {\n case 'year':\n outputPath = path.join(outputDirectory!, year);\n break;\n case 'month':\n outputPath = path.join(outputDirectory!, year, month);\n break;\n case 'day':\n outputPath = path.join(outputDirectory!, year, month, day);\n break;\n default:\n outputPath = outputDirectory!;\n }\n\n storage.createDirectory(outputPath);\n return outputPath;\n }\n\n return {\n constructFilename,\n constructOutputDirectory,\n }\n}\n"],"names":["create","config","options","logger","timezone","dates","Dates","storage","Storage","log","debug","outputDirectory","outputStructure","outputFilenameOptions","formatDate","date","Error","format","DATE_FORMAT_YEAR_MONTH_DAY","DATE_FORMAT_MONTH_DAY","DATE_FORMAT_DAY","sanitizeFilenameString","str","replace","constructFilename","type","hash","parts","includes","dateStr","push","timeStr","subject","join","constructOutputDirectory","creationTime","year","DATE_FORMAT_YEAR","month","DATE_FORMAT_MONTH","day","outputPath","path","createDirectory"],"mappings":";;;;;AAOO,MAAMA,MAAAA,GAAS,CAACC,MAAAA,EAAgBC,OAAAA,GAAAA;IAInC,MAAMC,MAAAA,GAASD,QAAQC,MAAM;AAC7B,IAAA,MAAMC,WAAWH,CAAAA,MAAAA,KAAAA,IAAAA,IAAAA,MAAAA,KAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,CAAQG,QAAQ,KAAI,KAAA;IACrC,MAAMC,KAAAA,GAAQC,QAAY,CAAC;AAAEF,QAAAA;AAAS,KAAA,CAAA;IACtC,MAAMG,OAAAA,GAA2BC,QAAc,CAAC;AAAEC,QAAAA,GAAAA,EAAKN,OAAOO;AAAM,KAAA,CAAA;AAEpE,IAAA,MAAM,EAAEC,eAAe,EAAEC,eAAe,EAAEC,qBAAqB,EAAE,GAAGZ,MAAAA;IAEpE,SAASa,UAAAA,CAAWC,IAAU,EAAEH,e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,QAAA,MAAMC,GAAAA,GAAMnC,KAAAA,CAAMY,MAAM,CAACF,IAAAA,EAAMK,eAAAA,CAAAA;QAE/B,IAAIqB,UAAAA;QACJ,OAAQ7B,eAAAA;YACJ,KAAK,MAAA;gBACD6B,UAAAA,GAAaC,IAAAA,CAAKT,IAAI,CAACtB,eAAAA,EAAkByB,IAAAA,CAAAA;AACzC,gBAAA;YACJ,KAAK,OAAA;AACDK,gBAAAA,UAAAA,GAAaC,IAAAA,CAAKT,IAAI,CAACtB,eAAAA,EAAkByB,IAAAA,EAAME,KAAAA,CAAAA;AAC/C,gBAAA;YACJ,KAAK,KAAA;AACDG,gBAAAA,UAAAA,GAAaC,IAAAA,CAAKT,IAAI,CAACtB,eAAAA,EAAkByB,MAAME,KAAAA,EAAOE,GAAAA,CAAAA;AACtD,gBAAA;AACJ,YAAA;gBACIC,UAAAA,GAAa9B,eAAAA;AACrB;AAEAJ,QAAAA,OAAAA,CAAQoC,eAAe,CAACF,UAAAA,CAAAA;QACxB,OAAOA,UAAAA;AACX,IAAA;IAEA,OAAO;AACHjB,QAAAA,iBAAAA;AACAU,QAAAA;AACJ,KAAA;AACJ;;;;"}
package/dist/read.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { Config, Feature, Args } from './dreadcabinet';
2
+ import { ArgumentError } from './error/ArgumentError';
3
+ export { ArgumentError };
4
+ export declare const read: (args: Args, features: Feature[]) => Promise<Partial<Config>>;
package/dist/read.js ADDED
@@ -0,0 +1,30 @@
1
+ function clean(obj) {
2
+ return Object.fromEntries(Object.entries(obj).filter(([_, v])=>v !== undefined));
3
+ }
4
+ const read = async (args, features)=>{
5
+ const config = {};
6
+ config.timezone = args.timezone;
7
+ if (features.includes('input')) {
8
+ config.inputDirectory = args.inputDirectory;
9
+ config.limit = args.limit;
10
+ }
11
+ if (features.includes('structured-input')) {
12
+ config.inputStructure = args.inputStructure;
13
+ config.inputFilenameOptions = args.inputFilenameOptions;
14
+ }
15
+ if (features.includes('output')) {
16
+ config.outputDirectory = args.outputDirectory;
17
+ }
18
+ if (features.includes('structured-output')) {
19
+ config.outputStructure = args.outputStructure;
20
+ config.outputFilenameOptions = args.outputFilenameOptions;
21
+ }
22
+ if (features.includes('extensions')) {
23
+ config.extensions = args.extensions;
24
+ }
25
+ // Returning a clean object to avoid undefined values
26
+ return clean(config);
27
+ };
28
+
29
+ export { read };
30
+ //# sourceMappingURL=read.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read.js","sources":["../src/read.ts"],"sourcesContent":["import { Config, Feature, Args } from \"dreadcabinet\";\nimport { ArgumentError } from \"./error/ArgumentError\";\n\nexport { ArgumentError };\n\nfunction clean(obj: any) {\n return Object.fromEntries(\n Object.entries(obj).filter(([_, v]) => v !== undefined)\n );\n}\n\nexport const read = async (args: Args, features: Feature[]): Promise<Partial<Config>> => {\n\n const config: Partial<Config> = {};\n\n config.timezone = args.timezone;\n if (features.includes('input')) {\n config.inputDirectory = args.inputDirectory;\n config.limit = args.limit;\n }\n if (features.includes('structured-input')) {\n config.inputStructure = args.inputStructure;\n config.inputFilenameOptions = args.inputFilenameOptions;\n }\n if (features.includes('output')) {\n config.outputDirectory = args.outputDirectory;\n }\n if (features.includes('structured-output')) {\n config.outputStructure = args.outputStructure;\n config.outputFilenameOptions = args.outputFilenameOptions;\n }\n if (features.includes('extensions')) {\n config.extensions = args.extensions;\n }\n\n // Returning a clean object to avoid undefined values\n return clean(config);\n}"],"names":["clean","obj","Object","fromEntries","entries","filter","_","v","undefined","read","args","features","config","timezone","includes","inputDirectory","limit","inputStructure","inputFilenameOptions","outputDirectory","outputStructure","outputFilenameOptions","extensions"],"mappings":"AAKA,SAASA,MAAMC,GAAQ,EAAA;AACnB,IAAA,OAAOC,MAAAA,CAAOC,WAAW,CACrBD,MAAAA,CAAOE,OAAO,CAACH,GAAAA,CAAAA,CAAKI,MAAM,CAAC,CAAC,CAACC,CAAAA,EAAGC,CAAAA,CAAE,GAAKA,CAAAA,KAAMC,SAAAA,CAAAA,CAAAA;AAErD;AAEO,MAAMC,IAAAA,GAAO,OAAOC,IAAAA,EAAYC,QAAAA,GAAAA;AAEnC,IAAA,MAAMC,SAA0B,EAAC;IAEjCA,MAAAA,CAAOC,QAAQ,GAAGH,IAAAA,CAAKG,QAAQ;IAC/B,IAAIF,QAAAA,CAASG,QAAQ,CAAC,OAAA,CAAA,EAAU;QAC5BF,MAAAA,CAAOG,cAAc,GAAGL,IAAAA,CAAKK,cAAc;QAC3CH,MAAAA,CAAOI,KAAK,GAAGN,IAAAA,CAAKM,KAAK;AAC7B,IAAA;IACA,IAAIL,QAAAA,CAASG,QAAQ,CAAC,kBAAA,CAAA,EAAqB;QACvCF,MAAAA,CAAOK,cAAc,GAAGP,IAAAA,CAAKO,cAAc;QAC3CL,MAAAA,CAAOM,oBAAoB,GAAGR,IAAAA,CAAKQ,oBAAoB;AAC3D,IAAA;IACA,IAAIP,QAAAA,CAASG,QAAQ,CAAC,QAAA,CAAA,EAAW;QAC7BF,MAAAA,CAAOO,eAAe,GAAGT,IAAAA,CAAKS,eAAe;AACjD,IAAA;IACA,IAAIR,QAAAA,CAASG,QAAQ,CAAC,mBAAA,CAAA,EAAsB;QACxCF,MAAAA,CAAOQ,eAAe,GAAGV,IAAAA,CAAKU,eAAe;QAC7CR,MAAAA,CAAOS,qBAAqB,GAAGX,IAAAA,CAAKW,qBAAqB;AAC7D,IAAA;IACA,IAAIV,QAAAA,CAASG,QAAQ,CAAC,YAAA,CAAA,EAAe;QACjCF,MAAAA,CAAOU,UAAU,GAAGZ,IAAAA,CAAKY,UAAU;AACvC,IAAA;;AAGA,IAAA,OAAOtB,KAAAA,CAAMY,MAAAA,CAAAA;AACjB;;;;"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Yes, wrapping dayjs is a bit annoying and might seem overly paranoid. However, I feel strongly
3
+ * about not letting Dayjs instances leak into the rest of the codebase. Having Dayjs objects
4
+ * floating around the application leads to inconsistent timezone handling, makes testing more
5
+ * difficult, and creates subtle bugs that are hard to track down.
6
+ *
7
+ * By wrapping dayjs completely and only exposing plain JavaScript Date objects, we get several
8
+ * key benefits:
9
+ * 1. Consistent timezone handling through a single configuration point
10
+ * 2. Simpler testing since we only need to mock this one library
11
+ * 3. Type safety - the rest of the codebase only deals with standard Date objects
12
+ * 4. No risk of dayjs method chains creating unexpected timezone shifts
13
+ *
14
+ * The Library interface gives us full control over all date operations while keeping the messy
15
+ * details of timezone manipulation contained in one place. Yes it's more code, but the peace of
16
+ * mind is worth it.
17
+ */
18
+ export interface Utility {
19
+ now: () => Date;
20
+ today: () => string;
21
+ date: (date: string | number | Date | null | undefined) => Date;
22
+ parse: (date: string | number | Date | null | undefined, format: string) => Date;
23
+ isValidDate: (date: string, format: string) => boolean;
24
+ addDays: (date: Date, days: number) => Date;
25
+ addMonths: (date: Date, months: number) => Date;
26
+ addYears: (date: Date, years: number) => Date;
27
+ format: (date: Date, format: string) => string;
28
+ subDays: (date: Date, days: number) => Date;
29
+ subMonths: (date: Date, months: number) => Date;
30
+ subYears: (date: Date, years: number) => Date;
31
+ startOfMonth: (date: Date) => Date;
32
+ endOfMonth: (date: Date) => Date;
33
+ startOfYear: (date: Date) => Date;
34
+ endOfYear: (date: Date) => Date;
35
+ isBefore: (date: Date, other: Date) => boolean;
36
+ isAfter: (date: Date, other: Date) => boolean;
37
+ }
38
+ export declare const create: (parameters: {
39
+ timezone: string;
40
+ }) => {
41
+ now: () => Date;
42
+ today: () => string;
43
+ date: (date: string | number | Date | null | undefined) => Date;
44
+ parse: (date: string | number | Date | null | undefined, format: string) => Date;
45
+ isValidDate: (date: string, format: string) => boolean;
46
+ addDays: (date: Date, days: number) => Date;
47
+ addMonths: (date: Date, months: number) => Date;
48
+ addYears: (date: Date, years: number) => Date;
49
+ format: (date: Date, format: string) => string;
50
+ subDays: (date: Date, days: number) => Date;
51
+ subMonths: (date: Date, months: number) => Date;
52
+ subYears: (date: Date, years: number) => Date;
53
+ startOfMonth: (date: Date) => Date;
54
+ endOfMonth: (date: Date) => Date;
55
+ startOfYear: (date: Date) => Date;
56
+ endOfYear: (date: Date) => Date;
57
+ isBefore: (date: Date, other: Date) => boolean;
58
+ isAfter: (date: Date, other: Date) => boolean;
59
+ };
60
+ export declare const validTimezones: () => string[];