@twin.org/standards-gs1 0.0.1-next.21

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.
Files changed (89) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/cjs/index.cjs +977 -0
  4. package/dist/esm/index.mjs +961 -0
  5. package/dist/types/dataTypes/gs1DataTypes.d.ts +10 -0
  6. package/dist/types/entities/gs1Location.d.ts +69 -0
  7. package/dist/types/identifiers/gs1Identifiers.d.ts +9 -0
  8. package/dist/types/index.d.ts +34 -0
  9. package/dist/types/models/epc/IEPCClassUri.d.ts +17 -0
  10. package/dist/types/models/epcis20/IAggregationEvent.d.ts +10 -0
  11. package/dist/types/models/epcis20/IAssociationEvent.d.ts +10 -0
  12. package/dist/types/models/epcis20/IBaseAggregationEvent.d.ts +19 -0
  13. package/dist/types/models/epcis20/IBizTransaction.d.ts +13 -0
  14. package/dist/types/models/epcis20/IDestination.d.ts +13 -0
  15. package/dist/types/models/epcis20/IEpcisDocument.d.ts +28 -0
  16. package/dist/types/models/epcis20/IEpcisEvent.d.ts +44 -0
  17. package/dist/types/models/epcis20/IEpcisEventDetails.d.ts +35 -0
  18. package/dist/types/models/epcis20/IEpcisQuery.d.ts +6 -0
  19. package/dist/types/models/epcis20/IEpcisQueryDocument.d.ts +54 -0
  20. package/dist/types/models/epcis20/IObjectEvent.d.ts +25 -0
  21. package/dist/types/models/epcis20/IQuantity.d.ts +13 -0
  22. package/dist/types/models/epcis20/ISensorElement.d.ts +15 -0
  23. package/dist/types/models/epcis20/ISensorMetadata.d.ts +21 -0
  24. package/dist/types/models/epcis20/ISensorReport.d.ts +17 -0
  25. package/dist/types/models/epcis20/ISimpleLocation.d.ts +9 -0
  26. package/dist/types/models/epcis20/ISource.d.ts +13 -0
  27. package/dist/types/models/epcis20/actionTypes.d.ts +21 -0
  28. package/dist/types/models/epcis20/bizStepTypes.d.ts +52 -0
  29. package/dist/types/models/epcis20/dispositionTypes.d.ts +44 -0
  30. package/dist/types/models/epcis20/epcisErrorTypes.d.ts +11 -0
  31. package/dist/types/models/epcis20/epcisEventUnionType.d.ts +7 -0
  32. package/dist/types/models/epcis20/eventTypes.d.ts +29 -0
  33. package/dist/types/models/gs1/gs1IdTypes.d.ts +89 -0
  34. package/dist/types/models/gs1/gs1IdentifierTypes.d.ts +25 -0
  35. package/dist/types/models/gs1/gs1Types.d.ts +13 -0
  36. package/dist/types/models/gs1/subSiteAttributes.d.ts +145 -0
  37. package/dist/types/models/gs1/subSiteTypes.d.ts +77 -0
  38. package/dist/types/utils/gs1IdentifiersValidation.d.ts +57 -0
  39. package/dist/types/utils/gs1Is.d.ts +17 -0
  40. package/dist/types/utils/gs1Validation.d.ts +16 -0
  41. package/docs/changelog.md +5 -0
  42. package/docs/examples.md +1 -0
  43. package/docs/reference/classes/Gs1DataTypes.md +26 -0
  44. package/docs/reference/classes/Gs1Identifiers.md +25 -0
  45. package/docs/reference/classes/Gs1IdentifiersValidation.md +215 -0
  46. package/docs/reference/classes/Gs1Is.md +57 -0
  47. package/docs/reference/classes/Gs1Location.md +135 -0
  48. package/docs/reference/classes/Gs1Validation.md +53 -0
  49. package/docs/reference/index.md +57 -0
  50. package/docs/reference/interfaces/IAggregationEvent.md +223 -0
  51. package/docs/reference/interfaces/IAssociationEvent.md +223 -0
  52. package/docs/reference/interfaces/IBizTransaction.md +19 -0
  53. package/docs/reference/interfaces/IDestination.md +19 -0
  54. package/docs/reference/interfaces/IEPCClassUri.md +27 -0
  55. package/docs/reference/interfaces/IEpcisDocument.md +41 -0
  56. package/docs/reference/interfaces/IEpcisEvent.md +79 -0
  57. package/docs/reference/interfaces/IEpcisEventDetails.md +167 -0
  58. package/docs/reference/interfaces/IEpcisQuery.md +7 -0
  59. package/docs/reference/interfaces/IEpcisQueryDocument.md +81 -0
  60. package/docs/reference/interfaces/IObjectEvent.md +211 -0
  61. package/docs/reference/interfaces/IQuantity.md +19 -0
  62. package/docs/reference/interfaces/ISensorElement.md +19 -0
  63. package/docs/reference/interfaces/ISensorMetadata.md +35 -0
  64. package/docs/reference/interfaces/ISensorReport.md +27 -0
  65. package/docs/reference/interfaces/ISimpleLocation.md +11 -0
  66. package/docs/reference/interfaces/ISource.md +19 -0
  67. package/docs/reference/type-aliases/ActionTypes.md +5 -0
  68. package/docs/reference/type-aliases/BizStepTypes.md +5 -0
  69. package/docs/reference/type-aliases/DispositionTypes.md +5 -0
  70. package/docs/reference/type-aliases/EpcisErrorTypes.md +5 -0
  71. package/docs/reference/type-aliases/EpcisEventUnionType.md +5 -0
  72. package/docs/reference/type-aliases/EventTypes.md +5 -0
  73. package/docs/reference/type-aliases/Gs1IdTypes.md +5 -0
  74. package/docs/reference/type-aliases/Gs1IdentifierTypes.md +5 -0
  75. package/docs/reference/type-aliases/Gs1Types.md +5 -0
  76. package/docs/reference/type-aliases/SubSiteAttributes.md +7 -0
  77. package/docs/reference/type-aliases/SubSiteTypes.md +7 -0
  78. package/docs/reference/variables/ActionTypes.md +25 -0
  79. package/docs/reference/variables/BizStepTypes.md +173 -0
  80. package/docs/reference/variables/DispositionTypes.md +141 -0
  81. package/docs/reference/variables/EpcisErrorTypes.md +15 -0
  82. package/docs/reference/variables/EventTypes.md +37 -0
  83. package/docs/reference/variables/Gs1IdTypes.md +127 -0
  84. package/docs/reference/variables/Gs1IdentifierTypes.md +31 -0
  85. package/docs/reference/variables/Gs1Types.md +13 -0
  86. package/docs/reference/variables/SubSiteAttributes.md +207 -0
  87. package/docs/reference/variables/SubSiteTypes.md +105 -0
  88. package/locales/en.json +12 -0
  89. package/package.json +41 -0
