@adviser/cement 0.1.10 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) 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 +987 -0
  10. package/index.cjs.map +1 -0
  11. package/index.d.cts +196 -0
  12. package/index.d.ts +196 -10
  13. package/index.js +611 -25
  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 +39 -11
  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/index.d.ts.map +0 -1
  49. package/logger.d.ts +0 -36
  50. package/logger.d.ts.map +0 -1
  51. package/logger.js +0 -11
  52. package/logger.js.map +0 -1
  53. package/logger.test.d.ts +0 -2
  54. package/logger.test.d.ts.map +0 -1
  55. package/logger.test.js +0 -362
  56. package/logger.test.js.map +0 -1
  57. package/logger_impl.d.ts +0 -64
  58. package/logger_impl.d.ts.map +0 -1
  59. package/logger_impl.js +0 -330
  60. package/logger_impl.js.map +0 -1
  61. package/node/index.d.ts.map +0 -1
  62. package/node/mock_file_service.d.ts +0 -11
  63. package/node/mock_file_service.d.ts.map +0 -1
  64. package/node/mock_file_service.js +0 -37
  65. package/node/mock_file_service.js.map +0 -1
  66. package/node/mock_file_service.test.d.ts +0 -2
  67. package/node/mock_file_service.test.d.ts.map +0 -1
  68. package/node/mock_file_service.test.js +0 -19
  69. package/node/mock_file_service.test.js.map +0 -1
  70. package/node/node_file_service.d.ts +0 -16
  71. package/node/node_file_service.d.ts.map +0 -1
  72. package/node/node_file_service.js +0 -84
  73. package/node/node_file_service.js.map +0 -1
  74. package/node/node_sys_abstraction.d.ts +0 -21
  75. package/node/node_sys_abstraction.d.ts.map +0 -1
  76. package/node/node_sys_abstraction.js +0 -101
  77. package/node/node_sys_abstraction.js.map +0 -1
  78. package/node/node_sys_abstraction.test.d.ts +0 -2
  79. package/node/node_sys_abstraction.test.d.ts.map +0 -1
  80. package/node/node_sys_abstraction.test.js +0 -57
  81. package/node/node_sys_abstraction.test.js.map +0 -1
  82. package/option.d.ts +0 -25
  83. package/option.d.ts.map +0 -1
  84. package/option.js +0 -53
  85. package/option.js.map +0 -1
  86. package/result.d.ts +0 -31
  87. package/result.d.ts.map +0 -1
  88. package/result.js +0 -69
  89. package/result.js.map +0 -1
  90. package/result.test.d.ts +0 -2
  91. package/result.test.d.ts.map +0 -1
  92. package/result.test.js +0 -39
  93. package/result.test.js.map +0 -1
  94. package/sys_abstraction.d.ts +0 -35
  95. package/sys_abstraction.d.ts.map +0 -1
  96. package/sys_abstraction.js +0 -35
  97. package/sys_abstraction.js.map +0 -1
  98. package/test/log_collector.d.ts +0 -22
  99. package/test/log_collector.d.ts.map +0 -1
  100. package/test/log_collector.js +0 -65
  101. package/test/log_collector.js.map +0 -1
  102. package/test/mock_logger.d.ts +0 -13
  103. package/test/mock_logger.d.ts.map +0 -1
  104. package/test/mock_logger.js +0 -30
  105. package/test/mock_logger.js.map +0 -1
  106. package/test/mock_logger.test.d.ts +0 -2
  107. package/test/mock_logger.test.d.ts.map +0 -1
  108. package/test/mock_logger.test.js +0 -49
  109. package/test/mock_logger.test.js.map +0 -1
  110. package/test/test-exit-handler.d.ts +0 -1
  111. package/test/test-exit-handler.d.ts.map +0 -1
  112. package/test/test-exit-handler.js +0 -76
  113. package/test/test-exit-handler.js.map +0 -1
  114. package/time.d.ts +0 -13
  115. package/time.d.ts.map +0 -1
  116. package/time.js +0 -18
  117. package/time.js.map +0 -1
  118. package/utils/index.d.ts.map +0 -1
  119. package/utils/rebuffer.d.ts +0 -3
  120. package/utils/rebuffer.d.ts.map +0 -1
  121. package/utils/rebuffer.js +0 -65
  122. package/utils/rebuffer.js.map +0 -1
  123. package/utils/rebuffer.test.d.ts +0 -2
  124. package/utils/rebuffer.test.d.ts.map +0 -1
  125. package/utils/rebuffer.test.js +0 -79
  126. package/utils/rebuffer.test.js.map +0 -1
  127. package/utils/stream2string.d.ts +0 -3
  128. package/utils/stream2string.d.ts.map +0 -1
  129. package/utils/stream2string.js +0 -53
  130. package/utils/stream2string.js.map +0 -1
  131. package/utils/stream2string.test.d.ts +0 -2
  132. package/utils/stream2string.test.d.ts.map +0 -1
  133. package/utils/stream2string.test.js +0 -31
  134. package/utils/stream2string.test.js.map +0 -1
  135. package/utils/stream_map.d.ts +0 -9
  136. package/utils/stream_map.d.ts.map +0 -1
  137. package/utils/stream_map.js +0 -67
  138. package/utils/stream_map.js.map +0 -1
  139. package/utils/stream_map.test.d.ts +0 -2
  140. package/utils/stream_map.test.d.ts.map +0 -1
  141. package/utils/stream_map.test.js +0 -89
  142. package/utils/stream_map.test.js.map +0 -1
  143. package/utils/stream_test_helper.d.ts +0 -15
  144. package/utils/stream_test_helper.d.ts.map +0 -1
  145. package/utils/stream_test_helper.js +0 -42
  146. package/utils/stream_test_helper.js.map +0 -1
  147. package/utils/string2stream.d.ts +0 -3
  148. package/utils/string2stream.d.ts.map +0 -1
  149. package/utils/string2stream.js +0 -18
  150. package/utils/string2stream.js.map +0 -1
  151. package/utils/string2stream.test.d.ts +0 -2
  152. package/utils/string2stream.test.d.ts.map +0 -1
  153. package/utils/string2stream.test.js +0 -9
  154. package/utils/string2stream.test.js.map +0 -1
  155. package/web/index.d.ts.map +0 -1
  156. package/web/web_sys_abstraction.d.ts +0 -4
  157. package/web/web_sys_abstraction.d.ts.map +0 -1
  158. package/web/web_sys_abstraction.js +0 -65
  159. package/web/web_sys_abstraction.js.map +0 -1
