@aidc-toolkit/app-extension 1.0.32-beta → 1.0.33-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 +1 -6528
- package/dist/index.d.cts +105 -106
- package/dist/index.d.ts +105 -106
- package/dist/index.js +1 -6508
- package/package.json +12 -12
- package/src/app-extension.ts +26 -47
- package/src/{app-utility-proxy.ts → app-helper-proxy.ts} +21 -19
- package/src/descriptor.ts +43 -2
- package/src/generator/generator.ts +116 -91
- package/src/generator/locale-resources-generator.ts +26 -14
- package/src/gs1/check-proxy.ts +12 -11
- package/src/gs1/gtin-creator-proxy.ts +2 -3
- package/src/gs1/gtin-descriptor.ts +2 -2
- package/src/gs1/gtin-validator-proxy.ts +12 -14
- package/src/gs1/identifier-creator-proxy.ts +19 -21
- package/src/gs1/identifier-descriptor.ts +3 -3
- package/src/gs1/identifier-validator-proxy.ts +15 -16
- package/src/gs1/non-gtin-creator-proxy.ts +0 -11
- package/src/gs1/non-gtin-validator-proxy.ts +0 -11
- package/src/gs1/prefix-definition-descriptor.ts +2 -2
- package/src/gs1/prefix-manager-proxy.ts +80 -120
- package/src/gs1/service-proxy.ts +6 -5
- package/src/gs1/variable-measure-proxy.ts +9 -8
- package/src/index.ts +1 -2
- package/src/locale/en/locale-resources.ts +28 -15
- package/src/locale/fr/locale-resources.ts +28 -15
- package/src/locale/i18n.ts +10 -9
- package/src/locale/i18next.d.ts +2 -0
- package/src/proxy.ts +64 -40
- package/src/utility/character-set-descriptor.ts +2 -2
- package/src/utility/character-set-proxy.ts +7 -7
- package/src/utility/reg-exp-proxy.ts +5 -5
- package/src/utility/string-descriptor.ts +2 -2
- package/src/utility/string-proxy.ts +4 -0
- package/src/utility/transformer-descriptor.ts +5 -5
- package/src/utility/transformer-proxy.ts +6 -5
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/app-data.ts +0 -94
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { Nullishable } from "@aidc-toolkit/core";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
type GCPLengthCache,
|
|
4
|
+
type GCPLengthData,
|
|
5
|
+
PrefixManager,
|
|
6
|
+
type PrefixType,
|
|
7
|
+
RemoteGCPLengthCache
|
|
8
|
+
} from "@aidc-toolkit/gs1";
|
|
9
|
+
import type { Logger } from "tslog";
|
|
10
|
+
import type { AppExtension } from "../app-extension.js";
|
|
11
|
+
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
6
12
|
import { LibProxy } from "../lib-proxy.js";
|
|
7
13
|
import { proxy } from "../proxy.js";
|
|
8
14
|
import type { ErrorExtends, Matrix, MatrixResult, SingletonResult } from "../type.js";
|
|
@@ -12,21 +18,21 @@ import { validateIdentifierType } from "./identifier-type.js";
|
|
|
12
18
|
const prefixParameterDescriptor: ParameterDescriptor = {
|
|
13
19
|
name: "prefix",
|
|
14
20
|
type: Types.String,
|
|
15
|
-
|
|
21
|
+
multiplicity: Multiplicities.Singleton,
|
|
16
22
|
isRequired: true
|
|
17
23
|
};
|
|
18
24
|
|
|
19
25
|
const prefixTypeParameterDescriptor: ParameterDescriptor = {
|
|
20
26
|
name: "prefixType",
|
|
21
27
|
type: Types.Number,
|
|
22
|
-
|
|
28
|
+
multiplicity: Multiplicities.Singleton,
|
|
23
29
|
isRequired: false
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
const tweakFactorParameterDescriptor: ParameterDescriptor = {
|
|
27
33
|
name: "tweakFactor",
|
|
28
34
|
type: Types.Number,
|
|
29
|
-
|
|
35
|
+
multiplicity: Multiplicities.Singleton,
|
|
30
36
|
isRequired: false
|
|
31
37
|
};
|
|
32
38
|
|
|
@@ -35,50 +41,14 @@ const gcpLengthIdentifierParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
35
41
|
name: "gcpLengthIdentifier"
|
|
36
42
|
};
|
|
37
43
|
|
|
38
|
-
/**
|
|
39
|
-
* GS1 Company Prefix length application data.
|
|
40
|
-
*/
|
|
41
|
-
interface GCPLengthAppData {
|
|
42
|
-
/**
|
|
43
|
-
* Next check date/time.
|
|
44
|
-
*/
|
|
45
|
-
nextCheckDateTime: Date | undefined;
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* GS1 Company Prefix length data.
|
|
49
|
-
*/
|
|
50
|
-
gcpLengthData: GCPLengthData | undefined;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Determine if data object is GS1 Company Prefix length application data.
|
|
55
|
-
*
|
|
56
|
-
* @param data
|
|
57
|
-
* Data object.
|
|
58
|
-
*
|
|
59
|
-
* @returns
|
|
60
|
-
* True if data object is GS1 Company Prefix length application data.
|
|
61
|
-
*/
|
|
62
|
-
function isGCPLengthAppData(data: AppData | undefined): data is GCPLengthAppData {
|
|
63
|
-
// Property type check is necessary to guard against data corruption or changes in format.
|
|
64
|
-
return typeof data === "object" && "nextCheckDateTime" in data && data.nextCheckDateTime instanceof Date;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
44
|
/**
|
|
68
45
|
* Application extension GCP length cache. Data is stored in application extension shared data.
|
|
69
46
|
*/
|
|
70
47
|
class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends RemoteGCPLengthCache {
|
|
71
48
|
/**
|
|
72
|
-
*
|
|
49
|
+
* Logger.
|
|
73
50
|
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Application extension.
|
|
78
|
-
*/
|
|
79
|
-
readonly #appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>;
|
|
80
|
-
|
|
81
|
-
#gcpLengthAppData?: GCPLengthAppData | undefined;
|
|
51
|
+
readonly #logger: Logger<object>;
|
|
82
52
|
|
|
83
53
|
/**
|
|
84
54
|
* Constructor.
|
|
@@ -87,61 +57,58 @@ class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends Erro
|
|
|
87
57
|
* Application extension.
|
|
88
58
|
*/
|
|
89
59
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) {
|
|
90
|
-
super();
|
|
91
|
-
|
|
92
|
-
this.#appExtension = appExtension;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
async initialize(): Promise<void> {
|
|
96
|
-
const gcpLengthAppData = await this.#appExtension.getSharedData(AppExtensionGCPLengthCache.#GCP_LENGTH_DATA_NAME);
|
|
97
|
-
|
|
98
|
-
if (isGCPLengthAppData(gcpLengthAppData)) {
|
|
99
|
-
this.#gcpLengthAppData = gcpLengthAppData;
|
|
60
|
+
super(appExtension.sharedAppDataStorage);
|
|
100
61
|
|
|
101
|
-
|
|
102
|
-
}
|
|
62
|
+
this.#logger = appExtension.logger;
|
|
103
63
|
}
|
|
104
64
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
override get nextCheckDateTime(): Promise<Date | undefined> {
|
|
69
|
+
return super.nextCheckDateTime.then((nextCheckDateTime) => {
|
|
70
|
+
this.#logger.debug(`GS1 Company Prefix length next check date/time ${nextCheckDateTime?.toISOString()}`);
|
|
109
71
|
|
|
110
|
-
|
|
72
|
+
return nextCheckDateTime;
|
|
73
|
+
});
|
|
111
74
|
}
|
|
112
75
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
76
|
+
/**
|
|
77
|
+
* @inheritDoc
|
|
78
|
+
*/
|
|
79
|
+
override get cacheDateTime(): Promise<Date | undefined> {
|
|
80
|
+
return super.cacheDateTime.then((cacheDateTime) => {
|
|
81
|
+
this.#logger.debug(`GS1 Company Prefix length cache date/time ${cacheDateTime?.toISOString()}`);
|
|
117
82
|
|
|
118
|
-
|
|
83
|
+
return cacheDateTime;
|
|
84
|
+
});
|
|
119
85
|
}
|
|
120
86
|
|
|
121
|
-
get cacheData(): GCPLengthData {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const gcpLengthData = this.#gcpLengthAppData?.gcpLengthData;
|
|
87
|
+
override get cacheData(): Promise<GCPLengthData> {
|
|
88
|
+
return super.cacheData.then((cacheData) => {
|
|
89
|
+
this.#logger.debug("GS1 Company Prefix length cache data retrieved");
|
|
125
90
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
throw new Error("Cache data not defined");
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
return gcpLengthData;
|
|
91
|
+
return cacheData;
|
|
92
|
+
});
|
|
132
93
|
}
|
|
133
94
|
|
|
95
|
+
/**
|
|
96
|
+
* @inheritDoc
|
|
97
|
+
*/
|
|
134
98
|
override get sourceDateTime(): Promise<Date> {
|
|
135
99
|
return super.sourceDateTime.then((sourceDateTime) => {
|
|
136
|
-
this.#
|
|
100
|
+
this.#logger.debug(`GS1 Company Prefix source date/time ${sourceDateTime.toISOString()}`);
|
|
137
101
|
|
|
138
102
|
return sourceDateTime;
|
|
139
103
|
});
|
|
140
104
|
}
|
|
141
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @inheritDoc
|
|
108
|
+
*/
|
|
142
109
|
override get sourceData(): Promise<GCPLengthData> {
|
|
143
110
|
return super.sourceData.then((sourceData) => {
|
|
144
|
-
this.#
|
|
111
|
+
this.#logger.debug("GS1 Company Prefix length source data retrieved");
|
|
145
112
|
|
|
146
113
|
return sourceData;
|
|
147
114
|
});
|
|
@@ -150,27 +117,29 @@ class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends Erro
|
|
|
150
117
|
/**
|
|
151
118
|
* @inheritDoc
|
|
152
119
|
*/
|
|
153
|
-
async update(nextCheckDateTime: Date,
|
|
154
|
-
|
|
155
|
-
nextCheckDateTime
|
|
156
|
-
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
await this.#appExtension.setSharedData(AppExtensionGCPLengthCache.#GCP_LENGTH_DATA_NAME, this.#gcpLengthAppData);
|
|
160
|
-
|
|
161
|
-
this.#appExtension.logger.trace(`GS1 Company Prefix length saved to shared data with next check date/time ${nextCheckDateTime.toISOString()}`);
|
|
120
|
+
override async update(nextCheckDateTime: Date, cacheDateTime?: Date, cacheData?: GCPLengthData): Promise<void> {
|
|
121
|
+
return super.update(nextCheckDateTime, cacheDateTime, cacheData).then(() => {
|
|
122
|
+
this.#logger.trace(`GS1 Company Prefix length saved to shared data with next check date/time ${nextCheckDateTime.toISOString()}`);
|
|
123
|
+
});
|
|
162
124
|
}
|
|
163
125
|
}
|
|
164
126
|
|
|
165
127
|
@proxy.describeClass(false, {
|
|
166
|
-
namespace: "GS1"
|
|
128
|
+
namespace: "GS1",
|
|
129
|
+
category: "prefix"
|
|
167
130
|
})
|
|
168
131
|
export class PrefixManagerProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
169
|
-
#gcpLengthCache
|
|
132
|
+
readonly #gcpLengthCache: GCPLengthCache;
|
|
170
133
|
|
|
134
|
+
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) {
|
|
135
|
+
super(appExtension);
|
|
136
|
+
|
|
137
|
+
this.#gcpLengthCache = new AppExtensionGCPLengthCache(appExtension);
|
|
138
|
+
}
|
|
139
|
+
|
|
171
140
|
@proxy.describeMethod({
|
|
172
141
|
type: Types.Any,
|
|
173
|
-
|
|
142
|
+
multiplicity: Multiplicities.SingletonArray,
|
|
174
143
|
parameterDescriptors: [prefixParameterDescriptor, prefixTypeParameterDescriptor, tweakFactorParameterDescriptor]
|
|
175
144
|
})
|
|
176
145
|
definePrefix(prefix: string, prefixType: Nullishable<PrefixType>, tweakFactor: Nullishable<number>): Matrix<unknown> {
|
|
@@ -180,58 +149,49 @@ export class PrefixManagerProxy<ThrowError extends boolean, TError extends Error
|
|
|
180
149
|
|
|
181
150
|
/**
|
|
182
151
|
* Load GS1 Company Prefix length data.
|
|
152
|
+
*
|
|
153
|
+
* @returns
|
|
154
|
+
* Void promise.
|
|
183
155
|
*/
|
|
184
156
|
async #loadGCPLengthData(): Promise<void> {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
this.#gcpLengthCache = new AppExtensionGCPLengthCache(this.appExtension);
|
|
189
|
-
|
|
190
|
-
await this.#gcpLengthCache.initialize();
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
const gcpLengthCache = this.#gcpLengthCache;
|
|
194
|
-
|
|
195
|
-
await PrefixManager.loadGCPLengthData(gcpLengthCache).catch((e: unknown) => {
|
|
196
|
-
// Swallow error and log it.
|
|
197
|
-
appExtension.logger.error("Load GS1 Company Prefix length data failed", e);
|
|
157
|
+
return PrefixManager.loadGCPLengthData(this.#gcpLengthCache).catch((e: unknown) => {
|
|
158
|
+
// Log and swallow error.
|
|
159
|
+
this.appExtension.logger.error("Load GS1 Company Prefix length data failed", e);
|
|
198
160
|
});
|
|
199
161
|
}
|
|
200
162
|
|
|
201
163
|
@proxy.describeMethod({
|
|
202
164
|
type: Types.Number,
|
|
203
|
-
|
|
165
|
+
multiplicity: Multiplicities.Matrix,
|
|
204
166
|
parameterDescriptors: [identifierTypeParameterDescriptor, gcpLengthIdentifierParameterDescriptor]
|
|
205
167
|
})
|
|
206
168
|
async gcpLength(identifierType: string, matrixIdentifiers: Matrix<string>): Promise<MatrixResult<number, ThrowError, TError>> {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
PrefixManager.gcpLength(validatedIdentifierType, identifier)
|
|
213
|
-
);
|
|
169
|
+
return this.#loadGCPLengthData().then(() => this.setUpMatrixResult(
|
|
170
|
+
() => validateIdentifierType(identifierType),
|
|
171
|
+
matrixIdentifiers,
|
|
172
|
+
(validatedIdentifierType, identifier) => PrefixManager.gcpLength(validatedIdentifierType, identifier)
|
|
173
|
+
));
|
|
214
174
|
}
|
|
215
175
|
|
|
216
176
|
@proxy.describeMethod({
|
|
217
177
|
type: Types.String,
|
|
218
|
-
|
|
178
|
+
multiplicity: Multiplicities.Singleton,
|
|
219
179
|
parameterDescriptors: []
|
|
220
180
|
})
|
|
221
181
|
async gcpLengthDateTime(): Promise<SingletonResult<string, ThrowError, TError>> {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
182
|
+
return this.#loadGCPLengthData().then(() =>
|
|
183
|
+
this.singletonResult(() => PrefixManager.gcpLengthDateTime().toISOString())
|
|
184
|
+
);
|
|
225
185
|
}
|
|
226
186
|
|
|
227
187
|
@proxy.describeMethod({
|
|
228
188
|
type: Types.String,
|
|
229
|
-
|
|
189
|
+
multiplicity: Multiplicities.Singleton,
|
|
230
190
|
parameterDescriptors: []
|
|
231
191
|
})
|
|
232
192
|
async gcpLengthDisclaimer(): Promise<SingletonResult<string, ThrowError, TError>> {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
193
|
+
return this.#loadGCPLengthData().then(() =>
|
|
194
|
+
this.singletonResult(() => PrefixManager.gcpLengthDisclaimer())
|
|
195
|
+
);
|
|
236
196
|
}
|
|
237
197
|
}
|
package/src/gs1/service-proxy.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNullish, type Nullishable } from "@aidc-toolkit/core";
|
|
2
2
|
import { verifiedByGS1 } from "@aidc-toolkit/gs1";
|
|
3
|
-
import { type ExtendsParameterDescriptor, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
3
|
+
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
4
4
|
import { LibProxy } from "../lib-proxy.js";
|
|
5
5
|
import { proxy } from "../proxy.js";
|
|
6
6
|
import type { ErrorExtends, Matrix, MatrixResult } from "../type.js";
|
|
@@ -15,24 +15,25 @@ const hyperlinkIdentifierParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
15
15
|
const hyperlinkTextParameterDescriptor: ParameterDescriptor = {
|
|
16
16
|
name: "hyperlinkText",
|
|
17
17
|
type: Types.String,
|
|
18
|
-
|
|
18
|
+
multiplicity: Multiplicities.Singleton,
|
|
19
19
|
isRequired: false
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const hyperlinkDetailsParameterDescriptor: ParameterDescriptor = {
|
|
23
23
|
name: "hyperlinkDetails",
|
|
24
24
|
type: Types.String,
|
|
25
|
-
|
|
25
|
+
multiplicity: Multiplicities.Singleton,
|
|
26
26
|
isRequired: false
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
@proxy.describeClass(false, {
|
|
30
|
-
namespace: "GS1"
|
|
30
|
+
namespace: "GS1",
|
|
31
|
+
category: "service"
|
|
31
32
|
})
|
|
32
33
|
export class ServiceProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
33
34
|
@proxy.describeMethod({
|
|
34
35
|
type: Types.Any,
|
|
35
|
-
|
|
36
|
+
multiplicity: Multiplicities.Matrix,
|
|
36
37
|
requiresContext: true,
|
|
37
38
|
parameterDescriptors: [
|
|
38
39
|
identifierTypeParameterDescriptor,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VariableMeasure } from "@aidc-toolkit/gs1";
|
|
2
|
-
import { type ParameterDescriptor, Types } from "../descriptor.js";
|
|
2
|
+
import { Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
3
3
|
import { LibProxy } from "../lib-proxy.js";
|
|
4
4
|
import { proxy } from "../proxy.js";
|
|
5
5
|
import type { ErrorExtends, Matrix, MatrixResult } from "../type.js";
|
|
@@ -7,38 +7,39 @@ import type { ErrorExtends, Matrix, MatrixResult } from "../type.js";
|
|
|
7
7
|
const rcnFormatParameterDescriptor: ParameterDescriptor = {
|
|
8
8
|
name: "rcnFormat",
|
|
9
9
|
type: Types.String,
|
|
10
|
-
|
|
10
|
+
multiplicity: Multiplicities.Singleton,
|
|
11
11
|
isRequired: true
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
const rcnParameterDescriptor: ParameterDescriptor = {
|
|
15
15
|
name: "rcn",
|
|
16
16
|
type: Types.String,
|
|
17
|
-
|
|
17
|
+
multiplicity: Multiplicities.Array,
|
|
18
18
|
isRequired: true
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const rcnItemReferenceParameterDescriptor: ParameterDescriptor = {
|
|
22
22
|
name: "rcnItemReference",
|
|
23
23
|
type: Types.Number,
|
|
24
|
-
|
|
24
|
+
multiplicity: Multiplicities.Singleton,
|
|
25
25
|
isRequired: true
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
const rcnPriceOrWeightParameterDescriptor: ParameterDescriptor = {
|
|
29
29
|
name: "rcnPriceOrWeight",
|
|
30
30
|
type: Types.Number,
|
|
31
|
-
|
|
31
|
+
multiplicity: Multiplicities.Matrix,
|
|
32
32
|
isRequired: true
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
@proxy.describeClass(false, {
|
|
36
|
-
namespace: "GS1"
|
|
36
|
+
namespace: "GS1",
|
|
37
|
+
category: "variableMeasure"
|
|
37
38
|
})
|
|
38
39
|
export class VariableMeasureProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
39
40
|
@proxy.describeMethod({
|
|
40
41
|
type: Types.Number,
|
|
41
|
-
|
|
42
|
+
multiplicity: Multiplicities.Matrix,
|
|
42
43
|
parameterDescriptors: [rcnFormatParameterDescriptor, rcnParameterDescriptor]
|
|
43
44
|
})
|
|
44
45
|
parseVariableMeasureRCN(format: string, matrixRCNs: Matrix<string>): MatrixResult<number, ThrowError, TError> {
|
|
@@ -51,7 +52,7 @@ export class VariableMeasureProxy<ThrowError extends boolean, TError extends Err
|
|
|
51
52
|
|
|
52
53
|
@proxy.describeMethod({
|
|
53
54
|
type: Types.String,
|
|
54
|
-
|
|
55
|
+
multiplicity: Multiplicities.Matrix,
|
|
55
56
|
ignoreInfix: true,
|
|
56
57
|
parameterDescriptors: [rcnFormatParameterDescriptor, rcnItemReferenceParameterDescriptor, rcnPriceOrWeightParameterDescriptor]
|
|
57
58
|
})
|
package/src/index.ts
CHANGED
|
@@ -17,14 +17,13 @@
|
|
|
17
17
|
export * from "./locale/i18n.js";
|
|
18
18
|
|
|
19
19
|
export type * from "./type.js";
|
|
20
|
-
export * from "./app-data.js";
|
|
21
20
|
|
|
22
21
|
export type * from "./streaming.js";
|
|
23
22
|
export * from "./app-extension.js";
|
|
24
23
|
export * from "./lib-proxy.js";
|
|
25
24
|
|
|
26
25
|
export * from "./descriptor.js";
|
|
27
|
-
export * from "./app-
|
|
26
|
+
export * from "./app-helper-proxy.js";
|
|
28
27
|
export * from "./utility/index.js";
|
|
29
28
|
export * as GS1 from "./gs1/index.js";
|
|
30
29
|
|
|
@@ -5,6 +5,19 @@ export default {
|
|
|
5
5
|
Proxy: {
|
|
6
6
|
matrixMustBeArray: "Input matrix must be one-dimensional"
|
|
7
7
|
},
|
|
8
|
+
Categories: {
|
|
9
|
+
helper: "Helper",
|
|
10
|
+
transformation: "Transformation",
|
|
11
|
+
string: "String",
|
|
12
|
+
GS1: {
|
|
13
|
+
checkCharacter: "Check character",
|
|
14
|
+
identifierValidation: "Identifier validation",
|
|
15
|
+
identifierCreation: "Identifier creation",
|
|
16
|
+
variableMeasure: "Variable measure",
|
|
17
|
+
prefix: "Prefix",
|
|
18
|
+
service: "Service"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
8
21
|
IdentifierCreatorProxy: {
|
|
9
22
|
prefixDefinitionMustBeOneDimensional: "Prefix definition must be a one-dimensional matrix",
|
|
10
23
|
prefixDefinitionMustHaveMaximumThreeElements: "Prefix definition must have a maximum of 3 elements",
|
|
@@ -17,21 +30,21 @@ export default {
|
|
|
17
30
|
invalidIdentifierType: "Invalid identifier type \"{{identifierType}}\""
|
|
18
31
|
},
|
|
19
32
|
Parameters: {
|
|
20
|
-
|
|
21
|
-
name: "
|
|
22
|
-
description: "
|
|
33
|
+
spillArray: {
|
|
34
|
+
name: "array",
|
|
35
|
+
description: "Array to spill."
|
|
23
36
|
},
|
|
24
37
|
spillMaximumWidth: {
|
|
25
38
|
name: "maximumWidth",
|
|
26
|
-
description: "Maximum width into which to spill the
|
|
39
|
+
description: "Maximum width into which to spill the array. If not provided, the remaining sheet width is used."
|
|
27
40
|
},
|
|
28
41
|
spillMaximumHeight: {
|
|
29
42
|
name: "maximumHeight",
|
|
30
|
-
description: "Maximum height into which to spill the
|
|
43
|
+
description: "Maximum height into which to spill the array. If not provided, the remaining sheet height is used."
|
|
31
44
|
},
|
|
32
45
|
domain: {
|
|
33
46
|
name: "domain",
|
|
34
|
-
description: "Transformation domain. Valid input values are from
|
|
47
|
+
description: "Transformation domain. Valid input values are from *0* to *domain-1*."
|
|
35
48
|
},
|
|
36
49
|
value: {
|
|
37
50
|
name: "value",
|
|
@@ -43,7 +56,7 @@ export default {
|
|
|
43
56
|
},
|
|
44
57
|
count: {
|
|
45
58
|
name: "count",
|
|
46
|
-
description: "Count of values to transform. If positive, values transformed are startValue to startValue+count-1
|
|
59
|
+
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*."
|
|
47
60
|
},
|
|
48
61
|
transformedValue: {
|
|
49
62
|
name: "transformedValue",
|
|
@@ -71,19 +84,19 @@ export default {
|
|
|
71
84
|
},
|
|
72
85
|
exclusionNone: {
|
|
73
86
|
name: "exclusion",
|
|
74
|
-
description: "String values to exclude. The only valid value is 0 (no exclusions)."
|
|
87
|
+
description: "String values to exclude. The only valid value is *0* (no exclusions)."
|
|
75
88
|
},
|
|
76
89
|
exclusionFirstZero: {
|
|
77
90
|
name: "exclusion",
|
|
78
|
-
description: "String values to exclude. Valid values are 0 (no exclusions) and 1 (strings starting with 0 excluded)."
|
|
91
|
+
description: "String values to exclude. Valid values are *0* (no exclusions) and *1* (strings starting with 0 excluded)."
|
|
79
92
|
},
|
|
80
93
|
exclusionAllNumeric: {
|
|
81
94
|
name: "exclusion",
|
|
82
|
-
description: "String values to exclude. Valid values are 0 (no exclusions) and 2 (strings that are all numeric excluded)."
|
|
95
|
+
description: "String values to exclude. Valid values are *0* (no exclusions) and *2* (strings that are all numeric excluded)."
|
|
83
96
|
},
|
|
84
97
|
exclusionAny: {
|
|
85
98
|
name: "exclusion",
|
|
86
|
-
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)."
|
|
99
|
+
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)."
|
|
87
100
|
},
|
|
88
101
|
length: {
|
|
89
102
|
name: "length",
|
|
@@ -163,7 +176,7 @@ export default {
|
|
|
163
176
|
},
|
|
164
177
|
gtinLevel: {
|
|
165
178
|
name: "level",
|
|
166
|
-
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)."
|
|
179
|
+
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)."
|
|
167
180
|
},
|
|
168
181
|
prefix: {
|
|
169
182
|
name: "prefix",
|
|
@@ -171,7 +184,7 @@ export default {
|
|
|
171
184
|
},
|
|
172
185
|
prefixType: {
|
|
173
186
|
name: "prefixType",
|
|
174
|
-
description: "Prefix type. Valid values are 0 (GS1 Company Prefix), 1 (U.P.C. Company Prefix), and 2 (GS1 Prefix)."
|
|
187
|
+
description: "Prefix type. Valid values are *0* (GS1 Company Prefix), *1* (U.P.C. Company Prefix), and *2* (GS1 Prefix)."
|
|
175
188
|
},
|
|
176
189
|
tweakFactor: {
|
|
177
190
|
name: "tweakFactor",
|
|
@@ -183,11 +196,11 @@ export default {
|
|
|
183
196
|
},
|
|
184
197
|
prefixDefinitionAny: {
|
|
185
198
|
name: "prefixDefinition",
|
|
186
|
-
description: "Prefix definition, either a simple GS1 Company Prefix (as a string) or the result of a call to definePrefix
|
|
199
|
+
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."
|
|
187
200
|
},
|
|
188
201
|
prefixDefinitionGS1UPC: {
|
|
189
202
|
name: "prefixDefinition",
|
|
190
|
-
description: "Prefix definition, either a simple GS1 Company Prefix (as a string) or the result of a call to definePrefix
|
|
203
|
+
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."
|
|
191
204
|
},
|
|
192
205
|
sparse: {
|
|
193
206
|
name: "sparse",
|
|
@@ -5,6 +5,19 @@ export default {
|
|
|
5
5
|
Proxy: {
|
|
6
6
|
matrixMustBeArray: "La matrice d'entrée doit être unidimensionnelle"
|
|
7
7
|
},
|
|
8
|
+
Categories: {
|
|
9
|
+
helper: "Auxiliaire",
|
|
10
|
+
transformation: "Transformation",
|
|
11
|
+
string: "Chaîne de caractères",
|
|
12
|
+
GS1: {
|
|
13
|
+
checkCharacter: "Caractère de contrôle",
|
|
14
|
+
identifierValidation: "Validation d'identifiants",
|
|
15
|
+
identifierCreation: "Création d'identifiants",
|
|
16
|
+
variableMeasure: "Mesure variable",
|
|
17
|
+
prefix: "Préfixe",
|
|
18
|
+
service: "Service"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
8
21
|
IdentifierCreatorProxy: {
|
|
9
22
|
prefixDefinitionMustBeOneDimensional: "La définition du préfixe doit être une matrice unidimensionnelle",
|
|
10
23
|
prefixDefinitionMustHaveMaximumThreeElements: "La définition du préfixe doit comporter un maximum de 3 éléments",
|
|
@@ -17,21 +30,21 @@ export default {
|
|
|
17
30
|
invalidIdentifierType: "Type d'identifiant invalide «{{identifierType}}»"
|
|
18
31
|
},
|
|
19
32
|
Parameters: {
|
|
20
|
-
|
|
21
|
-
name: "
|
|
22
|
-
description: "
|
|
33
|
+
spillArray: {
|
|
34
|
+
name: "tableau",
|
|
35
|
+
description: "Tableau à renverser."
|
|
23
36
|
},
|
|
24
37
|
spillMaximumWidth: {
|
|
25
38
|
name: "largeurMaximale",
|
|
26
|
-
description: "Largeur maximale dans laquelle déverser
|
|
39
|
+
description: "Largeur maximale dans laquelle déverser le tableau. Si non fournie, la largeur restante de la feuille est utilisée."
|
|
27
40
|
},
|
|
28
41
|
spillMaximumHeight: {
|
|
29
42
|
name: "hauteurMaximale",
|
|
30
|
-
description: "Hauteur maximale dans laquelle déverser
|
|
43
|
+
description: "Hauteur maximale dans laquelle déverser le tableau. Si non fournie, la hauteur restante de la feuille est utilisée."
|
|
31
44
|
},
|
|
32
45
|
domain: {
|
|
33
46
|
name: "domaine",
|
|
34
|
-
description: "Domaine de transformation. Les valeurs d'entrée valides vont de
|
|
47
|
+
description: "Domaine de transformation. Les valeurs d'entrée valides vont de *0* au *domaine-1*."
|
|
35
48
|
},
|
|
36
49
|
value: {
|
|
37
50
|
name: "valeur",
|
|
@@ -43,7 +56,7 @@ export default {
|
|
|
43
56
|
},
|
|
44
57
|
count: {
|
|
45
58
|
name: "compte",
|
|
46
|
-
description: "Nombre de valeurs à transformer. Si positive, les valeurs transformées vont de valeurInitiale ascendante à valeurInitiale+compte-1
|
|
59
|
+
description: "Nombre de valeurs à transformer. Si positive, les valeurs transformées vont de *valeurInitiale* ascendante à *valeurInitiale+compte-1*. Si négative, les valeurs transformées vont de *valeurInitiale* descendant à *valeurInitiale+compte+1*."
|
|
47
60
|
},
|
|
48
61
|
transformedValue: {
|
|
49
62
|
name: "valeurTransformee",
|
|
@@ -71,19 +84,19 @@ export default {
|
|
|
71
84
|
},
|
|
72
85
|
exclusionNone: {
|
|
73
86
|
name: "exclusion",
|
|
74
|
-
description: "Valeurs de chaîne à exclure. La seule valeur valide est 0 (aucune exclusion)."
|
|
87
|
+
description: "Valeurs de chaîne à exclure. La seule valeur valide est *0* (aucune exclusion)."
|
|
75
88
|
},
|
|
76
89
|
exclusionFirstZero: {
|
|
77
90
|
name: "exclusion",
|
|
78
|
-
description: "Valeurs de chaîne à exclure. Les valeurs valides sont 0 (aucune exclusion) et 1 (chaînes commençant par 0 exclues)."
|
|
91
|
+
description: "Valeurs de chaîne à exclure. Les valeurs valides sont *0* (aucune exclusion) et *1* (chaînes commençant par 0 exclues)."
|
|
79
92
|
},
|
|
80
93
|
exclusionAllNumeric: {
|
|
81
94
|
name: "exclusion",
|
|
82
|
-
description: "Valeurs de chaîne à exclure. Les valeurs valides sont 0 (aucune exclusion) et 2 (chaînes entièrement numériques exclues)."
|
|
95
|
+
description: "Valeurs de chaîne à exclure. Les valeurs valides sont *0* (aucune exclusion) et *2* (chaînes entièrement numériques exclues)."
|
|
83
96
|
},
|
|
84
97
|
exclusionAny: {
|
|
85
98
|
name: "exclusion",
|
|
86
|
-
description: "Valeurs de chaîne à exclure. Les valeurs valides sont 0 (aucune exclusion), 1 (chaînes commençant par 0 exclues) et 2 (chaînes toutes numériques exclues)."
|
|
99
|
+
description: "Valeurs de chaîne à exclure. Les valeurs valides sont *0* (aucune exclusion), *1* (chaînes commençant par 0 exclues) et *2* (chaînes toutes numériques exclues)."
|
|
87
100
|
},
|
|
88
101
|
length: {
|
|
89
102
|
name: "longueur",
|
|
@@ -163,7 +176,7 @@ export default {
|
|
|
163
176
|
},
|
|
164
177
|
gtinLevel: {
|
|
165
178
|
name: "niveau",
|
|
166
|
-
description: "Niveau auquel valider le GTIN. Les valeurs valides sont 0 (n'importe lequel), 1 (article commercial de consommation au détail) et 2 (autre que le niveau de l'article commercial de consommation au détail)."
|
|
179
|
+
description: "Niveau auquel valider le GTIN. Les valeurs valides sont *0* (n'importe lequel), *1* (article commercial de consommation au détail) et *2* (autre que le niveau de l'article commercial de consommation au détail)."
|
|
167
180
|
},
|
|
168
181
|
prefix: {
|
|
169
182
|
name: "prefixe",
|
|
@@ -171,7 +184,7 @@ export default {
|
|
|
171
184
|
},
|
|
172
185
|
prefixType: {
|
|
173
186
|
name: "typeDePréfixe",
|
|
174
|
-
description: "Type de préfixe. Les valeurs valides sont 0 (préfixe d'entreprise GS1), 1 (préfixe d'entreprise U.P.C.) et 2 (préfixe GS1)."
|
|
187
|
+
description: "Type de préfixe. Les valeurs valides sont *0* (préfixe d'entreprise GS1), *1* (préfixe d'entreprise U.P.C.) et *2* (préfixe GS1)."
|
|
175
188
|
},
|
|
176
189
|
tweakFactor: {
|
|
177
190
|
name: "facteurDeReglage",
|
|
@@ -183,11 +196,11 @@ export default {
|
|
|
183
196
|
},
|
|
184
197
|
prefixDefinitionAny: {
|
|
185
198
|
name: "prefixeDefinition",
|
|
186
|
-
description: "Définition de préfixe, soit un préfixe d'entreprise simple GS1 (sous forme de chaîne), soit le résultat d'un appel à
|
|
199
|
+
description: "Définition de préfixe, soit un préfixe d'entreprise simple GS1 (sous forme de chaîne), soit le résultat d'un appel à *definisserPrefixe*. Tout type de préfixe est pris en charge."
|
|
187
200
|
},
|
|
188
201
|
prefixDefinitionGS1UPC: {
|
|
189
202
|
name: "prefixeDefinition",
|
|
190
|
-
description: "Définition de préfixe, soit un préfixe d'entreprise simple GS1 (sous forme de chaîne), soit le résultat d'un appel à
|
|
203
|
+
description: "Définition de préfixe, soit un préfixe d'entreprise simple GS1 (sous forme de chaîne), soit le résultat d'un appel à *definisserPrefixe*. Seuls les types de préfixes *0* (préfixe d'entreprise GS1) et *1* (préfixe d'entreprise U.P.C.) sont pris en charge."
|
|
191
204
|
},
|
|
192
205
|
sparse: {
|
|
193
206
|
name: "clairsemee",
|