@aidc-toolkit/core 1.0.40-beta → 1.0.41
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/dist/browser-app-data-storage-G62WSQ5Z.js +1 -0
- package/dist/chunk-FIUBVWNN.js +1 -0
- package/dist/file-app-data-storage-Y5AB6YOB.js +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +761 -0
- package/dist/index.d.ts +761 -29
- package/dist/index.js +2 -11
- package/package.json +4 -4
- package/tsconfig-src.json +7 -1
- package/tsconfig-src.tsbuildinfo +1 -0
- package/tsconfig-tsup.json +7 -0
- package/dist/app-data-storage.d.ts +0 -118
- package/dist/app-data-storage.d.ts.map +0 -1
- package/dist/app-data-storage.js +0 -117
- package/dist/app-data-storage.js.map +0 -1
- package/dist/app-data.d.ts +0 -26
- package/dist/app-data.d.ts.map +0 -1
- package/dist/app-data.js +0 -79
- package/dist/app-data.js.map +0 -1
- package/dist/browser-app-data-storage.d.ts +0 -26
- package/dist/browser-app-data-storage.d.ts.map +0 -1
- package/dist/browser-app-data-storage.js +0 -34
- package/dist/browser-app-data-storage.js.map +0 -1
- package/dist/cache.d.ts +0 -58
- package/dist/cache.d.ts.map +0 -1
- package/dist/cache.js +0 -12
- package/dist/cache.js.map +0 -1
- package/dist/file-app-data-storage.d.ts +0 -26
- package/dist/file-app-data-storage.d.ts.map +0 -1
- package/dist/file-app-data-storage.js +0 -40
- package/dist/file-app-data-storage.js.map +0 -1
- package/dist/hyperlink.d.ts +0 -18
- package/dist/hyperlink.d.ts.map +0 -1
- package/dist/hyperlink.js +0 -2
- package/dist/hyperlink.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/local-app-data-storage.d.ts +0 -8
- package/dist/local-app-data-storage.d.ts.map +0 -1
- package/dist/local-app-data-storage.js +0 -11
- package/dist/local-app-data-storage.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -10
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -9
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -10
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -9
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -83
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -157
- package/dist/locale/i18n.js.map +0 -1
- package/dist/logger.d.ts +0 -136
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -256
- package/dist/logger.js.map +0 -1
- package/dist/parse-version.d.ts +0 -36
- package/dist/parse-version.d.ts.map +0 -1
- package/dist/parse-version.js +0 -23
- package/dist/parse-version.js.map +0 -1
- package/dist/remote-app-data-storage.d.ts +0 -18
- package/dist/remote-app-data-storage.d.ts.map +0 -1
- package/dist/remote-app-data-storage.js +0 -37
- package/dist/remote-app-data-storage.js.map +0 -1
- package/dist/type-helper.d.ts +0 -115
- package/dist/type-helper.d.ts.map +0 -1
- package/dist/type-helper.js +0 -163
- package/dist/type-helper.js.map +0 -1
- package/dist/type.d.ts +0 -111
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -2
- package/dist/type.js.map +0 -1
- package/dist/website-url.d.ts +0 -29
- package/dist/website-url.d.ts.map +0 -1
- package/dist/website-url.js +0 -60
- package/dist/website-url.js.map +0 -1
package/dist/logger.d.ts
DELETED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
import { type ISettingsParam, Logger } from "tslog";
|
|
2
|
-
/**
|
|
3
|
-
* Log levels.
|
|
4
|
-
*/
|
|
5
|
-
export declare const LogLevels: {
|
|
6
|
-
readonly Silly: 0;
|
|
7
|
-
readonly Trace: 1;
|
|
8
|
-
readonly Debug: 2;
|
|
9
|
-
readonly Info: 3;
|
|
10
|
-
readonly Warn: 4;
|
|
11
|
-
readonly Error: 5;
|
|
12
|
-
readonly Fatal: 6;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Log level key.
|
|
16
|
-
*/
|
|
17
|
-
export type LogLevelKey = keyof typeof LogLevels;
|
|
18
|
-
/**
|
|
19
|
-
* Log level.
|
|
20
|
-
*/
|
|
21
|
-
export type LogLevel = typeof LogLevels[LogLevelKey];
|
|
22
|
-
/**
|
|
23
|
-
* Get the log level enumeration value corresponding to a string or number.
|
|
24
|
-
*
|
|
25
|
-
* @param untypedLogLevel
|
|
26
|
-
* Untyped log level.
|
|
27
|
-
*
|
|
28
|
-
* @returns
|
|
29
|
-
* Typed log level or default `LogLevels.Info` if untyped log level not provided..
|
|
30
|
-
*/
|
|
31
|
-
export declare function logLevelOf(untypedLogLevel?: string | number): LogLevel;
|
|
32
|
-
/**
|
|
33
|
-
* Get a logger with an optional log level. The underlying implementation is
|
|
34
|
-
* [`tslog`](https://tslog.js.org/).
|
|
35
|
-
*
|
|
36
|
-
* @param logLevel
|
|
37
|
-
* Log level as enumeration value or string. Mapped to `minLevel` and sets `hideLogPositionForProduction` to true in
|
|
38
|
-
* settings if at {@linkcode LogLevels.Info} or higher. Default is {@linkcode LogLevels.Info}.
|
|
39
|
-
*
|
|
40
|
-
* @param settings
|
|
41
|
-
* Detailed settings. See [`tslog`](https://tslog.js.org/#/?id=settings) documentation for details. The `minLevel` is
|
|
42
|
-
* ignored in favour of `logLevel` but `hideLogPositionForProduction` will override the default logic.
|
|
43
|
-
*
|
|
44
|
-
* @param logObj
|
|
45
|
-
* Default log object. See [`tslog`](https://tslog.js.org/#/?id=defining-and-accessing-logobj) documentation for
|
|
46
|
-
* details.
|
|
47
|
-
*
|
|
48
|
-
* @returns
|
|
49
|
-
* Logger.
|
|
50
|
-
*
|
|
51
|
-
* @template T
|
|
52
|
-
* Log object type.
|
|
53
|
-
*/
|
|
54
|
-
export declare function getLogger<T extends object = object>(logLevel?: string | number, settings?: ISettingsParam<T>, logObj?: T): Logger<T>;
|
|
55
|
-
/**
|
|
56
|
-
* Get a loggable representation of a value. Values are returned unmodified, except as follows:
|
|
57
|
-
*
|
|
58
|
-
* - Big integers are converted to whole numbers where possible, otherwise as their decimal string representations.
|
|
59
|
-
* - Arrays are limited to a maximum of ten elements. Any array longer than ten elements is replaced with the first four
|
|
60
|
-
* elements, a string of three dots, and the last four elements. This may still create large results for
|
|
61
|
-
* multidimensional arrays.
|
|
62
|
-
* - Errors are converted to objects with `name`, `message`, and `stack` properties.
|
|
63
|
-
* - Symbols are converted to their string representations.
|
|
64
|
-
* - Functions are converted to strings of the form `Function(name)`.
|
|
65
|
-
*
|
|
66
|
-
* @param value
|
|
67
|
-
* Value.
|
|
68
|
-
*
|
|
69
|
-
* @returns
|
|
70
|
-
* Loggable value.
|
|
71
|
-
*/
|
|
72
|
-
export declare function loggableValue(value: unknown): unknown;
|
|
73
|
-
/**
|
|
74
|
-
* Logger transport that stores messages in memory.
|
|
75
|
-
*/
|
|
76
|
-
export declare class MemoryTransport<T extends object> {
|
|
77
|
-
#private;
|
|
78
|
-
/**
|
|
79
|
-
* Constructor.
|
|
80
|
-
*
|
|
81
|
-
* @param logger
|
|
82
|
-
* Logger.
|
|
83
|
-
*
|
|
84
|
-
* @param maximumLength
|
|
85
|
-
* Maximum length of messages array.
|
|
86
|
-
*
|
|
87
|
-
* @param truncateLength
|
|
88
|
-
* Length to which messages array is truncated when maximum is reached. Default is 50% of `maximumLength`, maximum
|
|
89
|
-
* is 80% of `maximumLength`.
|
|
90
|
-
*/
|
|
91
|
-
constructor(logger: Logger<T>, maximumLength: number, truncateLength?: number);
|
|
92
|
-
/**
|
|
93
|
-
* Get the messages.
|
|
94
|
-
*/
|
|
95
|
-
get messages(): string[];
|
|
96
|
-
/**
|
|
97
|
-
* Get the maximum length of messages array.
|
|
98
|
-
*/
|
|
99
|
-
get maximumLength(): number;
|
|
100
|
-
/**
|
|
101
|
-
* Get the length to which messages array is truncated when maximum is reached.
|
|
102
|
-
*/
|
|
103
|
-
get truncateLength(): number;
|
|
104
|
-
/**
|
|
105
|
-
* Add a notification callback. If one already exists under the current name, do nothing.
|
|
106
|
-
*
|
|
107
|
-
* @param name
|
|
108
|
-
* Callback name.
|
|
109
|
-
*
|
|
110
|
-
* @param notificationCallback
|
|
111
|
-
* Callback.
|
|
112
|
-
*
|
|
113
|
-
* @returns
|
|
114
|
-
* True if successfully added.
|
|
115
|
-
*/
|
|
116
|
-
addNotificationCallback(name: string, notificationCallback: (message: string | undefined, messages: readonly string[]) => void): boolean;
|
|
117
|
-
/**
|
|
118
|
-
* Remove a notification callback.
|
|
119
|
-
*
|
|
120
|
-
* @param name
|
|
121
|
-
* Callback name.
|
|
122
|
-
*/
|
|
123
|
-
removeNotificationCallback(name: string): void;
|
|
124
|
-
/**
|
|
125
|
-
* Resize the messages array.
|
|
126
|
-
*
|
|
127
|
-
* @param maximumLength
|
|
128
|
-
* Maximum length of messages array.
|
|
129
|
-
*
|
|
130
|
-
* @param truncateLength
|
|
131
|
-
* Length to which messages array is truncated when maximum is reached. Default is 50% of `maximumLength`, maximum
|
|
132
|
-
* is 80% of `maximumLength`.
|
|
133
|
-
*/
|
|
134
|
-
resize(maximumLength: number, truncateLength?: number): void;
|
|
135
|
-
}
|
|
136
|
-
//# sourceMappingURL=logger.d.ts.map
|
package/dist/logger.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGpD;;GAEG;AACH,eAAO,MAAM,SAAS;;;;;;;;CAQZ,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,SAAS,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,SAAS,CAAC,WAAW,CAAC,CAAC;AAErD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,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
-
* Log levels.
|
|
5
|
-
*/
|
|
6
|
-
export const LogLevels = {
|
|
7
|
-
Silly: 0,
|
|
8
|
-
Trace: 1,
|
|
9
|
-
Debug: 2,
|
|
10
|
-
Info: 3,
|
|
11
|
-
Warn: 4,
|
|
12
|
-
Error: 5,
|
|
13
|
-
Fatal: 6
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Get the log level enumeration value corresponding to a string or number.
|
|
17
|
-
*
|
|
18
|
-
* @param untypedLogLevel
|
|
19
|
-
* Untyped log level.
|
|
20
|
-
*
|
|
21
|
-
* @returns
|
|
22
|
-
* Typed log level or default `LogLevels.Info` if untyped log level not provided..
|
|
23
|
-
*/
|
|
24
|
-
export function logLevelOf(untypedLogLevel) {
|
|
25
|
-
let typedLogLevel;
|
|
26
|
-
if (typeof untypedLogLevel === "string") {
|
|
27
|
-
if (untypedLogLevel in LogLevels) {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- String exists as a key.
|
|
29
|
-
typedLogLevel = LogLevels[untypedLogLevel];
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
throw new RangeError(i18nextCore.t("Logger.unknownLogLevel", {
|
|
33
|
-
logLevel: untypedLogLevel
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
else if (untypedLogLevel !== undefined) {
|
|
38
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Assume that valid log level has been provided.
|
|
39
|
-
if (Object.values(LogLevels).includes(untypedLogLevel)) {
|
|
40
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Valid log level has been provided.
|
|
41
|
-
typedLogLevel = untypedLogLevel;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw new RangeError(i18nextCore.t("Logger.unknownLogLevel", {
|
|
45
|
-
logLevel: untypedLogLevel
|
|
46
|
-
}));
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
typedLogLevel = LogLevels.Info;
|
|
51
|
-
}
|
|
52
|
-
return typedLogLevel;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Get a logger with an optional log level. The underlying implementation is
|
|
56
|
-
* [`tslog`](https://tslog.js.org/).
|
|
57
|
-
*
|
|
58
|
-
* @param logLevel
|
|
59
|
-
* Log level as enumeration value or string. Mapped to `minLevel` and sets `hideLogPositionForProduction` to true in
|
|
60
|
-
* settings if at {@linkcode LogLevels.Info} or higher. Default is {@linkcode LogLevels.Info}.
|
|
61
|
-
*
|
|
62
|
-
* @param settings
|
|
63
|
-
* Detailed settings. See [`tslog`](https://tslog.js.org/#/?id=settings) documentation for details. The `minLevel` is
|
|
64
|
-
* ignored in favour of `logLevel` but `hideLogPositionForProduction` will override the default logic.
|
|
65
|
-
*
|
|
66
|
-
* @param logObj
|
|
67
|
-
* Default log object. See [`tslog`](https://tslog.js.org/#/?id=defining-and-accessing-logobj) documentation for
|
|
68
|
-
* details.
|
|
69
|
-
*
|
|
70
|
-
* @returns
|
|
71
|
-
* Logger.
|
|
72
|
-
*
|
|
73
|
-
* @template T
|
|
74
|
-
* Log object type.
|
|
75
|
-
*/
|
|
76
|
-
export function getLogger(logLevel, settings, logObj) {
|
|
77
|
-
const minLevel = logLevelOf(logLevel);
|
|
78
|
-
return new Logger({
|
|
79
|
-
// Hiding log position for production can be overridden in settings parameter.
|
|
80
|
-
hideLogPositionForProduction: minLevel >= LogLevels.Info,
|
|
81
|
-
...settings ?? {},
|
|
82
|
-
// Minimum log level overrides settings parameter.
|
|
83
|
-
minLevel
|
|
84
|
-
}, logObj);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Get a loggable representation of a value. Values are returned unmodified, except as follows:
|
|
88
|
-
*
|
|
89
|
-
* - Big integers are converted to whole numbers where possible, otherwise as their decimal string representations.
|
|
90
|
-
* - Arrays are limited to a maximum of ten elements. Any array longer than ten elements is replaced with the first four
|
|
91
|
-
* elements, a string of three dots, and the last four elements. This may still create large results for
|
|
92
|
-
* multidimensional arrays.
|
|
93
|
-
* - Errors are converted to objects with `name`, `message`, and `stack` properties.
|
|
94
|
-
* - Symbols are converted to their string representations.
|
|
95
|
-
* - Functions are converted to strings of the form `Function(name)`.
|
|
96
|
-
*
|
|
97
|
-
* @param value
|
|
98
|
-
* Value.
|
|
99
|
-
*
|
|
100
|
-
* @returns
|
|
101
|
-
* Loggable value.
|
|
102
|
-
*/
|
|
103
|
-
export function loggableValue(value) {
|
|
104
|
-
let replacementValue;
|
|
105
|
-
switch (typeof value) {
|
|
106
|
-
case "string":
|
|
107
|
-
case "number":
|
|
108
|
-
case "boolean":
|
|
109
|
-
case "undefined":
|
|
110
|
-
replacementValue = value;
|
|
111
|
-
break;
|
|
112
|
-
case "bigint":
|
|
113
|
-
// Big integers not supported in JSON.
|
|
114
|
-
replacementValue = value >= Number.MIN_SAFE_INTEGER && value <= Number.MAX_SAFE_INTEGER ? Number(value) : value.toString(10);
|
|
115
|
-
break;
|
|
116
|
-
case "object":
|
|
117
|
-
if (value === null) {
|
|
118
|
-
replacementValue = value;
|
|
119
|
-
}
|
|
120
|
-
else if (Array.isArray(value)) {
|
|
121
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Slicing array is necessary to keep log size down.
|
|
122
|
-
replacementValue = (value.length <= 10 ? value : [...value.slice(0, 4), "...", ...value.slice(-4)]).map(entry => loggableValue(entry));
|
|
123
|
-
}
|
|
124
|
-
else if (value instanceof Error) {
|
|
125
|
-
replacementValue = loggableValue({
|
|
126
|
-
name: value.name,
|
|
127
|
-
message: value.message,
|
|
128
|
-
stack: value.stack?.split("\n")
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
// Apply recursively to all properties of the object.
|
|
133
|
-
replacementValue = Object.fromEntries(Object.entries(value).map(([k, v]) => [k, loggableValue(v)]));
|
|
134
|
-
}
|
|
135
|
-
break;
|
|
136
|
-
case "symbol":
|
|
137
|
-
replacementValue = value.toString();
|
|
138
|
-
break;
|
|
139
|
-
case "function":
|
|
140
|
-
replacementValue = `Function(${value.name})`;
|
|
141
|
-
break;
|
|
142
|
-
}
|
|
143
|
-
return replacementValue;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Logger transport that stores messages in memory.
|
|
147
|
-
*/
|
|
148
|
-
export class MemoryTransport {
|
|
149
|
-
/**
|
|
150
|
-
* Notification callbacks map.
|
|
151
|
-
*/
|
|
152
|
-
#notificationCallbacksMap = new Map();
|
|
153
|
-
/**
|
|
154
|
-
* Messages.
|
|
155
|
-
*/
|
|
156
|
-
#messages = [];
|
|
157
|
-
/**
|
|
158
|
-
* Maximum length of messages array.
|
|
159
|
-
*/
|
|
160
|
-
#maximumLength = 0;
|
|
161
|
-
/**
|
|
162
|
-
* Length to which messages array is truncated when maximum is reached.
|
|
163
|
-
*/
|
|
164
|
-
#truncateLength = 0;
|
|
165
|
-
/**
|
|
166
|
-
* Constructor.
|
|
167
|
-
*
|
|
168
|
-
* @param logger
|
|
169
|
-
* Logger.
|
|
170
|
-
*
|
|
171
|
-
* @param maximumLength
|
|
172
|
-
* Maximum length of messages array.
|
|
173
|
-
*
|
|
174
|
-
* @param truncateLength
|
|
175
|
-
* Length to which messages array is truncated when maximum is reached. Default is 50% of `maximumLength`, maximum
|
|
176
|
-
* is 80% of `maximumLength`.
|
|
177
|
-
*/
|
|
178
|
-
constructor(logger, maximumLength, truncateLength) {
|
|
179
|
-
this.resize(maximumLength, truncateLength);
|
|
180
|
-
logger.attachTransport((logObject) => {
|
|
181
|
-
// Truncate logger messages if necessary.
|
|
182
|
-
if (this.#messages.length >= this.#maximumLength) {
|
|
183
|
-
this.#messages.splice(0, this.#maximumLength - this.#truncateLength);
|
|
184
|
-
}
|
|
185
|
-
const message = JSON.stringify(logObject);
|
|
186
|
-
this.#messages.push(message);
|
|
187
|
-
// Notify all registered callbacks.
|
|
188
|
-
for (const notificationCallback of this.#notificationCallbacksMap.values()) {
|
|
189
|
-
notificationCallback(message, this.#messages);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Get the messages.
|
|
195
|
-
*/
|
|
196
|
-
get messages() {
|
|
197
|
-
return this.#messages;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get the maximum length of messages array.
|
|
201
|
-
*/
|
|
202
|
-
get maximumLength() {
|
|
203
|
-
return this.#maximumLength;
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Get the length to which messages array is truncated when maximum is reached.
|
|
207
|
-
*/
|
|
208
|
-
get truncateLength() {
|
|
209
|
-
return this.#truncateLength;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Add a notification callback. If one already exists under the current name, do nothing.
|
|
213
|
-
*
|
|
214
|
-
* @param name
|
|
215
|
-
* Callback name.
|
|
216
|
-
*
|
|
217
|
-
* @param notificationCallback
|
|
218
|
-
* Callback.
|
|
219
|
-
*
|
|
220
|
-
* @returns
|
|
221
|
-
* True if successfully added.
|
|
222
|
-
*/
|
|
223
|
-
addNotificationCallback(name, notificationCallback) {
|
|
224
|
-
const added = !this.#notificationCallbacksMap.has(name);
|
|
225
|
-
if (added) {
|
|
226
|
-
this.#notificationCallbacksMap.set(name, notificationCallback);
|
|
227
|
-
// Notify with existing messages.
|
|
228
|
-
notificationCallback(undefined, this.#messages);
|
|
229
|
-
}
|
|
230
|
-
return added;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Remove a notification callback.
|
|
234
|
-
*
|
|
235
|
-
* @param name
|
|
236
|
-
* Callback name.
|
|
237
|
-
*/
|
|
238
|
-
removeNotificationCallback(name) {
|
|
239
|
-
this.#notificationCallbacksMap.delete(name);
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Resize the messages array.
|
|
243
|
-
*
|
|
244
|
-
* @param maximumLength
|
|
245
|
-
* Maximum length of messages array.
|
|
246
|
-
*
|
|
247
|
-
* @param truncateLength
|
|
248
|
-
* Length to which messages array is truncated when maximum is reached. Default is 50% of `maximumLength`, maximum
|
|
249
|
-
* is 80% of `maximumLength`.
|
|
250
|
-
*/
|
|
251
|
-
resize(maximumLength, truncateLength) {
|
|
252
|
-
this.#maximumLength = maximumLength;
|
|
253
|
-
this.#truncateLength = truncateLength !== undefined ? Math.min(truncateLength, Math.floor(maximumLength * 0.8)) : Math.floor(maximumLength / 2);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
//# sourceMappingURL=logger.js.map
|
package/dist/logger.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,MAAM,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACrB,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,KAAK,EAAE,CAAC;CACF,CAAC;AAYX;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CAAC,eAAiC;IACxD,IAAI,aAAuB,CAAC;IAE5B,IAAI,OAAO,eAAe,KAAK,QAAQ,EAAE,CAAC;QACtC,IAAI,eAAe,IAAI,SAAS,EAAE,CAAC;YAC/B,kGAAkG;YAClG,aAAa,GAAG,SAAS,CAAC,eAA8B,CAAC,CAAC;QAC9D,CAAC;aAAM,CAAC;YACJ,MAAM,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,wBAAwB,EAAE;gBACzD,QAAQ,EAAE,eAAe;aAC5B,CAAC,CAAC,CAAC;QACR,CAAC;IACL,CAAC;SAAM,IAAI,eAAe,KAAK,SAAS,EA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AI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,uBAAuB,CAAC,IAAY,EAAE,oBAAwF;QAC1H,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAExD,IAAI,KAAK,EAAE,CAAC;YACR,IAAI,CAAC,yBAAyB,CAAC,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC;YAE/D,iCAAiC;YACjC,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;OAKG;IACH,0BAA0B,CAAC,IAAY;QACnC,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,aAAqB,EAAE,cAAuB;QACjD,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;IACpJ,CAAC;CACJ"}
|
package/dist/parse-version.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parsed version.
|
|
3
|
-
*/
|
|
4
|
-
export interface ParsedVersion {
|
|
5
|
-
/**
|
|
6
|
-
* Major version.
|
|
7
|
-
*/
|
|
8
|
-
readonly majorVersion: number;
|
|
9
|
-
/**
|
|
10
|
-
* Minor version.
|
|
11
|
-
*/
|
|
12
|
-
readonly minorVersion: number;
|
|
13
|
-
/**
|
|
14
|
-
* Patch version.
|
|
15
|
-
*/
|
|
16
|
-
readonly patchVersion: number;
|
|
17
|
-
/**
|
|
18
|
-
* Pre-release identifier.
|
|
19
|
-
*/
|
|
20
|
-
readonly preReleaseIdentifier: string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Date/time included with pre-release identifier.
|
|
23
|
-
*/
|
|
24
|
-
readonly dateTime: string | undefined;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Parse version.
|
|
28
|
-
*
|
|
29
|
-
* @param version
|
|
30
|
-
* Version, typically from package.json.
|
|
31
|
-
*
|
|
32
|
-
* @returns
|
|
33
|
-
* Parsed version.
|
|
34
|
-
*/
|
|
35
|
-
export declare function parseVersion(version: string): ParsedVersion;
|
|
36
|
-
//# sourceMappingURL=parse-version.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-version.d.ts","sourceRoot":"","sources":["../src/parse-version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IAElD;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,CAc3D"}
|
package/dist/parse-version.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Parse version.
|
|
3
|
-
*
|
|
4
|
-
* @param version
|
|
5
|
-
* Version, typically from package.json.
|
|
6
|
-
*
|
|
7
|
-
* @returns
|
|
8
|
-
* Parsed version.
|
|
9
|
-
*/
|
|
10
|
-
export function parseVersion(version) {
|
|
11
|
-
const parsedVersionGroups = /^(?<majorVersion>\d+)\.(?<minorVersion>\d+)\.(?<patchVersion>\d+)(?:-(?<preReleaseIdentifier>alpha|beta)(?:\.(?<dateTime>\d{12}))?)?$/u.exec(version)?.groups;
|
|
12
|
-
if (parsedVersionGroups === undefined) {
|
|
13
|
-
throw new Error(`Invalid package version ${version}`);
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
majorVersion: Number(parsedVersionGroups["majorVersion"]),
|
|
17
|
-
minorVersion: Number(parsedVersionGroups["minorVersion"]),
|
|
18
|
-
patchVersion: Number(parsedVersionGroups["patchVersion"]),
|
|
19
|
-
preReleaseIdentifier: parsedVersionGroups["preReleaseIdentifier"],
|
|
20
|
-
dateTime: parsedVersionGroups["dateTime"]
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=parse-version.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parse-version.js","sourceRoot":"","sources":["../src/parse-version.ts"],"names":[],"mappings":"AA8BA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IACxC,MAAM,mBAAmB,GAAG,wIAAwI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE3L,IAAI,mBAAmB,KAAK,SAAS,EAAE,CAAC;QACpC,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACzD,YAAY,EAAE,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACzD,YAAY,EAAE,MAAM,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACzD,oBAAoB,EAAE,mBAAmB,CAAC,sBAAsB,CAAC;QACjE,QAAQ,EAAE,mBAAmB,CAAC,UAAU,CAAC;KAC5C,CAAC;AACN,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ReadOnlyAppDataStorage } from "./app-data-storage.js";
|
|
2
|
-
/**
|
|
3
|
-
* Remote application data storage using HTTP. The `store()` and `delete()` methods are not supported.
|
|
4
|
-
*/
|
|
5
|
-
export declare class RemoteAppDataStorage extends ReadOnlyAppDataStorage<true> {
|
|
6
|
-
/**
|
|
7
|
-
* Constructor.
|
|
8
|
-
*
|
|
9
|
-
* @param baseURL
|
|
10
|
-
* Base URL. The URL must not end with a slash.
|
|
11
|
-
*/
|
|
12
|
-
constructor(baseURL: string);
|
|
13
|
-
/**
|
|
14
|
-
* @inheritDoc
|
|
15
|
-
*/
|
|
16
|
-
protected doRead(key: string, asBinary: boolean | undefined): Promise<string | Uint8Array | undefined>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=remote-app-data-storage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-app-data-storage.d.ts","sourceRoot":"","sources":["../src/remote-app-data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAG/D;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,sBAAsB,CAAC,IAAI,CAAC;IAClE;;;;;OAKG;gBACS,OAAO,EAAE,MAAM;IAI3B;;OAEG;cACsB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;CAiBxH"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ReadOnlyAppDataStorage } from "./app-data-storage.js";
|
|
2
|
-
import { i18nextCore } from "./locale/i18n.js";
|
|
3
|
-
/**
|
|
4
|
-
* Remote application data storage using HTTP. The `store()` and `delete()` methods are not supported.
|
|
5
|
-
*/
|
|
6
|
-
export class RemoteAppDataStorage extends ReadOnlyAppDataStorage {
|
|
7
|
-
/**
|
|
8
|
-
* Constructor.
|
|
9
|
-
*
|
|
10
|
-
* @param baseURL
|
|
11
|
-
* Base URL. The URL must not end with a slash.
|
|
12
|
-
*/
|
|
13
|
-
constructor(baseURL) {
|
|
14
|
-
super(true, baseURL);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
async doRead(key, asBinary) {
|
|
20
|
-
return fetch(key).then(async (response) => {
|
|
21
|
-
let result;
|
|
22
|
-
if (response.ok) {
|
|
23
|
-
result = asBinary === true ? new Uint8Array(await response.arrayBuffer()) : await response.text();
|
|
24
|
-
}
|
|
25
|
-
else if (response.status === 404) {
|
|
26
|
-
result = undefined;
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
throw new RangeError(i18nextCore.t("RemoteAppDataStorage.httpError", {
|
|
30
|
-
status: response.status
|
|
31
|
-
}));
|
|
32
|
-
}
|
|
33
|
-
return result;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=remote-app-data-storage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remote-app-data-storage.js","sourceRoot":"","sources":["../src/remote-app-data-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,sBAA4B;IAClE;;;;;OAKG;IACH,YAAY,OAAe;QACvB,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACgB,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,QAA6B;QACtE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YACtC,IAAI,MAAuC,CAAC;YAE5C,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACd,MAAM,GAAG,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACtG,CAAC;iBAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACjC,MAAM,GAAG,SAAS,CAAC;YACvB,CAAC;iBAAM,CAAC;gBACJ,MAAM,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,gCAAgC,EAAE;oBACjE,MAAM,EAAE,QAAQ,CAAC,MAAM;iBAC1B,CAAC,CAAC,CAAC;YACR,CAAC;YAED,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/dist/type-helper.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an object with omitted entries.
|
|
3
|
-
*
|
|
4
|
-
* @template T
|
|
5
|
-
* Object type.
|
|
6
|
-
*
|
|
7
|
-
* @template K
|
|
8
|
-
* Object key type.
|
|
9
|
-
*
|
|
10
|
-
* @param o
|
|
11
|
-
* Object.
|
|
12
|
-
*
|
|
13
|
-
* @param keys
|
|
14
|
-
* Keys to omit.
|
|
15
|
-
*
|
|
16
|
-
* @returns
|
|
17
|
-
* Edited object.
|
|
18
|
-
*/
|
|
19
|
-
export declare function omit<T extends object, K extends keyof T>(o: T, ...keys: K[]): Omit<T, K>;
|
|
20
|
-
/**
|
|
21
|
-
* Create an object with picked entries.
|
|
22
|
-
*
|
|
23
|
-
* @template T
|
|
24
|
-
* Object type.
|
|
25
|
-
*
|
|
26
|
-
* @template K
|
|
27
|
-
* Object key type.
|
|
28
|
-
*
|
|
29
|
-
* @param o
|
|
30
|
-
* Object.
|
|
31
|
-
*
|
|
32
|
-
* @param keys
|
|
33
|
-
* Keys to pick.
|
|
34
|
-
*
|
|
35
|
-
* @returns
|
|
36
|
-
* Edited object.
|
|
37
|
-
*/
|
|
38
|
-
export declare function pick<T extends object, K extends keyof T>(o: T, ...keys: K[]): Pick<T, K>;
|
|
39
|
-
/**
|
|
40
|
-
* Create an object from a wide object without entries matching those from a narrow object.
|
|
41
|
-
*
|
|
42
|
-
* @template TWide
|
|
43
|
-
* Wide object type.
|
|
44
|
-
*
|
|
45
|
-
* @template TNarrow
|
|
46
|
-
* Narrow object type.
|
|
47
|
-
*
|
|
48
|
-
* @template K
|
|
49
|
-
* Narrow object key type, subset of wide object key type.
|
|
50
|
-
*
|
|
51
|
-
* @param wide
|
|
52
|
-
* Wide object.
|
|
53
|
-
*
|
|
54
|
-
* @param narrow
|
|
55
|
-
* Narrow object.
|
|
56
|
-
*
|
|
57
|
-
* @returns
|
|
58
|
-
* Edited object.
|
|
59
|
-
*/
|
|
60
|
-
export declare function exclude<TWide extends TNarrow, TNarrow extends object, K extends keyof TNarrow>(wide: TWide, narrow: TNarrow): Omit<TWide, K>;
|
|
61
|
-
/**
|
|
62
|
-
* Create an object from a wide object with entries matching those from a narrow object.
|
|
63
|
-
*
|
|
64
|
-
* @template TWide
|
|
65
|
-
* Wide object type.
|
|
66
|
-
*
|
|
67
|
-
* @template TNarrow
|
|
68
|
-
* Narrow object type.
|
|
69
|
-
*
|
|
70
|
-
* @template K
|
|
71
|
-
* Narrow object key type, subset of wide object key type.
|
|
72
|
-
*
|
|
73
|
-
* @param wide
|
|
74
|
-
* Wide object.
|
|
75
|
-
*
|
|
76
|
-
* @param narrow
|
|
77
|
-
* Narrow object.
|
|
78
|
-
*
|
|
79
|
-
* @returns
|
|
80
|
-
* Edited object.
|
|
81
|
-
*/
|
|
82
|
-
export declare function include<TWide extends TNarrow, TNarrow extends object, K extends keyof TNarrow>(wide: TWide, narrow: TNarrow): Pick<TWide, K>;
|
|
83
|
-
/**
|
|
84
|
-
* Cast a property as a more narrow type.
|
|
85
|
-
*
|
|
86
|
-
* @template T
|
|
87
|
-
* Object type.
|
|
88
|
-
*
|
|
89
|
-
* @template K
|
|
90
|
-
* Object key type.
|
|
91
|
-
*
|
|
92
|
-
* @template TAsType
|
|
93
|
-
* Desired type.
|
|
94
|
-
*
|
|
95
|
-
* @param o
|
|
96
|
-
* Object.
|
|
97
|
-
*
|
|
98
|
-
* @param key
|
|
99
|
-
* Key of property to cast.
|
|
100
|
-
*
|
|
101
|
-
* @returns
|
|
102
|
-
* Single-key object with property cast as desired type.
|
|
103
|
-
*/
|
|
104
|
-
export declare function propertyAs<T extends object, K extends keyof T, TAsType extends T[K]>(o: T, key: K): Readonly<Omit<T, K> extends T ? Partial<Record<K, TAsType>> : Record<K, TAsType>>;
|
|
105
|
-
/**
|
|
106
|
-
* Determine if argument is nullish. Application extension may pass `null` or `undefined` to missing parameters.
|
|
107
|
-
*
|
|
108
|
-
* @param argument
|
|
109
|
-
* Argument.
|
|
110
|
-
*
|
|
111
|
-
* @returns
|
|
112
|
-
* True if argument is undefined or null.
|
|
113
|
-
*/
|
|
114
|
-
export declare function isNullish(argument: unknown): argument is null | undefined;
|
|
115
|
-
//# sourceMappingURL=type-helper.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type-helper.d.ts","sourceRoot":"","sources":["../src/type-helper.ts"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAExF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC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