suanpan_node_sdk 2.2.4 → 2.2.5

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 (123) hide show
  1. package/dist/api/index.d.ts +10 -10
  2. package/dist/api/index.js +56 -52
  3. package/dist/api/index.js.map +1 -1
  4. package/dist/core/common/constant.d.ts +6 -6
  5. package/dist/core/common/constant.js +50 -50
  6. package/dist/core/common/exec.d.ts +1 -1
  7. package/dist/core/common/exec.js +53 -53
  8. package/dist/core/common/log.d.ts +3 -3
  9. package/dist/core/common/log.js +15 -15
  10. package/dist/core/event/index.d.ts +6 -6
  11. package/dist/core/event/index.js +10 -10
  12. package/dist/core/logkit/index.d.ts +33 -33
  13. package/dist/core/logkit/index.js +125 -125
  14. package/dist/core/logkit/index.js.map +1 -1
  15. package/dist/core/message/channel.d.ts +7 -7
  16. package/dist/core/message/channel.js +2 -2
  17. package/dist/core/message/channelFactory.d.ts +4 -4
  18. package/dist/core/message/channelFactory.js +10 -10
  19. package/dist/core/message/index.d.ts +6 -6
  20. package/dist/core/message/index.js +22 -18
  21. package/dist/core/message/index.js.map +1 -1
  22. package/dist/core/message/message.d.ts +19 -19
  23. package/dist/core/message/message.js +59 -59
  24. package/dist/core/message/message.js.map +1 -1
  25. package/dist/core/message/messageBuilder.d.ts +12 -12
  26. package/dist/core/message/messageBuilder.js +50 -50
  27. package/dist/core/message/messageBuilder.js.map +1 -1
  28. package/dist/core/message/messageChain.d.ts +9 -9
  29. package/dist/core/message/messageChain.js +29 -29
  30. package/dist/core/message/messageListener.d.ts +4 -4
  31. package/dist/core/message/messageListener.js +11 -11
  32. package/dist/core/message/mq/index.d.ts +9 -9
  33. package/dist/core/message/mq/index.js +50 -50
  34. package/dist/core/message/mq/redis.d.ts +12 -12
  35. package/dist/core/message/mq/redis.js +101 -97
  36. package/dist/core/message/mq/redis.js.map +1 -1
  37. package/dist/core/parameter/commandArgs.d.ts +2 -2
  38. package/dist/core/parameter/commandArgs.js +22 -22
  39. package/dist/core/parameter/commandArgs.js.map +1 -1
  40. package/dist/core/parameter/environment.d.ts +86 -86
  41. package/dist/core/parameter/environment.js +103 -103
  42. package/dist/core/parameter/index.d.ts +7 -7
  43. package/dist/core/parameter/index.js +33 -33
  44. package/dist/core/script/script-babel/babel.d.ts +1 -1
  45. package/dist/core/script/script-babel/babel.js +23 -23
  46. package/dist/core/script/script-babel/plugin.d.ts +7 -7
  47. package/dist/core/script/script-babel/plugin.js +16 -16
  48. package/dist/core/script/script-constant.d.ts +36 -36
  49. package/dist/core/script/script-constant.js +70 -70
  50. package/dist/core/script/script-context.d.ts +1 -1
  51. package/dist/core/script/script-context.js +295 -295
  52. package/dist/core/script/script-front.d.ts +1 -1
  53. package/dist/core/script/script-front.js +201 -201
  54. package/dist/core/script/script-insert.d.ts +18 -18
  55. package/dist/core/script/script-insert.js +43 -43
  56. package/dist/core/script/script-manager.d.ts +74 -74
  57. package/dist/core/script/script-manager.js +261 -261
  58. package/dist/core/script/script-storage.d.ts +22 -22
  59. package/dist/core/script/script-storage.js +241 -241
  60. package/dist/core/script/script-support.d.ts +11 -11
  61. package/dist/core/script/script-support.js +140 -140
  62. package/dist/core/script/script-template.d.ts +1 -1
  63. package/dist/core/script/script-template.js +6 -6
  64. package/dist/core/service/port.d.ts +5 -5
  65. package/dist/core/service/port.js +53 -53
  66. package/dist/core/service/port.js.map +1 -1
  67. package/dist/core/storage/index.d.ts +5 -5
  68. package/dist/core/storage/index.js +21 -17
  69. package/dist/core/storage/index.js.map +1 -1
  70. package/dist/core/storage/minioStorage.d.ts +31 -28
  71. package/dist/core/storage/minioStorage.js +224 -209
  72. package/dist/core/storage/minioStorage.js.map +1 -1
  73. package/dist/core/storage/objectStorage.d.ts +23 -19
  74. package/dist/core/storage/objectStorage.js +3 -3
  75. package/dist/core/storage/ossStorage.d.ts +29 -26
  76. package/dist/core/storage/ossStorage.js +215 -193
  77. package/dist/core/storage/ossStorage.js.map +1 -1
  78. package/dist/core/storage/storageFlusher.d.ts +14 -14
  79. package/dist/core/storage/storageFlusher.js +54 -54
  80. package/dist/core/storage/storageLogger.d.ts +16 -16
  81. package/dist/core/storage/storageLogger.js +100 -100
  82. package/dist/core/storage/storageLogger.js.map +1 -1
  83. package/dist/core/storage/storagePath.d.ts +16 -16
  84. package/dist/core/storage/storagePath.js +49 -49
  85. package/dist/core/storage/wrapperStorage.d.ts +17 -17
  86. package/dist/core/storage/wrapperStorage.js +47 -47
  87. package/dist/core/storage/wrapperStorage.js.map +1 -1
  88. package/dist/core/utils/flusher.d.ts +18 -18
  89. package/dist/core/utils/flusher.js +66 -62
  90. package/dist/core/utils/flusher.js.map +1 -1
  91. package/dist/core/utils/http.d.ts +3 -3
  92. package/dist/core/utils/http.js +35 -35
  93. package/dist/core/utils/http.js.map +1 -1
  94. package/dist/core/utils/index.d.ts +57 -56
  95. package/dist/core/utils/index.js +247 -243
  96. package/dist/core/utils/index.js.map +1 -1
  97. package/dist/core/utils/number.d.ts +2 -2
  98. package/dist/core/utils/number.js +19 -19
  99. package/dist/core/utils/retry.d.ts +1 -1
  100. package/dist/core/utils/retry.js +34 -34
  101. package/dist/core/utils/retry.js.map +1 -1
  102. package/dist/core/utils/suanpan.d.ts +21 -20
  103. package/dist/core/utils/suanpan.js +103 -92
  104. package/dist/core/utils/suanpan.js.map +1 -1
  105. package/dist/core/web/app.d.ts +2 -2
  106. package/dist/core/web/app.js +38 -38
  107. package/dist/core/web/app.js.map +1 -1
  108. package/dist/core/web/server.d.ts +3 -3
  109. package/dist/core/web/server.js +64 -60
  110. package/dist/core/web/server.js.map +1 -1
  111. package/dist/main.d.ts +5 -5
  112. package/dist/main.js +28 -24
  113. package/dist/main.js.map +1 -1
  114. package/dist/types/conmonTypes.d.ts +21 -21
  115. package/dist/types/conmonTypes.js +16 -16
  116. package/dist/types/index.d.ts +3 -3
  117. package/dist/types/index.js +19 -15
  118. package/dist/types/index.js.map +1 -1
  119. package/dist/types/storageTypes.d.ts +59 -58
  120. package/dist/types/storageTypes.js +9 -9
  121. package/dist/types/streamTypes.d.ts +21 -21
  122. package/dist/types/streamTypes.js +2 -2
  123. package/package.json +1 -1
