@aidc-toolkit/app-extension 1.0.54-beta → 1.0.54
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/character-set-proxy-C68be15v.d.cts +473 -0
- package/dist/character-set-proxy-C68be15v.d.ts +473 -0
- package/dist/chunk-OA72V24G.js +1 -0
- package/dist/chunk-TIM4QSVN.js +1 -0
- package/dist/chunk-YGZIM5SX.js +1 -0
- package/dist/{descriptor.d.ts → descriptor-Df-lif4q.d.cts} +13 -13
- package/dist/descriptor-Df-lif4q.d.ts +185 -0
- package/dist/generator/index.cjs +17 -0
- package/dist/generator/index.d.cts +224 -0
- package/dist/generator/index.d.ts +223 -18
- package/dist/generator/index.js +1 -3
- package/dist/gs1/index.cjs +1 -0
- package/dist/gs1/index.d.cts +185 -0
- package/dist/gs1/index.d.ts +185 -11
- package/dist/gs1/index.js +1 -11
- package/dist/index.cjs +17 -0
- package/dist/{locale/en/locale-resources.d.ts → index.d.cts} +98 -2
- package/dist/index.d.ts +847 -22
- package/dist/index.js +1 -7
- package/package.json +5 -5
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/app-extension-options.d.ts +0 -52
- package/dist/app-extension-options.d.ts.map +0 -1
- package/dist/app-extension-options.js +0 -2
- package/dist/app-extension-options.js.map +0 -1
- package/dist/app-extension.d.ts +0 -194
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -141
- package/dist/app-extension.js.map +0 -1
- package/dist/app-helper-proxy.d.ts +0 -57
- package/dist/app-helper-proxy.d.ts.map +0 -1
- package/dist/app-helper-proxy.js +0 -354
- package/dist/app-helper-proxy.js.map +0 -1
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -44
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/functions-generator.d.ts +0 -103
- package/dist/generator/functions-generator.d.ts.map +0 -1
- package/dist/generator/functions-generator.js +0 -179
- package/dist/generator/functions-generator.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -121
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -186
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js.map +0 -1
- package/dist/generator/locale-resources-generator.d.ts +0 -2
- package/dist/generator/locale-resources-generator.d.ts.map +0 -1
- package/dist/generator/locale-resources-generator.js +0 -333
- package/dist/generator/locale-resources-generator.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -12
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -126
- 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 -163
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/gcp-length-proxy.d.ts +0 -11
- package/dist/gs1/gcp-length-proxy.d.ts.map +0 -1
- package/dist/gs1/gcp-length-proxy.js +0 -187
- package/dist/gs1/gcp-length-proxy.js.map +0 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +0 -10
- package/dist/gs1/gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-creator-proxy.js +0 -85
- package/dist/gs1/gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/gtin-descriptor.d.ts +0 -3
- package/dist/gs1/gtin-descriptor.d.ts.map +0 -1
- package/dist/gs1/gtin-descriptor.js +0 -8
- package/dist/gs1/gtin-descriptor.js.map +0 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +0 -26
- package/dist/gs1/gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-validator-proxy.js +0 -256
- package/dist/gs1/gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +0 -30
- package/dist/gs1/identifier-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-creator-proxy.js +0 -318
- package/dist/gs1/identifier-creator-proxy.js.map +0 -1
- package/dist/gs1/identifier-descriptor.d.ts +0 -4
- package/dist/gs1/identifier-descriptor.d.ts.map +0 -1
- package/dist/gs1/identifier-descriptor.js +0 -14
- package/dist/gs1/identifier-descriptor.js.map +0 -1
- package/dist/gs1/identifier-type.d.ts +0 -22
- package/dist/gs1/identifier-type.d.ts.map +0 -1
- package/dist/gs1/identifier-type.js +0 -34
- package/dist/gs1/identifier-type.js.map +0 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +0 -29
- package/dist/gs1/identifier-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-validator-proxy.js +0 -212
- package/dist/gs1/identifier-validator-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +0 -37
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.js +0 -301
- package/dist/gs1/non-gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +0 -36
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.js +0 -302
- package/dist/gs1/non-gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.d.ts +0 -4
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.js +0 -16
- package/dist/gs1/prefix-definition-descriptor.js.map +0 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +0 -8
- package/dist/gs1/prefix-manager-proxy.d.ts.map +0 -1
- package/dist/gs1/prefix-manager-proxy.js +0 -94
- package/dist/gs1/prefix-manager-proxy.js.map +0 -1
- package/dist/gs1/variable-measure-proxy.d.ts +0 -7
- package/dist/gs1/variable-measure-proxy.d.ts.map +0 -1
- package/dist/gs1/variable-measure-proxy.js +0 -114
- package/dist/gs1/variable-measure-proxy.js.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +0 -7
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.js +0 -100
- package/dist/gs1/verified-by-gs1-proxy.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib-proxy.d.ts +0 -121
- package/dist/lib-proxy.d.ts.map +0 -1
- package/dist/lib-proxy.js +0 -258
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -754
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -755
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -754
- 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 -36
- package/dist/locale/i18n.js.map +0 -1
- package/dist/proxy.d.ts +0 -135
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -291
- package/dist/proxy.js.map +0 -1
- package/dist/streaming.d.ts +0 -10
- package/dist/streaming.d.ts.map +0 -1
- package/dist/streaming.js +0 -2
- package/dist/streaming.js.map +0 -1
- package/dist/type.d.ts +0 -72
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -2
- package/dist/type.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 -32
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -278
- 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 -8
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -103
- 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 -7
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -63
- 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 -10
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -111
- package/dist/utility/transformer-proxy.js.map +0 -1
- package/dist/version.d.ts +0 -5
- package/dist/version.d.ts.map +0 -1
- package/dist/version.js +0 -5
- package/dist/version.js.map +0 -1
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { VERSION } from "../version.js";
|
|
4
|
-
import { Generator } from "./generator.js";
|
|
5
|
-
/**
|
|
6
|
-
* Locale resources generator.
|
|
7
|
-
*/
|
|
8
|
-
class LocaleResourcesGenerator extends Generator {
|
|
9
|
-
/**
|
|
10
|
-
* Locale resources import path.
|
|
11
|
-
*/
|
|
12
|
-
static #IMPORT_PATH = "../app-extension/src/locale";
|
|
13
|
-
/**
|
|
14
|
-
* Parameters sequencer.
|
|
15
|
-
*/
|
|
16
|
-
#parametersSequencer = {};
|
|
17
|
-
/**
|
|
18
|
-
* Template parameters locale resources.
|
|
19
|
-
*/
|
|
20
|
-
#templateParametersLocaleResources = {};
|
|
21
|
-
/**
|
|
22
|
-
* Template functions locale resources.
|
|
23
|
-
*/
|
|
24
|
-
#templateFunctionsLocaleResources = {};
|
|
25
|
-
/**
|
|
26
|
-
* Template locale resources.
|
|
27
|
-
*/
|
|
28
|
-
#templateLocaleResources = {
|
|
29
|
-
Parameters: this.#templateParametersLocaleResources,
|
|
30
|
-
Functions: this.#templateFunctionsLocaleResources
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Constructor.
|
|
34
|
-
*/
|
|
35
|
-
constructor() {
|
|
36
|
-
super(VERSION, false);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
initialize() {
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* @inheritDoc
|
|
45
|
-
*/
|
|
46
|
-
createNamespace() {
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
createCategory() {
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
createClassProxy() {
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Save a parameter descriptor in the appropriate spot in the sequence.
|
|
60
|
-
*
|
|
61
|
-
* @param parameterDescriptor
|
|
62
|
-
* Parameter descriptor.
|
|
63
|
-
*
|
|
64
|
-
* @param isUsed
|
|
65
|
-
* True if parameter descriptor is actually used and not just a base.
|
|
66
|
-
*
|
|
67
|
-
* @returns
|
|
68
|
-
* Parameters sequencer entry.
|
|
69
|
-
*/
|
|
70
|
-
#saveParameterSequence(parameterDescriptor, isUsed) {
|
|
71
|
-
let parametersSequencerEntry;
|
|
72
|
-
if (!("extendsDescriptor" in parameterDescriptor)) {
|
|
73
|
-
const parameterName = parameterDescriptor.name;
|
|
74
|
-
// Create entry if it doesn't exist, otherwise pick up where last call left off.
|
|
75
|
-
if (!(parameterName in this.#parametersSequencer)) {
|
|
76
|
-
parametersSequencerEntry = {
|
|
77
|
-
parametersSequencerOrNull: null,
|
|
78
|
-
parameterDescriptor,
|
|
79
|
-
parameterName,
|
|
80
|
-
baseParameterName: parameterName,
|
|
81
|
-
isUsed
|
|
82
|
-
};
|
|
83
|
-
this.#parametersSequencer[parameterName] = parametersSequencerEntry;
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
parametersSequencerEntry = this.#parametersSequencer[parameterName];
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
const baseParametersSequencerEntry = this.#saveParameterSequence(parameterDescriptor.extendsDescriptor, false);
|
|
91
|
-
let parameterName;
|
|
92
|
-
let baseParameterName;
|
|
93
|
-
if (parameterDescriptor.name !== undefined) {
|
|
94
|
-
parameterName = parameterDescriptor.name;
|
|
95
|
-
baseParameterName = baseParametersSequencerEntry.parameterName;
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
parameterName = baseParametersSequencerEntry.parameterName;
|
|
99
|
-
baseParameterName = baseParametersSequencerEntry.baseParameterName;
|
|
100
|
-
}
|
|
101
|
-
if (parameterName !== baseParameterName) {
|
|
102
|
-
// Make sure that base parameters sequencer entry refers to a record type.
|
|
103
|
-
baseParametersSequencerEntry.parametersSequencerOrNull ??= {};
|
|
104
|
-
if (!(parameterName in baseParametersSequencerEntry.parametersSequencerOrNull)) {
|
|
105
|
-
parametersSequencerEntry = {
|
|
106
|
-
parametersSequencerOrNull: null,
|
|
107
|
-
parameterDescriptor,
|
|
108
|
-
parameterName,
|
|
109
|
-
baseParameterName,
|
|
110
|
-
isUsed
|
|
111
|
-
};
|
|
112
|
-
baseParametersSequencerEntry.parametersSequencerOrNull[parameterName] = parametersSequencerEntry;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
parametersSequencerEntry = baseParametersSequencerEntry.parametersSequencerOrNull[parameterName];
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
// If name is the same, which means that parameter descriptor modified type information only.
|
|
120
|
-
parametersSequencerEntry = baseParametersSequencerEntry;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
return parametersSequencerEntry;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* @inheritDoc
|
|
127
|
-
*/
|
|
128
|
-
createMethodProxy(classDescriptor, methodDescriptor) {
|
|
129
|
-
// Hidden functions aren't localized.
|
|
130
|
-
if (methodDescriptor.isHidden !== true) {
|
|
131
|
-
// Add any parameters that are not already known.
|
|
132
|
-
for (const parameterDescriptor of methodDescriptor.parameterDescriptors) {
|
|
133
|
-
this.#saveParameterSequence(parameterDescriptor, true);
|
|
134
|
-
}
|
|
135
|
-
let functionsLocaleResources = this.#templateFunctionsLocaleResources;
|
|
136
|
-
const namespace = classDescriptor.namespace;
|
|
137
|
-
if (namespace !== undefined) {
|
|
138
|
-
if (!(namespace in functionsLocaleResources)) {
|
|
139
|
-
const namespaceFunctionsLocaleResources = {};
|
|
140
|
-
// Add namespace and navigate to it.
|
|
141
|
-
functionsLocaleResources[namespace] = namespaceFunctionsLocaleResources;
|
|
142
|
-
functionsLocaleResources = namespaceFunctionsLocaleResources;
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
// Navigate to namespace.
|
|
146
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Entry is never a string.
|
|
147
|
-
functionsLocaleResources = functionsLocaleResources[namespace];
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
const functionName = methodDescriptor.functionName;
|
|
151
|
-
if (functionName in functionsLocaleResources) {
|
|
152
|
-
throw new Error(`Duplicate function ${functionName}`);
|
|
153
|
-
}
|
|
154
|
-
// Add function.
|
|
155
|
-
functionsLocaleResources[functionName] = {
|
|
156
|
-
name: functionName,
|
|
157
|
-
description: "*** LOCALIZATION REQUIRED ***"
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Merge template locale resources into existing import locale resources.
|
|
163
|
-
*
|
|
164
|
-
* @param mergedLocaleResources
|
|
165
|
-
* Merged locale resources.
|
|
166
|
-
*
|
|
167
|
-
* @param isDefaultLocale
|
|
168
|
-
* If true, locale being merged is the default.
|
|
169
|
-
*
|
|
170
|
-
* @param parentKey
|
|
171
|
-
* Parent key for logging purposes.
|
|
172
|
-
*
|
|
173
|
-
* @param templateLocaleResources
|
|
174
|
-
* Template locale resources.
|
|
175
|
-
*
|
|
176
|
-
* @param importLocaleResources
|
|
177
|
-
* Import locale resources.
|
|
178
|
-
*
|
|
179
|
-
* @param addMissing
|
|
180
|
-
* Add missing if true; applies to locale resources that are not regional.
|
|
181
|
-
*
|
|
182
|
-
* @returns
|
|
183
|
-
* True if any changes.
|
|
184
|
-
*/
|
|
185
|
-
#merge(mergedLocaleResources, isDefaultLocale, parentKey, templateLocaleResources, importLocaleResources, addMissing) {
|
|
186
|
-
let anyChanges = false;
|
|
187
|
-
// Some entries at the root are not part of the generator output.
|
|
188
|
-
const atRoot = parentKey === "";
|
|
189
|
-
if (parentKey.startsWith("Functions.") && "titleCaseName" in importLocaleResources && !("titleCaseName" in templateLocaleResources)) {
|
|
190
|
-
const description = templateLocaleResources["description"];
|
|
191
|
-
const patchTemplateLocaleResources = templateLocaleResources;
|
|
192
|
-
// Patch template locale resources to preserve required position of titleCaseName.
|
|
193
|
-
delete patchTemplateLocaleResources["description"];
|
|
194
|
-
patchTemplateLocaleResources["titleCaseName"] = undefined;
|
|
195
|
-
patchTemplateLocaleResources["description"] = description;
|
|
196
|
-
}
|
|
197
|
-
const patchMergedLocaleResources = mergedLocaleResources;
|
|
198
|
-
// Copy over or delete any import keys that are not in template.
|
|
199
|
-
for (const [key, importValue] of Object.entries(importLocaleResources)) {
|
|
200
|
-
if (!(key in templateLocaleResources)) {
|
|
201
|
-
if (atRoot) {
|
|
202
|
-
patchMergedLocaleResources[key] = importValue;
|
|
203
|
-
}
|
|
204
|
-
else {
|
|
205
|
-
if (isDefaultLocale) {
|
|
206
|
-
this.logger.info(`Deleting ${parentKey}${key}...`);
|
|
207
|
-
}
|
|
208
|
-
anyChanges = true;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
for (const [key, templateValue] of Object.entries(templateLocaleResources)) {
|
|
213
|
-
if (!(key in importLocaleResources)) {
|
|
214
|
-
if (addMissing) {
|
|
215
|
-
if (isDefaultLocale) {
|
|
216
|
-
this.logger.info(`Adding ${parentKey}${key}...`);
|
|
217
|
-
}
|
|
218
|
-
patchMergedLocaleResources[key] = templateValue;
|
|
219
|
-
anyChanges = true;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
const importValue = importLocaleResources[key];
|
|
224
|
-
if (typeof templateValue === "object" && typeof importValue === "object") {
|
|
225
|
-
patchMergedLocaleResources[key] = {};
|
|
226
|
-
if (this.#merge(patchMergedLocaleResources[key], isDefaultLocale, `${parentKey}${key}.`, templateValue, importValue, addMissing)) {
|
|
227
|
-
anyChanges = true;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
else if ((typeof templateValue === "string" || typeof templateValue === "undefined") && (typeof importValue === "string" || typeof importValue === "undefined" || typeof importValue === "object")) {
|
|
231
|
-
patchMergedLocaleResources[key] = importValue;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
throw new Error(`Mismatched types at ${parentKey}${key}`);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return anyChanges;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Build parameters locale resources by going through parameters sequencer.
|
|
242
|
-
*
|
|
243
|
-
* @param parametersSequencer
|
|
244
|
-
* Parameters sequencer.
|
|
245
|
-
*/
|
|
246
|
-
#buildParametersLocaleResources(parametersSequencer) {
|
|
247
|
-
const entries = Object.entries(parametersSequencer);
|
|
248
|
-
// Sort the entries as defined by the descriptors.
|
|
249
|
-
entries.sort((entry1, entry2) => {
|
|
250
|
-
let result;
|
|
251
|
-
const parameterDescriptor1 = entry1[1].parameterDescriptor;
|
|
252
|
-
const parameterDescriptor2 = entry2[1].parameterDescriptor;
|
|
253
|
-
if ("sortOrder" in parameterDescriptor1) {
|
|
254
|
-
if ("sortOrder" in parameterDescriptor2) {
|
|
255
|
-
result = parameterDescriptor1.sortOrder - parameterDescriptor2.sortOrder;
|
|
256
|
-
}
|
|
257
|
-
else {
|
|
258
|
-
// Parameter descriptors with undefined sort order to go the end.
|
|
259
|
-
result = -parameterDescriptor1.sortOrder;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
// eslint-disable-next-line no-lonely-if -- Matches structure in "then" clause.
|
|
264
|
-
if ("sortOrder" in parameterDescriptor2) {
|
|
265
|
-
// Parameter descriptors with undefined sort order to go the end.
|
|
266
|
-
result = parameterDescriptor2.sortOrder;
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
result = 0;
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return result;
|
|
273
|
-
});
|
|
274
|
-
for (const [parameterName, parametersSequencerEntry] of entries) {
|
|
275
|
-
if (parametersSequencerEntry.isUsed) {
|
|
276
|
-
this.#templateParametersLocaleResources[parameterName] = {
|
|
277
|
-
name: parameterName,
|
|
278
|
-
description: "*** LOCALIZATION REQUIRED ***"
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
if (parametersSequencerEntry.parametersSequencerOrNull !== null) {
|
|
282
|
-
this.#buildParametersLocaleResources(parametersSequencerEntry.parametersSequencerOrNull);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Build output to be written back to source file.
|
|
288
|
-
*
|
|
289
|
-
* @param prefix
|
|
290
|
-
* Line prefix.
|
|
291
|
-
*
|
|
292
|
-
* @param value
|
|
293
|
-
* Line value.
|
|
294
|
-
*
|
|
295
|
-
* @param indentLevel
|
|
296
|
-
* Indent level.
|
|
297
|
-
*
|
|
298
|
-
* @returns
|
|
299
|
-
* Output string.
|
|
300
|
-
*/
|
|
301
|
-
static #buildOutput(prefix, value, indentLevel) {
|
|
302
|
-
return `${" ".repeat(indentLevel)}${prefix} ${typeof value === "object" ?
|
|
303
|
-
`{\n${Object.entries(value).map(entry => LocaleResourcesGenerator.#buildOutput(`${entry[0]}:`, entry[1], indentLevel + 1)).join(",\n")}\n${" ".repeat(indentLevel)}}` :
|
|
304
|
-
// JSON.stringify() will apply quotes as appropriate.
|
|
305
|
-
JSON.stringify(value)}`;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* @inheritDoc
|
|
309
|
-
*/
|
|
310
|
-
async finalize(success) {
|
|
311
|
-
if (success) {
|
|
312
|
-
this.#buildParametersLocaleResources(this.#parametersSequencer);
|
|
313
|
-
await Promise.all(await fs.promises.readdir(LocaleResourcesGenerator.#IMPORT_PATH, {
|
|
314
|
-
withFileTypes: true
|
|
315
|
-
}).then(entries => entries.filter(entry => entry.isDirectory()).map(async (entry) => {
|
|
316
|
-
const localeResourcesSource = path.resolve(LocaleResourcesGenerator.#IMPORT_PATH, entry.name, "locale-resources.ts");
|
|
317
|
-
return import(localeResourcesSource).then(async (module) => {
|
|
318
|
-
const mergedLocaleResources = {};
|
|
319
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Module format is known.
|
|
320
|
-
return this.#merge(mergedLocaleResources, entry.name === "en", "", this.#templateLocaleResources, module.default, !entry.name.includes("-")) ?
|
|
321
|
-
fs.promises.writeFile(localeResourcesSource, `${LocaleResourcesGenerator.#buildOutput("export default", mergedLocaleResources, 0)};\n`) :
|
|
322
|
-
undefined;
|
|
323
|
-
});
|
|
324
|
-
})));
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
const generator = new LocaleResourcesGenerator();
|
|
329
|
-
generator.generate().catch((e) => {
|
|
330
|
-
generator.logger.error(e);
|
|
331
|
-
process.exit(1);
|
|
332
|
-
});
|
|
333
|
-
//# sourceMappingURL=locale-resources-generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-resources-generator.js","sourceRoot":"","sources":["../../src/generator/locale-resources-generator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAOlC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AA+C3C;;GAEG;AACH,MAAM,wBAAyB,SAAQ,SAAS;IAC5C;;OAEG;IACH,MAAM,CAAU,YAAY,GAAG,6BAA6B,CAAC;IAE7D;;OAEG;IACM,oBAAoB,GAAwB,EAAE,CAAC;IAExD;;OAEG;IACM,kCAAkC,GAAoB,EAAE,CAAC;IAElE;;OAEG;IACM,iCAAiC,GAAoB,EAAE,CAAC;IAEjE;;OAEG;IACM,wBAAwB,GAAoB;QACjD,UAAU,EAAE,IAAI,CAAC,kCAAkC;QACnD,SAAS,EAAE,IAAI,CAAC,iCAAiC;KACpD,CAAC;IAEF;;OAEG;IACH;QACI,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1B,CAAC;IAED;;OAEG;IACgB,UAAU;IAC7B,CAAC;IAED;;OAEG;IACgB,eAAe;IAClC,CAAC;IAED;;OAEG;IACgB,cAAc;IACjC,CAAC;IAED;;OAEG;IACgB,gBAAgB;IACnC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,sBAAsB,CAAC,mBAAqE,EAAE,MAAe;QACzG,IAAI,wBAAkD,CAAC;QAEvD,IAAI,CAAC,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,EAAE,CAAC;YAChD,MAAM,aAAa,GAAG,mBAAmB,CAAC,IAAI,CAAC;YAE/C,gFAA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AM,qBAAqB,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,YAAY,EAAE,KAAK,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;gBAErH,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;oBACvD,MAAM,qBAAqB,GAAoB,EAAE,CAAC;oBAElD,kGAAkG;oBAClG,OAAO,IAAI,CAAC,MAAM,CAAC,qBAAqB,EAAE,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,wBAAwB,EAAG,MAAgC,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;wBACrK,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,EAAE,GAAG,wBAAwB,CAAC,YAAY,CAAC,gBAAgB,EAAE,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;wBACzI,SAAS,CAAC;gBAClB,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC,CAAC,CAAC;QACT,CAAC;IACL,CAAC;;AAGL,MAAM,SAAS,GAAG,IAAI,wBAAwB,EAAE,CAAC;AAEjD,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAU,EAAE,EAAE;IACtC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { AppExtension } from "../app-extension.js";
|
|
2
|
-
import { CharacterSetCreatorProxy, CharacterSetValidatorProxy } from "../utility/index.js";
|
|
3
|
-
export declare class AI82Proxy extends CharacterSetCreatorProxy {
|
|
4
|
-
constructor(appExtension: AppExtension);
|
|
5
|
-
}
|
|
6
|
-
export declare class AI39Proxy extends CharacterSetCreatorProxy {
|
|
7
|
-
constructor(appExtension: AppExtension);
|
|
8
|
-
}
|
|
9
|
-
export declare class AI64Proxy extends CharacterSetValidatorProxy {
|
|
10
|
-
constructor(appExtension: AppExtension);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=character-set-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set-proxy.d.ts","sourceRoot":"","sources":["../../src/gs1/character-set-proxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAE3F,qBAUa,SAAU,SAAQ,wBAAwB;gBACvC,YAAY,EAAE,YAAY;CAGzC;AAED,qBAUa,SAAU,SAAQ,wBAAwB;gBACvC,YAAY,EAAE,YAAY;CAGzC;AAED,qBAIa,SAAU,SAAQ,0BAA0B;gBACzC,YAAY,EAAE,YAAY;CAGzC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
-
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
-
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
-
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
-
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
-
var _, done = false;
|
|
7
|
-
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
-
var context = {};
|
|
9
|
-
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
-
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
-
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
-
if (kind === "accessor") {
|
|
14
|
-
if (result === void 0) continue;
|
|
15
|
-
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
-
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
-
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
-
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
-
}
|
|
20
|
-
else if (_ = accept(result)) {
|
|
21
|
-
if (kind === "field") initializers.unshift(_);
|
|
22
|
-
else descriptor[key] = _;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
-
done = true;
|
|
27
|
-
};
|
|
28
|
-
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
-
var useValue = arguments.length > 2;
|
|
30
|
-
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
-
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
-
}
|
|
33
|
-
return useValue ? value : void 0;
|
|
34
|
-
};
|
|
35
|
-
import { AI39_CREATOR, AI64_VALIDATOR, AI82_CREATOR } from "@aidc-toolkit/gs1";
|
|
36
|
-
import { expandParameterDescriptor, proxy } from "../proxy.js";
|
|
37
|
-
import { exclusionAllNumericParameterDescriptor, exclusionNoneParameterDescriptor } from "../utility/character-set-descriptor.js";
|
|
38
|
-
import { CharacterSetCreatorProxy, CharacterSetValidatorProxy } from "../utility/index.js";
|
|
39
|
-
let AI82Proxy = (() => {
|
|
40
|
-
let _classDecorators = [proxy.describeClass(false, {
|
|
41
|
-
namespace: "GS1",
|
|
42
|
-
methodInfix: "AI82",
|
|
43
|
-
replacementParameterDescriptors: [
|
|
44
|
-
{
|
|
45
|
-
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
46
|
-
replacement: exclusionAllNumericParameterDescriptor
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
})];
|
|
50
|
-
let _classDescriptor;
|
|
51
|
-
let _classExtraInitializers = [];
|
|
52
|
-
let _classThis;
|
|
53
|
-
let _classSuper = CharacterSetCreatorProxy;
|
|
54
|
-
var AI82Proxy = class extends _classSuper {
|
|
55
|
-
static { _classThis = this; }
|
|
56
|
-
static {
|
|
57
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
58
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
59
|
-
AI82Proxy = _classThis = _classDescriptor.value;
|
|
60
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
61
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
62
|
-
}
|
|
63
|
-
constructor(appExtension) {
|
|
64
|
-
super(appExtension, AI82_CREATOR);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
return AI82Proxy = _classThis;
|
|
68
|
-
})();
|
|
69
|
-
export { AI82Proxy };
|
|
70
|
-
let AI39Proxy = (() => {
|
|
71
|
-
let _classDecorators = [proxy.describeClass(false, {
|
|
72
|
-
namespace: "GS1",
|
|
73
|
-
methodInfix: "AI39",
|
|
74
|
-
replacementParameterDescriptors: [
|
|
75
|
-
{
|
|
76
|
-
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
77
|
-
replacement: exclusionAllNumericParameterDescriptor
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
})];
|
|
81
|
-
let _classDescriptor;
|
|
82
|
-
let _classExtraInitializers = [];
|
|
83
|
-
let _classThis;
|
|
84
|
-
let _classSuper = CharacterSetCreatorProxy;
|
|
85
|
-
var AI39Proxy = class extends _classSuper {
|
|
86
|
-
static { _classThis = this; }
|
|
87
|
-
static {
|
|
88
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
89
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
90
|
-
AI39Proxy = _classThis = _classDescriptor.value;
|
|
91
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
92
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
93
|
-
}
|
|
94
|
-
constructor(appExtension) {
|
|
95
|
-
super(appExtension, AI39_CREATOR);
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
return AI39Proxy = _classThis;
|
|
99
|
-
})();
|
|
100
|
-
export { AI39Proxy };
|
|
101
|
-
let AI64Proxy = (() => {
|
|
102
|
-
let _classDecorators = [proxy.describeClass(false, {
|
|
103
|
-
namespace: "GS1",
|
|
104
|
-
methodInfix: "AI64"
|
|
105
|
-
})];
|
|
106
|
-
let _classDescriptor;
|
|
107
|
-
let _classExtraInitializers = [];
|
|
108
|
-
let _classThis;
|
|
109
|
-
let _classSuper = CharacterSetValidatorProxy;
|
|
110
|
-
var AI64Proxy = class extends _classSuper {
|
|
111
|
-
static { _classThis = this; }
|
|
112
|
-
static {
|
|
113
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
114
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
115
|
-
AI64Proxy = _classThis = _classDescriptor.value;
|
|
116
|
-
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
117
|
-
__runInitializers(_classThis, _classExtraInitializers);
|
|
118
|
-
}
|
|
119
|
-
constructor(appExtension) {
|
|
120
|
-
super(appExtension, AI64_VALIDATOR);
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
return AI64Proxy = _classThis;
|
|
124
|
-
})();
|
|
125
|
-
export { AI64Proxy };
|
|
126
|
-
//# sourceMappingURL=character-set-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set-proxy.js","sourceRoot":"","sources":["../../src/gs1/character-set-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EACH,sCAAsC,EACtC,gCAAgC,EACnC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;IAY9E,SAAS;4BAVrB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;YACxB,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,MAAM;YACnB,+BAA+B,EAAE;gBAC7B;oBACI,IAAI,EAAE,yBAAyB,CAAC,gCAAgC,CAAC,CAAC,IAAI;oBACtE,WAAW,EAAE,sCAAsC;iBACtD;aACJ;SACJ,CAAC;;;;sBAC6B,wBAAwB;yBAAhC,SAAQ,WAAwB;;;;YAAvD,6KAIC;;;YAJY,uDAAS;;QAClB,YAAY,YAA0B;YAClC,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QACtC,CAAC;;;;SAHQ,SAAS;IAgBT,SAAS;4BAVrB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;YACxB,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,MAAM;YACnB,+BAA+B,EAAE;gBAC7B;oBACI,IAAI,EAAE,yBAAyB,CAAC,gCAAgC,CAAC,CAAC,IAAI;oBACtE,WAAW,EAAE,sCAAsC;iBACtD;aACJ;SACJ,CAAC;;;;sBAC6B,wBAAwB;yBAAhC,SAAQ,WAAwB;;;;YAAvD,6KAIC;;;YAJY,uDAAS;;QAClB,YAAY,YAA0B;YAClC,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QACtC,CAAC;;;;SAHQ,SAAS;IAUT,SAAS;4BAJrB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;YACxB,SAAS,EAAE,KAAK;YAChB,WAAW,EAAE,MAAM;SACtB,CAAC;;;;sBAC6B,0BAA0B;yBAAlC,SAAQ,WAA0B;;;;YAAzD,6KAIC;;;YAJY,uDAAS;;QAClB,YAAY,YAA0B;YAClC,KAAK,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;QACxC,CAAC;;;;SAHQ,SAAS"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LibProxy } from "../lib-proxy.js";
|
|
2
|
-
import type { Matrix, MatrixResult, SingletonResult } from "../type.js";
|
|
3
|
-
export declare class CheckProxy extends LibProxy {
|
|
4
|
-
checkDigit(matrixSs: Matrix<string>): MatrixResult<string>;
|
|
5
|
-
hasValidCheckDigit(matrixSs: Matrix<string>): MatrixResult<boolean>;
|
|
6
|
-
priceOrWeightCheckDigit(matrixSs: Matrix<string>): MatrixResult<string>;
|
|
7
|
-
isValidPriceOrWeightCheckDigit(s: string, checkDigit: string): SingletonResult<boolean>;
|
|
8
|
-
checkCharacterPair(matrixSs: Matrix<string>): MatrixResult<string>;
|
|
9
|
-
hasValidCheckCharacterPair(matrixSs: Matrix<string>): MatrixResult<boolean>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=check-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-proxy.d.ts","sourceRoot":"","sources":["../../src/gs1/check-proxy.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA2CxE,qBAIa,UAAW,SAAQ,QAAQ;IAMpC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;IAS1D,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC;IASnE,uBAAuB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;IAYvE,8BAA8B,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC;IASvF,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;IASlE,0BAA0B,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC;CAG9E"}
|