@@ -0,0 +1,29 @@
1
+ /**
2
+ * EPCIS 2.0 event types.
3
+ */
4
+ export declare const EventTypes: {
5
+ /**
6
+ * ObjectEvent.
7
+ */
8
+ readonly ObjectEvent: "ObjectEvent";
9
+ /**
10
+ * Aggregation Event.
11
+ */
12
+ readonly AggregationEvent: "AggregationEvent";
13
+ /**
14
+ * Association Event.
15
+ */
16
+ readonly AssociationEvent: "AssociationEvent";
17
+ /**
18
+ * Transformation Event.
19
+ */
20
+ readonly TransformationEvent: "TransformationEvent";
21
+ /**
22
+ * Transaction Event.
23
+ */
24
+ readonly TransactionEvent: "TransactionEvent";
25
+ };
26
+ /**
27
+ * EPCIS 2.0 event types.
28
+ */
29
+ export type EventTypes = (typeof EventTypes)[keyof typeof EventTypes];
@@ -0,0 +1,89 @@
1
+ /**
2
+ * GS1 EPC Identifiers.
3
+ */
4
+ export declare const Gs1IdTypes: {
5
+ /**
6
+ * GTIN - Trade Item.
7
+ */
8
+ readonly Gtin: "sgtin";
9
+ /**
10
+ * SSCC - Logistics Unit.
11
+ */
12
+ readonly Sscc: "sscc";
13
+ /**
14
+ * GLN - Location.
15
+ */
16
+ readonly Gln: "sgln";
17
+ /**
18
+ * GRAI - Returnable Asset.
19
+ */
20
+ readonly Grai: "grai";
21
+ /**
22
+ * GIAI - Fixed Asset.
23
+ */
24
+ readonly Giai: "giai";
25
+ /**
26
+ * GSRN - Recipient - Hospital Admission or Club Membership.
27
+ */
28
+ readonly GsrnRecipient: "gsrn";
29
+ /**
30
+ * GSRN - Provider - Medical Caregiver or Loyalty Club.
31
+ */
32
+ readonly GsrnProvider: "gsrnp";
33
+ /**
34
+ * GDTI - Document.
35
+ */
36
+ readonly Gtdi: "gtdi";
37
+ /**
38
+ * Technical Industries for unique identification of parts and components.
39
+ */
40
+ readonly None: "cpi";
41
+ /**
42
+ * GCN - Coupon.
43
+ */
44
+ readonly Gcn: "sgcn";
45
+ /**
46
+ * Logical grouping of goods intended for transport as a whole assigned by a freight forwarder.
47
+ */
48
+ readonly Ginc: "ginc";
49
+ /**
50
+ * Logical grouping of logistic units travelling under one dispatch advice and/or bill of lading.
51
+ */
52
+ readonly Gsin: "gsin";
53
+ /**
54
+ * One of multiple pieces comprising, and subordinate to, a whole.
55
+ */
56
+ readonly Ai: "itip";
57
+ /**
58
+ * Pack identification to combat illicit trade.
59
+ */
60
+ readonly GtinTpx: "upui";
61
+ /**
62
+ * Identification of Economic Operator, Owning party or processing party in CoC/CoO.
63
+ */
64
+ readonly GlnAi: "pgln";
65
+ /**
66
+ * Unspecified.
67
+ */
68
+ readonly Unspecified: "gid";
69
+ /**
70
+ * US Dept of Defense supply chain.
71
+ */
72
+ readonly UsDod: "usdod";
73
+ /**
74
+ * Aerospace and Defense sector for unique identification of aircraft and other parts and items.
75
+ */
76
+ readonly AerospaceDefence: "adi";
77
+ /**
78
+ * Intermodal shipping containers.
79
+ */
80
+ readonly Intermodal: "bic";
81
+ /**
82
+ * Vessel Identification.
83
+ */
84
+ readonly Vessel: "imovn";
85
+ };
86
+ /**
87
+ * GS1 EPC Identifiers
88
+ */
89
+ export type Gs1IdTypes = (typeof Gs1IdTypes)[keyof typeof Gs1IdTypes];
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The types of GS1 Identifier data.
3
+ */
4
+ export declare const Gs1IdentifierTypes: {
5
+ /**
6
+ * Identifier epc id namespace.
7
+ */
8
+ readonly EpcId: "epc:id";
9
+ /**
10
+ * Identifier epc:id:gtin namespace.
11
+ */
12
+ readonly EpcIdGtin: "epc:id:sgtin";
13
+ /**
14
+ * Identifier epc:id:sgln namespace.
15
+ */
16
+ readonly EpcIdGln: "epc:id:sgln";
17
+ /**
18
+ * Identifier epc id namespace.
19
+ */
20
+ readonly EpcClass: "epc:class";
21
+ };
22
+ /**
23
+ * The types of GS1 Identifier data.
24
+ */
25
+ export type Gs1IdentifierTypes = (typeof Gs1IdentifierTypes)[keyof typeof Gs1IdentifierTypes];
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The types of GS1 data.
3
+ */
4
+ export declare const Gs1Types: {
5
+ /**
6
+ * Represents Location Master Data.
7
+ */
8
+ readonly LocationMasterData: "gs1_location_masterdata";
9
+ };
10
+ /**
11
+ * The types of GS1 data.
12
+ */
13
+ export type Gs1Types = (typeof Gs1Types)[keyof typeof Gs1Types];
@@ -0,0 +1,145 @@
1
+ /**
2
+ * Sub Site Attributes.
3
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
4
+ * Section 10.3.2 .
5
+ */
6
+ export declare const SubSiteAttributes: {
7
+ /**
8
+ * Electronics.
9
+ */
10
+ readonly Electronics: "401";
11
+ /**
12
+ * Cold Storage.
13
+ */
14
+ readonly ColdStorage: "402";
15
+ /**
16
+ * Shelf.
17
+ */
18
+ readonly Shelf: "403";
19
+ /**
20
+ * Frozen.
21
+ */
22
+ readonly Frozen: "404";
23
+ /**
24
+ * Fresh.
25
+ */
26
+ readonly Fresh: "405";
27
+ /**
28
+ * Promotion.
29
+ */
30
+ readonly Promotion: "406";
31
+ /**
32
+ * End Cap.
33
+ */
34
+ readonly EndCap: "407";
35
+ /**
36
+ * Point of Sale.
37
+ */
38
+ readonly PointOfSale: "408";
39
+ /**
40
+ * Security.
41
+ */
42
+ readonly Security: "409";
43
+ /**
44
+ * General Mdse.
45
+ */
46
+ readonly GeneralMdse: "411";
47
+ /**
48
+ * Grocery.
49
+ */
50
+ readonly Grocery: "412";
51
+ /**
52
+ * Box crusher.
53
+ */
54
+ readonly BoxCrusher: "413";
55
+ /**
56
+ * Dock/Door.
57
+ */
58
+ readonly DockDoor: "414";
59
+ /**
60
+ * Conveyor Belt.
61
+ */
62
+ readonly ConveyorBelt: "415";
63
+ /**
64
+ * Pallet Wrapper.
65
+ */
66
+ readonly PalletWrapper: "416";
67
+ /**
68
+ * Fixed Reader.
69
+ */
70
+ readonly FixedReader: "417";
71
+ /**
72
+ * Mobile Reader.
73
+ */
74
+ readonly MobileReader: "418";
75
+ /**
76
+ * Shelf Storage.
77
+ */
78
+ readonly ShelfStorage: "419";
79
+ /**
80
+ * Returns.
81
+ */
82
+ readonly Returns: "420";
83
+ /**
84
+ * Staging.
85
+ */
86
+ readonly Staging: "421";
87
+ /**
88
+ * Assembly.
89
+ */
90
+ readonly Assembly: "422";
91
+ /**
92
+ * Lay-Away.
93
+ */
94
+ readonly LayAway: "423";
95
+ /**
96
+ * Dispenser.
97
+ */
98
+ readonly Dispenser: "424";
99
+ /**
100
+ * Quarantine.
101
+ */
102
+ readonly Quarantine: "425";
103
+ /**
104
+ * Controlled Substance.
105
+ */
106
+ readonly ControlledSubstance: "426";
107
+ /**
108
+ * Recalled Product.
109
+ */
110
+ readonly RecalledProduct: "427";
111
+ /**
112
+ * Quality Control.
113
+ */
114
+ readonly QualityControl: "428";
115
+ /**
116
+ * Printing Room.
117
+ */
118
+ readonly PrintingRoom: "429";
119
+ /**
120
+ * Loading Dock.
121
+ */
122
+ readonly LoadingDock: "420";
123
+ /**
124
+ * Entrance Gate.
125
+ */
126
+ readonly EntranceGate: "431";
127
+ /**
128
+ * Exit Gate.
129
+ */
130
+ readonly ExitGate: "432";
131
+ /**
132
+ * Gate.
133
+ */
134
+ readonly Gate: "433";
135
+ /**
136
+ * Read Point Verification Spot.
137
+ */
138
+ readonly ReadPointVerificationSpot: "434";
139
+ };
140
+ /**
141
+ * Sub Site Attributes.
142
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
143
+ * Section 10.3.2 .
144
+ */
145
+ export type SubSiteAttributes = (typeof SubSiteAttributes)[keyof typeof SubSiteAttributes];
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Sub Site Identifier Types.
3
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
4
+ * Section 10.3.1 .
5
+ */
6
+ export declare const SubSiteTypes: {
7
+ /**
8
+ * The Backroom.
9
+ */
10
+ readonly Backroom: "201";
11
+ /**
12
+ * The Storage Area.
13
+ */
14
+ readonly StorageArea: "202";
15
+ /**
16
+ * The Sales Floor.
17
+ */
18
+ readonly SalesFloor: "203";
19
+ /**
20
+ * The Returns Area.
21
+ */
22
+ readonly ReturnsArea: "207";
23
+ /**
24
+ * The Production Area.
25
+ */
26
+ readonly ProductionArea: "208";
27
+ /**
28
+ * The Receiving Area.
29
+ */
30
+ readonly ReceivingArea: "209";
31
+ /**
32
+ * The Shipping Area.
33
+ */
34
+ readonly ShippingArea: "210";
35
+ /**
36
+ * The Sales Floor Transition Area.
37
+ */
38
+ readonly SalesFloorTransitionArea: "211";
39
+ /**
40
+ * The Customer Pick-Up Area.
41
+ */
42
+ readonly CustomerPickupArea: "212";
43
+ /**
44
+ * The Yard.
45
+ */
46
+ readonly Yard: "213";
47
+ /**
48
+ * The Container Deck.
49
+ */
50
+ readonly ContainerDeck: "214";
51
+ /**
52
+ * The Cargo Terminal.
53
+ */
54
+ readonly CargoTerminal: "215";
55
+ /**
56
+ * The Packaging Area.
57
+ */
58
+ readonly PackagingArea: "251";
59
+ /**
60
+ * The Picking Area.
61
+ */
62
+ readonly PickingArea: "252";
63
+ /**
64
+ * The Pharmacy Area.
65
+ */
66
+ readonly PharmacyArea: "253";
67
+ /**
68
+ * Undefined.
69
+ */
70
+ readonly Undefined: "299";
71
+ };
72
+ /**
73
+ * Sub Site Identifier Types.
74
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
75
+ * Section 10.3.1 .
76
+ */
77
+ export type SubSiteTypes = (typeof SubSiteTypes)[keyof typeof SubSiteTypes];
@@ -0,0 +1,57 @@
1
+ import { type IValidationFailure } from "@twin.org/core";
2
+ import type { IEPCClassUri } from "../models/epc/IEPCClassUri";
3
+ /**
4
+ * Validation for GS1 identifiers.
5
+ */
6
+ export declare class Gs1IdentifiersValidation {
7
+ /**
8
+ * Validate if the property is a valid epc.
9
+ * @param propertyName The name of the property being validated.
10
+ * @param value The value to test.
11
+ * @param failures The list of failures to add to.
12
+ * @returns True if the value is valid epc.
13
+ */
14
+ static epcId(propertyName: string, value: unknown, failures: IValidationFailure[]): value is string;
15
+ /**
16
+ * Validate if the property is a valid epc id gtin.
17
+ * @param propertyName The name of the property being validated.
18
+ * @param value The value to test.
19
+ * @param failures The list of failures to add to.
20
+ * @returns True if the value is valid epc.
21
+ */
22
+ static epcIdGtin(propertyName: string, value: unknown, failures: IValidationFailure[]): value is string;
23
+ /**
24
+ * Validate if the property is a valid epc id gln.
25
+ * @param propertyName The name of the property being validated.
26
+ * @param value The value to test.
27
+ * @param failures The list of failures to add to.
28
+ * @returns True if the value is valid epc.
29
+ */
30
+ static epcIdGln(propertyName: string, value: unknown, failures: IValidationFailure[]): value is string;
31
+ /**
32
+ * Validate if the property is a valid epc class.
33
+ * @param propertyName The name of the property being validated.
34
+ * @param value The value to test.
35
+ * @param failures The list of failures to add to.
36
+ * @returns True if the value is valid epc.
37
+ */
38
+ static epcClass(propertyName: string, value: unknown, failures: IValidationFailure[]): value is string;
39
+ /**
40
+ * Extract the EPC gtin from the URI.
41
+ * @param epc The uri to extract from.
42
+ * @returns The extracted data or undefined.
43
+ */
44
+ static extractEpcIdGtin(epc: string): string | undefined;
45
+ /**
46
+ * Extract the EPC gln from the URI.
47
+ * @param epc The uri to extract from.
48
+ * @returns The extracted data or undefined.
49
+ */
50
+ static extractEpcIdGln(epc: string): string | undefined;
51
+ /**
52
+ * Extract The EPC Class from the URI.
53
+ * @param epc The uri to extract from.
54
+ * @returns The extracted data or undefined.
55
+ */
56
+ static extractEpcClassUri(epc: string): IEPCClassUri | undefined;
57
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Is checks for GS1 data.
3
+ */
4
+ export declare class Gs1Is {
5
+ /**
6
+ * Is the value an EPC identifier.
7
+ * @param value The value to test.
8
+ * @returns True if the value is an epc.
9
+ */
10
+ static isEpcHex(value: string): boolean;
11
+ /**
12
+ * Is the value a valid geo uri https://en.wikipedia.org/wiki/Geo_URI_scheme.
13
+ * @param value The value to check.
14
+ * @returns True if the value matches a geo uri.
15
+ */
16
+ static isGeoUri(value: string): boolean;
17
+ }
@@ -0,0 +1,16 @@
1
+ import { type IValidationFailure } from "@twin.org/core";
2
+ import type { Gs1Location } from "../entities/gs1Location";
3
+ /**
4
+ * Validation for GS1 types.
5
+ */
6
+ export declare class Gs1Validation {
7
+ /**
8
+ * Validate if the property is a valid location.
9
+ * @param propertyName The name of the property being validated.
10
+ * @param value The value to test.
11
+ * @param failures The list of failures to add to.
12
+ * @param container The object which contains this one.
13
+ * @returns True if the value is a location.
14
+ */
15
+ static locationMasterData(propertyName: string, value: Gs1Location, failures: IValidationFailure[], container?: unknown): value is Gs1Location;
16
+ }
@@ -0,0 +1,5 @@
1
+ # @twin.org/standards-gs1 - Changelog
2
+
3
+ ## v0.0.1-next.21
4
+
5
+ - Initial Release
@@ -0,0 +1 @@
1
+ # @twin.org/standards-gs1 - Examples
@@ -0,0 +1,26 @@
1
+ # Class: Gs1DataTypes
2
+
3
+ Handle all the data types for GS1.
4
+ Vocabulary https://www.gs1.org/voc .
5
+
6
+ ## Constructors
7
+
8
+ ### new Gs1DataTypes()
9
+
10
+ > **new Gs1DataTypes**(): [`Gs1DataTypes`](Gs1DataTypes.md)
11
+
12
+ #### Returns
13
+
14
+ [`Gs1DataTypes`](Gs1DataTypes.md)
15
+
16
+ ## Methods
17
+
18
+ ### registerTypes()
19
+
20
+ > `static` **registerTypes**(): `void`
21
+
22
+ Register all the data types.
23
+
24
+ #### Returns
25
+
26
+ `void`
@@ -0,0 +1,25 @@
1
+ # Class: Gs1Identifiers
2
+
3
+ Handle all identifier types for GS1.
4
+
5
+ ## Constructors
6
+
7
+ ### new Gs1Identifiers()
8
+
9
+ > **new Gs1Identifiers**(): [`Gs1Identifiers`](Gs1Identifiers.md)
10
+
11
+ #### Returns
12
+
13
+ [`Gs1Identifiers`](Gs1Identifiers.md)
14
+
15
+ ## Methods
16
+
17
+ ### registerIdentifiers()
18
+
19
+ > `static` **registerIdentifiers**(): `void`
20
+
21
+ Register all the identifiers.
22
+
23
+ #### Returns
24
+
25
+ `void`