package/logger_impl.js DELETED
@@ -1,330 +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().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
- return this._li;
264
- }
265
- EnableLevel(level, ...modules) {
266
- this._li._levelHandler.enableLevel(level, ...modules);
267
- return this;
268
- }
269
- DisableLevel(level, ...modules) {
270
- this._li._levelHandler.enableLevel(level, ...modules);
271
- return this;
272
- }
273
- Module(key) {
274
- this._li.Module(key);
275
- return this;
276
- }
277
- SetDebug(...modules) {
278
- this._li.SetDebug(...modules);
279
- return this;
280
- }
281
- Str(key, value) {
282
- this._li.Str(key, value);
283
- return this;
284
- }
285
- Log() {
286
- this._li.Log();
287
- return this;
288
- }
289
- WithLevel(level) {
290
- this._li.WithLevel(level);
291
- return this;
292
- }
293
- Error() {
294
- this._li.Error();
295
- return this;
296
- }
297
- Warn() {
298
- this._li.Error();
299
- return this;
300
- }
301
- Debug() {
302
- this._li.Debug();
303
- return this;
304
- }
305
- Err(err) {
306
- this._li.Err(err);
307
- return this;
308
- }
309
- Info() {
310
- this._li.Info();
311
- return this;
312
- }
313
- Timestamp() {
314
- this._li._attributes["ts"] = "ETERNITY";
315
- return this;
316
- }
317
- Any(key, value) {
318
- this._li.Any(key, value);
319
- return this;
320
- }
321
- Dur(key, nsec) {
322
- this._li.Dur(key, nsec);
323
- return this;
324
- }
325
- Uint64(key, value) {
326
- this._li.Uint64(key, value);
327
- return this;
328
- }
329
- }
330
- //# sourceMappingURL=logger_impl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger_impl.js","sourceRoot":"","sources":["../src/logger_impl.ts"],"names":[],"mappings":";;;AACA,qCAA8D;AAC9D,mEAA8D;AAG9D,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAWlC,MAAa,gBAAgB;IAA7B;QACW,kBAAa,GAAe,IAAI,GAAG,CAAC,CAAC,cAAK,CAAC,IAAI,EAAE,cAAK,CAAC,KAAK,EAAE,cAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC3E,aAAQ,GAA4B,IAAI,GAAG,EAAE,CAAC;IA8DzD,CAAC;IA7DC,WAAW,CAAC,KAAY,EAAE,GAAG,OAAiB;QAC5C,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;YAC9B,OAAO;QACT,CAAC;QACD,IAAI,CAAC,UAAU,CACb,KAAK,EACL,CAAC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B,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;CA2BnE"}
@@ -1,37 +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
- abort() {
30
- throw new Error("not implemented");
31
- },
32
- }),
33
- };
34
- }
35
- }
36
- exports.MockFileService = MockFileService;
37
- //# 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;IAiCvD,CAAC;IA3BU,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,KAAI,CAAC;gBACV,KAAK;oBACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;gBACrC,CAAC;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AAlCD,0CAkCC"}
@@ -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,SAAS,CAAC,KAAK,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,cAAc,CAAC,KAAa;QAC1B,OAAO,iBAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,KAAa;QACnB,OAAO,mBAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,QAAQ,CAAC,KAAa;QACpB,OAAO,mBAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,IAAI,CAAC,GAAG,KAAe;QACrB,OAAO,mBAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,QAAQ,CAAC,IAAY,EAAE,EAAW;QAChC,IAAI,EAAE,KAAK,SAAS,EAAE,CAAC;YACrB,EAAE,GAAG,IAAI,CAAC;YACV,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QACvB,CAAC;QACD,MAAM,GAAG,GAAG,mBAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;Q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AM,EAAE,IAAI,cAAc,CAAa;gBACrC,KAAK,CAAC,KAAK;oBACT,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACnB,CAAC;gBACD,KAAK;oBACH,GAAG,CAAC,KAAK,EAAE,CAAC;gBACd,CAAC;gBACD,KAAK;oBACH,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;gBACrC,CAAC;aACF,CAAC;SACH,CAAC;IACJ,CAAC;CACF;AApFD,0CAoFC"}
@@ -1,21 +0,0 @@
1
- import { SysAbstraction, SystemService, VoidFunc } from "../sys_abstraction";
2
- import { ExitHandler, ExitService, WrapperSysAbstractionParams } from "../base_sys_abstraction";
3
- export declare class ExitServiceImpl implements ExitService {
4
- constructor();
5
- _exitHandlers: ExitHandler[];
6
- injectExitHandlers(hdls: ExitHandler[]): void;
7
- invoked: boolean;
8
- readonly _handleExit: () => Promise<void>;
9
- exit(code: number): void;
10
- }
11
- export declare class NodeSystemService implements SystemService {
12
- static readonly _exitHandlers: ExitHandler[];
13
- readonly _exitService: ExitService;
14
- constructor();
15
- Env(): Record<string, string>;
16
- Args(): string[];
17
- OnExit(hdl: VoidFunc): VoidFunc;
18
- Exit(code: number): void;
19
- }
20
- export declare function NodeSysAbstraction(param?: WrapperSysAbstractionParams): SysAbstraction;
21
- //# sourceMappingURL=node_sys_abstraction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"node_sys_abstraction.d.ts","sourceRoot":"","sources":["../../src/node/node_sys_abstraction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAEL,WAAW,EACX,WAAW,EAEX,2BAA2B,EAC5B,MAAM,yBAAyB,CAAC;AAGjC,qBAAa,eAAgB,YAAW,WAAW;;IA0BjD,aAAa,EAAE,WAAW,EAAE,CAAM;IAClC,kBAAkB,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI;IAI7C,OAAO,UAAS;IAChB,QAAQ,CAAC,WAAW,QAAa,QAAQ,IAAI,CAAC,CAkB5C;IAEF,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAWzB;AAED,qBAAa,iBAAkB,YAAW,aAAa;IACrD,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,WAAW,EAAE,CAAM;IAClD,QAAQ,CAAC,YAAY,EAAE,WAAW,CAAyB;;IAK3D,GAAG;IAIH,IAAI;IAIJ,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ;IAW/B,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAGzB;AAGD,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,2BAA2B,GAAG,cAAc,CAQtF"}