@twin.org/standards-gs1 0.0.1-next.42 → 0.0.1-next.44
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/cjs/index.cjs +16 -1
- package/dist/esm/index.mjs +16 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/gs1/gs1Contexts.d.ts +13 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/index.md +2 -0
- package/docs/reference/type-aliases/GS1Contexts.md +5 -0
- package/docs/reference/variables/GS1Contexts.md +13 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -4,6 +4,19 @@ var dataCore = require('@twin.org/data-core');
|
|
|
4
4
|
var core = require('@twin.org/core');
|
|
5
5
|
var entity = require('@twin.org/entity');
|
|
6
6
|
|
|
7
|
+
// Copyright 2024 IOTA Stiftung.
|
|
8
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
9
|
+
/**
|
|
10
|
+
* The contexts of GS1.
|
|
11
|
+
*/
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
const GS1Contexts = {
|
|
14
|
+
/**
|
|
15
|
+
* The context root for the GS1 types.
|
|
16
|
+
*/
|
|
17
|
+
ContextRoot: "https://gs1.org/voc/"
|
|
18
|
+
};
|
|
19
|
+
|
|
7
20
|
// Copyright 2024 IOTA Stiftung.
|
|
8
21
|
// SPDX-License-Identifier: Apache-2.0.
|
|
9
22
|
/**
|
|
@@ -407,7 +420,8 @@ class Gs1DataTypes {
|
|
|
407
420
|
* Register all the data types.
|
|
408
421
|
*/
|
|
409
422
|
static registerTypes() {
|
|
410
|
-
dataCore.DataTypeHandlerFactory.register(Gs1Types.LocationMasterData
|
|
423
|
+
dataCore.DataTypeHandlerFactory.register(`${GS1Contexts.ContextRoot}${Gs1Types.LocationMasterData}`, () => ({
|
|
424
|
+
context: GS1Contexts.ContextRoot,
|
|
411
425
|
type: Gs1Types.LocationMasterData,
|
|
412
426
|
defaultValue: {},
|
|
413
427
|
validate: async (propertyName, value, failures, container) => Gs1Validation.locationMasterData(propertyName, value, failures, container)
|
|
@@ -965,6 +979,7 @@ exports.BizStepTypes = BizStepTypes;
|
|
|
965
979
|
exports.DispositionTypes = DispositionTypes;
|
|
966
980
|
exports.EpcisErrorTypes = EpcisErrorTypes;
|
|
967
981
|
exports.EventTypes = EventTypes;
|
|
982
|
+
exports.GS1Contexts = GS1Contexts;
|
|
968
983
|
exports.Gs1DataTypes = Gs1DataTypes;
|
|
969
984
|
exports.Gs1IdTypes = Gs1IdTypes;
|
|
970
985
|
exports.Gs1IdentifierTypes = Gs1IdentifierTypes;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -2,6 +2,19 @@ import { IdentifierHandlerFactory, DataTypeHandlerFactory } from '@twin.org/data
|
|
|
2
2
|
import { Is, Validation, Urn } from '@twin.org/core';
|
|
3
3
|
import { property, entity } from '@twin.org/entity';
|
|
4
4
|
|
|
5
|
+
// Copyright 2024 IOTA Stiftung.
|
|
6
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
7
|
+
/**
|
|
8
|
+
* The contexts of GS1.
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
+
const GS1Contexts = {
|
|
12
|
+
/**
|
|
13
|
+
* The context root for the GS1 types.
|
|
14
|
+
*/
|
|
15
|
+
ContextRoot: "https://gs1.org/voc/"
|
|
16
|
+
};
|
|
17
|
+
|
|
5
18
|
// Copyright 2024 IOTA Stiftung.
|
|
6
19
|
// SPDX-License-Identifier: Apache-2.0.
|
|
7
20
|
/**
|
|
@@ -405,7 +418,8 @@ class Gs1DataTypes {
|
|
|
405
418
|
* Register all the data types.
|
|
406
419
|
*/
|
|
407
420
|
static registerTypes() {
|
|
408
|
-
DataTypeHandlerFactory.register(Gs1Types.LocationMasterData
|
|
421
|
+
DataTypeHandlerFactory.register(`${GS1Contexts.ContextRoot}${Gs1Types.LocationMasterData}`, () => ({
|
|
422
|
+
context: GS1Contexts.ContextRoot,
|
|
409
423
|
type: Gs1Types.LocationMasterData,
|
|
410
424
|
defaultValue: {},
|
|
411
425
|
validate: async (propertyName, value, failures, container) => Gs1Validation.locationMasterData(propertyName, value, failures, container)
|
|
@@ -958,4 +972,4 @@ class Gs1Is {
|
|
|
958
972
|
}
|
|
959
973
|
}
|
|
960
974
|
|
|
961
|
-
export { ActionTypes, BizStepTypes, DispositionTypes, EpcisErrorTypes, EventTypes, Gs1DataTypes, Gs1IdTypes, Gs1IdentifierTypes, Gs1Identifiers, Gs1IdentifiersValidation, Gs1Is, Gs1Location, Gs1Types, Gs1Validation, SubSiteAttributes, SubSiteTypes };
|
|
975
|
+
export { ActionTypes, BizStepTypes, DispositionTypes, EpcisErrorTypes, EventTypes, GS1Contexts, Gs1DataTypes, Gs1IdTypes, Gs1IdentifierTypes, Gs1Identifiers, Gs1IdentifiersValidation, Gs1Is, Gs1Location, Gs1Types, Gs1Validation, SubSiteAttributes, SubSiteTypes };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export * from "./models/epcis20/ISensorMetadata";
|
|
|
24
24
|
export * from "./models/epcis20/ISensorReport";
|
|
25
25
|
export * from "./models/epcis20/ISimpleLocation";
|
|
26
26
|
export * from "./models/epcis20/ISource";
|
|
27
|
+
export * from "./models/gs1/gs1Contexts";
|
|
27
28
|
export * from "./models/gs1/gs1IdentifierTypes";
|
|
28
29
|
export * from "./models/gs1/gs1IdTypes";
|
|
29
30
|
export * from "./models/gs1/gs1Types";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts of GS1.
|
|
3
|
+
*/
|
|
4
|
+
export declare const GS1Contexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The context root for the GS1 types.
|
|
7
|
+
*/
|
|
8
|
+
readonly ContextRoot: "https://gs1.org/voc/";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* The contexts of GS1.
|
|
12
|
+
*/
|
|
13
|
+
export type GS1Contexts = (typeof GS1Contexts)[keyof typeof GS1Contexts];
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @twin.org/standards-gs1 - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.1-next.44](https://github.com/twinfoundation/standards/compare/standards-gs1-v0.0.1-next.43...standards-gs1-v0.0.1-next.44) (2025-05-28)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* data types registered with full qualified names ([d64bd08](https://github.com/twinfoundation/standards/commit/d64bd082084172da543e9bfaffb78cdc34e6641d))
|
|
9
|
+
|
|
10
|
+
## [0.0.1-next.43](https://github.com/twinfoundation/standards/compare/standards-gs1-v0.0.1-next.42...standards-gs1-v0.0.1-next.43) (2025-05-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous Chores
|
|
14
|
+
|
|
15
|
+
* **standards-gs1:** Synchronize repo versions
|
|
16
|
+
|
|
3
17
|
## [0.0.1-next.42](https://github.com/twinfoundation/standards/compare/standards-gs1-v0.0.1-next.41...standards-gs1-v0.0.1-next.42) (2025-05-09)
|
|
4
18
|
|
|
5
19
|
|
package/docs/reference/index.md
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
- [EpcisErrorTypes](type-aliases/EpcisErrorTypes.md)
|
|
38
38
|
- [EpcisEventUnionType](type-aliases/EpcisEventUnionType.md)
|
|
39
39
|
- [EventTypes](type-aliases/EventTypes.md)
|
|
40
|
+
- [GS1Contexts](type-aliases/GS1Contexts.md)
|
|
40
41
|
- [Gs1IdTypes](type-aliases/Gs1IdTypes.md)
|
|
41
42
|
- [Gs1IdentifierTypes](type-aliases/Gs1IdentifierTypes.md)
|
|
42
43
|
- [Gs1Types](type-aliases/Gs1Types.md)
|
|
@@ -50,6 +51,7 @@
|
|
|
50
51
|
- [DispositionTypes](variables/DispositionTypes.md)
|
|
51
52
|
- [EpcisErrorTypes](variables/EpcisErrorTypes.md)
|
|
52
53
|
- [EventTypes](variables/EventTypes.md)
|
|
54
|
+
- [GS1Contexts](variables/GS1Contexts.md)
|
|
53
55
|
- [Gs1IdTypes](variables/Gs1IdTypes.md)
|
|
54
56
|
- [Gs1IdentifierTypes](variables/Gs1IdentifierTypes.md)
|
|
55
57
|
- [Gs1Types](variables/Gs1Types.md)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Variable: GS1Contexts
|
|
2
|
+
|
|
3
|
+
> `const` **GS1Contexts**: `object`
|
|
4
|
+
|
|
5
|
+
The contexts of GS1.
|
|
6
|
+
|
|
7
|
+
## Type declaration
|
|
8
|
+
|
|
9
|
+
### ContextRoot
|
|
10
|
+
|
|
11
|
+
> `readonly` **ContextRoot**: `"https://gs1.org/voc/"` = `"https://gs1.org/voc/"`
|
|
12
|
+
|
|
13
|
+
The context root for the GS1 types.
|