@adviser/cement 0.1.11 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (167) hide show
  1. package/base_sys_abstraction-BCdXJHNa.d.ts +21 -0
  2. package/base_sys_abstraction-BYZvxqsW.d.cts +21 -0
  3. package/chunk-J2IM7FHM.js +65 -0
  4. package/chunk-J2IM7FHM.js.map +1 -0
  5. package/chunk-MWAFFTM4.js +82 -0
  6. package/chunk-MWAFFTM4.js.map +1 -0
  7. package/chunk-PZTL4UNG.js +233 -0
  8. package/chunk-PZTL4UNG.js.map +1 -0
  9. package/index.cjs +986 -0
  10. package/index.cjs.map +1 -0
  11. package/index.d.cts +196 -0
  12. package/index.d.ts +196 -11
  13. package/index.js +610 -26
  14. package/index.js.map +1 -1
  15. package/node/index.cjs +436 -0
  16. package/node/index.cjs.map +1 -0
  17. package/node/index.d.cts +47 -0
  18. package/node/index.d.ts +47 -4
  19. package/node/index.js +215 -17
  20. package/node/index.js.map +1 -1
  21. package/package.json +34 -8
  22. package/sys_abstraction-CjljYIkv.d.cts +65 -0
  23. package/sys_abstraction-CjljYIkv.d.ts +65 -0
  24. package/utils/index.cjs +270 -0
  25. package/utils/index.cjs.map +1 -0
  26. package/utils/index.d.cts +33 -0
  27. package/utils/index.d.ts +33 -6
  28. package/utils/index.js +232 -20
  29. package/utils/index.js.map +1 -1
  30. package/web/index.cjs +286 -0
  31. package/web/index.cjs.map +1 -0
  32. package/web/index.d.cts +6 -0
  33. package/web/index.d.ts +6 -2
  34. package/web/index.js +7 -16
  35. package/web/index.js.map +1 -1
  36. package/base_sys_abstraction.d.ts +0 -79
  37. package/base_sys_abstraction.d.ts.map +0 -1
  38. package/base_sys_abstraction.js +0 -186
  39. package/base_sys_abstraction.js.map +0 -1
  40. package/base_sys_abstraction.test.d.ts +0 -2
  41. package/base_sys_abstraction.test.d.ts.map +0 -1
  42. package/base_sys_abstraction.test.js +0 -77
  43. package/base_sys_abstraction.test.js.map +0 -1
  44. package/file_service.d.ts +0 -18
  45. package/file_service.d.ts.map +0 -1
  46. package/file_service.js +0 -3
  47. package/file_service.js.map +0 -1
  48. package/future.d.ts +0 -8
  49. package/future.d.ts.map +0 -1
  50. package/future.js +0 -42
  51. package/future.js.map +0 -1
  52. package/future.test.d.ts +0 -2
  53. package/future.test.d.ts.map +0 -1
  54. package/future.test.js +0 -30
  55. package/future.test.js.map +0 -1
  56. package/index.d.ts.map +0 -1
  57. package/logger.d.ts +0 -36
  58. package/logger.d.ts.map +0 -1
  59. package/logger.js +0 -11
  60. package/logger.js.map +0 -1
  61. package/logger.test.d.ts +0 -2
  62. package/logger.test.d.ts.map +0 -1
  63. package/logger.test.js +0 -372
  64. package/logger.test.js.map +0 -1
  65. package/logger_impl.d.ts +0 -64
  66. package/logger_impl.d.ts.map +0 -1
  67. package/logger_impl.js +0 -331
  68. package/logger_impl.js.map +0 -1
  69. package/node/index.d.ts.map +0 -1
  70. package/node/mock_file_service.d.ts +0 -11
  71. package/node/mock_file_service.d.ts.map +0 -1
  72. package/node/mock_file_service.js +0 -38
  73. package/node/mock_file_service.js.map +0 -1
  74. package/node/mock_file_service.test.d.ts +0 -2
  75. package/node/mock_file_service.test.d.ts.map +0 -1
  76. package/node/mock_file_service.test.js +0 -19
  77. package/node/mock_file_service.test.js.map +0 -1
  78. package/node/node_file_service.d.ts +0 -16
  79. package/node/node_file_service.d.ts.map +0 -1
  80. package/node/node_file_service.js +0 -84
  81. package/node/node_file_service.js.map +0 -1
  82. package/node/node_sys_abstraction.d.ts +0 -21
  83. package/node/node_sys_abstraction.d.ts.map +0 -1
  84. package/node/node_sys_abstraction.js +0 -101
  85. package/node/node_sys_abstraction.js.map +0 -1
  86. package/node/node_sys_abstraction.test.d.ts +0 -2
  87. package/node/node_sys_abstraction.test.d.ts.map +0 -1
  88. package/node/node_sys_abstraction.test.js +0 -57
  89. package/node/node_sys_abstraction.test.js.map +0 -1
  90. package/option.d.ts +0 -25
  91. package/option.d.ts.map +0 -1
  92. package/option.js +0 -53
  93. package/option.js.map +0 -1
  94. package/result.d.ts +0 -31
  95. package/result.d.ts.map +0 -1
  96. package/result.js +0 -69
  97. package/result.js.map +0 -1
  98. package/result.test.d.ts +0 -2
  99. package/result.test.d.ts.map +0 -1
  100. package/result.test.js +0 -39
  101. package/result.test.js.map +0 -1
  102. package/sys_abstraction.d.ts +0 -35
  103. package/sys_abstraction.d.ts.map +0 -1
  104. package/sys_abstraction.js +0 -35
  105. package/sys_abstraction.js.map +0 -1
  106. package/test/log_collector.d.ts +0 -22
  107. package/test/log_collector.d.ts.map +0 -1
  108. package/test/log_collector.js +0 -66
  109. package/test/log_collector.js.map +0 -1
  110. package/test/mock_logger.d.ts +0 -13
  111. package/test/mock_logger.d.ts.map +0 -1
  112. package/test/mock_logger.js +0 -30
  113. package/test/mock_logger.js.map +0 -1
  114. package/test/mock_logger.test.d.ts +0 -2
  115. package/test/mock_logger.test.d.ts.map +0 -1
  116. package/test/mock_logger.test.js +0 -49
  117. package/test/mock_logger.test.js.map +0 -1
  118. package/test/test-exit-handler.d.ts +0 -1
  119. package/test/test-exit-handler.d.ts.map +0 -1
  120. package/test/test-exit-handler.js +0 -76
  121. package/test/test-exit-handler.js.map +0 -1
  122. package/time.d.ts +0 -13
  123. package/time.d.ts.map +0 -1
  124. package/time.js +0 -18
  125. package/time.js.map +0 -1
  126. package/utils/index.d.ts.map +0 -1
  127. package/utils/rebuffer.d.ts +0 -3
  128. package/utils/rebuffer.d.ts.map +0 -1
  129. package/utils/rebuffer.js +0 -65
  130. package/utils/rebuffer.js.map +0 -1
  131. package/utils/rebuffer.test.d.ts +0 -2
  132. package/utils/rebuffer.test.d.ts.map +0 -1
  133. package/utils/rebuffer.test.js +0 -79
  134. package/utils/rebuffer.test.js.map +0 -1
  135. package/utils/stream2string.d.ts +0 -3
  136. package/utils/stream2string.d.ts.map +0 -1
  137. package/utils/stream2string.js +0 -53
  138. package/utils/stream2string.js.map +0 -1
  139. package/utils/stream2string.test.d.ts +0 -2
  140. package/utils/stream2string.test.d.ts.map +0 -1
  141. package/utils/stream2string.test.js +0 -31
  142. package/utils/stream2string.test.js.map +0 -1
  143. package/utils/stream_map.d.ts +0 -9
  144. package/utils/stream_map.d.ts.map +0 -1
  145. package/utils/stream_map.js +0 -67
  146. package/utils/stream_map.js.map +0 -1
  147. package/utils/stream_map.test.d.ts +0 -2
  148. package/utils/stream_map.test.d.ts.map +0 -1
  149. package/utils/stream_map.test.js +0 -89
  150. package/utils/stream_map.test.js.map +0 -1
  151. package/utils/stream_test_helper.d.ts +0 -15
  152. package/utils/stream_test_helper.d.ts.map +0 -1
  153. package/utils/stream_test_helper.js +0 -42
  154. package/utils/stream_test_helper.js.map +0 -1
  155. package/utils/string2stream.d.ts +0 -3
  156. package/utils/string2stream.d.ts.map +0 -1
  157. package/utils/string2stream.js +0 -18
  158. package/utils/string2stream.js.map +0 -1
  159. package/utils/string2stream.test.d.ts +0 -2
  160. package/utils/string2stream.test.d.ts.map +0 -1
  161. package/utils/string2stream.test.js +0 -9
  162. package/utils/string2stream.test.js.map +0 -1
  163. package/web/index.d.ts.map +0 -1
  164. package/web/web_sys_abstraction.d.ts +0 -4
  165. package/web/web_sys_abstraction.d.ts.map +0 -1
  166. package/web/web_sys_abstraction.js +0 -65
  167. package/web/web_sys_abstraction.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.test.js","sourceRoot":"","sources":["../src/logger.test.ts"],"names":[],"mappings":";;AAAA,+CAA6D;AAC7D,wDAAoD;AAEpD,qCAAyC;AACzC,uDAA6C;AAC7C,mEAA8D;AAC9D,iEAAqD;AAErD,QAAQ,CAAC,YAAY,EAAE,GAAG,EAAE;IAC1B,IAAI,YAA0B,CAAC;IAC/B,IAAI,MAAc,CAAC;IAEnB,UAAU,CAAC,GAAG,EAAE;QACd,YAAY,GAAG,IAAI,4BAAY,EAAE,CAAC;QAClC,MAAM,GAAG,IAAI,wBAAU,CAAC;YACtB,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,IAAA,uCAAiB,EA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AAE,OAAO;gBACd,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,cAAc;aACpB;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;QAC5B,MAAM,EAAE,GAAG,IAAI,wBAAU,EAAE,CAAC,WAAW,CAAC,cAAK,CAAC,KAAK,CAAe,CAAC;QACnE,MAAM,EAAE,GAAG,IAAI,wBAAU,EAAE,CAAC;QAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,EAAgB,CAAC;QACxD,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;QAChD,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC;QAChD,MAAM,CAAE,EAAE,CAAC,aAAkC,CAAC,aAAa,CAAC,GAAG,CAAC,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAC3F,MAAM,CAAE,EAAE,CAAC,aAAkC,CAAC,aAAa,CAAC,GAAG,CAAC,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;QAC3F,MAAM,CAAE,EAAE,CAAC,aAAkC,CAAC,aAAa,CAAC,GAAG,CAAC,cAAK,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAC7F,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/logger_impl.d.ts DELETED
