@imqueue/async-logger 3.0.1 → 3.2.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.
- package/CONTRIBUTING.md +58 -0
- package/CONTRIBUTION-TERMS.md +79 -0
- package/SECURITY.md +41 -0
- package/index.d.ts +50 -2
- package/index.js +51 -20
- package/package.json +14 -4
- package/signatures/version1/cla.json +3 -0
- package/src/Logger.d.ts +96 -31
- package/src/Logger.js +118 -45
- package/src/TransportOptions.d.ts +36 -2
- package/src/TransportOptions.js +22 -2
- package/src/helpers/env.d.ts +31 -8
- package/src/helpers/env.js +60 -19
- package/src/helpers/index.d.ts +3 -3
- package/src/helpers/index.js +3 -19
- package/src/helpers/message.d.ts +9 -3
- package/src/helpers/message.js +12 -9
- package/src/helpers/transport.d.ts +12 -7
- package/src/helpers/transport.js +14 -12
- package/src/index.d.ts +4 -3
- package/src/index.js +4 -19
- package/src/types.d.ts +65 -0
- package/src/types.js +23 -0
package/src/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
1
|
/*!
|
|
18
2
|
* I'm Queue Software Project
|
|
19
3
|
* Copyright (C) 2025 imqueue.com <support@imqueue.com>
|
|
@@ -35,7 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
35
19
|
* purchase a proprietary commercial license. Please contact us at
|
|
36
20
|
* <support@imqueue.com> to get commercial licensing options.
|
|
37
21
|
*/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
22
|
+
export * from './types.js';
|
|
23
|
+
export * from './helpers/index.js';
|
|
24
|
+
export * from './TransportOptions.js';
|
|
25
|
+
export * from './Logger.js';
|
|
41
26
|
//# sourceMappingURL=index.js.map
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* I'm Queue Software Project
|
|
3
|
+
* Copyright (C) 2026 imqueue.com <support@imqueue.com>
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*
|
|
18
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
19
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
20
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Structural copies of the @imqueue/core types this package uses, kept
|
|
24
|
+
* local so the logger carries no runtime dependency on the queue library.
|
|
25
|
+
* The shapes match @imqueue/core exactly, so values typed here remain
|
|
26
|
+
* assignment-compatible with code written against the core interfaces.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Any value that survives `JSON.stringify` unchanged.
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* A structural copy of the type in `@imqueue/core`, declared here so the logger
|
|
33
|
+
* needs no runtime dependency on the queue library. The shapes match exactly, so
|
|
34
|
+
* values remain assignable in both directions.
|
|
35
|
+
*/
|
|
36
|
+
export type AnyJson = boolean | number | string | null | undefined | JsonArray | JsonObject;
|
|
37
|
+
/**
|
|
38
|
+
* A JSON object — string keys, {@link AnyJson} values. This is the type of the
|
|
39
|
+
* logger's default metadata.
|
|
40
|
+
*/
|
|
41
|
+
export interface JsonObject {
|
|
42
|
+
[key: string]: AnyJson;
|
|
43
|
+
}
|
|
44
|
+
/** A JSON array — any number of {@link AnyJson} values. */
|
|
45
|
+
export interface JsonArray extends Array<AnyJson> {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The logger contract shared across `@imqueue` — the four console methods, and
|
|
49
|
+
* nothing else.
|
|
50
|
+
*
|
|
51
|
+
* @remarks
|
|
52
|
+
* Deliberately console-shaped, so `console` itself satisfies it and any
|
|
53
|
+
* `@imqueue` component taking a logger accepts either that or a {@link Logger}
|
|
54
|
+
* with no adapter. Implement it to route the framework's own output elsewhere.
|
|
55
|
+
*/
|
|
56
|
+
export interface ILogger {
|
|
57
|
+
/** Logs at the default level. */
|
|
58
|
+
log(...args: unknown[]): void;
|
|
59
|
+
/** Logs at INFO level. */
|
|
60
|
+
info(...args: unknown[]): void;
|
|
61
|
+
/** Logs at WARN level. */
|
|
62
|
+
warn(...args: unknown[]): void;
|
|
63
|
+
/** Logs at ERROR level. */
|
|
64
|
+
error(...args: unknown[]): void;
|
|
65
|
+
}
|
package/src/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* I'm Queue Software Project
|
|
3
|
+
* Copyright (C) 2026 imqueue.com <support@imqueue.com>
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
* (at your option) any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*
|
|
18
|
+
* If you want to use this code in a closed source (commercial) project, you can
|
|
19
|
+
* purchase a proprietary commercial license. Please contact us at
|
|
20
|
+
* <support@imqueue.com> to get commercial licensing options.
|
|
21
|
+
*/
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|