@aidc-toolkit/app-extension 1.0.23-beta → 1.0.24-beta
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/index.cjs +3414 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1747 -0
- package/dist/index.d.ts +1747 -26
- package/dist/index.js +3379 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -10
- package/src/app-extension.ts +3 -10
- package/src/app-utility-proxy.ts +5 -4
- package/src/descriptor.ts +12 -8
- package/src/generator/descriptor.ts +1 -1
- package/src/generator/generator.ts +4 -4
- package/src/generator/index.ts +2 -2
- package/src/generator/locale-resources-generator.ts +14 -10
- package/src/gs1/character-set-proxy.ts +5 -5
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/identifier-proxy.ts +9 -8
- package/src/gs1/index.ts +3 -3
- package/src/index.ts +9 -9
- package/src/lib-proxy.ts +3 -3
- package/src/locale/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- package/{dist/types.d.ts → src/type.ts} +10 -38
- package/src/utility/character-set-descriptor.ts +1 -1
- package/src/utility/character-set-proxy.ts +9 -8
- package/src/utility/index.ts +3 -3
- package/src/utility/reg-exp-proxy.ts +5 -4
- package/src/utility/string-descriptor.ts +1 -1
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-descriptor.ts +1 -1
- package/src/utility/transformer-proxy.ts +5 -4
- package/tsup.config.ts +3 -0
- package/dist/app-extension.d.ts +0 -169
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -148
- package/dist/app-extension.js.map +0 -1
- package/dist/app-utility-proxy.d.ts +0 -66
- package/dist/app-utility-proxy.d.ts.map +0 -1
- package/dist/app-utility-proxy.js +0 -233
- package/dist/app-utility-proxy.js.map +0 -1
- package/dist/descriptor.d.ts +0 -172
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -174
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/descriptor.d.ts +0 -107
- package/dist/generator/descriptor.d.ts.map +0 -1
- package/dist/generator/descriptor.js +0 -2
- package/dist/generator/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -120
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -213
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts +0 -3
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js +0 -2
- package/dist/generator/index.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -10
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -47
- package/dist/gs1/character-set-proxy.js.map +0 -1
- package/dist/gs1/check-proxy.d.ts +0 -11
- package/dist/gs1/check-proxy.d.ts.map +0 -1
- package/dist/gs1/check-proxy.js +0 -120
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/identifier-proxy.d.ts +0 -136
- package/dist/gs1/identifier-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-proxy.js +0 -782
- package/dist/gs1/identifier-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts +0 -4
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js +0 -4
- package/dist/gs1/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib-proxy.d.ts +0 -135
- package/dist/lib-proxy.d.ts.map +0 -1
- package/dist/lib-proxy.js +0 -235
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -617
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -616
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -617
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -616
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -39
- package/dist/locale/i18n.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -13
- package/dist/types.js.map +0 -1
- package/dist/utility/character-set-descriptor.d.ts +0 -6
- package/dist/utility/character-set-descriptor.d.ts.map +0 -1
- package/dist/utility/character-set-descriptor.js +0 -28
- package/dist/utility/character-set-descriptor.js.map +0 -1
- package/dist/utility/character-set-proxy.d.ts +0 -26
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -167
- package/dist/utility/character-set-proxy.js.map +0 -1
- package/dist/utility/index.d.ts +0 -4
- package/dist/utility/index.d.ts.map +0 -1
- package/dist/utility/index.js +0 -4
- package/dist/utility/index.js.map +0 -1
- package/dist/utility/reg-exp-proxy.d.ts +0 -7
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -61
- package/dist/utility/reg-exp-proxy.js.map +0 -1
- package/dist/utility/string-descriptor.d.ts +0 -4
- package/dist/utility/string-descriptor.d.ts.map +0 -1
- package/dist/utility/string-descriptor.js +0 -12
- package/dist/utility/string-descriptor.js.map +0 -1
- package/dist/utility/string-proxy.d.ts +0 -8
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -12
- package/dist/utility/string-proxy.js.map +0 -1
- package/dist/utility/transformer-descriptor.d.ts +0 -6
- package/dist/utility/transformer-descriptor.d.ts.map +0 -1
- package/dist/utility/transformer-descriptor.js +0 -24
- package/dist/utility/transformer-descriptor.js.map +0 -1
- package/dist/utility/transformer-proxy.d.ts +0 -8
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -74
- package/dist/utility/transformer-proxy.js.map +0 -1
- package/src/generator/logger.ts +0 -45
- package/src/types.ts +0 -144
package/src/generator/logger.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Logger } from "tslog";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 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
|
-
} as const;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Log level.
|
|
18
|
-
*/
|
|
19
|
-
export type LogLevel = typeof LogLevels[keyof typeof LogLevels];
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Logger with a default minimum level of Info.
|
|
23
|
-
*/
|
|
24
|
-
export const logger = new Logger({
|
|
25
|
-
minLevel: LogLevels.Info
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Set the log level.
|
|
30
|
-
*
|
|
31
|
-
* @param logLevel
|
|
32
|
-
* Log level as enumeration value or string.
|
|
33
|
-
*/
|
|
34
|
-
export function setLogLevel(logLevel: string | number): void {
|
|
35
|
-
if (typeof logLevel === "string") {
|
|
36
|
-
if (logLevel in LogLevels) {
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- String exists as a key.
|
|
38
|
-
logger.settings.minLevel = LogLevels[logLevel as keyof typeof LogLevels];
|
|
39
|
-
} else {
|
|
40
|
-
logger.error(`Unknown log level ${logLevel}`);
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
logger.settings.minLevel = logLevel;
|
|
44
|
-
}
|
|
45
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type that error type is expected to extend. If the application framework reports errors through the throw/catch
|
|
3
|
-
* mechanism, the error type is expected to extend {@link Error}. Otherwise, it may extend any object type.
|
|
4
|
-
*
|
|
5
|
-
* @template ThrowError
|
|
6
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
7
|
-
*/
|
|
8
|
-
export type ErrorExtends<ThrowError extends boolean> = ThrowError extends true ? Error : object;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Sheet.
|
|
12
|
-
*/
|
|
13
|
-
export interface Sheet {
|
|
14
|
-
/**
|
|
15
|
-
* Sheet name.
|
|
16
|
-
*/
|
|
17
|
-
readonly name: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Single cell address.
|
|
22
|
-
*/
|
|
23
|
-
export interface Address {
|
|
24
|
-
/**
|
|
25
|
-
* Zero-indexed row.
|
|
26
|
-
*/
|
|
27
|
-
readonly rowIndex: number;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Zero-indexed column.
|
|
31
|
-
*/
|
|
32
|
-
readonly columnIndex: number;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Sheet address.
|
|
37
|
-
*/
|
|
38
|
-
export interface SheetAddress extends Sheet, Address {
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Range of cells.
|
|
43
|
-
*/
|
|
44
|
-
export interface Range {
|
|
45
|
-
/**
|
|
46
|
-
* Start address, inclusive.
|
|
47
|
-
*/
|
|
48
|
-
readonly startAddress: Address;
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* End address, exclusive.
|
|
52
|
-
*/
|
|
53
|
-
readonly endAddress: Address;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Sheet range.
|
|
58
|
-
*/
|
|
59
|
-
export interface SheetRange extends Sheet, Range {
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Matrix type; shorthand for defining a two-dimensional matrix (array of array) of a type.
|
|
64
|
-
*
|
|
65
|
-
* @template T
|
|
66
|
-
* Type.
|
|
67
|
-
*/
|
|
68
|
-
export type Matrix<T> = T[][];
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Function result, possibly including an error result. If the application framework reports errors through the return
|
|
72
|
-
* value, the result is the union of the result type and the error type; otherwise, it's just the result type.
|
|
73
|
-
*
|
|
74
|
-
* @template TResult
|
|
75
|
-
* Result type.
|
|
76
|
-
*
|
|
77
|
-
* @template ThrowError
|
|
78
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
79
|
-
*
|
|
80
|
-
* @template TError
|
|
81
|
-
* Error type.
|
|
82
|
-
*/
|
|
83
|
-
export type ResultError<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = ThrowError extends false ? TResult | TError : TResult;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Function result as matrix, possibly including an error result in each element. If the application framework reports
|
|
87
|
-
* errors through the return value, the individual element result is the union of the result type and the error type;
|
|
88
|
-
* otherwise, it's just the result type.
|
|
89
|
-
*
|
|
90
|
-
* @template TResult
|
|
91
|
-
* Result type.
|
|
92
|
-
*
|
|
93
|
-
* @template ThrowError
|
|
94
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
95
|
-
*
|
|
96
|
-
* @template TError
|
|
97
|
-
* Error type.
|
|
98
|
-
*/
|
|
99
|
-
export type MatrixResultError<TResult, ThrowError extends boolean, TError extends ErrorExtends<ThrowError>> = Matrix<ResultError<TResult, ThrowError, TError>>;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Typed function, applicable to any function, stricter than {@link Function}.
|
|
103
|
-
*/
|
|
104
|
-
export type TypedFunction<TMethod extends (...args: Parameters<TMethod>) => ReturnType<TMethod>> = (...args: Parameters<TMethod>) => ReturnType<TMethod>;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Typed synchronous function, applicable to any function that doesn't return a Promise.
|
|
108
|
-
*/
|
|
109
|
-
export type TypedSyncFunction<TMethod extends TypedFunction<TMethod>> = [ReturnType<TMethod>] extends [PromiseLike<unknown>] ? never : TypedFunction<TMethod>;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Determine the fundamental promised type. This is stricter than `Awaited\<Type\>` in that it requires a Promise.
|
|
113
|
-
*/
|
|
114
|
-
type PromisedType<T> = [T] extends [PromiseLike<infer TPromised>] ? TPromised : never;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Typed asynchronous function, applicable to any function that returns a Promise.
|
|
118
|
-
*/
|
|
119
|
-
export type TypedAsyncFunction<TMethod extends (...args: Parameters<TMethod>) => PromiseLike<PromisedType<ReturnType<TMethod>>>> = (...args: Parameters<TMethod>) => Promise<PromisedType<ReturnType<TMethod>>>;
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Nullishable type. Application extension may pass `null` or `undefined` to missing parameters.
|
|
123
|
-
*/
|
|
124
|
-
export type Nullishable<T> = T | null | undefined;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* Non-nullishable type. If T is an object type, it is spread and attributes within it are made non-nullishable.
|
|
128
|
-
*/
|
|
129
|
-
export type NonNullishable<T> = T extends object ? {
|
|
130
|
-
[P in keyof T]-?: NonNullishable<T[P]>
|
|
131
|
-
} : NonNullable<T>;
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* Determine if argument is nullish. Application extension may pass `null` or `undefined` to missing parameters.
|
|
135
|
-
*
|
|
136
|
-
* @param argument
|
|
137
|
-
* Argument.
|
|
138
|
-
*
|
|
139
|
-
* @returns
|
|
140
|
-
* True if argument is undefined or null.
|
|
141
|
-
*/
|
|
142
|
-
export function isNullish<T>(argument: T | null | undefined): argument is null | undefined {
|
|
143
|
-
return argument === null || argument === undefined;
|
|
144
|
-
}
|