@@ -1,63 +1,67 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.BufferFlusher = void 0;
23
- const events = __importStar(require("events"));
24
- class BufferFlusher extends events.EventEmitter {
25
- constructor(options = {}) {
26
- super();
27
- this._buffer = [];
28
- this._maxItems = options.maxItems || 1;
29
- this._flushInterval = options.flushInterval === undefined ? 0 : options.flushInterval;
30
- this.flush();
31
- }
32
- get() { return this._buffer; }
33
- clear() { this._buffer = []; }
34
- stop() { clearTimeout(this._flushTimeoutId); }
35
- add(data) {
36
- if (data) {
37
- this._buffer.push(data);
38
- if (this._buffer.length >= this._maxItems) {
39
- this.flush();
40
- }
41
- }
42
- }
43
- flush() {
44
- this.stop();
45
- // The timer is the only action that would hold the node-process open.
46
- // By unref-ing it, the process will exit prior to the timeout callback execution
47
- this._flushTimeoutId = setTimeout(() => this.flush(), this._flushInterval).unref();
48
- if (!this._buffer.length) {
49
- return;
50
- }
51
- try {
52
- this.emit('flush', this._buffer);
53
- }
54
- catch (err) {
55
- // 当事件被触发时,如果没有与该事件绑定的函数的话,该事件会被静默忽略掉
56
- // 但是如果事件的名称是 error 的话,没有与此相关的事件处理的话,程序就会 crash 退出
57
- this.emit('error', err);
58
- }
59
- this._buffer = [];
60
- }
61
- }
62
- exports.BufferFlusher = BufferFlusher;
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BufferFlusher = void 0;
27
+ const events = __importStar(require("events"));
28
+ class BufferFlusher extends events.EventEmitter {
29
+ constructor(options = {}) {
30
+ super();
31
+ this._buffer = [];
32
+ this._maxItems = options.maxItems || 1;
33
+ this._flushInterval = options.flushInterval === undefined ? 0 : options.flushInterval;
34
+ this.flush();
35
+ }
36
+ get() { return this._buffer; }
37
+ clear() { this._buffer = []; }
38
+ stop() { clearTimeout(this._flushTimeoutId); }
39
+ add(data) {
40
+ if (data) {
41
+ this._buffer.push(data);
42
+ if (this._buffer.length >= this._maxItems) {
43
+ this.flush();
44
+ }
45
+ }
46
+ }
47
+ flush() {
48
+ this.stop();
49
+ // The timer is the only action that would hold the node-process open.
50
+ // By unref-ing it, the process will exit prior to the timeout callback execution
51
+ this._flushTimeoutId = setTimeout(() => this.flush(), this._flushInterval).unref();
52
+ if (!this._buffer.length) {
53
+ return;
54
+ }
55
+ try {
56
+ this.emit('flush', this._buffer);
57
+ }
58
+ catch (err) {
59
+ // 当事件被触发时,如果没有与该事件绑定的函数的话,该事件会被静默忽略掉
60
+ // 但是如果事件的名称是 error 的话,没有与此相关的事件处理的话,程序就会 crash 退出
61
+ this.emit('error', err);
62
+ }
63
+ this._buffer = [];
64
+ }
65
+ }
66
+ exports.BufferFlusher = BufferFlusher;
63
67
  //# sourceMappingURL=flusher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flusher.js","sourceRoot":"","sources":["../../../src/core/utils/flusher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAMjC,MAAa,aAAc,SAAQ,MAAM,CAAC,YAAY;IAOpD,YAAY,UAAwB,EAAE;QACpC,KAAK,EAAE,CAAC;QANF,YAAO,GAAa,EAAE,CAAC;QAO7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QACtF,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,GAAG,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9B,KAAK,KAAK,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9B,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAE9C,GAAG,CAAC,IAAY;QACd,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE;gBACzC,IAAI,CAAC,KAAK,EAAE,CAAC;aACd;SACF;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,uEAAuE;QACvE,iFAAiF;QACjF,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC;QAEnF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAAE,OAAO;SAAE;QAErC,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SAClC;QAAC,OAAO,GAAG,EAAE;YACZ,qCAAqC;YACrC,kDAAkD;YAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SACzB;QAED,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;CACF;AA7CD,sCA6CC"}