@@ -1,64 +0,0 @@
1
- import { AsError, Level, Logger, WithLogger } from "./logger";
2
- import { SysAbstraction } from "./sys_abstraction";
3
- type JsonRecord = Record<string, string | number | boolean | unknown>;
4
- export interface LevelHandler {
5
- enableLevel(level: Level, ...modules: string[]): void;
6
- disableLevel(level: Level, ...modules: string[]): void;
7
- setDebug(...modules: (string | string[])[]): void;
8
- isEnabled(ilevel: unknown, module: unknown): boolean;
9
- }
10
- export declare class LevelHandlerImpl implements LevelHandler {
11
- readonly _globalLevels: Set<Level>;
12
- readonly _modules: Map<string, Set<Level>>;
13
- enableLevel(level: Level, ...modules: string[]): void;
14
- disableLevel(level: Level, ...modules: string[]): void;
15
- forModules(level: Level, fnAction: (p: string) => void, ...modules: (string | string[])[]): void;
16
- setDebug(...modules: (string | string[])[]): void;
17
- isEnabled(ilevel: unknown, module: unknown): boolean;
18
- }
19
- export declare class LogWriter {
20
- readonly _out: WritableStream<Uint8Array>;
21
- readonly _toFlush: (() => Promise<void>)[];
22
- constructor(out: WritableStream<Uint8Array>);
23
- write(encoded: Uint8Array): void;
24
- _flushIsRunning: boolean;
25
- _flushDoneFns: (() => void)[];
26
- _flush(toFlush?: (() => Promise<void>)[] | undefined, done?: () => void): void;
27
- }
28
- export interface LoggerImplParams {
29
- readonly out?: WritableStream<Uint8Array>;
30
- readonly logWriter?: LogWriter;
31
- readonly sys?: SysAbstraction;
32
- readonly withAttributes?: JsonRecord;
33
- readonly levelHandler?: LevelHandler;
34
- }
35
- export declare class LoggerImpl implements Logger {
36
- readonly _sys: SysAbstraction;
37
- readonly _attributes: JsonRecord;
38
- readonly _withAttributes: JsonRecord;
39
- readonly _logWriter: LogWriter;
40
- readonly _levelHandler: LevelHandler;
41
- constructor(params?: LoggerImplParams);
42
- EnableLevel(level: Level, ...modules: string[]): Logger;
43
- DisableLevel(level: Level, ...modules: string[]): Logger;
44
- Module(key: string): Logger;
45
- SetDebug(...modules: (string | string[])[]): Logger;
46
- Timestamp(): Logger;
47
- Warn(): Logger;
48
- Log(): Logger;
49
- Debug(): Logger;
50
- Error(): Logger;
51
- Info(): Logger;
52
- Err(err: unknown): Logger;
53
- WithLevel(l: Level): Logger;
54
- Str(key: string, value: string): Logger;
55
- Any(key: string, value: string | number | boolean | JsonRecord): Logger;
56
- Dur(key: string, nsec: number): Logger;
57
- Uint64(key: string, value: number): Logger;
58
- Flush(): Promise<void>;
59
- With(): WithLogger;
60
- _resetAttributes(fn: () => Error): Error;
61
- Msg(...args: string[]): AsError;
62
- }
63
- export {};
64
- //# sourceMappingURL=logger_impl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger_impl.d.ts","sourceRoot":"","sources":["../src/logger_impl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,KAAK,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACtD,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACvD,QAAQ,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;IAClD,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;CACtD;AAED,qBAAa,gBAAiB,YAAW,YAAY;IACnD,QAAQ,CAAC,aAAa,aAAyD;IAC/E,QAAQ,CAAC,QAAQ,0BAAiC;IAClD,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IAarD,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI;IActD,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,EAAE,GAAG,OAAO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BAGzB,MAAM,CAAC,EAAE,gBAAgB;IAgCrC,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM;IAIvD,YAAY,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM;IAKxD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAK3B,QAAQ,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM;IAMnD,SAAS,IAAI,MAAM;IAInB,IAAI,IAAI,MAAM;IAId,GAAG,IAAI,MAAM;IAGb,KAAK,IAAI,MAAM;IAIf,KAAK,IAAI,MAAM;IAIf,IAAI,IAAI,MAAM;IAId,GAAG,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM;IAQzB,SAAS,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM;IAK3B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAKvC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM;IAIvE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAKtC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAKpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAM5B,IAAI,IAAI,UAAU;IAelB,gBAAgB,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,KAAK;IASxC,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO;CAqBhC"}
package/logger_impl.js DELETED
@@ -1,331 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LoggerImpl = exports.LogWriter = exports.LevelHandlerImpl = void 0;
4
- const logger_1 = require("./logger");
5
- const web_sys_abstraction_1 = require("./web/web_sys_abstraction");
6
- const encoder = new TextEncoder();
7
- class LevelHandlerImpl {
8
- constructor() {
9
- this._globalLevels = new Set([logger_1.Level.INFO, logger_1.Level.ERROR, logger_1.Level.WARN]);
10
- this._modules = new Map();
11
- }
12
- enableLevel(level, ...modules) {
13
- if (modules.length == 0) {
14
- this._globalLevels.add(level);
15
- return;
16
- }
17
- this.forModules(level, (p) => {
18
- this._modules.set(p, new Set([...this._globalLevels, level]));
19
- }, ...modules);
20
- }
21
- disableLevel(level, ...modules) {
22
- if (modules.length == 0) {
23
- this._globalLevels.delete(level);
24
- return;
25
- }
26
- this.forModules(level, (p) => {
27
- this._modules.delete(p);
28
- }, ...modules);
29
- }
30
- forModules(level, fnAction, ...modules) {
31
- for (const m of modules.flat()) {
32
- const parts = m
33
- .split(",")
34
- .map((s) => s.trim())
35
- .filter((s) => s.length > 0);
36
- for (const p of parts) {
37
- fnAction(p);
38
- }
39
- }
40
- }
41
- setDebug(...modules) {
42
- this.forModules(logger_1.Level.DEBUG, (p) => {
43
- this._modules.set(p, new Set([...this._globalLevels, logger_1.Level.DEBUG]));
44
- }, ...modules);
45
- }
46
- isEnabled(ilevel, module) {
47
- const level = ilevel;
48
- if (module !== undefined) {
49
- const levels = this._modules.get(module);
50
- if (levels && levels.has(level)) {
51
- return true;
52
- }
53
- }
54
- if (level === undefined) {
55
- return true;
56
- }
57
- return this._globalLevels.has(level);
58
- }
59
- }
60
- exports.LevelHandlerImpl = LevelHandlerImpl;
61
- const levelSingleton = new LevelHandlerImpl();
62
- class LogWriter {
63
- constructor(out) {
64
- this._toFlush = [];
65
- this._flushIsRunning = false;
66
- this._flushDoneFns = Array();
67
- this._out = out;
68
- }
69
- write(encoded) {
70
- const my = async () => {
71
- try {
72
- const writer = this._out.getWriter();
73
- await writer.ready;
74
- await writer.write(encoded);
75
- await writer.releaseLock();
76
- }
77
- catch (err) {
78
- console.error("Chunk error:", err);
79
- }
80
- };
81
- this._toFlush.push(my);
82
- this._flush();
83
- }
84
- _flush(toFlush = undefined, done) {
85
- if (done) {
86
- this._flushDoneFns.push(done);
87
- }
88
- if (this._toFlush.length == 0) {
89
- this._flushIsRunning = false;
90
- this._flushDoneFns.forEach((fn) => fn());
91
- this._flushDoneFns = [];
92
- return;
93
- }
94
- if (!toFlush && this._toFlush.length == 1 && !this._flushIsRunning) {
95
- this._flushIsRunning = true;
96
- }
97
- else if (!toFlush) {
98
- return;
99
- }
100
- const my = this._toFlush.shift();
101
- my === null || my === void 0 ? void 0 : my().finally(() => {
102
- this._flush(this._toFlush);
103
- });
104
- }
105
- }
106
- exports.LogWriter = LogWriter;
107
- class LoggerImpl {
108
- constructor(params) {
109
- this._attributes = {};
110
- if (!params) {
111
- params = {};
112
- }
113
- if (!params.sys) {
114
- this._sys = (0, web_sys_abstraction_1.WebSysAbstraction)();
115
- }
116
- else {
117
- this._sys = params.sys;
118
- }
119
- if (params.logWriter) {
120
- this._logWriter = params.logWriter;
121
- }
122
- else {
123
- if (!params.out) {
124
- this._logWriter = new LogWriter(this._sys.Stdout());
125
- }
126
- else {
127
- this._logWriter = new LogWriter(params.out);
128
- }
129
- }
130
- if (!params.withAttributes) {
131
- this._withAttributes = {};
132
- }
133
- else {
134
- this._withAttributes = Object.assign({}, params.withAttributes);
135
- }
136
- this._attributes = Object.assign({}, this._withAttributes);
137
- if (params.levelHandler) {
138
- this._levelHandler = params.levelHandler;
139
- }
140
- else {
141
- this._levelHandler = levelSingleton;
142
- }
143
- }
144
- EnableLevel(level, ...modules) {
145
- this._levelHandler.enableLevel(level, ...modules);
146
- return this;
147
- }
148
- DisableLevel(level, ...modules) {
149
- this._levelHandler.disableLevel(level, ...modules);
150
- return this;
151
- }
152
- Module(key) {
153
- this._attributes["module"] = key;
154
- this._withAttributes["module"] = key;
155
- return this;
156
- }
157
- SetDebug(...modules) {
158
- this._levelHandler.setDebug(...modules);
159
- return this;
160
- }
161
- Timestamp() {
162
- this._attributes["ts"] = this._sys.Time().Now().toISOString();
163
- return this;
164
- }
165
- Warn() {
166
- this._attributes["level"] = logger_1.Level.WARN;
167
- return this;
168
- }
169
- Log() {
170
- return this;
171
- }
172
- Debug() {
173
- this._attributes["level"] = logger_1.Level.DEBUG;
174
- return this;
175
- }
176
- Error() {
177
- this._attributes["level"] = logger_1.Level.ERROR;
178
- return this;
179
- }
180
- Info() {
181
- this._attributes["level"] = logger_1.Level.INFO;
182
- return this;
183
- }
184
- Err(err) {
185
- if (err instanceof Error) {
186
- this._attributes["error"] = err.message;
187
- }
188
- else {
189
- this._attributes["error"] = "" + err;
190
- }
191
- return this;
192
- }
193
- WithLevel(l) {
194
- this._attributes["level"] = l;
195
- return this;
196
- }
197
- Str(key, value) {
198
- this._attributes[key] = value;
199
- return this;
200
- }
201
- Any(key, value) {
202
- this._attributes[key] = value;
203
- return this;
204
- }
205
- Dur(key, nsec) {
206
- this._attributes[key] = `${nsec}ms`;
207
- return this;
208
- }
209
- Uint64(key, value) {
210
- this._attributes[key] = value;
211
- return this;
212
- }
213
- async Flush() {
214
- return new Promise((resolve) => {
215
- this._logWriter._flush(undefined, resolve);
216
- });
217
- }
218
- With() {
219
- return new WithLoggerBuilder(new LoggerImpl({
220
- logWriter: this._logWriter,
221
- sys: this._sys,
222
- levelHandler: this._levelHandler,
223
- withAttributes: Object.assign({ module: this._attributes["module"] }, this._withAttributes),
224
- }));
225
- }
226
- _resetAttributes(fn) {
227
- const ret = fn();
228
- Object.keys(this._attributes).forEach((key) => {
229
- delete this._attributes[key];
230
- });
231
- Object.assign(this._attributes, this._withAttributes);
232
- return ret;
233
- }
234
- Msg(...args) {
235
- const error = this._resetAttributes(() => {
236
- const doWrite = this._levelHandler.isEnabled(this._attributes["level"], this._attributes["module"]);
237
- this._attributes["msg"] = args.join(" ");
238
- if (typeof this._attributes["msg"] === "string" && !this._attributes["msg"].trim().length) {
239
- delete this._attributes["msg"];
240
- }
241
- if (this._attributes["ts"] === "ETERNITY") {
242
- this.Timestamp();
243
- }
244
- const str = JSON.stringify(this._attributes);
245
- if (doWrite) {
246
- const encoded = encoder.encode(str + "\n");
247
- this._logWriter.write(encoded);
248
- }
249
- return new Error(str);
250
- });
251
- return {
252
- AsError: () => error,
253
- };
254
- }
255
- }
256
- exports.LoggerImpl = LoggerImpl;
257
- class WithLoggerBuilder {
258
- constructor(li) {
259
- this._li = li;
260
- }
261
- Logger() {
262
- Object.assign(this._li._withAttributes, this._li._attributes);
263
- console.log(`Logger:${JSON.stringify([...this._li._levelHandler._globalLevels])}`);
264
- return this._li;
265
- }
266
- EnableLevel(level, ...modules) {
267
- this._li._levelHandler.enableLevel(level, ...modules);
268
- return this;
269
- }
270
- DisableLevel(level, ...modules) {
271
- this._li._levelHandler.enableLevel(level, ...modules);
272
- return this;
273
- }
274
- Module(key) {
275
- this._li.Module(key);
276
- return this;
277
- }
278
- SetDebug(...modules) {
279
- this._li.SetDebug(...modules);
280
- return this;
281
- }
282
- Str(key, value) {
283
- this._li.Str(key, value);
284
- return this;
285
- }
286
- Log() {
287
- this._li.Log();
288
- return this;
289
- }
290
- WithLevel(level) {
291
- this._li.WithLevel(level);
292
- return this;
293
- }
294
- Error() {
295
- this._li.Error();
296
- return this;
297
- }
298
- Warn() {
299
- this._li.Error();
300
- return this;
301
- }
302
- Debug() {
303
- this._li.Debug();
304
- return this;
305
- }
306
- Err(err) {
307
- this._li.Err(err);
308
- return this;
309
- }
310
- Info() {
311
- this._li.Info();
312
- return this;
313
- }
314
- Timestamp() {
315
- this._li._attributes["ts"] = "ETERNITY";
316
- return this;
317
- }
318
- Any(key, value) {
319
- this._li.Any(key, value);
320
- return this;
321
- }
322
- Dur(key, nsec) {
323
- this._li.Dur(key, nsec);
324
- return this;
325
- }
326
- Uint64(key, value) {
327
- this._li.Uint64(key, value);
328
- return this;
329
- }
330
- }
331
- //# sourceMappingURL=logger_impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger_impl.js","sourceR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C;IACD,GAAG,CAAC,GAAY;QACd,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI;QACF,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,SAAS;QACP,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC;QACxC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,GAAG,CAAC,GAAW,EAAE,KAAiB;QAChC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,GAAG,CAAC,GAAW,EAAE,IAAY;QAC3B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,CAAC,GAAW,EAAE,KAAa;QAC/B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;CACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC"}
@@ -1,11 +0,0 @@
1
- import { NamedWritableStream } from "../file_service";
2
- import { NodeFileService } from "./node_file_service";
3
- export interface FileCollector {
4
- readonly name: string;
5
- content: string;
6
- }
7
- export declare class MockFileService extends NodeFileService {
8
- readonly files: Record<string, FileCollector>;
9
- create(fname: string): Promise<NamedWritableStream>;
10
- }
11
- //# sourceMappingURL=mock_file_service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock_file_service.d.ts","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,QAAQ,CAAC,KAAK,gCAAuC;IAMtC,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA6BnE"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockFileService = void 0;
4
- const node_file_service_1 = require("./node_file_service");
5
- class MockFileService extends node_file_service_1.NodeFileService {
6
- constructor() {
7
- super(...arguments);
8
- this.files = {};
9
- }
10
- async create(fname) {
11
- let oName = fname;
12
- if (!this.isAbsolute(fname)) {
13
- oName = await this.abs(fname);
14
- }
15
- const fc = {
16
- name: oName,
17
- content: "",
18
- };
19
- this.files[oName] = fc;
20
- this.files[fname] = fc;
21
- const decoder = new TextDecoder();
22
- return {
23
- name: oName,
24
- stream: new WritableStream({
25
- write(chunk) {
26
- fc.content = fc.content + decoder.decode(chunk);
27
- },
28
- close() {
29
- },
30
- abort() {
31
- throw new Error("not implemented");
32
- },
33
- }),
34
- };
35
- }
36
- }
37
- exports.MockFileService = MockFileService;
38
- //# sourceMappingURL=mock_file_service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock_file_service.js","sourceRoot":"","sources":["../../src/node/mock_file_service.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAOtD,MAAa,eAAgB,SAAQ,mCAAe;IAApD;;QACW,UAAK,GAAG,EAAmC,CAAC;IAmCvD,CAAC;IA7BU,KAAK,CAAC,MAAM,CAAC,KAAa;QACjC,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,KAAK,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC;QAED,MAAM,EAAE,GAAG;YACT,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,EAAE;SACZ,CAAC;QACF,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;QAElC,OAAO;YACL,IAAI,EAAE,KAAK;YACX,MAAM,EAAE,IAAI,cAAc,CAAa;gBACrC,KAAK,CAAC,KAAK;oBACT,EAAE,CAAC,OAAO,GAAG,EAAE,CAAC,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClD,CAAC;gBACD,KAAK;gBAEL,CAAC;gBACD,KAAK;oBACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;gBACrC,CAAC;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AApCD,0CAoCC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mock_file_service.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock_file_service.test.d.ts","sourceRoot":"","sources":["../../src/node/mock_file_service.test.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mock_file_service_1 = require("./mock_file_service");
4
- it("writeFileString", async () => {
5
- const f = new mock_file_service_1.MockFileService();
6
- const absFname = f.abs("test");
7
- await f.writeFileString("test", "hello");
8
- expect(f.files).toEqual({
9
- [absFname]: {
10
- content: "hello",
11
- name: absFname,
12
- },
13
- test: {
14
- name: absFname,
15
- content: "hello",
16
- },
17
- });
18
- });
19
- //# sourceMappingURL=mock_file_service.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mock_file_service.test.js","sourceRoot":"","sources":["../../src/node/mock_file_service.test.ts"],"names":[],"mappings":";;AAAA,2DAAsD;AAEtD,EAAE,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;IAC/B,MAAM,CAAC,GAAG,IAAI,mCAAe,EAAE,CAAC;IAChC,MAAM,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;QACtB,CAAC,QAAQ,CAAC,EAAE;YACV,OAAO,EAAE,OAAO;YAChB,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { FileService, NamedWritableStream } from "../file_service";
2
- export declare class NodeFileService implements FileService {
3
- readonly baseDir: string;
4
- constructor(baseDir?: string);
5
- nodeImport(fname: string): string;
6
- readFileString(fname: string): Promise<string>;
7
- dirname(fname: string): string;
8
- basename(fname: string): string;
9
- join(...paths: string[]): string;
10
- relative(from: string, to?: string): string;
11
- abs(fname: string): string;
12
- isAbsolute(fname: string): boolean;
13
- writeFileString(fname: string, content: string): Promise<void>;
14
- create(fname: string): Promise<NamedWritableStream>;
15
- }
16
- //# sourceMappingURL=node_file_service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_file_service.d.ts","sourceRoot":"","sources":["../../src/node/node_file_service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEnE,qBAAa,eAAgB,YAAW,WAAW;IACjD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;gBACb,OAAO,GAAE,MAAsB;IAI3C,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IASjC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI9C,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAG9B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI/B,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM;IAIhC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAU3C,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAS1B,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAI5B,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO9D,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAwB1D"}
@@ -1,84 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.NodeFileService = void 0;
7
- const node_path_1 = __importDefault(require("node:path"));
8
- const node_fs_1 = __importDefault(require("node:fs"));
9
- class NodeFileService {
10
- constructor(baseDir = process.cwd()) {
11
- this.baseDir = this.abs(baseDir);
12
- }
13
- nodeImport(fname) {
14
- if (node_path_1.default.isAbsolute(fname)) {
15
- return fname;
16
- }
17
- else {
18
- return "./" + node_path_1.default.normalize(fname);
19
- }
20
- }
21
- readFileString(fname) {
22
- return node_fs_1.default.promises.readFile(fname, { encoding: "utf-8" });
23
- }
24
- dirname(fname) {
25
- return node_path_1.default.dirname(fname);
26
- }
27
- basename(fname) {
28
- return node_path_1.default.basename(fname);
29
- }
30
- join(...paths) {
31
- return node_path_1.default.join(...paths);
32
- }
33
- relative(from, to) {
34
- if (to === undefined) {
35
- to = from;
36
- from = process.cwd();
37
- }
38
- const ret = node_path_1.default.relative(from, to);
39
- return ret;
40
- }
41
- abs(fname) {
42
- if (node_path_1.default.isAbsolute(fname)) {
43
- return fname;
44
- }
45
- else {
46
- const cwd = process.cwd();
47
- return node_path_1.default.resolve(cwd, fname);
48
- }
49
- }
50
- isAbsolute(fname) {
51
- return node_path_1.default.isAbsolute(fname);
52
- }
53
- async writeFileString(fname, content) {
54
- const o = await this.create(fname);
55
- const wr = o.stream.getWriter();
56
- await wr.write(new TextEncoder().encode(content));
57
- await wr.close();
58
- }
59
- async create(fname) {
60
- let oName = fname;
61
- if (!node_path_1.default.isAbsolute(fname)) {
62
- oName = this.abs(fname);
63
- }
64
- const base = node_path_1.default.dirname(oName);
65
- await node_fs_1.default.promises.mkdir(base, { recursive: true });
66
- const out = node_fs_1.default.createWriteStream(oName);
67
- return {
68
- name: oName,
69
- stream: new WritableStream({
70
- write(chunk) {
71
- out.write(chunk);
72
- },
73
- close() {
74
- out.close();
75
- },
76
- abort() {
77
- throw new Error("not implemented");
78
- },
79
- }),
80
- };
81
- }
82
- }
83
- exports.NodeFileService = NodeFileService;
84
- //# sourceMappingURL=node_file_service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_file_service.js","sourceRoot":"","sources":["../../src/node/node_file_service.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAAyB;AAGzB,MAAa,eAAe;IAE1B,YAAY,UAAkB,OAAO,CAAC,GAAG,EAAE;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED,UAAU,CAAC,KAAa;QAEtB,IAAI,mBAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,GAAG,mBAAI,CAAC,S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