@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/dist/index.cjs
ADDED
|
@@ -0,0 +1,3414 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
30
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
31
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
32
|
+
if (decorator = decorators[i])
|
|
33
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
34
|
+
if (kind && result) __defProp(target, key, result);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
38
|
+
|
|
39
|
+
// src/index.ts
|
|
40
|
+
var index_exports = {};
|
|
41
|
+
__export(index_exports, {
|
|
42
|
+
AlphabeticProxy: () => AlphabeticProxy,
|
|
43
|
+
AlphanumericProxy: () => AlphanumericProxy,
|
|
44
|
+
AppExtension: () => AppExtension,
|
|
45
|
+
AppUtilityProxy: () => AppUtilityProxy,
|
|
46
|
+
CharacterSetProxy: () => CharacterSetProxy,
|
|
47
|
+
GS1: () => gs1_exports,
|
|
48
|
+
Generator: () => Generator,
|
|
49
|
+
HexadecimalProxy: () => HexadecimalProxy,
|
|
50
|
+
LibProxy: () => LibProxy,
|
|
51
|
+
NumericProxy: () => NumericProxy,
|
|
52
|
+
ProxyClass: () => ProxyClass,
|
|
53
|
+
ProxyMethod: () => ProxyMethod,
|
|
54
|
+
ProxyParameter: () => ProxyParameter,
|
|
55
|
+
RegExpProxy: () => RegExpProxy,
|
|
56
|
+
TransformerProxy: () => TransformerProxy,
|
|
57
|
+
Types: () => Types,
|
|
58
|
+
appExtensionNS: () => appExtensionNS,
|
|
59
|
+
appExtensionResources: () => appExtensionResources,
|
|
60
|
+
expandParameterDescriptor: () => expandParameterDescriptor,
|
|
61
|
+
getClassDescriptorsMap: () => getClassDescriptorsMap,
|
|
62
|
+
i18nAppExtensionInit: () => i18nAppExtensionInit,
|
|
63
|
+
i18nextAppExtension: () => i18nextAppExtension
|
|
64
|
+
});
|
|
65
|
+
module.exports = __toCommonJS(index_exports);
|
|
66
|
+
|
|
67
|
+
// src/locale/i18n.ts
|
|
68
|
+
var import_core = require("@aidc-toolkit/core");
|
|
69
|
+
var import_gs1 = require("@aidc-toolkit/gs1");
|
|
70
|
+
var import_utility = require("@aidc-toolkit/utility");
|
|
71
|
+
var import_i18next = __toESM(require("i18next"), 1);
|
|
72
|
+
|
|
73
|
+
// src/locale/en/locale-resources.ts
|
|
74
|
+
var locale_resources_default = {
|
|
75
|
+
AppExtension: {
|
|
76
|
+
sequenceCountMustBeLessThanOrEqualTo: "Sequence count {{sequenceCount, number}} must be less than or equal to {{maximumSequenceCount, number}}"
|
|
77
|
+
},
|
|
78
|
+
Proxy: {
|
|
79
|
+
vSpillMustBeHorizontalArray: "Input must be a horizontal array",
|
|
80
|
+
hSpillMustBeVerticalArray: "Input must be a vertical array",
|
|
81
|
+
matrixMustBeArray: "Input must be a one-dimensional array"
|
|
82
|
+
},
|
|
83
|
+
IdentifierCreatorProxy: {
|
|
84
|
+
prefixDefinitionMustBeOneDimensional: "Prefix definition must be a one-dimensional matrix",
|
|
85
|
+
prefixDefinitionMustHaveMaximumThreeElements: "Prefix definition must have a maximum of 3 elements",
|
|
86
|
+
prefixMustBeString: "Prefix must be a string",
|
|
87
|
+
prefixTypeMustBeNumber: "Prefix type must be a number in the range of 0 to {{maximumPrefixType, number}}",
|
|
88
|
+
tweakFactorMustBeNumber: "Tweak factor must be a number"
|
|
89
|
+
},
|
|
90
|
+
Parameters: {
|
|
91
|
+
spillMatrix: {
|
|
92
|
+
name: "matrix",
|
|
93
|
+
description: "One-dimensional matrix to spill."
|
|
94
|
+
},
|
|
95
|
+
spillMaximumWidth: {
|
|
96
|
+
name: "maximumWidth",
|
|
97
|
+
description: "Maximum width into which to spill the matrix. If not provided, the remaining width is used."
|
|
98
|
+
},
|
|
99
|
+
spillMaximumHeight: {
|
|
100
|
+
name: "maximumHeight",
|
|
101
|
+
description: "Maximum height into which to spill the matrix. If not provided, the remaining height is used."
|
|
102
|
+
},
|
|
103
|
+
domain: {
|
|
104
|
+
name: "domain",
|
|
105
|
+
description: "Transformation domain. Valid input values are from zero to domain-1."
|
|
106
|
+
},
|
|
107
|
+
value: {
|
|
108
|
+
name: "value",
|
|
109
|
+
description: "Value to transform."
|
|
110
|
+
},
|
|
111
|
+
startValue: {
|
|
112
|
+
name: "startValue",
|
|
113
|
+
description: "Start value of a domain of values to transform."
|
|
114
|
+
},
|
|
115
|
+
count: {
|
|
116
|
+
name: "count",
|
|
117
|
+
description: "Count of values to transform. If positive, values transformed are startValue to startValue+count-1. If negative, values transformed are startValue down to startValue+count+1."
|
|
118
|
+
},
|
|
119
|
+
transformedValue: {
|
|
120
|
+
name: "transformedValue",
|
|
121
|
+
description: "Previous output value of a transformation."
|
|
122
|
+
},
|
|
123
|
+
tweak: {
|
|
124
|
+
name: "tweak",
|
|
125
|
+
description: "Value by which to tweak the transformation. If not provided or zero, the output is sequential. Otherwise, the output is encrypted in such a way as to appear random, masking the values used as inputs to the sequence."
|
|
126
|
+
},
|
|
127
|
+
regExp: {
|
|
128
|
+
name: "regExp",
|
|
129
|
+
description: "Regular expression against which to validate a string."
|
|
130
|
+
},
|
|
131
|
+
validateS: {
|
|
132
|
+
name: "s",
|
|
133
|
+
description: "String to validate."
|
|
134
|
+
},
|
|
135
|
+
valueForS: {
|
|
136
|
+
name: "s",
|
|
137
|
+
description: "String for which to determine the value."
|
|
138
|
+
},
|
|
139
|
+
errorMessage: {
|
|
140
|
+
name: "errorMessage",
|
|
141
|
+
description: "Custom error message to use if validation fails. If not provided, an internal error message is used."
|
|
142
|
+
},
|
|
143
|
+
exclusionNone: {
|
|
144
|
+
name: "exclusion",
|
|
145
|
+
description: "String values to exclude. The only valid value is 0 (no exclusions)."
|
|
146
|
+
},
|
|
147
|
+
exclusionFirstZero: {
|
|
148
|
+
name: "exclusion",
|
|
149
|
+
description: "String values to exclude. Valid values are 0 (no exclusions) and 1 (strings starting with 0 excluded)."
|
|
150
|
+
},
|
|
151
|
+
exclusionAllNumeric: {
|
|
152
|
+
name: "exclusion",
|
|
153
|
+
description: "String values to exclude. Valid values are 0 (no exclusions) and 2 (strings that are all numeric excluded)."
|
|
154
|
+
},
|
|
155
|
+
exclusionAny: {
|
|
156
|
+
name: "exclusion",
|
|
157
|
+
description: "String values to exclude. Valid values are 0 (no exclusions), 1 (strings starting with 0 excluded), and 2 (strings that are all numeric excluded)."
|
|
158
|
+
},
|
|
159
|
+
length: {
|
|
160
|
+
name: "length",
|
|
161
|
+
description: "Length of string to create."
|
|
162
|
+
},
|
|
163
|
+
numericS: {
|
|
164
|
+
name: "s",
|
|
165
|
+
description: "Numeric string."
|
|
166
|
+
},
|
|
167
|
+
numericSFourOrFiveDigits: {
|
|
168
|
+
name: "s",
|
|
169
|
+
description: "Four- or five-digit numeric string."
|
|
170
|
+
},
|
|
171
|
+
numericSWithCheckDigit: {
|
|
172
|
+
name: "s",
|
|
173
|
+
description: "Numeric string with check digit."
|
|
174
|
+
},
|
|
175
|
+
checkDigit: {
|
|
176
|
+
name: "checkDigit",
|
|
177
|
+
description: "Check digit."
|
|
178
|
+
},
|
|
179
|
+
ai82S: {
|
|
180
|
+
name: "s",
|
|
181
|
+
description: "GS1 AI encodable character set 82 string."
|
|
182
|
+
},
|
|
183
|
+
ai82SWithCheckCharacterPair: {
|
|
184
|
+
name: "s",
|
|
185
|
+
description: "GS1 AI encodable character set 82 string with check character pair."
|
|
186
|
+
},
|
|
187
|
+
validateIdentifier: {
|
|
188
|
+
name: "identifier",
|
|
189
|
+
description: "Identifier to validate."
|
|
190
|
+
},
|
|
191
|
+
zeroSuppressibleGTIN12: {
|
|
192
|
+
name: "gtin12",
|
|
193
|
+
description: "GTIN-12 for which to suppress zeros."
|
|
194
|
+
},
|
|
195
|
+
zeroSuppressedGTIN12: {
|
|
196
|
+
name: "zeroSuppressedGTIN12",
|
|
197
|
+
description: "Zero-suppressed GTIN-12 to expand."
|
|
198
|
+
},
|
|
199
|
+
convertGTIN: {
|
|
200
|
+
name: "gtin",
|
|
201
|
+
description: "GTIN to convert to GTIN-14."
|
|
202
|
+
},
|
|
203
|
+
normalizeGTIN: {
|
|
204
|
+
name: "gtin",
|
|
205
|
+
description: "GTIN to normalize."
|
|
206
|
+
},
|
|
207
|
+
validateGTIN: {
|
|
208
|
+
name: "gtin",
|
|
209
|
+
description: "GTIN to validate."
|
|
210
|
+
},
|
|
211
|
+
validateGTIN14: {
|
|
212
|
+
name: "gtin14",
|
|
213
|
+
description: "GTIN-14 to validate."
|
|
214
|
+
},
|
|
215
|
+
baseIdentifier: {
|
|
216
|
+
name: "baseIdentifier",
|
|
217
|
+
description: "Base identifier."
|
|
218
|
+
},
|
|
219
|
+
indicatorDigit: {
|
|
220
|
+
name: "indicatorDigit",
|
|
221
|
+
description: "Indicator digit."
|
|
222
|
+
},
|
|
223
|
+
gtinLevel: {
|
|
224
|
+
name: "level",
|
|
225
|
+
description: "Level at which to validate the GTIN. Valid values are 0 (any), 1 (retail consumer trade item), and 2 (other than retail consumer trade item level)."
|
|
226
|
+
},
|
|
227
|
+
rcnFormat: {
|
|
228
|
+
name: "format",
|
|
229
|
+
description: "Restricted Circulation Number format."
|
|
230
|
+
},
|
|
231
|
+
rcn: {
|
|
232
|
+
name: "rcn",
|
|
233
|
+
description: "Restricted Circulation Number to parse."
|
|
234
|
+
},
|
|
235
|
+
prefix: {
|
|
236
|
+
name: "prefix",
|
|
237
|
+
description: "Prefix."
|
|
238
|
+
},
|
|
239
|
+
prefixType: {
|
|
240
|
+
name: "prefixType",
|
|
241
|
+
description: "Prefix type. Valid values are 0 (GS1 Company Prefix), 1 (U.P.C. Company Prefix), and 2 (GS1 Prefix)."
|
|
242
|
+
},
|
|
243
|
+
tweakFactor: {
|
|
244
|
+
name: "tweakFactor",
|
|
245
|
+
description: "Tweak factor, used to support the creation of sparse identifiers. The default tweak factor is based on the GS1 Company Prefix, and is usually sufficient for obfuscation. This allows more control over the encryption when higher security is required."
|
|
246
|
+
},
|
|
247
|
+
prefixDefinitionAny: {
|
|
248
|
+
name: "prefixDefinition",
|
|
249
|
+
description: "Prefix definition, either a simple GS1 Company Prefix (as a string) or the result of a call to definePrefix. Any prefix type is supported."
|
|
250
|
+
},
|
|
251
|
+
prefixDefinitionGS1UPC: {
|
|
252
|
+
name: "prefixDefinition",
|
|
253
|
+
description: "Prefix definition, either a simple GS1 Company Prefix (as a string) or the result of a call to definePrefix. Only prefix types 0 (GS1 Company Prefix) and 1 (U.P.C. Company Prefix) are supported."
|
|
254
|
+
},
|
|
255
|
+
sparse: {
|
|
256
|
+
name: "sparse",
|
|
257
|
+
description: "If true, value is mapped to a sparse sequence resistant to discovery. Default is false."
|
|
258
|
+
},
|
|
259
|
+
rcnItemReference: {
|
|
260
|
+
name: "itemReference",
|
|
261
|
+
description: "Item reference."
|
|
262
|
+
},
|
|
263
|
+
rcnPriceOrWeight: {
|
|
264
|
+
name: "priceOrWeight",
|
|
265
|
+
description: "Price or weight (whole number only)."
|
|
266
|
+
},
|
|
267
|
+
serialComponent: {
|
|
268
|
+
name: "serialComponent",
|
|
269
|
+
description: "Serial component."
|
|
270
|
+
},
|
|
271
|
+
reference: {
|
|
272
|
+
name: "reference",
|
|
273
|
+
description: "Reference portion of identifier."
|
|
274
|
+
}
|
|
275
|
+
},
|
|
276
|
+
Functions: {
|
|
277
|
+
version: {
|
|
278
|
+
name: "version",
|
|
279
|
+
description: "Get the version of the AIDC Toolkit."
|
|
280
|
+
},
|
|
281
|
+
vSpill: {
|
|
282
|
+
name: "vSpill",
|
|
283
|
+
description: "Spill a horizontal array vertically to fit within a given maximum width and height."
|
|
284
|
+
},
|
|
285
|
+
hSpill: {
|
|
286
|
+
name: "hSpill",
|
|
287
|
+
description: "Spill a vertical array horizontally to fit within a given maximum height and width."
|
|
288
|
+
},
|
|
289
|
+
forwardTransform: {
|
|
290
|
+
name: "forwardTransform",
|
|
291
|
+
description: "Transform a value forward."
|
|
292
|
+
},
|
|
293
|
+
forwardTransformSequence: {
|
|
294
|
+
name: "forwardTransformSequence",
|
|
295
|
+
description: "Transform a sequence of values forward."
|
|
296
|
+
},
|
|
297
|
+
reverseTransform: {
|
|
298
|
+
name: "reverseTransform",
|
|
299
|
+
description: "Transform a value in reverse."
|
|
300
|
+
},
|
|
301
|
+
validateRegExp: {
|
|
302
|
+
name: "validateRegExp",
|
|
303
|
+
description: "Validate a string against a regular expression."
|
|
304
|
+
},
|
|
305
|
+
isValidRegExp: {
|
|
306
|
+
name: "isValidRegExp",
|
|
307
|
+
description: "Determine if a string is valid against a regular expression."
|
|
308
|
+
},
|
|
309
|
+
validateNumeric: {
|
|
310
|
+
name: "validateNumeric",
|
|
311
|
+
description: "Validate a numeric string."
|
|
312
|
+
},
|
|
313
|
+
isValidNumeric: {
|
|
314
|
+
name: "isValidNumeric",
|
|
315
|
+
description: "Determine if a string is numeric."
|
|
316
|
+
},
|
|
317
|
+
createNumeric: {
|
|
318
|
+
name: "createNumeric",
|
|
319
|
+
description: "Create a numeric string."
|
|
320
|
+
},
|
|
321
|
+
createNumericSequence: {
|
|
322
|
+
name: "createNumericSequence",
|
|
323
|
+
description: "Create a sequence of numeric strings."
|
|
324
|
+
},
|
|
325
|
+
valueForNumeric: {
|
|
326
|
+
name: "valueForNumeric",
|
|
327
|
+
description: "Get the value for a numeric string."
|
|
328
|
+
},
|
|
329
|
+
validateHexadecimal: {
|
|
330
|
+
name: "validateHexadecimal",
|
|
331
|
+
description: "Validate a hexadecimal string."
|
|
332
|
+
},
|
|
333
|
+
isValidHexadecimal: {
|
|
334
|
+
name: "isValidHexadecimal",
|
|
335
|
+
description: "Determine if a string is hexadecimal."
|
|
336
|
+
},
|
|
337
|
+
createHexadecimal: {
|
|
338
|
+
name: "createHexadecimal",
|
|
339
|
+
description: "Create a hexadecimal string."
|
|
340
|
+
},
|
|
341
|
+
createHexadecimalSequence: {
|
|
342
|
+
name: "createHexadecimalSequence",
|
|
343
|
+
description: "Create a sequence of hexadecimal strings."
|
|
344
|
+
},
|
|
345
|
+
valueForHexadecimal: {
|
|
346
|
+
name: "valueForHexadecimal",
|
|
347
|
+
description: "Get the value for a hexadecimal string."
|
|
348
|
+
},
|
|
349
|
+
validateAlphabetic: {
|
|
350
|
+
name: "validateAlphabetic",
|
|
351
|
+
description: "Validate an alphabetic string."
|
|
352
|
+
},
|
|
353
|
+
isValidAlphabetic: {
|
|
354
|
+
name: "isValidAlphabetic",
|
|
355
|
+
description: "Determine if a string is alphabetic."
|
|
356
|
+
},
|
|
357
|
+
createAlphabetic: {
|
|
358
|
+
name: "createAlphabetic",
|
|
359
|
+
description: "Create an alphabetic string."
|
|
360
|
+
},
|
|
361
|
+
createAlphabeticSequence: {
|
|
362
|
+
name: "createAlphabeticSequence",
|
|
363
|
+
description: "Create a sequence of alphabetic strings."
|
|
364
|
+
},
|
|
365
|
+
valueForAlphabetic: {
|
|
366
|
+
name: "valueForAlphabetic",
|
|
367
|
+
description: "Get the value for an alphabetic string."
|
|
368
|
+
},
|
|
369
|
+
validateAlphanumeric: {
|
|
370
|
+
name: "validateAlphanumeric",
|
|
371
|
+
description: "Validate an alphanumeric string."
|
|
372
|
+
},
|
|
373
|
+
isValidAlphanumeric: {
|
|
374
|
+
name: "isValidAlphanumeric",
|
|
375
|
+
description: "Determine if a string is alphanumeric."
|
|
376
|
+
},
|
|
377
|
+
createAlphanumeric: {
|
|
378
|
+
name: "createAlphanumeric",
|
|
379
|
+
description: "Create an alphanumeric string."
|
|
380
|
+
},
|
|
381
|
+
createAlphanumericSequence: {
|
|
382
|
+
name: "createAlphanumericSequence",
|
|
383
|
+
description: "Create a sequence of alphanumeric strings."
|
|
384
|
+
},
|
|
385
|
+
valueForAlphanumeric: {
|
|
386
|
+
name: "valueForAlphanumeric",
|
|
387
|
+
description: "Get the value for an alphanumeric string."
|
|
388
|
+
},
|
|
389
|
+
GS1: {
|
|
390
|
+
validateAI82: {
|
|
391
|
+
name: "validateAI82",
|
|
392
|
+
description: "Validate a GS1 AI 82 encodable character set string."
|
|
393
|
+
},
|
|
394
|
+
isValidAI82: {
|
|
395
|
+
name: "isValidAI82",
|
|
396
|
+
description: "Determine if a string is GS1 AI 82 encodable character set."
|
|
397
|
+
},
|
|
398
|
+
createAI82: {
|
|
399
|
+
name: "createAI82",
|
|
400
|
+
description: "Create a GS1 AI 82 encodable character set string."
|
|
401
|
+
},
|
|
402
|
+
createAI82Sequence: {
|
|
403
|
+
name: "createAI82Sequence",
|
|
404
|
+
description: "Create a sequence of GS1 AI 82 encodable character set strings."
|
|
405
|
+
},
|
|
406
|
+
valueForAI82: {
|
|
407
|
+
name: "valueForAI82",
|
|
408
|
+
description: "Get the value for a GS1 AI 82 encodable character set string."
|
|
409
|
+
},
|
|
410
|
+
validateAI39: {
|
|
411
|
+
name: "validateAI39",
|
|
412
|
+
description: "Validate a GS1 AI 39 encodable character set string."
|
|
413
|
+
},
|
|
414
|
+
isValidAI39: {
|
|
415
|
+
name: "isValidAI39",
|
|
416
|
+
description: "Determine if a string is GS1 AI 39 encodable character set."
|
|
417
|
+
},
|
|
418
|
+
createAI39: {
|
|
419
|
+
name: "createAI39",
|
|
420
|
+
description: "Create a GS1 AI 39 encodable character set string."
|
|
421
|
+
},
|
|
422
|
+
createAI39Sequence: {
|
|
423
|
+
name: "createAI39Sequence",
|
|
424
|
+
description: "Create a sequence of GS1 AI 39 encodable character set strings."
|
|
425
|
+
},
|
|
426
|
+
valueForAI39: {
|
|
427
|
+
name: "valueForAI39",
|
|
428
|
+
description: "Get the value for a GS1 AI 39 encodable character set string."
|
|
429
|
+
},
|
|
430
|
+
checkDigit: {
|
|
431
|
+
name: "checkDigit",
|
|
432
|
+
description: "Calculate the check digit for a numeric string."
|
|
433
|
+
},
|
|
434
|
+
hasValidCheckDigit: {
|
|
435
|
+
name: "hasValidCheckDigit",
|
|
436
|
+
description: "Determine if a string has a valid check digit."
|
|
437
|
+
},
|
|
438
|
+
priceOrWeightCheckDigit: {
|
|
439
|
+
name: "priceOrWeightCheckDigit",
|
|
440
|
+
description: "Calculate the check digit for a price or weight."
|
|
441
|
+
},
|
|
442
|
+
isValidPriceOrWeightCheckDigit: {
|
|
443
|
+
name: "isValidPriceOrWeightCheckDigit",
|
|
444
|
+
description: "Determine if a price or weight check digit is valid."
|
|
445
|
+
},
|
|
446
|
+
checkCharacterPair: {
|
|
447
|
+
name: "checkCharacterPair",
|
|
448
|
+
description: "Calculate the check character pair for a GS1 AI 82 encodable character set string."
|
|
449
|
+
},
|
|
450
|
+
hasValidCheckCharacterPair: {
|
|
451
|
+
name: "hasValidCheckCharacterPair",
|
|
452
|
+
description: "Determine if a GS1 AI 82 encodable character set string has a valid check character pair."
|
|
453
|
+
},
|
|
454
|
+
validateGTIN13: {
|
|
455
|
+
name: "validateGTIN13",
|
|
456
|
+
description: "Validate a GTIN-13."
|
|
457
|
+
},
|
|
458
|
+
validateGTIN12: {
|
|
459
|
+
name: "validateGTIN12",
|
|
460
|
+
description: "Validate a GTIN-12."
|
|
461
|
+
},
|
|
462
|
+
validateGTIN8: {
|
|
463
|
+
name: "validateGTIN8",
|
|
464
|
+
description: "Validate a GTIN-8."
|
|
465
|
+
},
|
|
466
|
+
zeroSuppressGTIN12: {
|
|
467
|
+
name: "zeroSuppressGTIN12",
|
|
468
|
+
description: "Zero-suppress a GTIN-12."
|
|
469
|
+
},
|
|
470
|
+
zeroExpandGTIN12: {
|
|
471
|
+
name: "zeroExpandGTIN12",
|
|
472
|
+
description: "Expand a zero-suppressed GTIN-12."
|
|
473
|
+
},
|
|
474
|
+
convertToGTIN14: {
|
|
475
|
+
name: "convertToGTIN14",
|
|
476
|
+
description: "Convert a GTIN to GTIN-14."
|
|
477
|
+
},
|
|
478
|
+
normalizeGTIN: {
|
|
479
|
+
name: "normalizeGTIN",
|
|
480
|
+
description: "Normalize a GTIN."
|
|
481
|
+
},
|
|
482
|
+
validateGTIN: {
|
|
483
|
+
name: "validateGTIN",
|
|
484
|
+
description: "Validate any GTIN."
|
|
485
|
+
},
|
|
486
|
+
validateGTIN14: {
|
|
487
|
+
name: "validateGTIN14",
|
|
488
|
+
description: "Validate a GTIN-14."
|
|
489
|
+
},
|
|
490
|
+
parseVariableMeasureRCN: {
|
|
491
|
+
name: "parseVariableMeasureRCN",
|
|
492
|
+
description: "Parse a Restricted Circulation Number (RCN) using a variable measure trade item format."
|
|
493
|
+
},
|
|
494
|
+
validateGLN: {
|
|
495
|
+
name: "validateGLN",
|
|
496
|
+
description: "Validate a GLN."
|
|
497
|
+
},
|
|
498
|
+
validateSSCC: {
|
|
499
|
+
name: "validateSSCC",
|
|
500
|
+
description: "Validate an SSCC."
|
|
501
|
+
},
|
|
502
|
+
validateGRAI: {
|
|
503
|
+
name: "validateGRAI",
|
|
504
|
+
description: "Validate a GRAI."
|
|
505
|
+
},
|
|
506
|
+
validateGIAI: {
|
|
507
|
+
name: "validateGIAI",
|
|
508
|
+
description: "Validate a GIAI."
|
|
509
|
+
},
|
|
510
|
+
validateGSRN: {
|
|
511
|
+
name: "validateGSRN",
|
|
512
|
+
description: "Validate a GSRN."
|
|
513
|
+
},
|
|
514
|
+
validateGDTI: {
|
|
515
|
+
name: "validateGDTI",
|
|
516
|
+
description: "Validate a GDTI."
|
|
517
|
+
},
|
|
518
|
+
validateGINC: {
|
|
519
|
+
name: "validateGINC",
|
|
520
|
+
description: "Validate a GINC."
|
|
521
|
+
},
|
|
522
|
+
validateGSIN: {
|
|
523
|
+
name: "validateGSIN",
|
|
524
|
+
description: "Validate a GSIN."
|
|
525
|
+
},
|
|
526
|
+
validateGCN: {
|
|
527
|
+
name: "validateGCN",
|
|
528
|
+
description: "Validate a GCN."
|
|
529
|
+
},
|
|
530
|
+
validateCPID: {
|
|
531
|
+
name: "validateCPID",
|
|
532
|
+
description: "Validate a CPID."
|
|
533
|
+
},
|
|
534
|
+
validateGMN: {
|
|
535
|
+
name: "validateGMN",
|
|
536
|
+
description: "Validate a GMN."
|
|
537
|
+
},
|
|
538
|
+
definePrefix: {
|
|
539
|
+
name: "definePrefix",
|
|
540
|
+
description: "Define a prefix for use in GS1 identifier creation functions."
|
|
541
|
+
},
|
|
542
|
+
createGTIN: {
|
|
543
|
+
name: "createGTIN",
|
|
544
|
+
description: "Create a GTIN."
|
|
545
|
+
},
|
|
546
|
+
createGTINSequence: {
|
|
547
|
+
name: "createGTINSequence",
|
|
548
|
+
description: "Create a sequence of GTINs."
|
|
549
|
+
},
|
|
550
|
+
createAllGTIN: {
|
|
551
|
+
name: "createAllGTIN",
|
|
552
|
+
description: "Create all GTINs for a prefix."
|
|
553
|
+
},
|
|
554
|
+
createGTIN14: {
|
|
555
|
+
name: "createGTIN14",
|
|
556
|
+
description: "Create a GTIN-14."
|
|
557
|
+
},
|
|
558
|
+
createVariableMeasureRCN: {
|
|
559
|
+
name: "createVariableMeasureRCN",
|
|
560
|
+
description: "Create a variable measure Restricted Circulation Number (RCN)."
|
|
561
|
+
},
|
|
562
|
+
createGLN: {
|
|
563
|
+
name: "createGLN",
|
|
564
|
+
description: "Create a GLN."
|
|
565
|
+
},
|
|
566
|
+
createGLNSequence: {
|
|
567
|
+
name: "createGLNSequence",
|
|
568
|
+
description: "Create a sequence of GLNs."
|
|
569
|
+
},
|
|
570
|
+
createAllGLN: {
|
|
571
|
+
name: "createAllGLN",
|
|
572
|
+
description: "Create all GLNs for a prefix."
|
|
573
|
+
},
|
|
574
|
+
createSSCC: {
|
|
575
|
+
name: "createSSCC",
|
|
576
|
+
description: "Create an SSCC."
|
|
577
|
+
},
|
|
578
|
+
createSSCCSequence: {
|
|
579
|
+
name: "createSSCCSequence",
|
|
580
|
+
description: "Create a sequence of SSCCs."
|
|
581
|
+
},
|
|
582
|
+
createAllSSCC: {
|
|
583
|
+
name: "createAllSSCC",
|
|
584
|
+
description: "Create all SSCCs for a prefix."
|
|
585
|
+
},
|
|
586
|
+
createGRAI: {
|
|
587
|
+
name: "createGRAI",
|
|
588
|
+
description: "Create a GRAI."
|
|
589
|
+
},
|
|
590
|
+
createGRAISequence: {
|
|
591
|
+
name: "createGRAISequence",
|
|
592
|
+
description: "Create a sequence of GRAIs."
|
|
593
|
+
},
|
|
594
|
+
createAllGRAI: {
|
|
595
|
+
name: "createAllGRAI",
|
|
596
|
+
description: "Create all GRAIs for a prefix."
|
|
597
|
+
},
|
|
598
|
+
createSerializedGRAI: {
|
|
599
|
+
name: "createSerializedGRAI",
|
|
600
|
+
description: "Create a serialized GRAI."
|
|
601
|
+
},
|
|
602
|
+
concatenateGRAI: {
|
|
603
|
+
name: "concatenateGRAI",
|
|
604
|
+
description: "Concatenate a base GRAI with a serial component."
|
|
605
|
+
},
|
|
606
|
+
createGIAI: {
|
|
607
|
+
name: "createGIAI",
|
|
608
|
+
description: "Create a GIAI."
|
|
609
|
+
},
|
|
610
|
+
createGSRN: {
|
|
611
|
+
name: "createGSRN",
|
|
612
|
+
description: "Create a GSRN."
|
|
613
|
+
},
|
|
614
|
+
createGSRNSequence: {
|
|
615
|
+
name: "createGSRNSequence",
|
|
616
|
+
description: "Create a sequence of GSRNs."
|
|
617
|
+
},
|
|
618
|
+
createAllGSRN: {
|
|
619
|
+
name: "createAllGSRN",
|
|
620
|
+
description: "Create all GSRNs for a prefix."
|
|
621
|
+
},
|
|
622
|
+
createGDTI: {
|
|
623
|
+
name: "createGDTI",
|
|
624
|
+
description: "Create a GDTI."
|
|
625
|
+
},
|
|
626
|
+
createGDTISequence: {
|
|
627
|
+
name: "createGDTISequence",
|
|
628
|
+
description: "Create a sequence of GDTIs."
|
|
629
|
+
},
|
|
630
|
+
createAllGDTI: {
|
|
631
|
+
name: "createAllGDTI",
|
|
632
|
+
description: "Create all GDTIs for a prefix."
|
|
633
|
+
},
|
|
634
|
+
createSerializedGDTI: {
|
|
635
|
+
name: "createSerializedGDTI",
|
|
636
|
+
description: "Create a serialized GDTI."
|
|
637
|
+
},
|
|
638
|
+
concatenateGDTI: {
|
|
639
|
+
name: "concatenateGDTI",
|
|
640
|
+
description: "Concatenate a base GDTI with a serial component."
|
|
641
|
+
},
|
|
642
|
+
createGINC: {
|
|
643
|
+
name: "createGINC",
|
|
644
|
+
description: "Create a GINC."
|
|
645
|
+
},
|
|
646
|
+
createGSIN: {
|
|
647
|
+
name: "createGSIN",
|
|
648
|
+
description: "Create a GSIN."
|
|
649
|
+
},
|
|
650
|
+
createGSINSequence: {
|
|
651
|
+
name: "createGSINSequence",
|
|
652
|
+
description: "Create a sequence of GSINs."
|
|
653
|
+
},
|
|
654
|
+
createAllGSIN: {
|
|
655
|
+
name: "createAllGSIN",
|
|
656
|
+
description: "Create all GSINs for a prefix."
|
|
657
|
+
},
|
|
658
|
+
createGCN: {
|
|
659
|
+
name: "createGCN",
|
|
660
|
+
description: "Create a GCN."
|
|
661
|
+
},
|
|
662
|
+
createGCNSequence: {
|
|
663
|
+
name: "createGCNSequence",
|
|
664
|
+
description: "Create a sequence of GCNs."
|
|
665
|
+
},
|
|
666
|
+
createAllGCN: {
|
|
667
|
+
name: "createAllGCN",
|
|
668
|
+
description: "Create all GCNs for a prefix."
|
|
669
|
+
},
|
|
670
|
+
createSerializedGCN: {
|
|
671
|
+
name: "createSerializedGCN",
|
|
672
|
+
description: "Create a serialized GCN."
|
|
673
|
+
},
|
|
674
|
+
concatenateGCN: {
|
|
675
|
+
name: "concatenateGCN",
|
|
676
|
+
description: "Concatenate a base GCN with a serial component."
|
|
677
|
+
},
|
|
678
|
+
createCPID: {
|
|
679
|
+
name: "createCPID",
|
|
680
|
+
description: "Create a CPID."
|
|
681
|
+
},
|
|
682
|
+
createGMN: {
|
|
683
|
+
name: "createGMN",
|
|
684
|
+
description: "Create a GMN."
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
};
|
|
689
|
+
|
|
690
|
+
// src/locale/fr/locale-resources.ts
|
|
691
|
+
var locale_resources_default2 = {
|
|
692
|
+
AppExtension: {
|
|
693
|
+
sequenceCountMustBeLessThanOrEqualTo: "Le nombre de s\xE9quences {{sequenceCount, number}} doit \xEAtre inf\xE9rieur ou \xE9gal \xE0 {{maximumSequenceCount, number}}"
|
|
694
|
+
},
|
|
695
|
+
Proxy: {
|
|
696
|
+
vSpillMustBeHorizontalArray: "L'entr\xE9e doit \xEAtre un tableau horizontal",
|
|
697
|
+
hSpillMustBeVerticalArray: "L'entr\xE9e doit \xEAtre un tableau vertical",
|
|
698
|
+
matrixMustBeArray: "L'entr\xE9e doit \xEAtre un tableau unidimensionnel"
|
|
699
|
+
},
|
|
700
|
+
IdentifierCreatorProxy: {
|
|
701
|
+
prefixDefinitionMustBeOneDimensional: "La d\xE9finition du pr\xE9fixe doit \xEAtre une matrice unidimensionnelle",
|
|
702
|
+
prefixDefinitionMustHaveMaximumThreeElements: "La d\xE9finition du pr\xE9fixe doit comporter un maximum de 3 \xE9l\xE9ments",
|
|
703
|
+
prefixMustBeString: "Le pr\xE9fixe doit \xEAtre une cha\xEEne",
|
|
704
|
+
prefixTypeMustBeNumber: "Le type de pr\xE9fixe doit \xEAtre un nombre compris entre 0 et {{maximumPrefixType, number}}",
|
|
705
|
+
tweakFactorMustBeNumber: "Le facteur de r\xE9glage doit \xEAtre un nombre"
|
|
706
|
+
},
|
|
707
|
+
Parameters: {
|
|
708
|
+
spillMatrix: {
|
|
709
|
+
name: "matrice",
|
|
710
|
+
description: "Matrice unidimensionnelle \xE0 renverser."
|
|
711
|
+
},
|
|
712
|
+
spillMaximumWidth: {
|
|
713
|
+
name: "largeurMaximale",
|
|
714
|
+
description: "Largeur maximale dans laquelle d\xE9verser la matrice. Si non fournie, la largeur restante est utilis\xE9e."
|
|
715
|
+
},
|
|
716
|
+
spillMaximumHeight: {
|
|
717
|
+
name: "hauteurMaximale",
|
|
718
|
+
description: "Hauteur maximale dans laquelle d\xE9verser la matrice. Si non fournie, la hauteur restante est utilis\xE9e."
|
|
719
|
+
},
|
|
720
|
+
domain: {
|
|
721
|
+
name: "domaine",
|
|
722
|
+
description: "Domaine de transformation. Les valeurs d'entr\xE9e valides vont de z\xE9ro au domaine-1."
|
|
723
|
+
},
|
|
724
|
+
value: {
|
|
725
|
+
name: "valeur",
|
|
726
|
+
description: "Valeur \xE0 transformer."
|
|
727
|
+
},
|
|
728
|
+
startValue: {
|
|
729
|
+
name: "valeurInitiale",
|
|
730
|
+
description: "Valeur de d\xE9part d'un domaine de valeurs \xE0 transformer."
|
|
731
|
+
},
|
|
732
|
+
count: {
|
|
733
|
+
name: "compte",
|
|
734
|
+
description: "Nombre de valeurs \xE0 transformer. Si positive, les valeurs transform\xE9es vont de valeurInitiale ascendante \xE0 valeurInitiale+compte-1. Si n\xE9gative, les valeurs transform\xE9es vont de valeurInitiale descendant \xE0 valeurInitiale+compte+1."
|
|
735
|
+
},
|
|
736
|
+
transformedValue: {
|
|
737
|
+
name: "valeurTransformee",
|
|
738
|
+
description: "Valeur de sortie pr\xE9c\xE9dente d'une transformation."
|
|
739
|
+
},
|
|
740
|
+
tweak: {
|
|
741
|
+
name: "reglage",
|
|
742
|
+
description: "Valeur par laquelle r\xE9glager la transformation. Si non fourni ou nul, la sortie est s\xE9quentielle. Sinon, la sortie est crypt\xE9e de mani\xE8re \xE0 para\xEEtre al\xE9atoire, masquant les valeurs utilis\xE9es comme entr\xE9es de la s\xE9quence."
|
|
743
|
+
},
|
|
744
|
+
regExp: {
|
|
745
|
+
name: "expReg",
|
|
746
|
+
description: "Expression r\xE9guli\xE8re par rapport \xE0 laquelle valider une cha\xEEne."
|
|
747
|
+
},
|
|
748
|
+
validateS: {
|
|
749
|
+
name: "c",
|
|
750
|
+
description: "Cha\xEEne \xE0 valider."
|
|
751
|
+
},
|
|
752
|
+
valueForS: {
|
|
753
|
+
name: "c",
|
|
754
|
+
description: "Cha\xEEne pour laquelle d\xE9terminer la valeur."
|
|
755
|
+
},
|
|
756
|
+
errorMessage: {
|
|
757
|
+
name: "messageDErreur",
|
|
758
|
+
description: "Message d'erreur personnalis\xE9 \xE0 utiliser si la validation \xE9choue. S'il n'est pas fourni, un message d'erreur interne est utilis\xE9."
|
|
759
|
+
},
|
|
760
|
+
exclusionNone: {
|
|
761
|
+
name: "exclusion",
|
|
762
|
+
description: "Valeurs de cha\xEEne \xE0 exclure. La seule valeur valide est 0 (aucune exclusion)."
|
|
763
|
+
},
|
|
764
|
+
exclusionFirstZero: {
|
|
765
|
+
name: "exclusion",
|
|
766
|
+
description: "Valeurs de cha\xEEne \xE0 exclure. Les valeurs valides sont 0 (aucune exclusion) et 1 (cha\xEEnes commen\xE7ant par 0 exclues)."
|
|
767
|
+
},
|
|
768
|
+
exclusionAllNumeric: {
|
|
769
|
+
name: "exclusion",
|
|
770
|
+
description: "Valeurs de cha\xEEne \xE0 exclure. Les valeurs valides sont 0 (aucune exclusion) et 2 (cha\xEEnes enti\xE8rement num\xE9riques exclues)."
|
|
771
|
+
},
|
|
772
|
+
exclusionAny: {
|
|
773
|
+
name: "exclusion",
|
|
774
|
+
description: "Valeurs de cha\xEEne \xE0 exclure. Les valeurs valides sont 0 (aucune exclusion), 1 (cha\xEEnes commen\xE7ant par 0 exclues) et 2 (cha\xEEnes toutes num\xE9riques exclues)."
|
|
775
|
+
},
|
|
776
|
+
length: {
|
|
777
|
+
name: "longueur",
|
|
778
|
+
description: "Longueur de cha\xEEne \xE0 cr\xE9er."
|
|
779
|
+
},
|
|
780
|
+
numericS: {
|
|
781
|
+
name: "c",
|
|
782
|
+
description: "Cha\xEEne num\xE9rique."
|
|
783
|
+
},
|
|
784
|
+
numericSFourOrFiveDigits: {
|
|
785
|
+
name: "c",
|
|
786
|
+
description: "Cha\xEEne num\xE9rique \xE0 quatre ou cinq chiffres."
|
|
787
|
+
},
|
|
788
|
+
numericSWithCheckDigit: {
|
|
789
|
+
name: "c",
|
|
790
|
+
description: "Cha\xEEne num\xE9rique avec chiffre de contr\xF4le."
|
|
791
|
+
},
|
|
792
|
+
checkDigit: {
|
|
793
|
+
name: "chiffreDeControle",
|
|
794
|
+
description: "Chiffre de contr\xF4le."
|
|
795
|
+
},
|
|
796
|
+
ai82S: {
|
|
797
|
+
name: "c",
|
|
798
|
+
description: "Cha\xEEne de caract\xE8res GS1 AI 82."
|
|
799
|
+
},
|
|
800
|
+
ai82SWithCheckCharacterPair: {
|
|
801
|
+
name: "c",
|
|
802
|
+
description: "Cha\xEEne de caract\xE8res GS1 AI 82 avec paire de caract\xE8res de contr\xF4le."
|
|
803
|
+
},
|
|
804
|
+
validateIdentifier: {
|
|
805
|
+
name: "cleDIdentification",
|
|
806
|
+
description: "Cl\xE9 d'identification \xE0 valider."
|
|
807
|
+
},
|
|
808
|
+
zeroSuppressibleGTIN12: {
|
|
809
|
+
name: "gtin12",
|
|
810
|
+
description: "GTIN-12 pour lequel supprimer les z\xE9ros."
|
|
811
|
+
},
|
|
812
|
+
zeroSuppressedGTIN12: {
|
|
813
|
+
name: "gtin12SupprimeAZero",
|
|
814
|
+
description: "GTIN-12 supprim\xE9 \xE0 z\xE9ro pour s'\xE9tendre."
|
|
815
|
+
},
|
|
816
|
+
convertGTIN: {
|
|
817
|
+
name: "gtin",
|
|
818
|
+
description: "GTIN \xE0 convertir en GTIN-14."
|
|
819
|
+
},
|
|
820
|
+
normalizeGTIN: {
|
|
821
|
+
name: "gtin",
|
|
822
|
+
description: "GTIN \xE0 normaliser."
|
|
823
|
+
},
|
|
824
|
+
validateGTIN: {
|
|
825
|
+
name: "gtin",
|
|
826
|
+
description: "GTIN \xE0 valider."
|
|
827
|
+
},
|
|
828
|
+
validateGTIN14: {
|
|
829
|
+
name: "gtin14",
|
|
830
|
+
description: "GTIN-14 \xE0 valider."
|
|
831
|
+
},
|
|
832
|
+
baseIdentifier: {
|
|
833
|
+
name: "cleDIdentificationDeBase",
|
|
834
|
+
description: "Cl\xE9 d'identification de base."
|
|
835
|
+
},
|
|
836
|
+
indicatorDigit: {
|
|
837
|
+
name: "indicatorDigit",
|
|
838
|
+
description: "Chiffre indicateur."
|
|
839
|
+
},
|
|
840
|
+
gtinLevel: {
|
|
841
|
+
name: "niveau",
|
|
842
|
+
description: "Niveau auquel valider le GTIN. Les valeurs valides sont 0 (n'importe lequel), 1 (article commercial de consommation au d\xE9tail) et 2 (autre que le niveau de l'article commercial de consommation au d\xE9tail)."
|
|
843
|
+
},
|
|
844
|
+
rcnFormat: {
|
|
845
|
+
name: "format",
|
|
846
|
+
description: "Format de num\xE9ro de diffusion restreinte."
|
|
847
|
+
},
|
|
848
|
+
rcn: {
|
|
849
|
+
name: "rcn",
|
|
850
|
+
description: "Num\xE9ro de diffusion restreint \xE0 analyser."
|
|
851
|
+
},
|
|
852
|
+
prefix: {
|
|
853
|
+
name: "prefixe",
|
|
854
|
+
description: "Pr\xE9fixe."
|
|
855
|
+
},
|
|
856
|
+
prefixType: {
|
|
857
|
+
name: "typeDePr\xE9fixe",
|
|
858
|
+
description: "Type de pr\xE9fixe. Les valeurs valides sont 0 (pr\xE9fixe d'entreprise GS1), 1 (pr\xE9fixe d'entreprise U.P.C.) et 2 (pr\xE9fixe GS1)."
|
|
859
|
+
},
|
|
860
|
+
tweakFactor: {
|
|
861
|
+
name: "facteurDeReglage",
|
|
862
|
+
description: "Facteur de r\xE9glage, utilis\xE9 pour prendre en charge la cr\xE9ation de cl\xE9s d'identification \xE9parses. Le facteur de r\xE9glage par d\xE9faut est bas\xE9 sur le pr\xE9fixe d'entreprise GS1 et est g\xE9n\xE9ralement suffisant pour l'obscurcissement. Cela permet un meilleur contr\xF4le du cryptage lorsqu'une s\xE9curit\xE9 plus \xE9lev\xE9e est requise."
|
|
863
|
+
},
|
|
864
|
+
prefixDefinitionAny: {
|
|
865
|
+
name: "prefixeDefinition",
|
|
866
|
+
description: "D\xE9finition de pr\xE9fixe, soit un pr\xE9fixe d'entreprise simple GS1 (sous forme de cha\xEEne), soit le r\xE9sultat d'un appel \xE0 definePrefix. Tout type de pr\xE9fixe est pris en charge."
|
|
867
|
+
},
|
|
868
|
+
prefixDefinitionGS1UPC: {
|
|
869
|
+
name: "prefixeDefinition",
|
|
870
|
+
description: "D\xE9finition de pr\xE9fixe, soit un pr\xE9fixe d'entreprise simple GS1 (sous forme de cha\xEEne), soit le r\xE9sultat d'un appel \xE0 definePrefix. Seuls les types de pr\xE9fixes 0 (pr\xE9fixe d'entreprise GS1) et 1 (pr\xE9fixe d'entreprise U.P.C.) sont pris en charge."
|
|
871
|
+
},
|
|
872
|
+
sparse: {
|
|
873
|
+
name: "clairsemee",
|
|
874
|
+
description: "Si cette valeur est vraie, la valeur est mapp\xE9e sur une s\xE9quence clairsem\xE9e r\xE9sistante \xE0 la d\xE9couverte. La valeur par d\xE9faut est faux."
|
|
875
|
+
},
|
|
876
|
+
rcnItemReference: {
|
|
877
|
+
name: "referenceDArticle",
|
|
878
|
+
description: "R\xE9f\xE9rence d'article."
|
|
879
|
+
},
|
|
880
|
+
rcnPriceOrWeight: {
|
|
881
|
+
name: "prixOuPoids",
|
|
882
|
+
description: "Prix ou poids (nombre entier uniquement)."
|
|
883
|
+
},
|
|
884
|
+
serialComponent: {
|
|
885
|
+
name: "composanteSerie",
|
|
886
|
+
description: "Composante s\xE9rie."
|
|
887
|
+
},
|
|
888
|
+
reference: {
|
|
889
|
+
name: "reference",
|
|
890
|
+
description: "Partie de r\xE9f\xE9rence de la cl\xE9 d'identification."
|
|
891
|
+
}
|
|
892
|
+
},
|
|
893
|
+
Functions: {
|
|
894
|
+
version: {
|
|
895
|
+
name: "version",
|
|
896
|
+
description: "Obtener la version de la bo\xEEte \xE0 outils AIDC."
|
|
897
|
+
},
|
|
898
|
+
vSpill: {
|
|
899
|
+
name: "vDeverser",
|
|
900
|
+
description: "D\xE9verser un tableau horizontal verticalement pour l'adapter \xE0 une largeur et une hauteur maximales donn\xE9es."
|
|
901
|
+
},
|
|
902
|
+
hSpill: {
|
|
903
|
+
name: "hDeverser",
|
|
904
|
+
description: "D\xE9verser un tableau vertical horizontalement pour l'adapter \xE0 une hauteur et une largeur maximales donn\xE9es."
|
|
905
|
+
},
|
|
906
|
+
forwardTransform: {
|
|
907
|
+
name: "transformerAvant",
|
|
908
|
+
description: "Transformer une valeur en avant."
|
|
909
|
+
},
|
|
910
|
+
forwardTransformSequence: {
|
|
911
|
+
name: "transformerSequenceAvant",
|
|
912
|
+
description: "Transformer une s\xE9quence de valeurs en avant."
|
|
913
|
+
},
|
|
914
|
+
reverseTransform: {
|
|
915
|
+
name: "transformerArriere",
|
|
916
|
+
description: "Transformer une valeur en arri\xE8re."
|
|
917
|
+
},
|
|
918
|
+
validateRegExp: {
|
|
919
|
+
name: "validerExpReg",
|
|
920
|
+
description: "Valider une cha\xEEne par rapport \xE0 une expression r\xE9guli\xE8re."
|
|
921
|
+
},
|
|
922
|
+
isValidRegExp: {
|
|
923
|
+
name: "estValideExpReg",
|
|
924
|
+
description: "D\xE9terminer si une cha\xEEne est valide par rapport \xE0 une expression r\xE9guli\xE8re."
|
|
925
|
+
},
|
|
926
|
+
validateNumeric: {
|
|
927
|
+
name: "validerNumerique",
|
|
928
|
+
description: "Valider une cha\xEEne num\xE9rique."
|
|
929
|
+
},
|
|
930
|
+
isValidNumeric: {
|
|
931
|
+
name: "estValideNumerique",
|
|
932
|
+
description: "D\xE9terminer si une cha\xEEne est num\xE9rique."
|
|
933
|
+
},
|
|
934
|
+
createNumeric: {
|
|
935
|
+
name: "creerNumerique",
|
|
936
|
+
description: "Cr\xE9er une cha\xEEne num\xE9rique."
|
|
937
|
+
},
|
|
938
|
+
createNumericSequence: {
|
|
939
|
+
name: "creerSequenceNumerique",
|
|
940
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes num\xE9riques."
|
|
941
|
+
},
|
|
942
|
+
valueForNumeric: {
|
|
943
|
+
name: "valeurDeNumerique",
|
|
944
|
+
description: "Obtenir la valeur d'une cha\xEEne num\xE9rique."
|
|
945
|
+
},
|
|
946
|
+
validateHexadecimal: {
|
|
947
|
+
name: "validerHexadecimale",
|
|
948
|
+
description: "Valider une cha\xEEne hexad\xE9cimale."
|
|
949
|
+
},
|
|
950
|
+
isValidHexadecimal: {
|
|
951
|
+
name: "estValideHexadecimale",
|
|
952
|
+
description: "D\xE9terminer si une cha\xEEne est hexad\xE9cimale."
|
|
953
|
+
},
|
|
954
|
+
createHexadecimal: {
|
|
955
|
+
name: "creerHexadecimale",
|
|
956
|
+
description: "Cr\xE9er une cha\xEEne hexad\xE9cimale."
|
|
957
|
+
},
|
|
958
|
+
createHexadecimalSequence: {
|
|
959
|
+
name: "creerSequenceHexadecimale",
|
|
960
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes hexad\xE9cimales."
|
|
961
|
+
},
|
|
962
|
+
valueForHexadecimal: {
|
|
963
|
+
name: "valeurDeHexadecimale",
|
|
964
|
+
description: "Obtenir la valeur d'une cha\xEEne hexad\xE9cimale."
|
|
965
|
+
},
|
|
966
|
+
validateAlphabetic: {
|
|
967
|
+
name: "validerAlphabetique",
|
|
968
|
+
description: "Valider une cha\xEEne alphab\xE9tique."
|
|
969
|
+
},
|
|
970
|
+
isValidAlphabetic: {
|
|
971
|
+
name: "estValideAlphabetique",
|
|
972
|
+
description: "D\xE9terminer si une cha\xEEne est alphab\xE9tique."
|
|
973
|
+
},
|
|
974
|
+
createAlphabetic: {
|
|
975
|
+
name: "creerAlphabetique",
|
|
976
|
+
description: "Cr\xE9er une cha\xEEne alphab\xE9tique."
|
|
977
|
+
},
|
|
978
|
+
createAlphabeticSequence: {
|
|
979
|
+
name: "creerSequenceAlphabetique",
|
|
980
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes alphab\xE9tiques."
|
|
981
|
+
},
|
|
982
|
+
valueForAlphabetic: {
|
|
983
|
+
name: "valeurDeAlphabetique",
|
|
984
|
+
description: "Obtenir la valeur d'une cha\xEEne alphab\xE9tique."
|
|
985
|
+
},
|
|
986
|
+
validateAlphanumeric: {
|
|
987
|
+
name: "validerAlphanumerique",
|
|
988
|
+
description: "Valider une cha\xEEne alphanum\xE9rique."
|
|
989
|
+
},
|
|
990
|
+
isValidAlphanumeric: {
|
|
991
|
+
name: "estValideAlphanumerique",
|
|
992
|
+
description: "D\xE9terminer si une cha\xEEne est alphanum\xE9rique."
|
|
993
|
+
},
|
|
994
|
+
createAlphanumeric: {
|
|
995
|
+
name: "creerAlphanumerique",
|
|
996
|
+
description: "Cr\xE9er une cha\xEEne alphanum\xE9rique."
|
|
997
|
+
},
|
|
998
|
+
createAlphanumericSequence: {
|
|
999
|
+
name: "creerSequenceAlphanumerique",
|
|
1000
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes alphanum\xE9riques."
|
|
1001
|
+
},
|
|
1002
|
+
valueForAlphanumeric: {
|
|
1003
|
+
name: "valeurDeAlphanumerique",
|
|
1004
|
+
description: "Obtenir la valeur d'une cha\xEEne alphanum\xE9rique."
|
|
1005
|
+
},
|
|
1006
|
+
GS1: {
|
|
1007
|
+
validateAI82: {
|
|
1008
|
+
name: "validerAI82",
|
|
1009
|
+
description: "Valider une cha\xEEne de caract\xE8res GS1 AI 82."
|
|
1010
|
+
},
|
|
1011
|
+
isValidAI82: {
|
|
1012
|
+
name: "estValideAI82",
|
|
1013
|
+
description: "D\xE9terminer si une cha\xEEne est un jeu de caract\xE8res GS1 AI 82."
|
|
1014
|
+
},
|
|
1015
|
+
createAI82: {
|
|
1016
|
+
name: "creerAI82",
|
|
1017
|
+
description: "Cr\xE9er une cha\xEEne de caract\xE8res GS1 AI 82."
|
|
1018
|
+
},
|
|
1019
|
+
createAI82Sequence: {
|
|
1020
|
+
name: "creerSequenceAI82",
|
|
1021
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes de caract\xE8res GS1 AI 82."
|
|
1022
|
+
},
|
|
1023
|
+
valueForAI82: {
|
|
1024
|
+
name: "valeurDeAI82",
|
|
1025
|
+
description: "Obtenez la valeur d'une cha\xEEne de caract\xE8res GS1 AI 82."
|
|
1026
|
+
},
|
|
1027
|
+
validateAI39: {
|
|
1028
|
+
name: "validerAI39",
|
|
1029
|
+
description: "Valider une cha\xEEne de caract\xE8res GS1 AI 39."
|
|
1030
|
+
},
|
|
1031
|
+
isValidAI39: {
|
|
1032
|
+
name: "estValideAI39",
|
|
1033
|
+
description: "D\xE9terminer si une cha\xEEne est un jeu de caract\xE8res GS1 AI 39."
|
|
1034
|
+
},
|
|
1035
|
+
createAI39: {
|
|
1036
|
+
name: "creerAI39",
|
|
1037
|
+
description: "Cr\xE9er une cha\xEEne de caract\xE8res GS1 AI 39."
|
|
1038
|
+
},
|
|
1039
|
+
createAI39Sequence: {
|
|
1040
|
+
name: "creerSequenceAI39",
|
|
1041
|
+
description: "Cr\xE9er une s\xE9quence de cha\xEEnes de caract\xE8res GS1 AI 39."
|
|
1042
|
+
},
|
|
1043
|
+
valueForAI39: {
|
|
1044
|
+
name: "valeurDeAI39",
|
|
1045
|
+
description: "Obtenez la valeur d'une cha\xEEne de caract\xE8res GS1 AI 39."
|
|
1046
|
+
},
|
|
1047
|
+
checkDigit: {
|
|
1048
|
+
name: "chiffreDeControle",
|
|
1049
|
+
description: "Calculer le chiffre de contr\xF4le pour une cha\xEEne num\xE9rique."
|
|
1050
|
+
},
|
|
1051
|
+
hasValidCheckDigit: {
|
|
1052
|
+
name: "aChiffreDeControleValide",
|
|
1053
|
+
description: "D\xE9terminer si une cha\xEEne a un chiffre de contr\xF4le valide."
|
|
1054
|
+
},
|
|
1055
|
+
priceOrWeightCheckDigit: {
|
|
1056
|
+
name: "chiffreDeControlePrixOuPoids",
|
|
1057
|
+
description: "Calculer le chiffre de contr\xF4le pour un prix ou un poids."
|
|
1058
|
+
},
|
|
1059
|
+
isValidPriceOrWeightCheckDigit: {
|
|
1060
|
+
name: "estChiffreDeControlePrixOuPoidsValide",
|
|
1061
|
+
description: "D\xE9terminer si un chiffre de contr\xF4le de prix ou de poids est valide."
|
|
1062
|
+
},
|
|
1063
|
+
checkCharacterPair: {
|
|
1064
|
+
name: "paireDeCaracteresDeControle",
|
|
1065
|
+
description: "Calculer la paire de caract\xE8res de contr\xF4le pour une cha\xEEne de caract\xE8res."
|
|
1066
|
+
},
|
|
1067
|
+
hasValidCheckCharacterPair: {
|
|
1068
|
+
name: "aPaireDeCaracteresDeControleValide",
|
|
1069
|
+
description: "D\xE9terminez si une cha\xEEne de caract\xE8res GS1 AI 82 a une paire de caract\xE8res de contr\xF4le valide."
|
|
1070
|
+
},
|
|
1071
|
+
validateGTIN13: {
|
|
1072
|
+
name: "validerGTIN13",
|
|
1073
|
+
description: "Valider un GTIN-13."
|
|
1074
|
+
},
|
|
1075
|
+
validateGTIN12: {
|
|
1076
|
+
name: "validerGTIN12",
|
|
1077
|
+
description: "Valider un GTIN-12."
|
|
1078
|
+
},
|
|
1079
|
+
validateGTIN8: {
|
|
1080
|
+
name: "validerGTIN8",
|
|
1081
|
+
description: "Valider un GTIN-8."
|
|
1082
|
+
},
|
|
1083
|
+
zeroSuppressGTIN12: {
|
|
1084
|
+
name: "supprimerZeroGTIN12",
|
|
1085
|
+
description: "Supprimer les z\xE9ros d'un GTIN-12."
|
|
1086
|
+
},
|
|
1087
|
+
zeroExpandGTIN12: {
|
|
1088
|
+
name: "etendrerZeroGTIN12",
|
|
1089
|
+
description: "\xC9tendrer un GTIN-12 supprim\xE9 \xE0 z\xE9ro."
|
|
1090
|
+
},
|
|
1091
|
+
convertToGTIN14: {
|
|
1092
|
+
name: "convertirEnGTIN14",
|
|
1093
|
+
description: "Convertir un GTIN en GTIN-14."
|
|
1094
|
+
},
|
|
1095
|
+
normalizeGTIN: {
|
|
1096
|
+
name: "normalizeGTIN",
|
|
1097
|
+
description: "Normaliser un GTIN."
|
|
1098
|
+
},
|
|
1099
|
+
validateGTIN: {
|
|
1100
|
+
name: "validerGTIN",
|
|
1101
|
+
description: "Validez n'importe quel GTIN."
|
|
1102
|
+
},
|
|
1103
|
+
validateGTIN14: {
|
|
1104
|
+
name: "validerGTIN14",
|
|
1105
|
+
description: "Valider un GTIN-14."
|
|
1106
|
+
},
|
|
1107
|
+
parseVariableMeasureRCN: {
|
|
1108
|
+
name: "parseVariableMeasureRCN",
|
|
1109
|
+
description: "Analyser un num\xE9ro de diffusion restreinte (RCN) \xE0 l'aide d'un format d'article commercial \xE0 mesure variable."
|
|
1110
|
+
},
|
|
1111
|
+
validateGLN: {
|
|
1112
|
+
name: "validerGLN",
|
|
1113
|
+
description: "Valider un GLN."
|
|
1114
|
+
},
|
|
1115
|
+
validateSSCC: {
|
|
1116
|
+
name: "validerSSCC",
|
|
1117
|
+
description: "Valider un SSCC."
|
|
1118
|
+
},
|
|
1119
|
+
validateGRAI: {
|
|
1120
|
+
name: "validerGRAI",
|
|
1121
|
+
description: "Valider un GRAI."
|
|
1122
|
+
},
|
|
1123
|
+
validateGIAI: {
|
|
1124
|
+
name: "validerGIAI",
|
|
1125
|
+
description: "Valider un GIAI."
|
|
1126
|
+
},
|
|
1127
|
+
validateGSRN: {
|
|
1128
|
+
name: "validerGSRN",
|
|
1129
|
+
description: "Valider un GSRN."
|
|
1130
|
+
},
|
|
1131
|
+
validateGDTI: {
|
|
1132
|
+
name: "validerGDTI",
|
|
1133
|
+
description: "Valider un GDTI."
|
|
1134
|
+
},
|
|
1135
|
+
validateGINC: {
|
|
1136
|
+
name: "validerGINC",
|
|
1137
|
+
description: "Valider un GINC."
|
|
1138
|
+
},
|
|
1139
|
+
validateGSIN: {
|
|
1140
|
+
name: "validerGSIN",
|
|
1141
|
+
description: "Valider un GSIN."
|
|
1142
|
+
},
|
|
1143
|
+
validateGCN: {
|
|
1144
|
+
name: "validerGCN",
|
|
1145
|
+
description: "Valider un GCN."
|
|
1146
|
+
},
|
|
1147
|
+
validateCPID: {
|
|
1148
|
+
name: "validerCPID",
|
|
1149
|
+
description: "Valider un CPID."
|
|
1150
|
+
},
|
|
1151
|
+
validateGMN: {
|
|
1152
|
+
name: "validerGMN",
|
|
1153
|
+
description: "Valider un GMN."
|
|
1154
|
+
},
|
|
1155
|
+
definePrefix: {
|
|
1156
|
+
name: "definisserPrefixe",
|
|
1157
|
+
description: "D\xE9finisser un pr\xE9fixe \xE0 utiliser dans les fonctions de cr\xE9ation de cl\xE9 d'identification GS1."
|
|
1158
|
+
},
|
|
1159
|
+
createGTIN: {
|
|
1160
|
+
name: "creerGTIN",
|
|
1161
|
+
description: "Cr\xE9er un GTIN."
|
|
1162
|
+
},
|
|
1163
|
+
createGTINSequence: {
|
|
1164
|
+
name: "creerSequenceGTIN",
|
|
1165
|
+
description: "Cr\xE9er un s\xE9quence de GTIN."
|
|
1166
|
+
},
|
|
1167
|
+
createAllGTIN: {
|
|
1168
|
+
name: "creerTousGTIN",
|
|
1169
|
+
description: "Cr\xE9ez tous les GTIN pour un pr\xE9fixe."
|
|
1170
|
+
},
|
|
1171
|
+
createGTIN14: {
|
|
1172
|
+
name: "creerGTIN14",
|
|
1173
|
+
description: "Cr\xE9er un GTIN-14."
|
|
1174
|
+
},
|
|
1175
|
+
createVariableMeasureRCN: {
|
|
1176
|
+
name: "creerMesureVariableRCN",
|
|
1177
|
+
description: "Cr\xE9er un num\xE9ro de diffusion restreinte (RCN) \xE0 l'aide d'un format d'article commercial \xE0 mesure variable."
|
|
1178
|
+
},
|
|
1179
|
+
createGLN: {
|
|
1180
|
+
name: "creerGLN",
|
|
1181
|
+
description: "Cr\xE9er un GLN."
|
|
1182
|
+
},
|
|
1183
|
+
createGLNSequence: {
|
|
1184
|
+
name: "creerSequenceGLN",
|
|
1185
|
+
description: "Cr\xE9er un s\xE9quence de GLN."
|
|
1186
|
+
},
|
|
1187
|
+
createAllGLN: {
|
|
1188
|
+
name: "creerTousGLN",
|
|
1189
|
+
description: "Cr\xE9ez tous les GLN pour un pr\xE9fixe."
|
|
1190
|
+
},
|
|
1191
|
+
createSSCC: {
|
|
1192
|
+
name: "creerSSCC",
|
|
1193
|
+
description: "Cr\xE9er un SSCC."
|
|
1194
|
+
},
|
|
1195
|
+
createSSCCSequence: {
|
|
1196
|
+
name: "creerSequenceSSCC",
|
|
1197
|
+
description: "Cr\xE9er un s\xE9quence de SSCC."
|
|
1198
|
+
},
|
|
1199
|
+
createAllSSCC: {
|
|
1200
|
+
name: "creerTousSSCC",
|
|
1201
|
+
description: "Cr\xE9ez tous les SSCC pour un pr\xE9fixe."
|
|
1202
|
+
},
|
|
1203
|
+
createGRAI: {
|
|
1204
|
+
name: "creerGRAI",
|
|
1205
|
+
description: "Cr\xE9er un GRAI."
|
|
1206
|
+
},
|
|
1207
|
+
createGRAISequence: {
|
|
1208
|
+
name: "creerSequenceGRAI",
|
|
1209
|
+
description: "Cr\xE9er un s\xE9quence de GRAI."
|
|
1210
|
+
},
|
|
1211
|
+
createAllGRAI: {
|
|
1212
|
+
name: "creerTousGRAI",
|
|
1213
|
+
description: "Cr\xE9ez tous les GRAI pour un pr\xE9fixe."
|
|
1214
|
+
},
|
|
1215
|
+
createSerializedGRAI: {
|
|
1216
|
+
name: "creerGRAISerialise",
|
|
1217
|
+
description: "Cr\xE9er un GRAI s\xE9rialis\xE9."
|
|
1218
|
+
},
|
|
1219
|
+
concatenateGRAI: {
|
|
1220
|
+
name: "concatenerGRAI",
|
|
1221
|
+
description: "Concat\xE9ner une base GRAI avec un composant s\xE9rie."
|
|
1222
|
+
},
|
|
1223
|
+
createGIAI: {
|
|
1224
|
+
name: "creerGIAI",
|
|
1225
|
+
description: "Cr\xE9er un GIAI."
|
|
1226
|
+
},
|
|
1227
|
+
createGSRN: {
|
|
1228
|
+
name: "creerGSRN",
|
|
1229
|
+
description: "Cr\xE9er un GSRN."
|
|
1230
|
+
},
|
|
1231
|
+
createGSRNSequence: {
|
|
1232
|
+
name: "creerSequenceGSRN",
|
|
1233
|
+
description: "Cr\xE9er un s\xE9quence de GSRN."
|
|
1234
|
+
},
|
|
1235
|
+
createAllGSRN: {
|
|
1236
|
+
name: "creerTousGSRN",
|
|
1237
|
+
description: "Cr\xE9ez tous les GSRN pour un pr\xE9fixe."
|
|
1238
|
+
},
|
|
1239
|
+
createGDTI: {
|
|
1240
|
+
name: "creerGDTI",
|
|
1241
|
+
description: "Cr\xE9er un GDTI."
|
|
1242
|
+
},
|
|
1243
|
+
createGDTISequence: {
|
|
1244
|
+
name: "creerSequenceGDTI",
|
|
1245
|
+
description: "Cr\xE9er un s\xE9quence de GDTI."
|
|
1246
|
+
},
|
|
1247
|
+
createAllGDTI: {
|
|
1248
|
+
name: "creerTousGDTI",
|
|
1249
|
+
description: "Cr\xE9ez tous les GDTI pour un pr\xE9fixe."
|
|
1250
|
+
},
|
|
1251
|
+
createSerializedGDTI: {
|
|
1252
|
+
name: "creerGDTISerialise",
|
|
1253
|
+
description: "Cr\xE9er un GDTI s\xE9rialis\xE9."
|
|
1254
|
+
},
|
|
1255
|
+
concatenateGDTI: {
|
|
1256
|
+
name: "concatenerGDTI",
|
|
1257
|
+
description: "Concat\xE9ner une base GDTI avec un composant s\xE9rie."
|
|
1258
|
+
},
|
|
1259
|
+
createGINC: {
|
|
1260
|
+
name: "creerGINC",
|
|
1261
|
+
description: "Cr\xE9er un GINC."
|
|
1262
|
+
},
|
|
1263
|
+
createGSIN: {
|
|
1264
|
+
name: "creerGSIN",
|
|
1265
|
+
description: "Cr\xE9er un GSIN."
|
|
1266
|
+
},
|
|
1267
|
+
createGSINSequence: {
|
|
1268
|
+
name: "creerSequenceGSIN",
|
|
1269
|
+
description: "Cr\xE9er un s\xE9quence de GSIN."
|
|
1270
|
+
},
|
|
1271
|
+
createAllGSIN: {
|
|
1272
|
+
name: "creerTousGSIN",
|
|
1273
|
+
description: "Cr\xE9ez tous les GSIN pour un pr\xE9fixe."
|
|
1274
|
+
},
|
|
1275
|
+
createGCN: {
|
|
1276
|
+
name: "creerGCN",
|
|
1277
|
+
description: "Cr\xE9er un GCN."
|
|
1278
|
+
},
|
|
1279
|
+
createGCNSequence: {
|
|
1280
|
+
name: "creerSequenceGCN",
|
|
1281
|
+
description: "Cr\xE9er un s\xE9quence de GCN."
|
|
1282
|
+
},
|
|
1283
|
+
createAllGCN: {
|
|
1284
|
+
name: "creerTousGCN",
|
|
1285
|
+
description: "Cr\xE9ez tous les GCN pour un pr\xE9fixe."
|
|
1286
|
+
},
|
|
1287
|
+
createSerializedGCN: {
|
|
1288
|
+
name: "creerGCNSerialise",
|
|
1289
|
+
description: "Cr\xE9er un GCN s\xE9rialis\xE9."
|
|
1290
|
+
},
|
|
1291
|
+
concatenateGCN: {
|
|
1292
|
+
name: "concatenerGCN",
|
|
1293
|
+
description: "Concat\xE9ner une base GCN avec un composant s\xE9rie."
|
|
1294
|
+
},
|
|
1295
|
+
createCPID: {
|
|
1296
|
+
name: "creerCPID",
|
|
1297
|
+
description: "Cr\xE9er un CPID."
|
|
1298
|
+
},
|
|
1299
|
+
createGMN: {
|
|
1300
|
+
name: "creerGMN",
|
|
1301
|
+
description: "Cr\xE9er un GMN."
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
// src/locale/i18n.ts
|
|
1308
|
+
var appExtensionNS = "aidct_app_extension";
|
|
1309
|
+
var appExtensionResources = {
|
|
1310
|
+
en: {
|
|
1311
|
+
aidct_app_extension: locale_resources_default
|
|
1312
|
+
},
|
|
1313
|
+
fr: {
|
|
1314
|
+
aidct_app_extension: locale_resources_default2
|
|
1315
|
+
}
|
|
1316
|
+
};
|
|
1317
|
+
var i18nextAppExtension = import_i18next.default.createInstance();
|
|
1318
|
+
async function i18nAppExtensionInit(environment, debug = false) {
|
|
1319
|
+
await (0, import_utility.i18nUtilityInit)(environment, debug);
|
|
1320
|
+
await (0, import_gs1.i18nGS1Init)(environment, debug);
|
|
1321
|
+
await (0, import_core.i18nCoreInit)(i18nextAppExtension, environment, debug, appExtensionNS, import_utility.utilityResources, import_gs1.gs1Resources, appExtensionResources);
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
// src/app-extension.ts
|
|
1325
|
+
var AppExtension = class {
|
|
1326
|
+
/**
|
|
1327
|
+
* Application version.
|
|
1328
|
+
*/
|
|
1329
|
+
_version;
|
|
1330
|
+
/**
|
|
1331
|
+
* Maximum sequence count supported by application.
|
|
1332
|
+
*/
|
|
1333
|
+
_maximumSequenceCount;
|
|
1334
|
+
/**
|
|
1335
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
1336
|
+
*/
|
|
1337
|
+
_throwError;
|
|
1338
|
+
/**
|
|
1339
|
+
* Maximum width supported by application.
|
|
1340
|
+
*/
|
|
1341
|
+
_maximumWidth;
|
|
1342
|
+
/**
|
|
1343
|
+
* Maximum height supported by application.
|
|
1344
|
+
*/
|
|
1345
|
+
_maximumHeight;
|
|
1346
|
+
/**
|
|
1347
|
+
* Constructor.
|
|
1348
|
+
*
|
|
1349
|
+
* @param version
|
|
1350
|
+
* Application version.
|
|
1351
|
+
*
|
|
1352
|
+
* @param maximumSequenceCount
|
|
1353
|
+
* Maximum sequence count supported by application.
|
|
1354
|
+
*
|
|
1355
|
+
* @param throwError
|
|
1356
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
1357
|
+
*/
|
|
1358
|
+
constructor(version, maximumSequenceCount, throwError) {
|
|
1359
|
+
this._version = version;
|
|
1360
|
+
this._maximumSequenceCount = maximumSequenceCount;
|
|
1361
|
+
this._throwError = throwError;
|
|
1362
|
+
}
|
|
1363
|
+
/**
|
|
1364
|
+
* Get the version.
|
|
1365
|
+
*
|
|
1366
|
+
* @returns
|
|
1367
|
+
* Version.
|
|
1368
|
+
*/
|
|
1369
|
+
get version() {
|
|
1370
|
+
return this._version;
|
|
1371
|
+
}
|
|
1372
|
+
/**
|
|
1373
|
+
* Determine if errors are reported through the throw/catch mechanism.
|
|
1374
|
+
*/
|
|
1375
|
+
get throwError() {
|
|
1376
|
+
return this._throwError;
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Get the maximum width supported by the application.
|
|
1380
|
+
*
|
|
1381
|
+
* @returns
|
|
1382
|
+
* Maximum width supported by the application.
|
|
1383
|
+
*/
|
|
1384
|
+
async maximumWidth() {
|
|
1385
|
+
this._maximumWidth ??= await this.getMaximumWidth();
|
|
1386
|
+
return this._maximumWidth;
|
|
1387
|
+
}
|
|
1388
|
+
/**
|
|
1389
|
+
* Get the maximum height supported by the application.
|
|
1390
|
+
*
|
|
1391
|
+
* @returns
|
|
1392
|
+
* Maximum height supported by the application.
|
|
1393
|
+
*/
|
|
1394
|
+
async maximumHeight() {
|
|
1395
|
+
this._maximumHeight ??= await this.getMaximumHeight();
|
|
1396
|
+
return this._maximumHeight;
|
|
1397
|
+
}
|
|
1398
|
+
/**
|
|
1399
|
+
* Validate a sequence count against the maximum supported by application.
|
|
1400
|
+
*
|
|
1401
|
+
* @param sequenceCount
|
|
1402
|
+
* Sequence count.
|
|
1403
|
+
*/
|
|
1404
|
+
validateSequenceCount(sequenceCount) {
|
|
1405
|
+
const absoluteSequenceCount = Math.abs(sequenceCount);
|
|
1406
|
+
if (absoluteSequenceCount > this._maximumSequenceCount) {
|
|
1407
|
+
throw new RangeError(i18nextAppExtension.t("AppExtension.sequenceCountMustBeLessThanOrEqualTo", {
|
|
1408
|
+
sequenceCount: absoluteSequenceCount,
|
|
1409
|
+
maximumSequenceCount: this._maximumSequenceCount
|
|
1410
|
+
}));
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Bind a synchronous method and wrap it in a try/catch for comprehensive error handling.
|
|
1415
|
+
*
|
|
1416
|
+
* @param thisArg
|
|
1417
|
+
* The value to be passed as the `this` parameter to the method.
|
|
1418
|
+
*
|
|
1419
|
+
* @param method
|
|
1420
|
+
* Method to call.
|
|
1421
|
+
*
|
|
1422
|
+
* @returns
|
|
1423
|
+
* Function wrapped around the method.
|
|
1424
|
+
*/
|
|
1425
|
+
bindSync(thisArg, method) {
|
|
1426
|
+
const boundMethod = method.bind(thisArg);
|
|
1427
|
+
return (...args) => {
|
|
1428
|
+
try {
|
|
1429
|
+
return boundMethod(...args);
|
|
1430
|
+
} catch (e) {
|
|
1431
|
+
console.error(e);
|
|
1432
|
+
this.handleError(e instanceof Error ? e.message : String(e));
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
/**
|
|
1437
|
+
* Bind an asynchronous method and wrap it in a try/catch for comprehensive error handling.
|
|
1438
|
+
*
|
|
1439
|
+
* @param thisArg
|
|
1440
|
+
* The value to be passed as the `this` parameter to the method.
|
|
1441
|
+
*
|
|
1442
|
+
* @param method
|
|
1443
|
+
* Method to call.
|
|
1444
|
+
*
|
|
1445
|
+
* @returns
|
|
1446
|
+
* Function wrapped around the method.
|
|
1447
|
+
*/
|
|
1448
|
+
bindAsync(thisArg, method) {
|
|
1449
|
+
const boundMethod = method.bind(thisArg);
|
|
1450
|
+
return async (...args) => await boundMethod(...args).catch((e) => {
|
|
1451
|
+
console.error(e);
|
|
1452
|
+
this.handleError(e instanceof Error ? e.message : String(e));
|
|
1453
|
+
});
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
|
|
1457
|
+
// src/lib-proxy.ts
|
|
1458
|
+
var import_utility2 = require("@aidc-toolkit/utility");
|
|
1459
|
+
var LibProxy = class {
|
|
1460
|
+
/**
|
|
1461
|
+
* Application extension.
|
|
1462
|
+
*/
|
|
1463
|
+
_appExtension;
|
|
1464
|
+
/**
|
|
1465
|
+
* Constructor.
|
|
1466
|
+
*
|
|
1467
|
+
* @param appExtension
|
|
1468
|
+
* Application extension.
|
|
1469
|
+
*/
|
|
1470
|
+
constructor(appExtension) {
|
|
1471
|
+
this._appExtension = appExtension;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Get the application extension.
|
|
1475
|
+
*/
|
|
1476
|
+
get appExtension() {
|
|
1477
|
+
return this._appExtension;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Map big integer to another type if necessary.
|
|
1481
|
+
*
|
|
1482
|
+
* @param value
|
|
1483
|
+
* Big integer value to map.
|
|
1484
|
+
*
|
|
1485
|
+
* @returns
|
|
1486
|
+
* Mapped big integer value.
|
|
1487
|
+
*/
|
|
1488
|
+
mapBigInt(value) {
|
|
1489
|
+
return this._appExtension.mapBigInt(value);
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Handle an error thrown by a function call.
|
|
1493
|
+
*
|
|
1494
|
+
* @param e
|
|
1495
|
+
* Error.
|
|
1496
|
+
*
|
|
1497
|
+
* @returns
|
|
1498
|
+
* Error if errors are not thrown.
|
|
1499
|
+
*/
|
|
1500
|
+
handleError(e) {
|
|
1501
|
+
let result;
|
|
1502
|
+
if (e instanceof RangeError) {
|
|
1503
|
+
const error = this._appExtension.mapRangeError(e);
|
|
1504
|
+
if (this._appExtension.throwError) {
|
|
1505
|
+
throw error;
|
|
1506
|
+
}
|
|
1507
|
+
result = error;
|
|
1508
|
+
} else {
|
|
1509
|
+
throw e;
|
|
1510
|
+
}
|
|
1511
|
+
return result;
|
|
1512
|
+
}
|
|
1513
|
+
/**
|
|
1514
|
+
* Do the callback for a simple return.
|
|
1515
|
+
*
|
|
1516
|
+
* @param value
|
|
1517
|
+
* Value.
|
|
1518
|
+
*
|
|
1519
|
+
* @param callback
|
|
1520
|
+
* Callback.
|
|
1521
|
+
*
|
|
1522
|
+
* @returns
|
|
1523
|
+
* Callback result or error if errors are not thrown.
|
|
1524
|
+
*/
|
|
1525
|
+
doCallback(value, callback) {
|
|
1526
|
+
let result;
|
|
1527
|
+
try {
|
|
1528
|
+
result = callback(value);
|
|
1529
|
+
} catch (e) {
|
|
1530
|
+
result = this.handleError(e);
|
|
1531
|
+
}
|
|
1532
|
+
return result;
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Map a matrix of values using a callback.
|
|
1536
|
+
*
|
|
1537
|
+
* @param matrixValues
|
|
1538
|
+
* Matrix of values.
|
|
1539
|
+
*
|
|
1540
|
+
* @param callback
|
|
1541
|
+
* Callback.
|
|
1542
|
+
*
|
|
1543
|
+
* @returns
|
|
1544
|
+
* Matrix of callback results and errors if errors are not thrown.
|
|
1545
|
+
*/
|
|
1546
|
+
mapMatrix(matrixValues, callback) {
|
|
1547
|
+
return matrixValues.map((rowValues) => rowValues.map((value) => this.doCallback(value, callback)));
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Do the callback for an array return.
|
|
1551
|
+
*
|
|
1552
|
+
* @param value
|
|
1553
|
+
* Value.
|
|
1554
|
+
*
|
|
1555
|
+
* @param callback
|
|
1556
|
+
* Callback.
|
|
1557
|
+
*
|
|
1558
|
+
* @returns
|
|
1559
|
+
* Callback result or error as array if errors are not thrown.
|
|
1560
|
+
*/
|
|
1561
|
+
doArrayCallback(value, callback) {
|
|
1562
|
+
const result = this.doCallback(value, callback);
|
|
1563
|
+
return result instanceof Array ? result : [result];
|
|
1564
|
+
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Map a one-dimensional matrix of values using a callback.
|
|
1567
|
+
*
|
|
1568
|
+
* @param matrixValues
|
|
1569
|
+
* Matrix of values.
|
|
1570
|
+
*
|
|
1571
|
+
* @param callback
|
|
1572
|
+
* Callback.
|
|
1573
|
+
*
|
|
1574
|
+
* @returns
|
|
1575
|
+
* Matrix of callback results and errors if errors are not thrown.
|
|
1576
|
+
*/
|
|
1577
|
+
mapArray(matrixValues, callback) {
|
|
1578
|
+
let matrixResultError;
|
|
1579
|
+
if (matrixValues.length === 0) {
|
|
1580
|
+
matrixResultError = [[]];
|
|
1581
|
+
} else if (matrixValues.length === 1) {
|
|
1582
|
+
matrixResultError = [];
|
|
1583
|
+
matrixValues[0].forEach((value, columnIndex) => {
|
|
1584
|
+
const arrayResultError = this.doArrayCallback(value, callback);
|
|
1585
|
+
arrayResultError.forEach((resultError, rowIndex) => {
|
|
1586
|
+
if (matrixResultError.length <= rowIndex) {
|
|
1587
|
+
matrixResultError.push([]);
|
|
1588
|
+
}
|
|
1589
|
+
matrixResultError[rowIndex][columnIndex] = resultError;
|
|
1590
|
+
});
|
|
1591
|
+
});
|
|
1592
|
+
} else {
|
|
1593
|
+
matrixResultError = matrixValues.map((rowValue) => {
|
|
1594
|
+
let arrayResultError;
|
|
1595
|
+
if (rowValue.length === 0) {
|
|
1596
|
+
arrayResultError = [];
|
|
1597
|
+
} else if (rowValue.length === 1) {
|
|
1598
|
+
arrayResultError = this.doArrayCallback(rowValue[0], callback);
|
|
1599
|
+
} else {
|
|
1600
|
+
arrayResultError = [this.handleError(new RangeError(i18nextAppExtension.t("Proxy.matrixMustBeArray")))];
|
|
1601
|
+
}
|
|
1602
|
+
return arrayResultError;
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
return matrixResultError;
|
|
1606
|
+
}
|
|
1607
|
+
/**
|
|
1608
|
+
* Map a matrix of values to a matrix of strings via a callback that either returns or throws a range error. If the
|
|
1609
|
+
* callback returns, the result for that element is the empty string; otherwise, if it's a range error, the result
|
|
1610
|
+
* for that element is the error message.
|
|
1611
|
+
*
|
|
1612
|
+
* @param matrixValues
|
|
1613
|
+
* Matrix to map.
|
|
1614
|
+
*
|
|
1615
|
+
* @param callback
|
|
1616
|
+
* Callback that either returns or throws an exception.
|
|
1617
|
+
*
|
|
1618
|
+
* @returns
|
|
1619
|
+
* Matrix of strings.
|
|
1620
|
+
*
|
|
1621
|
+
* @template TValue
|
|
1622
|
+
* Value type.
|
|
1623
|
+
*/
|
|
1624
|
+
static mapMatrixRangeError(matrixValues, callback) {
|
|
1625
|
+
return matrixValues.map((rowValues) => rowValues.map((value) => {
|
|
1626
|
+
let result;
|
|
1627
|
+
try {
|
|
1628
|
+
callback(value);
|
|
1629
|
+
result = "";
|
|
1630
|
+
} catch (e) {
|
|
1631
|
+
if (e instanceof RangeError) {
|
|
1632
|
+
result = e.message;
|
|
1633
|
+
} else {
|
|
1634
|
+
throw e instanceof Error ? e : new Error("Unknown error", {
|
|
1635
|
+
cause: e
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
return result;
|
|
1640
|
+
}));
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Convert an iterable result of a callback to a matrix result. Although the natural approach would be to map to a
|
|
1644
|
+
* single-element array containing an array of *N* results (i.e., [[r0, r1, r2, ..., r*N*]]), this is rendered
|
|
1645
|
+
* visually as a single row. The more readable approach is as a single column, so the mapping is to an *N*-element
|
|
1646
|
+
* array of single-element result arrays (i.e., [[r0], [r1], [r2], ..., [r*N*]]).
|
|
1647
|
+
*
|
|
1648
|
+
* @param iterableResult
|
|
1649
|
+
* Iterable result.
|
|
1650
|
+
*
|
|
1651
|
+
* @returns
|
|
1652
|
+
* Matrix of callback results.
|
|
1653
|
+
*/
|
|
1654
|
+
static matrixResult(iterableResult) {
|
|
1655
|
+
return Array.from((0, import_utility2.mapIterable)(iterableResult, (result) => [result]));
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
|
|
1659
|
+
// src/descriptor.ts
|
|
1660
|
+
var Types = {
|
|
1661
|
+
/**
|
|
1662
|
+
* String.
|
|
1663
|
+
*/
|
|
1664
|
+
String: 0,
|
|
1665
|
+
/**
|
|
1666
|
+
* Number or enumeration.
|
|
1667
|
+
*/
|
|
1668
|
+
Number: 1,
|
|
1669
|
+
/**
|
|
1670
|
+
* Boolean.
|
|
1671
|
+
*/
|
|
1672
|
+
Boolean: 2,
|
|
1673
|
+
/**
|
|
1674
|
+
* Any.
|
|
1675
|
+
*/
|
|
1676
|
+
Any: 3
|
|
1677
|
+
};
|
|
1678
|
+
function expandParameterDescriptor(parameterDescriptor) {
|
|
1679
|
+
return !("extendsDescriptor" in parameterDescriptor) ? parameterDescriptor : {
|
|
1680
|
+
...expandParameterDescriptor(parameterDescriptor.extendsDescriptor),
|
|
1681
|
+
...parameterDescriptor
|
|
1682
|
+
};
|
|
1683
|
+
}
|
|
1684
|
+
var pendingParameterDescriptors = [];
|
|
1685
|
+
var classMethodsDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1686
|
+
var classDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1687
|
+
function ProxyParameter(parameterDescriptor) {
|
|
1688
|
+
return (_target, _propertyKey, parameterIndex) => {
|
|
1689
|
+
pendingParameterDescriptors[parameterIndex] = parameterDescriptor;
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
function ProxyMethod(methodDescriptor) {
|
|
1693
|
+
return (target, propertyKey, propertyDescriptor) => {
|
|
1694
|
+
const declarationClassName = target.constructor.name;
|
|
1695
|
+
if (typeof propertyDescriptor.value !== "function") {
|
|
1696
|
+
throw new Error(`${declarationClassName}.${propertyKey} is not a method`);
|
|
1697
|
+
}
|
|
1698
|
+
const parameterCount = propertyDescriptor.value.length - (!(methodDescriptor.requiresContext ?? false) ? 0 : 1);
|
|
1699
|
+
let anyOptional = false;
|
|
1700
|
+
for (let index = 0; index < parameterCount; index++) {
|
|
1701
|
+
const parameterDescriptor = expandParameterDescriptor(pendingParameterDescriptors[index]);
|
|
1702
|
+
if (typeof parameterDescriptor === "undefined") {
|
|
1703
|
+
throw new Error(`Missing parameter descriptor at index ${index} of ${declarationClassName}.${propertyKey}`);
|
|
1704
|
+
}
|
|
1705
|
+
if (!parameterDescriptor.isRequired) {
|
|
1706
|
+
anyOptional = true;
|
|
1707
|
+
} else if (anyOptional) {
|
|
1708
|
+
throw new Error(`Parameter descriptor ${parameterDescriptor.name} at index ${index} of ${declarationClassName}.${propertyKey} is required but prior parameter descriptor ${pendingParameterDescriptors[index - 1].name} is optional`);
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
let methodDescriptors = classMethodsDescriptorsMap.get(declarationClassName);
|
|
1712
|
+
if (methodDescriptors === void 0) {
|
|
1713
|
+
methodDescriptors = [];
|
|
1714
|
+
classMethodsDescriptorsMap.set(declarationClassName, methodDescriptors);
|
|
1715
|
+
}
|
|
1716
|
+
methodDescriptors.push({
|
|
1717
|
+
name: propertyKey,
|
|
1718
|
+
...methodDescriptor,
|
|
1719
|
+
parameterDescriptors: pendingParameterDescriptors
|
|
1720
|
+
});
|
|
1721
|
+
pendingParameterDescriptors = [];
|
|
1722
|
+
};
|
|
1723
|
+
}
|
|
1724
|
+
function ProxyClass(classDescriptor = {}) {
|
|
1725
|
+
return (classType) => {
|
|
1726
|
+
const methodDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1727
|
+
function buildMethodDescriptorsMap(classType2) {
|
|
1728
|
+
const baseClassType = Object.getPrototypeOf(classType2);
|
|
1729
|
+
if (baseClassType !== LibProxy) {
|
|
1730
|
+
buildMethodDescriptorsMap(baseClassType);
|
|
1731
|
+
}
|
|
1732
|
+
const classMethodDescriptors = classMethodsDescriptorsMap.get(classType2.name);
|
|
1733
|
+
if (classMethodDescriptors !== void 0) {
|
|
1734
|
+
for (const classMethodDescriptor of classMethodDescriptors) {
|
|
1735
|
+
methodDescriptorsMap.set(classMethodDescriptor.name, classMethodDescriptor);
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
buildMethodDescriptorsMap(classType);
|
|
1740
|
+
let methodDescriptors;
|
|
1741
|
+
if (classDescriptor.replaceParameterDescriptors !== void 0) {
|
|
1742
|
+
const replacementParameterDescriptorsMap = new Map(classDescriptor.replaceParameterDescriptors.map((replaceParameterDescriptor) => [replaceParameterDescriptor.name, replaceParameterDescriptor.replacement]));
|
|
1743
|
+
methodDescriptors = Array.from(methodDescriptorsMap.values()).map((methodDescriptor) => ({
|
|
1744
|
+
...methodDescriptor,
|
|
1745
|
+
parameterDescriptors: methodDescriptor.parameterDescriptors.map((parameterDescriptor) => replacementParameterDescriptorsMap.get(expandParameterDescriptor(parameterDescriptor).name) ?? parameterDescriptor)
|
|
1746
|
+
}));
|
|
1747
|
+
} else {
|
|
1748
|
+
methodDescriptors = Array.from(methodDescriptorsMap.values());
|
|
1749
|
+
}
|
|
1750
|
+
classDescriptorsMap.set(classType.name, {
|
|
1751
|
+
name: classType.name,
|
|
1752
|
+
...classDescriptor,
|
|
1753
|
+
methodDescriptors
|
|
1754
|
+
});
|
|
1755
|
+
};
|
|
1756
|
+
}
|
|
1757
|
+
function getClassDescriptorsMap() {
|
|
1758
|
+
return classDescriptorsMap;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
// src/app-utility-proxy.ts
|
|
1762
|
+
var import_core2 = require("@aidc-toolkit/core");
|
|
1763
|
+
var spillMatrix = {
|
|
1764
|
+
name: "spillMatrix",
|
|
1765
|
+
type: Types.Any,
|
|
1766
|
+
isMatrix: true,
|
|
1767
|
+
isRequired: true
|
|
1768
|
+
};
|
|
1769
|
+
var spillMaximumParameterDescriptor = {
|
|
1770
|
+
name: "spillMaximum",
|
|
1771
|
+
type: Types.Number,
|
|
1772
|
+
isMatrix: false,
|
|
1773
|
+
isRequired: false
|
|
1774
|
+
};
|
|
1775
|
+
var spillMaximumWidthParameterDescriptor = {
|
|
1776
|
+
extendsDescriptor: spillMaximumParameterDescriptor,
|
|
1777
|
+
sortOrder: 0,
|
|
1778
|
+
name: "spillMaximumWidth"
|
|
1779
|
+
};
|
|
1780
|
+
var spillMaximumHeightParameterDescriptor = {
|
|
1781
|
+
extendsDescriptor: spillMaximumParameterDescriptor,
|
|
1782
|
+
sortOrder: 1,
|
|
1783
|
+
name: "spillMaximumHeight"
|
|
1784
|
+
};
|
|
1785
|
+
var AppUtilityProxy = class extends LibProxy {
|
|
1786
|
+
version() {
|
|
1787
|
+
return this.appExtension.version;
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* Provide default values for maximum width and height if required.
|
|
1791
|
+
*
|
|
1792
|
+
* @param maximumDimensions
|
|
1793
|
+
* Maximum dimensions provided to function.
|
|
1794
|
+
*
|
|
1795
|
+
* @param invocationContext
|
|
1796
|
+
* Invocation context.
|
|
1797
|
+
*
|
|
1798
|
+
* @returns
|
|
1799
|
+
* Array of maximum width and maximum height.
|
|
1800
|
+
*/
|
|
1801
|
+
async defaultMaximums(maximumDimensions, invocationContext) {
|
|
1802
|
+
if ((0, import_core2.isNullish)(invocationContext)) {
|
|
1803
|
+
throw new Error("Invocation context not provided by application");
|
|
1804
|
+
}
|
|
1805
|
+
const maximumWidth = maximumDimensions.width;
|
|
1806
|
+
const maximumHeight = maximumDimensions.height;
|
|
1807
|
+
let definedMaximumWidth;
|
|
1808
|
+
let definedMaximumHeight;
|
|
1809
|
+
if ((0, import_core2.isNullish)(maximumWidth) || (0, import_core2.isNullish)(maximumHeight)) {
|
|
1810
|
+
const sheetAddress = await this.appExtension.getSheetAddress(invocationContext);
|
|
1811
|
+
definedMaximumWidth = maximumWidth ?? await this.appExtension.maximumWidth() - sheetAddress.columnIndex;
|
|
1812
|
+
definedMaximumHeight = maximumHeight ?? await this.appExtension.maximumHeight() - sheetAddress.rowIndex;
|
|
1813
|
+
} else {
|
|
1814
|
+
definedMaximumWidth = maximumWidth;
|
|
1815
|
+
definedMaximumHeight = maximumHeight;
|
|
1816
|
+
}
|
|
1817
|
+
return {
|
|
1818
|
+
width: definedMaximumWidth,
|
|
1819
|
+
height: definedMaximumHeight
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
async vSpill(hMatrixValues, maximumWidth, maximumHeight, invocationContext) {
|
|
1823
|
+
let result;
|
|
1824
|
+
if (hMatrixValues.length !== 1) {
|
|
1825
|
+
throw new RangeError(i18nextAppExtension.t("Proxy.vSpillMustBeHorizontalArray"));
|
|
1826
|
+
}
|
|
1827
|
+
const maximumDimensions = await this.defaultMaximums({
|
|
1828
|
+
width: maximumWidth,
|
|
1829
|
+
height: maximumHeight
|
|
1830
|
+
}, invocationContext);
|
|
1831
|
+
const hArrayValues = hMatrixValues[0];
|
|
1832
|
+
const hLength = hArrayValues.length;
|
|
1833
|
+
const maximumArea = maximumDimensions.width * maximumDimensions.height;
|
|
1834
|
+
if (hLength > 1 && hLength <= maximumArea) {
|
|
1835
|
+
let spillWidth = Math.min(Math.ceil(Math.sqrt(maximumArea)), maximumDimensions.width);
|
|
1836
|
+
if (Number.isInteger(Math.log10(hLength))) {
|
|
1837
|
+
const spillWidth10 = Math.pow(10, Math.floor(Math.log10(spillWidth)));
|
|
1838
|
+
if (hLength / spillWidth10 <= maximumDimensions.height) {
|
|
1839
|
+
spillWidth = spillWidth10;
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
result = [];
|
|
1843
|
+
let hStartIndex = 0;
|
|
1844
|
+
do {
|
|
1845
|
+
const hEndIndex = hStartIndex + spillWidth;
|
|
1846
|
+
result.push(hArrayValues.slice(hStartIndex, hEndIndex));
|
|
1847
|
+
hStartIndex = hEndIndex;
|
|
1848
|
+
} while (hStartIndex < hLength);
|
|
1849
|
+
} else {
|
|
1850
|
+
result = hMatrixValues;
|
|
1851
|
+
}
|
|
1852
|
+
return result;
|
|
1853
|
+
}
|
|
1854
|
+
async hSpill(vMatrixValues, maximumHeight, maximumWidth, invocationContext) {
|
|
1855
|
+
let result;
|
|
1856
|
+
for (const hArrayValues of vMatrixValues) {
|
|
1857
|
+
if (hArrayValues.length !== 1) {
|
|
1858
|
+
throw new RangeError(i18nextAppExtension.t("Proxy.hSpillMustBeVerticalArray"));
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
const maximumDimensions = await this.defaultMaximums({
|
|
1862
|
+
width: maximumWidth,
|
|
1863
|
+
height: maximumHeight
|
|
1864
|
+
}, invocationContext);
|
|
1865
|
+
const vLength = vMatrixValues.length;
|
|
1866
|
+
const maximumArea = maximumDimensions.width * maximumDimensions.height;
|
|
1867
|
+
if (vLength > 1 && vLength <= maximumArea) {
|
|
1868
|
+
let spillHeight = Math.min(Math.ceil(Math.sqrt(maximumArea)), maximumDimensions.height);
|
|
1869
|
+
if (Number.isInteger(Math.log10(vLength))) {
|
|
1870
|
+
const spillHeight10 = Math.pow(10, Math.floor(Math.log10(spillHeight)));
|
|
1871
|
+
if (vLength / spillHeight10 <= maximumDimensions.width) {
|
|
1872
|
+
spillHeight = spillHeight10;
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
result = [];
|
|
1876
|
+
for (let rowIndex = 0; rowIndex < spillHeight; rowIndex++) {
|
|
1877
|
+
const row = new Array();
|
|
1878
|
+
for (let cellIndex = rowIndex; cellIndex < vLength; cellIndex++) {
|
|
1879
|
+
row.push(vMatrixValues[cellIndex][0]);
|
|
1880
|
+
}
|
|
1881
|
+
result.push(row);
|
|
1882
|
+
}
|
|
1883
|
+
} else {
|
|
1884
|
+
result = vMatrixValues;
|
|
1885
|
+
}
|
|
1886
|
+
return result;
|
|
1887
|
+
}
|
|
1888
|
+
};
|
|
1889
|
+
__decorateClass([
|
|
1890
|
+
ProxyMethod({
|
|
1891
|
+
type: Types.String,
|
|
1892
|
+
isMatrix: false
|
|
1893
|
+
})
|
|
1894
|
+
], AppUtilityProxy.prototype, "version", 1);
|
|
1895
|
+
__decorateClass([
|
|
1896
|
+
ProxyMethod({
|
|
1897
|
+
requiresContext: true,
|
|
1898
|
+
type: Types.Any,
|
|
1899
|
+
isMatrix: true
|
|
1900
|
+
}),
|
|
1901
|
+
__decorateParam(0, ProxyParameter(spillMatrix)),
|
|
1902
|
+
__decorateParam(1, ProxyParameter(spillMaximumWidthParameterDescriptor)),
|
|
1903
|
+
__decorateParam(2, ProxyParameter(spillMaximumHeightParameterDescriptor))
|
|
1904
|
+
], AppUtilityProxy.prototype, "vSpill", 1);
|
|
1905
|
+
__decorateClass([
|
|
1906
|
+
ProxyMethod({
|
|
1907
|
+
requiresContext: true,
|
|
1908
|
+
type: Types.Any,
|
|
1909
|
+
isMatrix: true
|
|
1910
|
+
}),
|
|
1911
|
+
__decorateParam(0, ProxyParameter(spillMatrix)),
|
|
1912
|
+
__decorateParam(1, ProxyParameter(spillMaximumHeightParameterDescriptor)),
|
|
1913
|
+
__decorateParam(2, ProxyParameter(spillMaximumWidthParameterDescriptor))
|
|
1914
|
+
], AppUtilityProxy.prototype, "hSpill", 1);
|
|
1915
|
+
AppUtilityProxy = __decorateClass([
|
|
1916
|
+
ProxyClass()
|
|
1917
|
+
], AppUtilityProxy);
|
|
1918
|
+
|
|
1919
|
+
// src/utility/transformer-proxy.ts
|
|
1920
|
+
var import_utility3 = require("@aidc-toolkit/utility");
|
|
1921
|
+
|
|
1922
|
+
// src/utility/transformer-descriptor.ts
|
|
1923
|
+
var valueParameterDescriptor = {
|
|
1924
|
+
name: "value",
|
|
1925
|
+
type: Types.Number,
|
|
1926
|
+
isMatrix: true,
|
|
1927
|
+
isRequired: true
|
|
1928
|
+
};
|
|
1929
|
+
var startValueParameterDescriptor = {
|
|
1930
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
1931
|
+
name: "startValue",
|
|
1932
|
+
isMatrix: false
|
|
1933
|
+
};
|
|
1934
|
+
var countParameterDescriptor = {
|
|
1935
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
1936
|
+
name: "count",
|
|
1937
|
+
isMatrix: false
|
|
1938
|
+
};
|
|
1939
|
+
var tweakParameterDescriptor = {
|
|
1940
|
+
name: "tweak",
|
|
1941
|
+
type: Types.Number,
|
|
1942
|
+
isMatrix: false,
|
|
1943
|
+
isRequired: false
|
|
1944
|
+
};
|
|
1945
|
+
|
|
1946
|
+
// src/utility/transformer-proxy.ts
|
|
1947
|
+
var domainParameterDescriptor = {
|
|
1948
|
+
name: "domain",
|
|
1949
|
+
type: Types.Number,
|
|
1950
|
+
isMatrix: false,
|
|
1951
|
+
isRequired: true
|
|
1952
|
+
};
|
|
1953
|
+
var transformedValueParameterDescriptor = {
|
|
1954
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
1955
|
+
name: "transformedValue"
|
|
1956
|
+
};
|
|
1957
|
+
var TransformerProxy = class extends LibProxy {
|
|
1958
|
+
forward(domain, matrixValues, tweak) {
|
|
1959
|
+
const transformer = import_utility3.Transformer.get(domain, tweak ?? void 0);
|
|
1960
|
+
return this.mapMatrix(matrixValues, (value) => this.mapBigInt(transformer.forward(value)));
|
|
1961
|
+
}
|
|
1962
|
+
forwardSequence(domain, startValue, count, tweak) {
|
|
1963
|
+
this.appExtension.validateSequenceCount(count);
|
|
1964
|
+
return LibProxy.matrixResult((0, import_utility3.mapIterable)(import_utility3.Transformer.get(domain, tweak ?? void 0).forward(new import_utility3.Sequence(startValue, count)), (value) => this.mapBigInt(value)));
|
|
1965
|
+
}
|
|
1966
|
+
reverse(domain, matrixTransformedValues, tweak) {
|
|
1967
|
+
const transformer = import_utility3.Transformer.get(domain, tweak ?? void 0);
|
|
1968
|
+
return this.mapMatrix(matrixTransformedValues, (transformedValue) => this.mapBigInt(transformer.reverse(transformedValue)));
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
__decorateClass([
|
|
1972
|
+
ProxyMethod({
|
|
1973
|
+
type: Types.Number,
|
|
1974
|
+
isMatrix: true
|
|
1975
|
+
}),
|
|
1976
|
+
__decorateParam(0, ProxyParameter(domainParameterDescriptor)),
|
|
1977
|
+
__decorateParam(1, ProxyParameter(valueParameterDescriptor)),
|
|
1978
|
+
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
1979
|
+
], TransformerProxy.prototype, "forward", 1);
|
|
1980
|
+
__decorateClass([
|
|
1981
|
+
ProxyMethod({
|
|
1982
|
+
infixBefore: "Sequence",
|
|
1983
|
+
type: Types.Number,
|
|
1984
|
+
isMatrix: true
|
|
1985
|
+
}),
|
|
1986
|
+
__decorateParam(0, ProxyParameter(domainParameterDescriptor)),
|
|
1987
|
+
__decorateParam(1, ProxyParameter(startValueParameterDescriptor)),
|
|
1988
|
+
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
1989
|
+
__decorateParam(3, ProxyParameter(tweakParameterDescriptor))
|
|
1990
|
+
], TransformerProxy.prototype, "forwardSequence", 1);
|
|
1991
|
+
__decorateClass([
|
|
1992
|
+
ProxyMethod({
|
|
1993
|
+
type: Types.Number,
|
|
1994
|
+
isMatrix: true
|
|
1995
|
+
}),
|
|
1996
|
+
__decorateParam(0, ProxyParameter(domainParameterDescriptor)),
|
|
1997
|
+
__decorateParam(1, ProxyParameter(transformedValueParameterDescriptor)),
|
|
1998
|
+
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
1999
|
+
], TransformerProxy.prototype, "reverse", 1);
|
|
2000
|
+
TransformerProxy = __decorateClass([
|
|
2001
|
+
ProxyClass({
|
|
2002
|
+
methodInfix: "Transform"
|
|
2003
|
+
})
|
|
2004
|
+
], TransformerProxy);
|
|
2005
|
+
|
|
2006
|
+
// src/utility/reg-exp-proxy.ts
|
|
2007
|
+
var import_utility4 = require("@aidc-toolkit/utility");
|
|
2008
|
+
|
|
2009
|
+
// src/utility/string-descriptor.ts
|
|
2010
|
+
var sParameterDescriptor = {
|
|
2011
|
+
name: "s",
|
|
2012
|
+
type: Types.String,
|
|
2013
|
+
isMatrix: true,
|
|
2014
|
+
isRequired: true
|
|
2015
|
+
};
|
|
2016
|
+
var validateSParameterDescriptor = {
|
|
2017
|
+
extendsDescriptor: sParameterDescriptor,
|
|
2018
|
+
name: "validateS"
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
// src/utility/string-proxy.ts
|
|
2022
|
+
var StringProxy = class extends LibProxy {
|
|
2023
|
+
validateString(validator, matrixSs, validation) {
|
|
2024
|
+
return LibProxy.mapMatrixRangeError(matrixSs, (s) => {
|
|
2025
|
+
validator.validate(s, validation);
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
isValidString(matrixValidateResults) {
|
|
2029
|
+
return this.mapMatrix(matrixValidateResults, (validateResult) => validateResult === "");
|
|
2030
|
+
}
|
|
2031
|
+
};
|
|
2032
|
+
|
|
2033
|
+
// src/utility/reg-exp-proxy.ts
|
|
2034
|
+
var regExpParameterDescriptor = {
|
|
2035
|
+
name: "regExp",
|
|
2036
|
+
type: Types.String,
|
|
2037
|
+
isMatrix: false,
|
|
2038
|
+
isRequired: true
|
|
2039
|
+
};
|
|
2040
|
+
var errorMessageParameterDescriptor = {
|
|
2041
|
+
name: "errorMessage",
|
|
2042
|
+
type: Types.String,
|
|
2043
|
+
isMatrix: false,
|
|
2044
|
+
isRequired: false
|
|
2045
|
+
};
|
|
2046
|
+
var RegExpProxy = class extends StringProxy {
|
|
2047
|
+
validate(regExp, matrixSs, errorMessage) {
|
|
2048
|
+
return this.validateString(new class extends import_utility4.RegExpValidator {
|
|
2049
|
+
createErrorMessage(s) {
|
|
2050
|
+
return errorMessage ?? super.createErrorMessage(s);
|
|
2051
|
+
}
|
|
2052
|
+
}(new RegExp(regExp)), matrixSs);
|
|
2053
|
+
}
|
|
2054
|
+
isValid(regExp, matrixSs) {
|
|
2055
|
+
return this.isValidString(this.validate(regExp, matrixSs, void 0));
|
|
2056
|
+
}
|
|
2057
|
+
};
|
|
2058
|
+
__decorateClass([
|
|
2059
|
+
ProxyMethod({
|
|
2060
|
+
type: Types.String,
|
|
2061
|
+
isMatrix: true
|
|
2062
|
+
}),
|
|
2063
|
+
__decorateParam(0, ProxyParameter(regExpParameterDescriptor)),
|
|
2064
|
+
__decorateParam(1, ProxyParameter(validateSParameterDescriptor)),
|
|
2065
|
+
__decorateParam(2, ProxyParameter(errorMessageParameterDescriptor))
|
|
2066
|
+
], RegExpProxy.prototype, "validate", 1);
|
|
2067
|
+
__decorateClass([
|
|
2068
|
+
ProxyMethod({
|
|
2069
|
+
type: Types.Boolean,
|
|
2070
|
+
isMatrix: true
|
|
2071
|
+
}),
|
|
2072
|
+
__decorateParam(0, ProxyParameter(regExpParameterDescriptor)),
|
|
2073
|
+
__decorateParam(1, ProxyParameter(validateSParameterDescriptor))
|
|
2074
|
+
], RegExpProxy.prototype, "isValid", 1);
|
|
2075
|
+
RegExpProxy = __decorateClass([
|
|
2076
|
+
ProxyClass({
|
|
2077
|
+
methodInfix: "RegExp"
|
|
2078
|
+
})
|
|
2079
|
+
], RegExpProxy);
|
|
2080
|
+
|
|
2081
|
+
// src/utility/character-set-proxy.ts
|
|
2082
|
+
var import_utility5 = require("@aidc-toolkit/utility");
|
|
2083
|
+
|
|
2084
|
+
// src/utility/character-set-descriptor.ts
|
|
2085
|
+
var exclusionParameterDescriptor = {
|
|
2086
|
+
name: "exclusion",
|
|
2087
|
+
type: Types.Number,
|
|
2088
|
+
isMatrix: false,
|
|
2089
|
+
isRequired: false
|
|
2090
|
+
};
|
|
2091
|
+
var exclusionNoneParameterDescriptor = {
|
|
2092
|
+
extendsDescriptor: exclusionParameterDescriptor,
|
|
2093
|
+
sortOrder: 0,
|
|
2094
|
+
name: "exclusionNone"
|
|
2095
|
+
};
|
|
2096
|
+
var exclusionFirstZeroParameterDescriptor = {
|
|
2097
|
+
extendsDescriptor: exclusionParameterDescriptor,
|
|
2098
|
+
sortOrder: 1,
|
|
2099
|
+
name: "exclusionFirstZero"
|
|
2100
|
+
};
|
|
2101
|
+
var exclusionAllNumericParameterDescriptor = {
|
|
2102
|
+
extendsDescriptor: exclusionParameterDescriptor,
|
|
2103
|
+
sortOrder: 2,
|
|
2104
|
+
name: "exclusionAllNumeric"
|
|
2105
|
+
};
|
|
2106
|
+
var exclusionAnyParameterDescriptor = {
|
|
2107
|
+
extendsDescriptor: exclusionParameterDescriptor,
|
|
2108
|
+
sortOrder: 3,
|
|
2109
|
+
name: "exclusionAny"
|
|
2110
|
+
};
|
|
2111
|
+
|
|
2112
|
+
// src/utility/character-set-proxy.ts
|
|
2113
|
+
var lengthParameterDescriptor = {
|
|
2114
|
+
name: "length",
|
|
2115
|
+
type: Types.Number,
|
|
2116
|
+
isMatrix: false,
|
|
2117
|
+
isRequired: true
|
|
2118
|
+
};
|
|
2119
|
+
var valueForSParameterDescriptor = {
|
|
2120
|
+
extendsDescriptor: sParameterDescriptor,
|
|
2121
|
+
name: "valueForS"
|
|
2122
|
+
};
|
|
2123
|
+
var CharacterSetProxy = class extends StringProxy {
|
|
2124
|
+
_characterSetCreator;
|
|
2125
|
+
constructor(appExtension, characterSetCreator) {
|
|
2126
|
+
super(appExtension);
|
|
2127
|
+
this._characterSetCreator = characterSetCreator;
|
|
2128
|
+
}
|
|
2129
|
+
validate(matrixSs, exclusion) {
|
|
2130
|
+
return this.validateString(this._characterSetCreator, matrixSs, {
|
|
2131
|
+
exclusion: exclusion ?? void 0
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
isValid(matrixSs, exclusion) {
|
|
2135
|
+
return this.isValidString(this.validate(matrixSs, exclusion));
|
|
2136
|
+
}
|
|
2137
|
+
create(length, matrixValues, exclusion, tweak) {
|
|
2138
|
+
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2139
|
+
const tweakOrUndefined = tweak ?? void 0;
|
|
2140
|
+
return this.mapMatrix(matrixValues, (value) => this._characterSetCreator.create(length, value, exclusionOrUndefined, tweakOrUndefined));
|
|
2141
|
+
}
|
|
2142
|
+
createSequence(length, startValue, count, exclusion, tweak) {
|
|
2143
|
+
this.appExtension.validateSequenceCount(count);
|
|
2144
|
+
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2145
|
+
const tweakOrUndefined = tweak ?? void 0;
|
|
2146
|
+
return LibProxy.matrixResult(this._characterSetCreator.create(length, new import_utility5.Sequence(startValue, count), exclusionOrUndefined, tweakOrUndefined));
|
|
2147
|
+
}
|
|
2148
|
+
valueFor(matrixSs, exclusion, tweak) {
|
|
2149
|
+
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2150
|
+
const tweakOrUndefined = tweak ?? void 0;
|
|
2151
|
+
return this.mapMatrix(matrixSs, (s) => this.mapBigInt(this._characterSetCreator.valueFor(s, exclusionOrUndefined, tweakOrUndefined)));
|
|
2152
|
+
}
|
|
2153
|
+
};
|
|
2154
|
+
__decorateClass([
|
|
2155
|
+
ProxyMethod({
|
|
2156
|
+
type: Types.String,
|
|
2157
|
+
isMatrix: true
|
|
2158
|
+
}),
|
|
2159
|
+
__decorateParam(0, ProxyParameter(validateSParameterDescriptor)),
|
|
2160
|
+
__decorateParam(1, ProxyParameter(exclusionNoneParameterDescriptor))
|
|
2161
|
+
], CharacterSetProxy.prototype, "validate", 1);
|
|
2162
|
+
__decorateClass([
|
|
2163
|
+
ProxyMethod({
|
|
2164
|
+
type: Types.Boolean,
|
|
2165
|
+
isMatrix: true
|
|
2166
|
+
}),
|
|
2167
|
+
__decorateParam(0, ProxyParameter(validateSParameterDescriptor)),
|
|
2168
|
+
__decorateParam(1, ProxyParameter(exclusionNoneParameterDescriptor))
|
|
2169
|
+
], CharacterSetProxy.prototype, "isValid", 1);
|
|
2170
|
+
__decorateClass([
|
|
2171
|
+
ProxyMethod({
|
|
2172
|
+
type: Types.String,
|
|
2173
|
+
isMatrix: true
|
|
2174
|
+
}),
|
|
2175
|
+
__decorateParam(0, ProxyParameter(lengthParameterDescriptor)),
|
|
2176
|
+
__decorateParam(1, ProxyParameter(valueParameterDescriptor)),
|
|
2177
|
+
__decorateParam(2, ProxyParameter(exclusionNoneParameterDescriptor)),
|
|
2178
|
+
__decorateParam(3, ProxyParameter(tweakParameterDescriptor))
|
|
2179
|
+
], CharacterSetProxy.prototype, "create", 1);
|
|
2180
|
+
__decorateClass([
|
|
2181
|
+
ProxyMethod({
|
|
2182
|
+
infixBefore: "Sequence",
|
|
2183
|
+
type: Types.String,
|
|
2184
|
+
isMatrix: true
|
|
2185
|
+
}),
|
|
2186
|
+
__decorateParam(0, ProxyParameter(lengthParameterDescriptor)),
|
|
2187
|
+
__decorateParam(1, ProxyParameter(startValueParameterDescriptor)),
|
|
2188
|
+
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
2189
|
+
__decorateParam(3, ProxyParameter(exclusionNoneParameterDescriptor)),
|
|
2190
|
+
__decorateParam(4, ProxyParameter(tweakParameterDescriptor))
|
|
2191
|
+
], CharacterSetProxy.prototype, "createSequence", 1);
|
|
2192
|
+
__decorateClass([
|
|
2193
|
+
ProxyMethod({
|
|
2194
|
+
type: Types.Number,
|
|
2195
|
+
isMatrix: true
|
|
2196
|
+
}),
|
|
2197
|
+
__decorateParam(0, ProxyParameter(valueForSParameterDescriptor)),
|
|
2198
|
+
__decorateParam(1, ProxyParameter(exclusionNoneParameterDescriptor)),
|
|
2199
|
+
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
2200
|
+
], CharacterSetProxy.prototype, "valueFor", 1);
|
|
2201
|
+
var NumericProxy = class extends CharacterSetProxy {
|
|
2202
|
+
constructor(appExtension) {
|
|
2203
|
+
super(appExtension, import_utility5.NUMERIC_CREATOR);
|
|
2204
|
+
}
|
|
2205
|
+
};
|
|
2206
|
+
NumericProxy = __decorateClass([
|
|
2207
|
+
ProxyClass({
|
|
2208
|
+
methodInfix: "Numeric",
|
|
2209
|
+
replaceParameterDescriptors: [
|
|
2210
|
+
{
|
|
2211
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2212
|
+
replacement: exclusionFirstZeroParameterDescriptor
|
|
2213
|
+
}
|
|
2214
|
+
]
|
|
2215
|
+
})
|
|
2216
|
+
], NumericProxy);
|
|
2217
|
+
var HexadecimalProxy = class extends CharacterSetProxy {
|
|
2218
|
+
constructor(appExtension) {
|
|
2219
|
+
super(appExtension, import_utility5.HEXADECIMAL_CREATOR);
|
|
2220
|
+
}
|
|
2221
|
+
};
|
|
2222
|
+
HexadecimalProxy = __decorateClass([
|
|
2223
|
+
ProxyClass({
|
|
2224
|
+
methodInfix: "Hexadecimal",
|
|
2225
|
+
replaceParameterDescriptors: [
|
|
2226
|
+
{
|
|
2227
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2228
|
+
replacement: exclusionAnyParameterDescriptor
|
|
2229
|
+
}
|
|
2230
|
+
]
|
|
2231
|
+
})
|
|
2232
|
+
], HexadecimalProxy);
|
|
2233
|
+
var AlphabeticProxy = class extends CharacterSetProxy {
|
|
2234
|
+
constructor(appExtension) {
|
|
2235
|
+
super(appExtension, import_utility5.ALPHABETIC_CREATOR);
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2238
|
+
AlphabeticProxy = __decorateClass([
|
|
2239
|
+
ProxyClass({
|
|
2240
|
+
methodInfix: "Alphabetic"
|
|
2241
|
+
})
|
|
2242
|
+
], AlphabeticProxy);
|
|
2243
|
+
var AlphanumericProxy = class extends CharacterSetProxy {
|
|
2244
|
+
constructor(appExtension) {
|
|
2245
|
+
super(appExtension, import_utility5.ALPHANUMERIC_CREATOR);
|
|
2246
|
+
}
|
|
2247
|
+
};
|
|
2248
|
+
AlphanumericProxy = __decorateClass([
|
|
2249
|
+
ProxyClass({
|
|
2250
|
+
methodInfix: "Alphanumeric",
|
|
2251
|
+
replaceParameterDescriptors: [
|
|
2252
|
+
{
|
|
2253
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2254
|
+
replacement: exclusionAnyParameterDescriptor
|
|
2255
|
+
}
|
|
2256
|
+
]
|
|
2257
|
+
})
|
|
2258
|
+
], AlphanumericProxy);
|
|
2259
|
+
|
|
2260
|
+
// src/gs1/index.ts
|
|
2261
|
+
var gs1_exports = {};
|
|
2262
|
+
__export(gs1_exports, {
|
|
2263
|
+
AI39Proxy: () => AI39Proxy,
|
|
2264
|
+
AI82Proxy: () => AI82Proxy,
|
|
2265
|
+
CPIDCreatorProxy: () => CPIDCreatorProxy,
|
|
2266
|
+
CPIDValidatorProxy: () => CPIDValidatorProxy,
|
|
2267
|
+
CheckProxy: () => CheckProxy,
|
|
2268
|
+
GCNCreatorProxy: () => GCNCreatorProxy,
|
|
2269
|
+
GCNValidatorProxy: () => GCNValidatorProxy,
|
|
2270
|
+
GDTICreatorProxy: () => GDTICreatorProxy,
|
|
2271
|
+
GDTIValidatorProxy: () => GDTIValidatorProxy,
|
|
2272
|
+
GIAICreatorProxy: () => GIAICreatorProxy,
|
|
2273
|
+
GIAIValidatorProxy: () => GIAIValidatorProxy,
|
|
2274
|
+
GINCCreatorProxy: () => GINCCreatorProxy,
|
|
2275
|
+
GINCValidatorProxy: () => GINCValidatorProxy,
|
|
2276
|
+
GLNCreatorProxy: () => GLNCreatorProxy,
|
|
2277
|
+
GLNValidatorProxy: () => GLNValidatorProxy,
|
|
2278
|
+
GMNCreatorProxy: () => GMNCreatorProxy,
|
|
2279
|
+
GMNValidatorProxy: () => GMNValidatorProxy,
|
|
2280
|
+
GRAICreatorProxy: () => GRAICreatorProxy,
|
|
2281
|
+
GRAIValidatorProxy: () => GRAIValidatorProxy,
|
|
2282
|
+
GSINCreatorProxy: () => GSINCreatorProxy,
|
|
2283
|
+
GSINValidatorProxy: () => GSINValidatorProxy,
|
|
2284
|
+
GSRNCreatorProxy: () => GSRNCreatorProxy,
|
|
2285
|
+
GSRNValidatorProxy: () => GSRNValidatorProxy,
|
|
2286
|
+
GTIN12ValidatorProxy: () => GTIN12ValidatorProxy,
|
|
2287
|
+
GTIN13ValidatorProxy: () => GTIN13ValidatorProxy,
|
|
2288
|
+
GTIN8ValidatorProxy: () => GTIN8ValidatorProxy,
|
|
2289
|
+
GTINCreatorProxy: () => GTINCreatorProxy,
|
|
2290
|
+
GTINValidatorStaticProxy: () => GTINValidatorStaticProxy,
|
|
2291
|
+
PrefixManagerProxy: () => PrefixManagerProxy,
|
|
2292
|
+
SSCCCreatorProxy: () => SSCCCreatorProxy,
|
|
2293
|
+
SSCCValidatorProxy: () => SSCCValidatorProxy
|
|
2294
|
+
});
|
|
2295
|
+
|
|
2296
|
+
// src/gs1/character-set-proxy.ts
|
|
2297
|
+
var import_gs12 = require("@aidc-toolkit/gs1");
|
|
2298
|
+
var AI82Proxy = class extends CharacterSetProxy {
|
|
2299
|
+
constructor(appExtension) {
|
|
2300
|
+
super(appExtension, import_gs12.AI82_CREATOR);
|
|
2301
|
+
}
|
|
2302
|
+
};
|
|
2303
|
+
AI82Proxy = __decorateClass([
|
|
2304
|
+
ProxyClass({
|
|
2305
|
+
namespace: "GS1",
|
|
2306
|
+
methodInfix: "AI82",
|
|
2307
|
+
replaceParameterDescriptors: [
|
|
2308
|
+
{
|
|
2309
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2310
|
+
replacement: exclusionAllNumericParameterDescriptor
|
|
2311
|
+
}
|
|
2312
|
+
]
|
|
2313
|
+
})
|
|
2314
|
+
], AI82Proxy);
|
|
2315
|
+
var AI39Proxy = class extends CharacterSetProxy {
|
|
2316
|
+
constructor(appExtension) {
|
|
2317
|
+
super(appExtension, import_gs12.AI39_CREATOR);
|
|
2318
|
+
}
|
|
2319
|
+
};
|
|
2320
|
+
AI39Proxy = __decorateClass([
|
|
2321
|
+
ProxyClass({
|
|
2322
|
+
namespace: "GS1",
|
|
2323
|
+
methodInfix: "AI39",
|
|
2324
|
+
replaceParameterDescriptors: [
|
|
2325
|
+
{
|
|
2326
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2327
|
+
replacement: exclusionAllNumericParameterDescriptor
|
|
2328
|
+
}
|
|
2329
|
+
]
|
|
2330
|
+
})
|
|
2331
|
+
], AI39Proxy);
|
|
2332
|
+
|
|
2333
|
+
// src/gs1/check-proxy.ts
|
|
2334
|
+
var import_gs13 = require("@aidc-toolkit/gs1");
|
|
2335
|
+
var checkSParameterDescriptor = {
|
|
2336
|
+
name: "checkS",
|
|
2337
|
+
type: Types.String,
|
|
2338
|
+
isMatrix: true,
|
|
2339
|
+
isRequired: true
|
|
2340
|
+
};
|
|
2341
|
+
var numericSParameterDescriptor = {
|
|
2342
|
+
extendsDescriptor: checkSParameterDescriptor,
|
|
2343
|
+
name: "numericS"
|
|
2344
|
+
};
|
|
2345
|
+
var numericSFourOrFiveDigitsParameterDescriptor = {
|
|
2346
|
+
extendsDescriptor: numericSParameterDescriptor,
|
|
2347
|
+
sortOrder: 0,
|
|
2348
|
+
name: "numericSFourOrFiveDigits"
|
|
2349
|
+
};
|
|
2350
|
+
var numericSWithCheckDigitParameterDescriptor = {
|
|
2351
|
+
extendsDescriptor: numericSParameterDescriptor,
|
|
2352
|
+
sortOrder: 1,
|
|
2353
|
+
name: "numericSWithCheckDigit"
|
|
2354
|
+
};
|
|
2355
|
+
var checkDigitParameterDescriptor = {
|
|
2356
|
+
extendsDescriptor: numericSParameterDescriptor,
|
|
2357
|
+
sortOrder: 2,
|
|
2358
|
+
name: "checkDigit",
|
|
2359
|
+
isMatrix: false
|
|
2360
|
+
};
|
|
2361
|
+
var ai82SParameterDescriptor = {
|
|
2362
|
+
extendsDescriptor: checkSParameterDescriptor,
|
|
2363
|
+
name: "ai82S"
|
|
2364
|
+
};
|
|
2365
|
+
var ai82SWithCheckCharacterPairParameterDescriptor = {
|
|
2366
|
+
extendsDescriptor: ai82SParameterDescriptor,
|
|
2367
|
+
name: "ai82SWithCheckCharacterPair"
|
|
2368
|
+
};
|
|
2369
|
+
var CheckProxy = class extends LibProxy {
|
|
2370
|
+
checkDigit(matrixSs) {
|
|
2371
|
+
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.checkDigit)(s));
|
|
2372
|
+
}
|
|
2373
|
+
hasValidCheckDigit(matrixSs) {
|
|
2374
|
+
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.hasValidCheckDigit)(s));
|
|
2375
|
+
}
|
|
2376
|
+
priceOrWeightCheckDigit(matrixSs) {
|
|
2377
|
+
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.priceOrWeightCheckDigit)(s));
|
|
2378
|
+
}
|
|
2379
|
+
isValidPriceOrWeightCheckDigit(s, checkDigit2) {
|
|
2380
|
+
return (0, import_gs13.isValidPriceOrWeightCheckDigit)(s, checkDigit2);
|
|
2381
|
+
}
|
|
2382
|
+
checkCharacterPair(matrixSs) {
|
|
2383
|
+
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.checkCharacterPair)(s));
|
|
2384
|
+
}
|
|
2385
|
+
hasValidCheckCharacterPair(matrixSs) {
|
|
2386
|
+
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.hasValidCheckCharacterPair)(s));
|
|
2387
|
+
}
|
|
2388
|
+
};
|
|
2389
|
+
__decorateClass([
|
|
2390
|
+
ProxyMethod({
|
|
2391
|
+
type: Types.String,
|
|
2392
|
+
isMatrix: true
|
|
2393
|
+
}),
|
|
2394
|
+
__decorateParam(0, ProxyParameter(numericSParameterDescriptor))
|
|
2395
|
+
], CheckProxy.prototype, "checkDigit", 1);
|
|
2396
|
+
__decorateClass([
|
|
2397
|
+
ProxyMethod({
|
|
2398
|
+
type: Types.String,
|
|
2399
|
+
isMatrix: true
|
|
2400
|
+
}),
|
|
2401
|
+
__decorateParam(0, ProxyParameter(numericSWithCheckDigitParameterDescriptor))
|
|
2402
|
+
], CheckProxy.prototype, "hasValidCheckDigit", 1);
|
|
2403
|
+
__decorateClass([
|
|
2404
|
+
ProxyMethod({
|
|
2405
|
+
type: Types.String,
|
|
2406
|
+
isMatrix: true
|
|
2407
|
+
}),
|
|
2408
|
+
__decorateParam(0, ProxyParameter(numericSFourOrFiveDigitsParameterDescriptor))
|
|
2409
|
+
], CheckProxy.prototype, "priceOrWeightCheckDigit", 1);
|
|
2410
|
+
__decorateClass([
|
|
2411
|
+
ProxyMethod({
|
|
2412
|
+
type: Types.String,
|
|
2413
|
+
isMatrix: false
|
|
2414
|
+
}),
|
|
2415
|
+
__decorateParam(0, ProxyParameter({
|
|
2416
|
+
...numericSFourOrFiveDigitsParameterDescriptor,
|
|
2417
|
+
isMatrix: false
|
|
2418
|
+
})),
|
|
2419
|
+
__decorateParam(1, ProxyParameter(checkDigitParameterDescriptor))
|
|
2420
|
+
], CheckProxy.prototype, "isValidPriceOrWeightCheckDigit", 1);
|
|
2421
|
+
__decorateClass([
|
|
2422
|
+
ProxyMethod({
|
|
2423
|
+
type: Types.String,
|
|
2424
|
+
isMatrix: true
|
|
2425
|
+
}),
|
|
2426
|
+
__decorateParam(0, ProxyParameter(ai82SParameterDescriptor))
|
|
2427
|
+
], CheckProxy.prototype, "checkCharacterPair", 1);
|
|
2428
|
+
__decorateClass([
|
|
2429
|
+
ProxyMethod({
|
|
2430
|
+
type: Types.String,
|
|
2431
|
+
isMatrix: true
|
|
2432
|
+
}),
|
|
2433
|
+
__decorateParam(0, ProxyParameter(ai82SWithCheckCharacterPairParameterDescriptor))
|
|
2434
|
+
], CheckProxy.prototype, "hasValidCheckCharacterPair", 1);
|
|
2435
|
+
CheckProxy = __decorateClass([
|
|
2436
|
+
ProxyClass({
|
|
2437
|
+
namespace: "GS1"
|
|
2438
|
+
})
|
|
2439
|
+
], CheckProxy);
|
|
2440
|
+
|
|
2441
|
+
// src/gs1/identifier-proxy.ts
|
|
2442
|
+
var import_core3 = require("@aidc-toolkit/core");
|
|
2443
|
+
var import_gs14 = require("@aidc-toolkit/gs1");
|
|
2444
|
+
var import_utility7 = require("@aidc-toolkit/utility");
|
|
2445
|
+
var identifierParameterDescriptor = {
|
|
2446
|
+
name: "identifier",
|
|
2447
|
+
type: Types.String,
|
|
2448
|
+
isMatrix: true,
|
|
2449
|
+
isRequired: true
|
|
2450
|
+
};
|
|
2451
|
+
var validateIdentifierParameterDescriptor = {
|
|
2452
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2453
|
+
sortOrder: 0,
|
|
2454
|
+
name: "validateIdentifier"
|
|
2455
|
+
};
|
|
2456
|
+
var IdentifierValidatorProxy = class extends StringProxy {
|
|
2457
|
+
_validator;
|
|
2458
|
+
constructor(appExtension, validator) {
|
|
2459
|
+
super(appExtension);
|
|
2460
|
+
this._validator = validator;
|
|
2461
|
+
}
|
|
2462
|
+
get validator() {
|
|
2463
|
+
return this._validator;
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2466
|
+
var NumericIdentifierValidatorProxy = class extends IdentifierValidatorProxy {
|
|
2467
|
+
validate(matrixIdentifiers) {
|
|
2468
|
+
return this.validateString(this.validator, matrixIdentifiers);
|
|
2469
|
+
}
|
|
2470
|
+
};
|
|
2471
|
+
__decorateClass([
|
|
2472
|
+
ProxyMethod({
|
|
2473
|
+
type: Types.String,
|
|
2474
|
+
isMatrix: true
|
|
2475
|
+
}),
|
|
2476
|
+
__decorateParam(0, ProxyParameter(validateIdentifierParameterDescriptor))
|
|
2477
|
+
], NumericIdentifierValidatorProxy.prototype, "validate", 1);
|
|
2478
|
+
var GTINValidatorProxy = class extends NumericIdentifierValidatorProxy {
|
|
2479
|
+
};
|
|
2480
|
+
var NonGTINNumericIdentifierValidatorProxy = class extends NumericIdentifierValidatorProxy {
|
|
2481
|
+
};
|
|
2482
|
+
var SerializableNumericIdentifierValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2483
|
+
};
|
|
2484
|
+
var NonNumericIdentifierValidatorProxy = class extends IdentifierValidatorProxy {
|
|
2485
|
+
validate(matrixIdentifiers, exclusion) {
|
|
2486
|
+
return this.validateString(this.validator, matrixIdentifiers, {
|
|
2487
|
+
exclusion: exclusion ?? void 0
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
};
|
|
2491
|
+
__decorateClass([
|
|
2492
|
+
ProxyMethod({
|
|
2493
|
+
type: Types.String,
|
|
2494
|
+
isMatrix: true
|
|
2495
|
+
}),
|
|
2496
|
+
__decorateParam(0, ProxyParameter(validateIdentifierParameterDescriptor)),
|
|
2497
|
+
__decorateParam(1, ProxyParameter(exclusionAllNumericParameterDescriptor))
|
|
2498
|
+
], NonNumericIdentifierValidatorProxy.prototype, "validate", 1);
|
|
2499
|
+
var GTIN13ValidatorProxy = class extends GTINValidatorProxy {
|
|
2500
|
+
constructor(appExtension) {
|
|
2501
|
+
super(appExtension, import_gs14.GTIN13_VALIDATOR);
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
GTIN13ValidatorProxy = __decorateClass([
|
|
2505
|
+
ProxyClass({
|
|
2506
|
+
namespace: "GS1",
|
|
2507
|
+
methodInfix: "GTIN13"
|
|
2508
|
+
})
|
|
2509
|
+
], GTIN13ValidatorProxy);
|
|
2510
|
+
var GTIN12ValidatorProxy = class extends GTINValidatorProxy {
|
|
2511
|
+
constructor(appExtension) {
|
|
2512
|
+
super(appExtension, import_gs14.GTIN12_VALIDATOR);
|
|
2513
|
+
}
|
|
2514
|
+
};
|
|
2515
|
+
GTIN12ValidatorProxy = __decorateClass([
|
|
2516
|
+
ProxyClass({
|
|
2517
|
+
namespace: "GS1",
|
|
2518
|
+
methodInfix: "GTIN12"
|
|
2519
|
+
})
|
|
2520
|
+
], GTIN12ValidatorProxy);
|
|
2521
|
+
var GTIN8ValidatorProxy = class extends GTINValidatorProxy {
|
|
2522
|
+
constructor(appExtension) {
|
|
2523
|
+
super(appExtension, import_gs14.GTIN8_VALIDATOR);
|
|
2524
|
+
}
|
|
2525
|
+
};
|
|
2526
|
+
GTIN8ValidatorProxy = __decorateClass([
|
|
2527
|
+
ProxyClass({
|
|
2528
|
+
namespace: "GS1",
|
|
2529
|
+
methodInfix: "GTIN8"
|
|
2530
|
+
})
|
|
2531
|
+
], GTIN8ValidatorProxy);
|
|
2532
|
+
var zeroSuppressibleGTIN12ParameterDescriptor = {
|
|
2533
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2534
|
+
name: "zeroSuppressibleGTIN12"
|
|
2535
|
+
};
|
|
2536
|
+
var zeroSuppressedGTIN12ParameterDescriptor = {
|
|
2537
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2538
|
+
name: "zeroSuppressedGTIN12"
|
|
2539
|
+
};
|
|
2540
|
+
var indicatorDigitParameterDescriptor = {
|
|
2541
|
+
name: "indicatorDigit",
|
|
2542
|
+
type: Types.String,
|
|
2543
|
+
isMatrix: false,
|
|
2544
|
+
isRequired: true
|
|
2545
|
+
};
|
|
2546
|
+
var convertGTINParameterDescriptor = {
|
|
2547
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2548
|
+
name: "convertGTIN"
|
|
2549
|
+
};
|
|
2550
|
+
var normalizeGTINParameterDescriptor = {
|
|
2551
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2552
|
+
name: "normalizeGTIN"
|
|
2553
|
+
};
|
|
2554
|
+
var validateGTINParameterDescriptor = {
|
|
2555
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2556
|
+
name: "validateGTIN"
|
|
2557
|
+
};
|
|
2558
|
+
var gtinLevelParameterDescriptor = {
|
|
2559
|
+
name: "gtinLevel",
|
|
2560
|
+
type: Types.Number,
|
|
2561
|
+
isMatrix: false,
|
|
2562
|
+
isRequired: false
|
|
2563
|
+
};
|
|
2564
|
+
var validateGTIN14ParameterDescriptor = {
|
|
2565
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2566
|
+
name: "validateGTIN14"
|
|
2567
|
+
};
|
|
2568
|
+
var rcnFormatParameterDescriptor = {
|
|
2569
|
+
name: "rcnFormat",
|
|
2570
|
+
type: Types.String,
|
|
2571
|
+
isMatrix: false,
|
|
2572
|
+
isRequired: true
|
|
2573
|
+
};
|
|
2574
|
+
var rcnParameterDescriptor = {
|
|
2575
|
+
name: "rcn",
|
|
2576
|
+
type: Types.String,
|
|
2577
|
+
isMatrix: true,
|
|
2578
|
+
isRequired: true
|
|
2579
|
+
};
|
|
2580
|
+
var rcnItemReferenceParameterDescriptor = {
|
|
2581
|
+
name: "rcnItemReference",
|
|
2582
|
+
type: Types.Number,
|
|
2583
|
+
isMatrix: false,
|
|
2584
|
+
isRequired: true
|
|
2585
|
+
};
|
|
2586
|
+
var rcnPriceOrWeightParameterDescriptor = {
|
|
2587
|
+
name: "rcnPriceOrWeight",
|
|
2588
|
+
type: Types.Number,
|
|
2589
|
+
isMatrix: true,
|
|
2590
|
+
isRequired: true
|
|
2591
|
+
};
|
|
2592
|
+
var GTINValidatorStaticProxy = class extends LibProxy {
|
|
2593
|
+
zeroSuppressGTIN12(matrixGTIN12s) {
|
|
2594
|
+
return this.mapMatrix(matrixGTIN12s, (gtin12) => import_gs14.GTINValidator.zeroSuppress(gtin12));
|
|
2595
|
+
}
|
|
2596
|
+
zeroExpandGTIN12(matrixZeroSuppressedGTIN12s) {
|
|
2597
|
+
return this.mapMatrix(matrixZeroSuppressedGTIN12s, (zeroSuppressedGTIN12) => import_gs14.GTINValidator.zeroExpand(zeroSuppressedGTIN12));
|
|
2598
|
+
}
|
|
2599
|
+
convertToGTIN14(indicatorDigit, matrixGTINs) {
|
|
2600
|
+
return this.mapMatrix(matrixGTINs, (gtin) => import_gs14.GTINValidator.convertToGTIN14(indicatorDigit, gtin));
|
|
2601
|
+
}
|
|
2602
|
+
normalizeGTIN(matrixGTINs) {
|
|
2603
|
+
return this.mapMatrix(matrixGTINs, (gtin) => import_gs14.GTINValidator.normalize(gtin));
|
|
2604
|
+
}
|
|
2605
|
+
validateGTIN(matrixGTINs, gtinLevel) {
|
|
2606
|
+
const gtinLevelOrUndefined = gtinLevel ?? void 0;
|
|
2607
|
+
return LibProxy.mapMatrixRangeError(matrixGTINs, (gtin) => {
|
|
2608
|
+
import_gs14.GTINValidator.validateAny(gtin, gtinLevelOrUndefined);
|
|
2609
|
+
});
|
|
2610
|
+
}
|
|
2611
|
+
validateGTIN14(matrixGTIN14s) {
|
|
2612
|
+
return LibProxy.mapMatrixRangeError(matrixGTIN14s, (gtin14) => {
|
|
2613
|
+
import_gs14.GTINValidator.validateGTIN14(gtin14);
|
|
2614
|
+
});
|
|
2615
|
+
}
|
|
2616
|
+
parseVariableMeasureRCN(format, matrixRCNs) {
|
|
2617
|
+
return this.mapArray(matrixRCNs, (rcn) => {
|
|
2618
|
+
const rcnReference = import_gs14.GTINValidator.parseVariableMeasureRCN(format, rcn);
|
|
2619
|
+
return [rcnReference.itemReference, rcnReference.priceOrWeight];
|
|
2620
|
+
});
|
|
2621
|
+
}
|
|
2622
|
+
};
|
|
2623
|
+
__decorateClass([
|
|
2624
|
+
ProxyMethod({
|
|
2625
|
+
type: Types.String,
|
|
2626
|
+
isMatrix: true
|
|
2627
|
+
}),
|
|
2628
|
+
__decorateParam(0, ProxyParameter(zeroSuppressibleGTIN12ParameterDescriptor))
|
|
2629
|
+
], GTINValidatorStaticProxy.prototype, "zeroSuppressGTIN12", 1);
|
|
2630
|
+
__decorateClass([
|
|
2631
|
+
ProxyMethod({
|
|
2632
|
+
type: Types.String,
|
|
2633
|
+
isMatrix: true
|
|
2634
|
+
}),
|
|
2635
|
+
__decorateParam(0, ProxyParameter(zeroSuppressedGTIN12ParameterDescriptor))
|
|
2636
|
+
], GTINValidatorStaticProxy.prototype, "zeroExpandGTIN12", 1);
|
|
2637
|
+
__decorateClass([
|
|
2638
|
+
ProxyMethod({
|
|
2639
|
+
type: Types.String,
|
|
2640
|
+
isMatrix: true
|
|
2641
|
+
}),
|
|
2642
|
+
__decorateParam(0, ProxyParameter(indicatorDigitParameterDescriptor)),
|
|
2643
|
+
__decorateParam(1, ProxyParameter(convertGTINParameterDescriptor))
|
|
2644
|
+
], GTINValidatorStaticProxy.prototype, "convertToGTIN14", 1);
|
|
2645
|
+
__decorateClass([
|
|
2646
|
+
ProxyMethod({
|
|
2647
|
+
type: Types.String,
|
|
2648
|
+
isMatrix: true
|
|
2649
|
+
}),
|
|
2650
|
+
__decorateParam(0, ProxyParameter(normalizeGTINParameterDescriptor))
|
|
2651
|
+
], GTINValidatorStaticProxy.prototype, "normalizeGTIN", 1);
|
|
2652
|
+
__decorateClass([
|
|
2653
|
+
ProxyMethod({
|
|
2654
|
+
type: Types.String,
|
|
2655
|
+
isMatrix: true
|
|
2656
|
+
}),
|
|
2657
|
+
__decorateParam(0, ProxyParameter(validateGTINParameterDescriptor)),
|
|
2658
|
+
__decorateParam(1, ProxyParameter(gtinLevelParameterDescriptor))
|
|
2659
|
+
], GTINValidatorStaticProxy.prototype, "validateGTIN", 1);
|
|
2660
|
+
__decorateClass([
|
|
2661
|
+
ProxyMethod({
|
|
2662
|
+
type: Types.String,
|
|
2663
|
+
isMatrix: true
|
|
2664
|
+
}),
|
|
2665
|
+
__decorateParam(0, ProxyParameter(validateGTIN14ParameterDescriptor))
|
|
2666
|
+
], GTINValidatorStaticProxy.prototype, "validateGTIN14", 1);
|
|
2667
|
+
__decorateClass([
|
|
2668
|
+
ProxyMethod({
|
|
2669
|
+
type: Types.Number,
|
|
2670
|
+
isMatrix: true
|
|
2671
|
+
}),
|
|
2672
|
+
__decorateParam(0, ProxyParameter(rcnFormatParameterDescriptor)),
|
|
2673
|
+
__decorateParam(1, ProxyParameter(rcnParameterDescriptor))
|
|
2674
|
+
], GTINValidatorStaticProxy.prototype, "parseVariableMeasureRCN", 1);
|
|
2675
|
+
GTINValidatorStaticProxy = __decorateClass([
|
|
2676
|
+
ProxyClass({
|
|
2677
|
+
namespace: "GS1"
|
|
2678
|
+
})
|
|
2679
|
+
], GTINValidatorStaticProxy);
|
|
2680
|
+
var GLNValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2681
|
+
constructor(appExtension) {
|
|
2682
|
+
super(appExtension, import_gs14.GLN_VALIDATOR);
|
|
2683
|
+
}
|
|
2684
|
+
};
|
|
2685
|
+
GLNValidatorProxy = __decorateClass([
|
|
2686
|
+
ProxyClass({
|
|
2687
|
+
namespace: "GS1",
|
|
2688
|
+
methodInfix: "GLN"
|
|
2689
|
+
})
|
|
2690
|
+
], GLNValidatorProxy);
|
|
2691
|
+
var SSCCValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2692
|
+
constructor(appExtension) {
|
|
2693
|
+
super(appExtension, import_gs14.SSCC_VALIDATOR);
|
|
2694
|
+
}
|
|
2695
|
+
};
|
|
2696
|
+
SSCCValidatorProxy = __decorateClass([
|
|
2697
|
+
ProxyClass({
|
|
2698
|
+
namespace: "GS1",
|
|
2699
|
+
methodInfix: "SSCC"
|
|
2700
|
+
})
|
|
2701
|
+
], SSCCValidatorProxy);
|
|
2702
|
+
var GRAIValidatorProxy = class extends SerializableNumericIdentifierValidatorProxy {
|
|
2703
|
+
constructor(appExtension) {
|
|
2704
|
+
super(appExtension, import_gs14.GRAI_VALIDATOR);
|
|
2705
|
+
}
|
|
2706
|
+
};
|
|
2707
|
+
GRAIValidatorProxy = __decorateClass([
|
|
2708
|
+
ProxyClass({
|
|
2709
|
+
namespace: "GS1",
|
|
2710
|
+
methodInfix: "GRAI"
|
|
2711
|
+
})
|
|
2712
|
+
], GRAIValidatorProxy);
|
|
2713
|
+
var GIAIValidatorProxy = class extends NonNumericIdentifierValidatorProxy {
|
|
2714
|
+
constructor(appExtension) {
|
|
2715
|
+
super(appExtension, import_gs14.GIAI_VALIDATOR);
|
|
2716
|
+
}
|
|
2717
|
+
};
|
|
2718
|
+
GIAIValidatorProxy = __decorateClass([
|
|
2719
|
+
ProxyClass({
|
|
2720
|
+
namespace: "GS1",
|
|
2721
|
+
methodInfix: "GIAI"
|
|
2722
|
+
})
|
|
2723
|
+
], GIAIValidatorProxy);
|
|
2724
|
+
var GSRNValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2725
|
+
constructor(appExtension) {
|
|
2726
|
+
super(appExtension, import_gs14.GSRN_VALIDATOR);
|
|
2727
|
+
}
|
|
2728
|
+
};
|
|
2729
|
+
GSRNValidatorProxy = __decorateClass([
|
|
2730
|
+
ProxyClass({
|
|
2731
|
+
namespace: "GS1",
|
|
2732
|
+
methodInfix: "GSRN"
|
|
2733
|
+
})
|
|
2734
|
+
], GSRNValidatorProxy);
|
|
2735
|
+
var GDTIValidatorProxy = class extends SerializableNumericIdentifierValidatorProxy {
|
|
2736
|
+
constructor(appExtension) {
|
|
2737
|
+
super(appExtension, import_gs14.GDTI_VALIDATOR);
|
|
2738
|
+
}
|
|
2739
|
+
};
|
|
2740
|
+
GDTIValidatorProxy = __decorateClass([
|
|
2741
|
+
ProxyClass({
|
|
2742
|
+
namespace: "GS1",
|
|
2743
|
+
methodInfix: "GDTI"
|
|
2744
|
+
})
|
|
2745
|
+
], GDTIValidatorProxy);
|
|
2746
|
+
var GINCValidatorProxy = class extends NonNumericIdentifierValidatorProxy {
|
|
2747
|
+
constructor(appExtension) {
|
|
2748
|
+
super(appExtension, import_gs14.GINC_VALIDATOR);
|
|
2749
|
+
}
|
|
2750
|
+
};
|
|
2751
|
+
GINCValidatorProxy = __decorateClass([
|
|
2752
|
+
ProxyClass({
|
|
2753
|
+
namespace: "GS1",
|
|
2754
|
+
methodInfix: "GINC"
|
|
2755
|
+
})
|
|
2756
|
+
], GINCValidatorProxy);
|
|
2757
|
+
var GSINValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2758
|
+
constructor(appExtension) {
|
|
2759
|
+
super(appExtension, import_gs14.GSIN_VALIDATOR);
|
|
2760
|
+
}
|
|
2761
|
+
};
|
|
2762
|
+
GSINValidatorProxy = __decorateClass([
|
|
2763
|
+
ProxyClass({
|
|
2764
|
+
namespace: "GS1",
|
|
2765
|
+
methodInfix: "GSIN"
|
|
2766
|
+
})
|
|
2767
|
+
], GSINValidatorProxy);
|
|
2768
|
+
var GCNValidatorProxy = class extends SerializableNumericIdentifierValidatorProxy {
|
|
2769
|
+
constructor(appExtension) {
|
|
2770
|
+
super(appExtension, import_gs14.GCN_VALIDATOR);
|
|
2771
|
+
}
|
|
2772
|
+
};
|
|
2773
|
+
GCNValidatorProxy = __decorateClass([
|
|
2774
|
+
ProxyClass({
|
|
2775
|
+
namespace: "GS1",
|
|
2776
|
+
methodInfix: "GCN"
|
|
2777
|
+
})
|
|
2778
|
+
], GCNValidatorProxy);
|
|
2779
|
+
var CPIDValidatorProxy = class extends NonNumericIdentifierValidatorProxy {
|
|
2780
|
+
constructor(appExtension) {
|
|
2781
|
+
super(appExtension, import_gs14.CPID_VALIDATOR);
|
|
2782
|
+
}
|
|
2783
|
+
};
|
|
2784
|
+
CPIDValidatorProxy = __decorateClass([
|
|
2785
|
+
ProxyClass({
|
|
2786
|
+
namespace: "GS1",
|
|
2787
|
+
methodInfix: "CPID"
|
|
2788
|
+
})
|
|
2789
|
+
], CPIDValidatorProxy);
|
|
2790
|
+
var GMNValidatorProxy = class extends NonNumericIdentifierValidatorProxy {
|
|
2791
|
+
constructor(appExtension) {
|
|
2792
|
+
super(appExtension, import_gs14.GMN_VALIDATOR);
|
|
2793
|
+
}
|
|
2794
|
+
};
|
|
2795
|
+
GMNValidatorProxy = __decorateClass([
|
|
2796
|
+
ProxyClass({
|
|
2797
|
+
namespace: "GS1",
|
|
2798
|
+
methodInfix: "GMN"
|
|
2799
|
+
})
|
|
2800
|
+
], GMNValidatorProxy);
|
|
2801
|
+
var prefixParameterDescriptor = {
|
|
2802
|
+
name: "prefix",
|
|
2803
|
+
type: Types.String,
|
|
2804
|
+
isMatrix: false,
|
|
2805
|
+
isRequired: true
|
|
2806
|
+
};
|
|
2807
|
+
var prefixTypeParameterDescriptor = {
|
|
2808
|
+
name: "prefixType",
|
|
2809
|
+
type: Types.Number,
|
|
2810
|
+
isMatrix: false,
|
|
2811
|
+
isRequired: false
|
|
2812
|
+
};
|
|
2813
|
+
var tweakFactorParameterDescriptor = {
|
|
2814
|
+
name: "tweakFactor",
|
|
2815
|
+
type: Types.Number,
|
|
2816
|
+
isMatrix: false,
|
|
2817
|
+
isRequired: false
|
|
2818
|
+
};
|
|
2819
|
+
var prefixDefinitionParameterDescriptor = {
|
|
2820
|
+
name: "prefixDefinition",
|
|
2821
|
+
type: Types.Any,
|
|
2822
|
+
isMatrix: true,
|
|
2823
|
+
isRequired: true
|
|
2824
|
+
};
|
|
2825
|
+
var prefixDefinitionGS1UPCParameterDescriptor = {
|
|
2826
|
+
extendsDescriptor: prefixDefinitionParameterDescriptor,
|
|
2827
|
+
name: "prefixDefinitionGS1UPC"
|
|
2828
|
+
};
|
|
2829
|
+
var prefixDefinitionAnyParameterDescriptor = {
|
|
2830
|
+
extendsDescriptor: prefixDefinitionParameterDescriptor,
|
|
2831
|
+
name: "prefixDefinitionAny"
|
|
2832
|
+
};
|
|
2833
|
+
var PrefixManagerProxy = class extends LibProxy {
|
|
2834
|
+
definePrefix(prefix, prefixType, tweakFactor) {
|
|
2835
|
+
return [[prefix, prefixType, tweakFactor]];
|
|
2836
|
+
}
|
|
2837
|
+
};
|
|
2838
|
+
__decorateClass([
|
|
2839
|
+
ProxyMethod({
|
|
2840
|
+
type: Types.Any,
|
|
2841
|
+
isMatrix: true
|
|
2842
|
+
}),
|
|
2843
|
+
__decorateParam(0, ProxyParameter(prefixParameterDescriptor)),
|
|
2844
|
+
__decorateParam(1, ProxyParameter(prefixTypeParameterDescriptor)),
|
|
2845
|
+
__decorateParam(2, ProxyParameter(tweakFactorParameterDescriptor))
|
|
2846
|
+
], PrefixManagerProxy.prototype, "definePrefix", 1);
|
|
2847
|
+
PrefixManagerProxy = __decorateClass([
|
|
2848
|
+
ProxyClass({
|
|
2849
|
+
namespace: "GS1"
|
|
2850
|
+
})
|
|
2851
|
+
], PrefixManagerProxy);
|
|
2852
|
+
var IdentifierCreatorProxy = class _IdentifierCreatorProxy extends LibProxy {
|
|
2853
|
+
static PREFIX_TYPES = [import_gs14.PrefixTypes.GS1CompanyPrefix, import_gs14.PrefixTypes.UPCCompanyPrefix, import_gs14.PrefixTypes.GS18Prefix];
|
|
2854
|
+
_getCreator;
|
|
2855
|
+
constructor(appExtension, getCreator) {
|
|
2856
|
+
super(appExtension);
|
|
2857
|
+
this._getCreator = getCreator;
|
|
2858
|
+
}
|
|
2859
|
+
getCreator(prefixDefinition) {
|
|
2860
|
+
const reducedPrefixDefinition = prefixDefinition.length === 1 ? (
|
|
2861
|
+
// Prefix definition is horizontal.
|
|
2862
|
+
prefixDefinition[0]
|
|
2863
|
+
) : (
|
|
2864
|
+
// Prefix definition is vertical.
|
|
2865
|
+
prefixDefinition.map((prefixDefinitionRow) => {
|
|
2866
|
+
if (prefixDefinitionRow.length !== 1) {
|
|
2867
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixDefinitionMustBeOneDimensional"));
|
|
2868
|
+
}
|
|
2869
|
+
return prefixDefinitionRow[0];
|
|
2870
|
+
})
|
|
2871
|
+
);
|
|
2872
|
+
if (reducedPrefixDefinition.length > 3) {
|
|
2873
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixDefinitionMustHaveMaximumThreeElements"));
|
|
2874
|
+
}
|
|
2875
|
+
const prefix = reducedPrefixDefinition[0];
|
|
2876
|
+
if (typeof prefix !== "string") {
|
|
2877
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixMustBeString"));
|
|
2878
|
+
}
|
|
2879
|
+
const prefixTypeIndex = reducedPrefixDefinition[1] ?? 0;
|
|
2880
|
+
if (typeof prefixTypeIndex !== "number" || prefixTypeIndex < 0 || prefixTypeIndex >= _IdentifierCreatorProxy.PREFIX_TYPES.length) {
|
|
2881
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixTypeMustBeNumber", {
|
|
2882
|
+
maximumPrefixType: _IdentifierCreatorProxy.PREFIX_TYPES.length - 1
|
|
2883
|
+
}));
|
|
2884
|
+
}
|
|
2885
|
+
const prefixManager = import_gs14.PrefixManager.get(_IdentifierCreatorProxy.PREFIX_TYPES[prefixTypeIndex], prefix);
|
|
2886
|
+
const tweakFactor = reducedPrefixDefinition[2];
|
|
2887
|
+
if (!(0, import_core3.isNullish)(tweakFactor)) {
|
|
2888
|
+
if (typeof tweakFactor !== "number") {
|
|
2889
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.tweakFactorMustBeNumber"));
|
|
2890
|
+
}
|
|
2891
|
+
prefixManager.tweakFactor = tweakFactor;
|
|
2892
|
+
} else {
|
|
2893
|
+
prefixManager.resetTweakFactor();
|
|
2894
|
+
}
|
|
2895
|
+
return this._getCreator(prefixManager);
|
|
2896
|
+
}
|
|
2897
|
+
};
|
|
2898
|
+
var sparseParameterDescriptor = {
|
|
2899
|
+
name: "sparse",
|
|
2900
|
+
type: Types.Boolean,
|
|
2901
|
+
isMatrix: false,
|
|
2902
|
+
isRequired: false
|
|
2903
|
+
};
|
|
2904
|
+
var NumericIdentifierCreatorProxy = class extends IdentifierCreatorProxy {
|
|
2905
|
+
create(prefixDefinition, matrixValues, sparse) {
|
|
2906
|
+
const creator = this.getCreator(prefixDefinition);
|
|
2907
|
+
const sparseOrUndefined = sparse ?? void 0;
|
|
2908
|
+
return this.mapMatrix(matrixValues, (value) => creator.create(value, sparseOrUndefined));
|
|
2909
|
+
}
|
|
2910
|
+
createSequence(prefixDefinition, startValue, count, sparse) {
|
|
2911
|
+
this.appExtension.validateSequenceCount(count);
|
|
2912
|
+
return LibProxy.matrixResult(this.getCreator(prefixDefinition).create(new import_utility7.Sequence(startValue, count), sparse ?? void 0));
|
|
2913
|
+
}
|
|
2914
|
+
createAll(prefixDefinition) {
|
|
2915
|
+
const creator = this.getCreator(prefixDefinition);
|
|
2916
|
+
this.appExtension.validateSequenceCount(creator.capacity);
|
|
2917
|
+
return LibProxy.matrixResult(creator.createAll());
|
|
2918
|
+
}
|
|
2919
|
+
};
|
|
2920
|
+
__decorateClass([
|
|
2921
|
+
ProxyMethod({
|
|
2922
|
+
type: Types.String,
|
|
2923
|
+
isMatrix: true
|
|
2924
|
+
}),
|
|
2925
|
+
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
2926
|
+
__decorateParam(1, ProxyParameter(valueParameterDescriptor)),
|
|
2927
|
+
__decorateParam(2, ProxyParameter(sparseParameterDescriptor))
|
|
2928
|
+
], NumericIdentifierCreatorProxy.prototype, "create", 1);
|
|
2929
|
+
__decorateClass([
|
|
2930
|
+
ProxyMethod({
|
|
2931
|
+
infixBefore: "Sequence",
|
|
2932
|
+
type: Types.String,
|
|
2933
|
+
isMatrix: true
|
|
2934
|
+
}),
|
|
2935
|
+
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
2936
|
+
__decorateParam(1, ProxyParameter(startValueParameterDescriptor)),
|
|
2937
|
+
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
2938
|
+
__decorateParam(3, ProxyParameter(sparseParameterDescriptor))
|
|
2939
|
+
], NumericIdentifierCreatorProxy.prototype, "createSequence", 1);
|
|
2940
|
+
__decorateClass([
|
|
2941
|
+
ProxyMethod({
|
|
2942
|
+
type: Types.String,
|
|
2943
|
+
isMatrix: true
|
|
2944
|
+
}),
|
|
2945
|
+
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor))
|
|
2946
|
+
], NumericIdentifierCreatorProxy.prototype, "createAll", 1);
|
|
2947
|
+
var NonGTINNumericIdentifierCreatorProxy = class extends NumericIdentifierCreatorProxy {
|
|
2948
|
+
};
|
|
2949
|
+
var singleValueParameterDescriptor = {
|
|
2950
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
2951
|
+
isMatrix: false
|
|
2952
|
+
};
|
|
2953
|
+
var baseIdentifierParameterDescriptor = {
|
|
2954
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
2955
|
+
name: "baseIdentifier",
|
|
2956
|
+
isMatrix: false
|
|
2957
|
+
};
|
|
2958
|
+
var serialComponentParameterDescriptor = {
|
|
2959
|
+
name: "serialComponent",
|
|
2960
|
+
type: Types.String,
|
|
2961
|
+
isMatrix: true,
|
|
2962
|
+
isRequired: true
|
|
2963
|
+
};
|
|
2964
|
+
var SerializableNumericIdentifierCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
2965
|
+
createSerialized(prefixDefinition, value, matrixSerialComponents, sparse) {
|
|
2966
|
+
const creator = this.getCreator(prefixDefinition);
|
|
2967
|
+
const sparseOrUndefined = sparse ?? void 0;
|
|
2968
|
+
return this.mapMatrix(matrixSerialComponents, (serialComponent) => creator.createSerialized(value, serialComponent, sparseOrUndefined));
|
|
2969
|
+
}
|
|
2970
|
+
concatenate(baseIdentifier, matrixSerialComponents) {
|
|
2971
|
+
const creator = this.getCreator([[baseIdentifier.substring(0, !baseIdentifier.startsWith("0") ? import_gs14.PrefixValidator.GS1_COMPANY_PREFIX_MINIMUM_LENGTH : import_gs14.PrefixValidator.UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1), import_gs14.PrefixTypes.GS1CompanyPrefix]]);
|
|
2972
|
+
return this.mapMatrix(matrixSerialComponents, (serialComponent) => creator.concatenate(baseIdentifier, serialComponent));
|
|
2973
|
+
}
|
|
2974
|
+
};
|
|
2975
|
+
__decorateClass([
|
|
2976
|
+
ProxyMethod({
|
|
2977
|
+
type: Types.String,
|
|
2978
|
+
isMatrix: true
|
|
2979
|
+
}),
|
|
2980
|
+
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
2981
|
+
__decorateParam(1, ProxyParameter(singleValueParameterDescriptor)),
|
|
2982
|
+
__decorateParam(2, ProxyParameter(serialComponentParameterDescriptor)),
|
|
2983
|
+
__decorateParam(3, ProxyParameter(sparseParameterDescriptor))
|
|
2984
|
+
], SerializableNumericIdentifierCreatorProxy.prototype, "createSerialized", 1);
|
|
2985
|
+
__decorateClass([
|
|
2986
|
+
ProxyMethod({
|
|
2987
|
+
type: Types.String,
|
|
2988
|
+
isMatrix: true
|
|
2989
|
+
}),
|
|
2990
|
+
__decorateParam(0, ProxyParameter(baseIdentifierParameterDescriptor)),
|
|
2991
|
+
__decorateParam(1, ProxyParameter(serialComponentParameterDescriptor))
|
|
2992
|
+
], SerializableNumericIdentifierCreatorProxy.prototype, "concatenate", 1);
|
|
2993
|
+
var referenceParameterDescriptor = {
|
|
2994
|
+
name: "reference",
|
|
2995
|
+
type: Types.String,
|
|
2996
|
+
isMatrix: true,
|
|
2997
|
+
isRequired: true
|
|
2998
|
+
};
|
|
2999
|
+
var NonNumericIdentifierCreatorProxy = class extends IdentifierCreatorProxy {
|
|
3000
|
+
create(prefixDefinition, matrixReferences) {
|
|
3001
|
+
const creator = this.getCreator(prefixDefinition);
|
|
3002
|
+
return this.mapMatrix(matrixReferences, (reference) => creator.create(reference));
|
|
3003
|
+
}
|
|
3004
|
+
};
|
|
3005
|
+
__decorateClass([
|
|
3006
|
+
ProxyMethod({
|
|
3007
|
+
type: Types.String,
|
|
3008
|
+
isMatrix: true
|
|
3009
|
+
}),
|
|
3010
|
+
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
3011
|
+
__decorateParam(1, ProxyParameter(referenceParameterDescriptor))
|
|
3012
|
+
], NonNumericIdentifierCreatorProxy.prototype, "create", 1);
|
|
3013
|
+
var GTINCreatorProxy = class extends NumericIdentifierCreatorProxy {
|
|
3014
|
+
constructor(appExtension) {
|
|
3015
|
+
super(appExtension, (prefixManager) => prefixManager.gtinCreator);
|
|
3016
|
+
}
|
|
3017
|
+
createGTIN14(indicatorDigit, prefixDefinition, matrixValues, sparse) {
|
|
3018
|
+
const creator = this.getCreator(prefixDefinition);
|
|
3019
|
+
const sparseOrUndefined = sparse ?? void 0;
|
|
3020
|
+
return this.mapMatrix(matrixValues, (value) => creator.createGTIN14(indicatorDigit, value, sparseOrUndefined));
|
|
3021
|
+
}
|
|
3022
|
+
createVariableMeasureRCN(format, itemReference, matrixPricesOrWeights) {
|
|
3023
|
+
return this.mapMatrix(matrixPricesOrWeights, (priceOrWeight) => import_gs14.GTINCreator.createVariableMeasureRCN(format, itemReference, priceOrWeight));
|
|
3024
|
+
}
|
|
3025
|
+
};
|
|
3026
|
+
__decorateClass([
|
|
3027
|
+
ProxyMethod({
|
|
3028
|
+
type: Types.String,
|
|
3029
|
+
isMatrix: true,
|
|
3030
|
+
ignoreInfix: true
|
|
3031
|
+
}),
|
|
3032
|
+
__decorateParam(0, ProxyParameter(indicatorDigitParameterDescriptor)),
|
|
3033
|
+
__decorateParam(1, ProxyParameter(prefixDefinitionAnyParameterDescriptor)),
|
|
3034
|
+
__decorateParam(2, ProxyParameter(valueParameterDescriptor)),
|
|
3035
|
+
__decorateParam(3, ProxyParameter(sparseParameterDescriptor))
|
|
3036
|
+
], GTINCreatorProxy.prototype, "createGTIN14", 1);
|
|
3037
|
+
__decorateClass([
|
|
3038
|
+
ProxyMethod({
|
|
3039
|
+
type: Types.String,
|
|
3040
|
+
isMatrix: true,
|
|
3041
|
+
ignoreInfix: true
|
|
3042
|
+
}),
|
|
3043
|
+
__decorateParam(0, ProxyParameter(rcnFormatParameterDescriptor)),
|
|
3044
|
+
__decorateParam(1, ProxyParameter(rcnItemReferenceParameterDescriptor)),
|
|
3045
|
+
__decorateParam(2, ProxyParameter(rcnPriceOrWeightParameterDescriptor))
|
|
3046
|
+
], GTINCreatorProxy.prototype, "createVariableMeasureRCN", 1);
|
|
3047
|
+
GTINCreatorProxy = __decorateClass([
|
|
3048
|
+
ProxyClass({
|
|
3049
|
+
namespace: "GS1",
|
|
3050
|
+
methodInfix: "GTIN",
|
|
3051
|
+
replaceParameterDescriptors: [
|
|
3052
|
+
{
|
|
3053
|
+
name: expandParameterDescriptor(prefixDefinitionGS1UPCParameterDescriptor).name,
|
|
3054
|
+
replacement: prefixDefinitionAnyParameterDescriptor
|
|
3055
|
+
}
|
|
3056
|
+
]
|
|
3057
|
+
})
|
|
3058
|
+
], GTINCreatorProxy);
|
|
3059
|
+
var GLNCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3060
|
+
constructor(appExtension) {
|
|
3061
|
+
super(appExtension, (prefixManager) => prefixManager.glnCreator);
|
|
3062
|
+
}
|
|
3063
|
+
};
|
|
3064
|
+
GLNCreatorProxy = __decorateClass([
|
|
3065
|
+
ProxyClass({
|
|
3066
|
+
namespace: "GS1",
|
|
3067
|
+
methodInfix: "GLN"
|
|
3068
|
+
})
|
|
3069
|
+
], GLNCreatorProxy);
|
|
3070
|
+
var SSCCCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3071
|
+
constructor(appExtension) {
|
|
3072
|
+
super(appExtension, (prefixManager) => prefixManager.ssccCreator);
|
|
3073
|
+
}
|
|
3074
|
+
};
|
|
3075
|
+
SSCCCreatorProxy = __decorateClass([
|
|
3076
|
+
ProxyClass({
|
|
3077
|
+
namespace: "GS1",
|
|
3078
|
+
methodInfix: "SSCC"
|
|
3079
|
+
})
|
|
3080
|
+
], SSCCCreatorProxy);
|
|
3081
|
+
var GRAICreatorProxy = class extends SerializableNumericIdentifierCreatorProxy {
|
|
3082
|
+
constructor(appExtension) {
|
|
3083
|
+
super(appExtension, (prefixManager) => prefixManager.graiCreator);
|
|
3084
|
+
}
|
|
3085
|
+
};
|
|
3086
|
+
GRAICreatorProxy = __decorateClass([
|
|
3087
|
+
ProxyClass({
|
|
3088
|
+
namespace: "GS1",
|
|
3089
|
+
methodInfix: "GRAI"
|
|
3090
|
+
})
|
|
3091
|
+
], GRAICreatorProxy);
|
|
3092
|
+
var GIAICreatorProxy = class extends NonNumericIdentifierCreatorProxy {
|
|
3093
|
+
constructor(appExtension) {
|
|
3094
|
+
super(appExtension, (prefixManager) => prefixManager.giaiCreator);
|
|
3095
|
+
}
|
|
3096
|
+
};
|
|
3097
|
+
GIAICreatorProxy = __decorateClass([
|
|
3098
|
+
ProxyClass({
|
|
3099
|
+
namespace: "GS1",
|
|
3100
|
+
methodInfix: "GIAI"
|
|
3101
|
+
})
|
|
3102
|
+
], GIAICreatorProxy);
|
|
3103
|
+
var GSRNCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3104
|
+
constructor(appExtension) {
|
|
3105
|
+
super(appExtension, (prefixManager) => prefixManager.gsrnCreator);
|
|
3106
|
+
}
|
|
3107
|
+
};
|
|
3108
|
+
GSRNCreatorProxy = __decorateClass([
|
|
3109
|
+
ProxyClass({
|
|
3110
|
+
namespace: "GS1",
|
|
3111
|
+
methodInfix: "GSRN"
|
|
3112
|
+
})
|
|
3113
|
+
], GSRNCreatorProxy);
|
|
3114
|
+
var GDTICreatorProxy = class extends SerializableNumericIdentifierCreatorProxy {
|
|
3115
|
+
constructor(appExtension) {
|
|
3116
|
+
super(appExtension, (prefixManager) => prefixManager.gdtiCreator);
|
|
3117
|
+
}
|
|
3118
|
+
};
|
|
3119
|
+
GDTICreatorProxy = __decorateClass([
|
|
3120
|
+
ProxyClass({
|
|
3121
|
+
namespace: "GS1",
|
|
3122
|
+
methodInfix: "GDTI"
|
|
3123
|
+
})
|
|
3124
|
+
], GDTICreatorProxy);
|
|
3125
|
+
var GINCCreatorProxy = class extends NonNumericIdentifierCreatorProxy {
|
|
3126
|
+
constructor(appExtension) {
|
|
3127
|
+
super(appExtension, (prefixManager) => prefixManager.gincCreator);
|
|
3128
|
+
}
|
|
3129
|
+
};
|
|
3130
|
+
GINCCreatorProxy = __decorateClass([
|
|
3131
|
+
ProxyClass({
|
|
3132
|
+
namespace: "GS1",
|
|
3133
|
+
methodInfix: "GINC"
|
|
3134
|
+
})
|
|
3135
|
+
], GINCCreatorProxy);
|
|
3136
|
+
var GSINCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3137
|
+
constructor(appExtension) {
|
|
3138
|
+
super(appExtension, (prefixManager) => prefixManager.gsinCreator);
|
|
3139
|
+
}
|
|
3140
|
+
};
|
|
3141
|
+
GSINCreatorProxy = __decorateClass([
|
|
3142
|
+
ProxyClass({
|
|
3143
|
+
namespace: "GS1",
|
|
3144
|
+
methodInfix: "GSIN"
|
|
3145
|
+
})
|
|
3146
|
+
], GSINCreatorProxy);
|
|
3147
|
+
var GCNCreatorProxy = class extends SerializableNumericIdentifierCreatorProxy {
|
|
3148
|
+
constructor(appExtension) {
|
|
3149
|
+
super(appExtension, (prefixManager) => prefixManager.gcnCreator);
|
|
3150
|
+
}
|
|
3151
|
+
};
|
|
3152
|
+
GCNCreatorProxy = __decorateClass([
|
|
3153
|
+
ProxyClass({
|
|
3154
|
+
namespace: "GS1",
|
|
3155
|
+
methodInfix: "GCN"
|
|
3156
|
+
})
|
|
3157
|
+
], GCNCreatorProxy);
|
|
3158
|
+
var CPIDCreatorProxy = class extends NonNumericIdentifierCreatorProxy {
|
|
3159
|
+
constructor(appExtension) {
|
|
3160
|
+
super(appExtension, (prefixManager) => prefixManager.cpidCreator);
|
|
3161
|
+
}
|
|
3162
|
+
};
|
|
3163
|
+
CPIDCreatorProxy = __decorateClass([
|
|
3164
|
+
ProxyClass({
|
|
3165
|
+
namespace: "GS1",
|
|
3166
|
+
methodInfix: "CPID"
|
|
3167
|
+
})
|
|
3168
|
+
], CPIDCreatorProxy);
|
|
3169
|
+
var GMNCreatorProxy = class extends NonNumericIdentifierCreatorProxy {
|
|
3170
|
+
constructor(appExtension) {
|
|
3171
|
+
super(appExtension, (prefixManager) => prefixManager.gmnCreator);
|
|
3172
|
+
}
|
|
3173
|
+
};
|
|
3174
|
+
GMNCreatorProxy = __decorateClass([
|
|
3175
|
+
ProxyClass({
|
|
3176
|
+
namespace: "GS1",
|
|
3177
|
+
methodInfix: "GMN"
|
|
3178
|
+
})
|
|
3179
|
+
], GMNCreatorProxy);
|
|
3180
|
+
|
|
3181
|
+
// src/generator/generator.ts
|
|
3182
|
+
var import_core4 = require("@aidc-toolkit/core");
|
|
3183
|
+
var Generator = class _Generator {
|
|
3184
|
+
/**
|
|
3185
|
+
* Documentation base URL.
|
|
3186
|
+
*/
|
|
3187
|
+
static DOCUMENTATION_BASE_URL = "https://aidc-toolkit.com/";
|
|
3188
|
+
/**
|
|
3189
|
+
* Documentation path, optionally preceded by locale.
|
|
3190
|
+
*/
|
|
3191
|
+
static DOCUMENTATION_PATH = "app-extension/";
|
|
3192
|
+
/**
|
|
3193
|
+
* Locales.
|
|
3194
|
+
*/
|
|
3195
|
+
_locales;
|
|
3196
|
+
/**
|
|
3197
|
+
* Default locale.
|
|
3198
|
+
*/
|
|
3199
|
+
_defaultLocale;
|
|
3200
|
+
/**
|
|
3201
|
+
* Map of function localizations maps by namespace function name.
|
|
3202
|
+
*/
|
|
3203
|
+
_functionLocalizationsMapsMap = /* @__PURE__ */ new Map();
|
|
3204
|
+
/**
|
|
3205
|
+
* Map of parameter localizations maps by namespace function parameter name.
|
|
3206
|
+
*/
|
|
3207
|
+
_parameterLocalizationsMapsMap = /* @__PURE__ */ new Map();
|
|
3208
|
+
/**
|
|
3209
|
+
*
|
|
3210
|
+
*/
|
|
3211
|
+
/**
|
|
3212
|
+
* Constructor.
|
|
3213
|
+
*
|
|
3214
|
+
* @param includeLocalizations
|
|
3215
|
+
* Include localizations if true.
|
|
3216
|
+
*/
|
|
3217
|
+
constructor(includeLocalizations = true) {
|
|
3218
|
+
this._locales = includeLocalizations ? Object.keys(appExtensionResources) : [];
|
|
3219
|
+
this._defaultLocale = this._locales[0] ?? "";
|
|
3220
|
+
}
|
|
3221
|
+
/**
|
|
3222
|
+
* Get the locales.
|
|
3223
|
+
*/
|
|
3224
|
+
get locales() {
|
|
3225
|
+
return this._locales;
|
|
3226
|
+
}
|
|
3227
|
+
/**
|
|
3228
|
+
* Get the default locale.
|
|
3229
|
+
*/
|
|
3230
|
+
get defaultLocale() {
|
|
3231
|
+
return this._defaultLocale;
|
|
3232
|
+
}
|
|
3233
|
+
/**
|
|
3234
|
+
* Get function localization.
|
|
3235
|
+
*
|
|
3236
|
+
* @param namespaceFunctionName
|
|
3237
|
+
* Namespace function name.
|
|
3238
|
+
*
|
|
3239
|
+
* @param locale
|
|
3240
|
+
* Locale.
|
|
3241
|
+
*
|
|
3242
|
+
* @returns
|
|
3243
|
+
* Function localization.
|
|
3244
|
+
*/
|
|
3245
|
+
getFunctionLocalization(namespaceFunctionName, locale) {
|
|
3246
|
+
const functionLocalization = this._functionLocalizationsMapsMap.get(namespaceFunctionName)?.get(locale);
|
|
3247
|
+
if (functionLocalization === void 0) {
|
|
3248
|
+
throw new Error(`Localization for function "${namespaceFunctionName}", locale "${locale}" not found`);
|
|
3249
|
+
}
|
|
3250
|
+
return functionLocalization;
|
|
3251
|
+
}
|
|
3252
|
+
/**
|
|
3253
|
+
* Get parameter localization.
|
|
3254
|
+
*
|
|
3255
|
+
* @param namespaceFunctionName
|
|
3256
|
+
* Namespace function name.
|
|
3257
|
+
*
|
|
3258
|
+
* @param parameterName
|
|
3259
|
+
* Parameter name.
|
|
3260
|
+
*
|
|
3261
|
+
* @param locale
|
|
3262
|
+
* Locale.
|
|
3263
|
+
*
|
|
3264
|
+
* @returns
|
|
3265
|
+
* Function localization.
|
|
3266
|
+
*/
|
|
3267
|
+
getParameterLocalization(namespaceFunctionName, parameterName, locale) {
|
|
3268
|
+
const parameterLocalization = this._parameterLocalizationsMapsMap.get(`${namespaceFunctionName}.${parameterName}`)?.get(locale);
|
|
3269
|
+
if (parameterLocalization === void 0) {
|
|
3270
|
+
throw new Error(`Localization for function "${namespaceFunctionName}", parameter "${parameterName}", locale "${locale}" not found`);
|
|
3271
|
+
}
|
|
3272
|
+
return parameterLocalization;
|
|
3273
|
+
}
|
|
3274
|
+
/**
|
|
3275
|
+
* Generate localizations map.
|
|
3276
|
+
*
|
|
3277
|
+
* @param localizedKeyPrefix
|
|
3278
|
+
* Localized key prefix.
|
|
3279
|
+
*
|
|
3280
|
+
* @param localizationCallback
|
|
3281
|
+
* Callback to finalize localization.
|
|
3282
|
+
*
|
|
3283
|
+
* @returns
|
|
3284
|
+
* Localization map.
|
|
3285
|
+
*/
|
|
3286
|
+
generateLocalizationsMap(localizedKeyPrefix, localizationCallback) {
|
|
3287
|
+
return new Map(this._locales.map((locale) => {
|
|
3288
|
+
const lngOption = {
|
|
3289
|
+
lng: locale
|
|
3290
|
+
};
|
|
3291
|
+
return [locale, localizationCallback(locale, {
|
|
3292
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
3293
|
+
name: i18nextAppExtension.t(`${localizedKeyPrefix}name`, lngOption),
|
|
3294
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
3295
|
+
description: i18nextAppExtension.t(`${localizedKeyPrefix}description`, lngOption)
|
|
3296
|
+
})];
|
|
3297
|
+
}));
|
|
3298
|
+
}
|
|
3299
|
+
/**
|
|
3300
|
+
* Generate by processing individual imports.
|
|
3301
|
+
*/
|
|
3302
|
+
async generate() {
|
|
3303
|
+
let success = false;
|
|
3304
|
+
await i18nAppExtensionInit(import_core4.I18nEnvironments.CLI);
|
|
3305
|
+
this.initialize();
|
|
3306
|
+
try {
|
|
3307
|
+
for (const classDescriptor of getClassDescriptorsMap().values()) {
|
|
3308
|
+
const namespace = classDescriptor.namespace;
|
|
3309
|
+
const namespacePrefix = namespace === void 0 ? "" : `${namespace}.`;
|
|
3310
|
+
const className = classDescriptor.name;
|
|
3311
|
+
const methodInfix = classDescriptor.methodInfix;
|
|
3312
|
+
const namespaceClassName = `${namespacePrefix}${className}`;
|
|
3313
|
+
const classNameMatch = /^([A-Z]+[0-9]*|[A-Z][^A-Z.]*)([A-Z][^.]*|)\.?([A-Z].*|)$/.exec(namespaceClassName);
|
|
3314
|
+
if (classNameMatch === null) {
|
|
3315
|
+
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
3316
|
+
}
|
|
3317
|
+
const proxyObjectDescriptor = {
|
|
3318
|
+
namespace,
|
|
3319
|
+
className,
|
|
3320
|
+
namespaceClassName,
|
|
3321
|
+
classDescriptor,
|
|
3322
|
+
objectName: `${classNameMatch[1].toLowerCase()}${classNameMatch[2]}${classNameMatch[3]}`
|
|
3323
|
+
};
|
|
3324
|
+
this.createProxyObject(proxyObjectDescriptor);
|
|
3325
|
+
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
3326
|
+
const methodName = methodDescriptor.name;
|
|
3327
|
+
const infixBefore = methodDescriptor.infixBefore;
|
|
3328
|
+
let functionName;
|
|
3329
|
+
if (methodInfix === void 0 || methodDescriptor.ignoreInfix === true) {
|
|
3330
|
+
functionName = methodName;
|
|
3331
|
+
} else if (infixBefore === void 0) {
|
|
3332
|
+
functionName = `${methodName}${methodInfix}`;
|
|
3333
|
+
} else {
|
|
3334
|
+
const insertIndex = methodName.indexOf(infixBefore);
|
|
3335
|
+
if (insertIndex === -1) {
|
|
3336
|
+
throw new Error(`Cannot find "${infixBefore}" in method name ${methodName}`);
|
|
3337
|
+
}
|
|
3338
|
+
functionName = `${methodName.substring(0, insertIndex)}${methodInfix}${methodName.substring(insertIndex)}`;
|
|
3339
|
+
}
|
|
3340
|
+
const namespaceFunctionName = `${namespacePrefix}${functionName}`;
|
|
3341
|
+
const functionLocalizationsMap = this.generateLocalizationsMap(`Functions.${namespaceFunctionName}.`, (locale, localization) => ({
|
|
3342
|
+
...localization,
|
|
3343
|
+
documentationURL: `${_Generator.DOCUMENTATION_BASE_URL}${locale === this.defaultLocale ? "" : `${locale}/`}${_Generator.DOCUMENTATION_PATH}${namespace === void 0 ? "" : `${namespace}/`}${localization.name}.html`
|
|
3344
|
+
}));
|
|
3345
|
+
this._functionLocalizationsMapsMap.set(namespaceFunctionName, functionLocalizationsMap);
|
|
3346
|
+
this.createProxyFunction({
|
|
3347
|
+
...proxyObjectDescriptor,
|
|
3348
|
+
functionName,
|
|
3349
|
+
namespaceFunctionName,
|
|
3350
|
+
localizationsMap: functionLocalizationsMap,
|
|
3351
|
+
proxyParameterDescriptors: methodDescriptor.parameterDescriptors.map((parameterDescriptor) => {
|
|
3352
|
+
const expandedParameterDescriptor = expandParameterDescriptor(parameterDescriptor);
|
|
3353
|
+
const parameterName = expandedParameterDescriptor.name;
|
|
3354
|
+
const parameterLocalizationsMap = this.generateLocalizationsMap(`Parameters.${parameterName}.`, (_locale, localization) => localization);
|
|
3355
|
+
this._parameterLocalizationsMapsMap.set(`${namespaceFunctionName}.${parameterName}`, parameterLocalizationsMap);
|
|
3356
|
+
return {
|
|
3357
|
+
namespace,
|
|
3358
|
+
parameterName,
|
|
3359
|
+
localizationsMap: parameterLocalizationsMap,
|
|
3360
|
+
parameterDescriptor: expandedParameterDescriptor
|
|
3361
|
+
};
|
|
3362
|
+
}),
|
|
3363
|
+
methodDescriptor
|
|
3364
|
+
});
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
success = true;
|
|
3368
|
+
} finally {
|
|
3369
|
+
await this.finalize(success);
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
};
|
|
3373
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3374
|
+
0 && (module.exports = {
|
|
3375
|
+
AlphabeticProxy,
|
|
3376
|
+
AlphanumericProxy,
|
|
3377
|
+
AppExtension,
|
|
3378
|
+
AppUtilityProxy,
|
|
3379
|
+
CharacterSetProxy,
|
|
3380
|
+
GS1,
|
|
3381
|
+
Generator,
|
|
3382
|
+
HexadecimalProxy,
|
|
3383
|
+
LibProxy,
|
|
3384
|
+
NumericProxy,
|
|
3385
|
+
ProxyClass,
|
|
3386
|
+
ProxyMethod,
|
|
3387
|
+
ProxyParameter,
|
|
3388
|
+
RegExpProxy,
|
|
3389
|
+
TransformerProxy,
|
|
3390
|
+
Types,
|
|
3391
|
+
appExtensionNS,
|
|
3392
|
+
appExtensionResources,
|
|
3393
|
+
expandParameterDescriptor,
|
|
3394
|
+
getClassDescriptorsMap,
|
|
3395
|
+
i18nAppExtensionInit,
|
|
3396
|
+
i18nextAppExtension
|
|
3397
|
+
});
|
|
3398
|
+
/*!
|
|
3399
|
+
* Copyright © 2024-2025 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
3400
|
+
* contributors
|
|
3401
|
+
*
|
|
3402
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3403
|
+
* you may not use this file except in compliance with the License.
|
|
3404
|
+
* You may obtain a copy of the License at
|
|
3405
|
+
*
|
|
3406
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
3407
|
+
*
|
|
3408
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3409
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3410
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3411
|
+
* See the License for the specific language governing permissions and
|
|
3412
|
+
* limitations under the License.
|
|
3413
|
+
*/
|
|
3414
|
+
//# sourceMappingURL=index.cjs.map
|