1
+ {"version":3,"file":"flusher.js","sourceRoot":"","sources":["../../../src/core/utils/flusher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAMjC,MAAa,aAAc,SAAQ,MAAM,CAAC,YAAY;IAOpD,YAAY,UAAwB,EAAE;QACpC,KAAK,EAAE,CAAC;QANF,YAAO,GAAa,EAAE,CAAC;QAO7B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QACtF,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IAED,GAAG,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9B,KAAK,KAAK,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC;IAC9B,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAE9C,GAAG,CAAC,IAAY;QACd,IAAI,IAAI,EAAE;YACR,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE;gBACzC,IAAI,CAAC,KAAK,EAAE,CAAC;aACd;SACF;IACH,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,uEAAuE;QACvE,iFAAiF;QACjF,IAAI,CAAC,eAAe,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC;QAEnF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAAE,OAAO;SAAE;QAErC,IAAI;YACF,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;SAClC;QAAC,OAAO,GAAG,EAAE;YACZ,qCAAqC;YACrC,kDAAkD;YAClD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SACzB;QAED,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACpB,CAAC;CACF;AA7CD,sCA6CC"}
@@ -1,3 +1,3 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- export declare type RequestConfig = AxiosRequestConfig;
3
- export declare function httpRequest<T>(options: RequestConfig): Promise<T>;
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export type RequestConfig = AxiosRequestConfig;
3
+ export declare function httpRequest<T>(options: RequestConfig): Promise<T>;
@@ -1,36 +1,36 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.httpRequest = void 0;
16
- const log_1 = __importDefault(require("../common/log"));
17
- const axios_1 = __importDefault(require("axios"));
18
- const utils_1 = require("../utils");
19
- function httpRequest(options) {
20
- return __awaiter(this, void 0, void 0, function* () {
21
- let res;
22
- yield utils_1.promiseRetry((retry, times) => __awaiter(this, void 0, void 0, function* () {
23
- try {
24
- res = yield axios_1.default.request(options);
25
- }
26
- catch (ex) {
27
- log_1.default.error('http request error is : \n%O', ex);
28
- log_1.default.info(`retry ${times} times`);
29
- retry(ex);
30
- }
31
- }));
32
- return res.data;
33
- });
34
- }
35
- exports.httpRequest = httpRequest;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.httpRequest = void 0;
16
+ const log_1 = __importDefault(require("../common/log"));
17
+ const axios_1 = __importDefault(require("axios"));
18
+ const utils_1 = require("../utils");
19
+ function httpRequest(options) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ let res;
22
+ yield (0, utils_1.promiseRetry)((retry, times) => __awaiter(this, void 0, void 0, function* () {
23
+ try {
24
+ res = yield axios_1.default.request(options);
25
+ }
26
+ catch (ex) {
27
+ log_1.default.error('http request error is : \n%O', ex);
28
+ log_1.default.info(`retry ${times} times`);
29
+ retry(ex);
30
+ }
31
+ }));
32
+ return res.data;
33
+ });
34
+ }
35
+ exports.httpRequest = httpRequest;
36
36
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/core/utils/http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAmC;AACnC,kDAAiE;AACjE,oCAAwC;AAIxC,SAAsB,WAAW,CAAI,OAAsB;;QACzD,IAAI,GAAsB,CAAC;QAC3B,MAAM,oBAAY,CAAC,CAAO,KAAK,EAAE,KAAa,EAAE,EAAE;YAChD,IAAI;gBACF,GAAG,GAAG,MAAM,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACpC;YAAC,OAAO,EAAE,EAAE;gBACX,aAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;gBACjD,aAAM,CAAC,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;gBACpC,KAAK,CAAC,EAAE,CAAC,CAAC;aACX;QACH,CAAC,CAAA,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;CAAA;AAZD,kCAYC"}
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/core/utils/http.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wDAAmC;AACnC,kDAAiE;AACjE,oCAAwC;AAIxC,SAAsB,WAAW,CAAI,OAAsB;;QACzD,IAAI,GAAsB,CAAC;QAC3B,MAAM,IAAA,oBAAY,EAAC,CAAO,KAAK,EAAE,KAAa,EAAE,EAAE;YAChD,IAAI;gBACF,GAAG,GAAG,MAAM,eAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;aACpC;YAAC,OAAO,EAAE,EAAE;gBACX,aAAM,CAAC,KAAK,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;gBACjD,aAAM,CAAC,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC;gBACpC,KAAK,CAAC,EAAE,CAAC,CAAC;aACX;QACH,CAAC,CAAA,CAAC,CAAC;QACH,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;CAAA;AAZD,kCAYC"}
@@ -1,56 +1,57 @@
1
- /// <reference types="node" />
2
- export * from './flusher';
3
- export * from './number';
4
- export * from './retry';
5
- import { Readable as ReadableStream, Stream } from 'stream';
6
- export declare function generateUUID(): string;
7
- export declare function getConfig(setting: any): any;
8
- export declare function tryJSONParse(text: string, fallback?: any): any;
9
- export declare function isTrue(value: unknown): boolean;
10
- export declare function isDesktop(): boolean;
11
- export declare const isUseMaster: () => boolean;
12
- export declare function isDesktopMaster(): boolean;
13
- export declare function stringifyIfNecessary(data: any): any;
14
- export declare function pathEndWith(csvFilePath: any, fileSuffix: any): boolean;
15
- export declare function readableToString(readable: ReadableStream): Promise<unknown>;
16
- export declare function leftMerge(leftObj?: {}, rightObj?: {}): {};
17
- /**
18
- * insert a string at a specific index
19
- *
20
- * @param leftInsert and @param replace cannot be true at the same time
21
- *
22
- * by default, @param insertStr will be inserted between index and index + 1,
23
- * you can set @param leftInsert: true to insert @param insertStr between index-1 and index
24
- *
25
- * @param {*} originString
26
- * @param {*} index
27
- * @param {*} insertStr
28
- */
29
- export declare function insertbyIndex(originString: string, { index, insertStr, leftInsert, replace }: {
30
- index: any;
31
- insertStr: any;
32
- leftInsert?: boolean | undefined;
33
- replace?: boolean | undefined;
34
- }): string;
35
- /**
36
- * find the nth occurrence of the specified character
37
- * @param {*} str
38
- * @param {*} char
39
- * @param {*} num
40
- */
41
- export declare function indexOfNthCharacters(str: string, char: any, num: any): number;
42
- /**
43
- * find the nth occurrence of the specified character
44
- * @param {*} str
45
- * @param {*} char
46
- * @param {*} num
47
- */
48
- export declare function lastIndexOfNthCharacters(str: string, char: any, num: any): number;
49
- export declare function signatureV1(secret?: string, data?: string): string;
50
- export declare function fileExists(path: any): boolean;
51
- export declare function writeBufToFile(dstPath: any, buf: any): Promise<unknown>;
52
- export declare function sleep(ms: number): Promise<unknown>;
53
- export declare function convertStreamToBuffer(stream: Stream): Promise<Buffer>;
54
- declare type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'latin1' | 'binary' | 'hex';
55
- export declare function convertStreamToString(stream: Stream, encoding?: BufferEncoding): Promise<string>;
56
- export declare function convertBufferToStream(buffer: Buffer): Stream;
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ export * from './flusher';
4
+ export * from './number';
5
+ export * from './retry';
6
+ import { Readable as ReadableStream, Stream } from 'stream';
7
+ export declare function generateUUID(): string;
8
+ export declare function getConfig(setting: any): any;
9
+ export declare function tryJSONParse(text: string, fallback?: any): any;
10
+ export declare function isTrue(value: unknown): boolean;
11
+ export declare function isDesktop(): boolean;
12
+ export declare const isUseMaster: () => boolean;
13
+ export declare function isDesktopMaster(): boolean;
14
+ export declare function stringifyIfNecessary(data: any): any;
15
+ export declare function pathEndWith(csvFilePath: any, fileSuffix: any): boolean;
16
+ export declare function readableToString(readable: ReadableStream): Promise<unknown>;
17
+ export declare function leftMerge(leftObj?: {}, rightObj?: {}): {};
18
+ /**
19
+ * insert a string at a specific index
20
+ *
21
+ * @param leftInsert and @param replace cannot be true at the same time
22
+ *
23
+ * by default, @param insertStr will be inserted between index and index + 1,
24
+ * you can set @param leftInsert: true to insert @param insertStr between index-1 and index
25
+ *
26
+ * @param {*} originString
27
+ * @param {*} index
28
+ * @param {*} insertStr
29
+ */
30
+ export declare function insertbyIndex(originString: string, { index, insertStr, leftInsert, replace }: {
31
+ index: any;
32
+ insertStr: any;
33
+ leftInsert?: boolean | undefined;
34
+ replace?: boolean | undefined;
35
+ }): string;
36
+ /**
37
+ * find the nth occurrence of the specified character
38
+ * @param {*} str
39
+ * @param {*} char
40
+ * @param {*} num
41
+ */
42
+ export declare function indexOfNthCharacters(str: string, char: any, num: any): number;
43
+ /**
44
+ * find the nth occurrence of the specified character
45
+ * @param {*} str
46
+ * @param {*} char
47
+ * @param {*} num
48
+ */
49
+ export declare function lastIndexOfNthCharacters(str: string, char: any, num: any): number;
50
+ export declare function signatureV1(secret?: string, data?: string): string;
51
+ export declare function fileExists(path: any): boolean;
52
+ export declare function writeBufToFile(dstPath: any, buf: any): Promise<unknown>;
53
+ export declare function sleep(ms: number): Promise<unknown>;
54
+ export declare function convertStreamToBuffer(stream: Stream): Promise<Buffer>;
55
+ type BufferEncoding = 'ascii' | 'utf8' | 'utf-8' | 'utf16le' | 'ucs2' | 'ucs-2' | 'base64' | 'latin1' | 'binary' | 'hex';
56
+ export declare function convertStreamToString(stream: Stream, encoding?: BufferEncoding): Promise<string>;
57
+ export declare function convertBufferToStream(buffer: Buffer): Stream;