@twin.org/standards-gs1 0.0.2-next.9 → 0.0.3-next.1

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 (94) hide show
  1. package/dist/es/dataTypes/gs1DataTypes.js +24 -0
  2. package/dist/es/dataTypes/gs1DataTypes.js.map +1 -0
  3. package/dist/es/entities/gs1Location.js +193 -0
  4. package/dist/es/entities/gs1Location.js.map +1 -0
  5. package/dist/es/identifiers/gs1Identifiers.js +32 -0
  6. package/dist/es/identifiers/gs1Identifiers.js.map +1 -0
  7. package/dist/es/index.js +38 -0
  8. package/dist/es/index.js.map +1 -0
  9. package/dist/es/models/epc/IEPCClassUri.js +4 -0
  10. package/dist/es/models/epc/IEPCClassUri.js.map +1 -0
  11. package/dist/es/models/epcis20/IAggregationEvent.js +2 -0
  12. package/dist/es/models/epcis20/IAggregationEvent.js.map +1 -0
  13. package/dist/es/models/epcis20/IAssociationEvent.js +2 -0
  14. package/dist/es/models/epcis20/IAssociationEvent.js.map +1 -0
  15. package/dist/es/models/epcis20/IBaseAggregationEvent.js +2 -0
  16. package/dist/es/models/epcis20/IBaseAggregationEvent.js.map +1 -0
  17. package/dist/es/models/epcis20/IBizTransaction.js +4 -0
  18. package/dist/es/models/epcis20/IBizTransaction.js.map +1 -0
  19. package/dist/es/models/epcis20/IDestination.js +4 -0
  20. package/dist/es/models/epcis20/IDestination.js.map +1 -0
  21. package/dist/es/models/epcis20/IEpcisDocument.js +2 -0
  22. package/dist/es/models/epcis20/IEpcisDocument.js.map +1 -0
  23. package/dist/es/models/epcis20/IEpcisEvent.js +2 -0
  24. package/dist/es/models/epcis20/IEpcisEvent.js.map +1 -0
  25. package/dist/es/models/epcis20/IEpcisEventDetails.js +2 -0
  26. package/dist/es/models/epcis20/IEpcisEventDetails.js.map +1 -0
  27. package/dist/es/models/epcis20/IEpcisQuery.js +4 -0
  28. package/dist/es/models/epcis20/IEpcisQuery.js.map +1 -0
  29. package/dist/es/models/epcis20/IEpcisQueryDocument.js +2 -0
  30. package/dist/es/models/epcis20/IEpcisQueryDocument.js.map +1 -0
  31. package/dist/es/models/epcis20/IObjectEvent.js +2 -0
  32. package/dist/es/models/epcis20/IObjectEvent.js.map +1 -0
  33. package/dist/es/models/epcis20/IQuantity.js +4 -0
  34. package/dist/es/models/epcis20/IQuantity.js.map +1 -0
  35. package/dist/es/models/epcis20/ISensorElement.js +2 -0
  36. package/dist/es/models/epcis20/ISensorElement.js.map +1 -0
  37. package/dist/es/models/epcis20/ISensorMetadata.js +4 -0
  38. package/dist/es/models/epcis20/ISensorMetadata.js.map +1 -0
  39. package/dist/es/models/epcis20/ISensorReport.js +4 -0
  40. package/dist/es/models/epcis20/ISensorReport.js.map +1 -0
  41. package/dist/es/models/epcis20/ISimpleLocation.js +4 -0
  42. package/dist/es/models/epcis20/ISimpleLocation.js.map +1 -0
  43. package/dist/es/models/epcis20/ISource.js +4 -0
  44. package/dist/es/models/epcis20/ISource.js.map +1 -0
  45. package/dist/es/models/epcis20/actionTypes.js +21 -0
  46. package/dist/es/models/epcis20/actionTypes.js.map +1 -0
  47. package/dist/es/models/epcis20/bizStepTypes.js +52 -0
  48. package/dist/es/models/epcis20/bizStepTypes.js.map +1 -0
  49. package/dist/es/models/epcis20/dispositionTypes.js +45 -0
  50. package/dist/es/models/epcis20/dispositionTypes.js.map +1 -0
  51. package/dist/es/models/epcis20/epcisErrorTypes.js +11 -0
  52. package/dist/es/models/epcis20/epcisErrorTypes.js.map +1 -0
  53. package/dist/es/models/epcis20/epcisEventUnionType.js +2 -0
  54. package/dist/es/models/epcis20/epcisEventUnionType.js.map +1 -0
  55. package/dist/es/models/epcis20/eventTypes.js +29 -0
  56. package/dist/es/models/epcis20/eventTypes.js.map +1 -0
  57. package/dist/es/models/gs1/gs1Contexts.js +13 -0
  58. package/dist/es/models/gs1/gs1Contexts.js.map +1 -0
  59. package/dist/es/models/gs1/gs1IdTypes.js +90 -0
  60. package/dist/es/models/gs1/gs1IdTypes.js.map +1 -0
  61. package/dist/es/models/gs1/gs1IdentifierTypes.js +26 -0
  62. package/dist/es/models/gs1/gs1IdentifierTypes.js.map +1 -0
  63. package/dist/es/models/gs1/gs1Types.js +13 -0
  64. package/dist/es/models/gs1/gs1Types.js.map +1 -0
  65. package/dist/es/models/gs1/subSiteAttributes.js +143 -0
  66. package/dist/es/models/gs1/subSiteAttributes.js.map +1 -0
  67. package/dist/es/models/gs1/subSiteTypes.js +75 -0
  68. package/dist/es/models/gs1/subSiteTypes.js.map +1 -0
  69. package/dist/es/utils/gs1IdentifiersValidation.js +144 -0
  70. package/dist/es/utils/gs1IdentifiersValidation.js.map +1 -0
  71. package/dist/es/utils/gs1Is.js +24 -0
  72. package/dist/es/utils/gs1Is.js.map +1 -0
  73. package/dist/es/utils/gs1Validation.js +51 -0
  74. package/dist/es/utils/gs1Validation.js.map +1 -0
  75. package/dist/types/entities/gs1Location.d.ts +2 -2
  76. package/dist/types/index.d.ts +35 -35
  77. package/dist/types/models/epcis20/IAggregationEvent.d.ts +1 -1
  78. package/dist/types/models/epcis20/IAssociationEvent.d.ts +1 -1
  79. package/dist/types/models/epcis20/IBaseAggregationEvent.d.ts +2 -2
  80. package/dist/types/models/epcis20/IEpcisDocument.d.ts +1 -1
  81. package/dist/types/models/epcis20/IEpcisEvent.d.ts +2 -2
  82. package/dist/types/models/epcis20/IEpcisEventDetails.d.ts +6 -6
  83. package/dist/types/models/epcis20/IEpcisQueryDocument.d.ts +1 -1
  84. package/dist/types/models/epcis20/IObjectEvent.d.ts +3 -3
  85. package/dist/types/models/epcis20/ISensorElement.d.ts +2 -2
  86. package/dist/types/models/epcis20/epcisEventUnionType.d.ts +3 -3
  87. package/dist/types/utils/gs1IdentifiersValidation.d.ts +1 -1
  88. package/dist/types/utils/gs1Validation.d.ts +1 -1
  89. package/docs/changelog.md +62 -0
  90. package/docs/reference/classes/Gs1IdentifiersValidation.md +6 -6
  91. package/locales/en.json +0 -1
  92. package/package.json +20 -8
  93. package/dist/cjs/index.cjs +0 -991
  94. package/dist/esm/index.mjs +0 -974
@@ -0,0 +1,45 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /* cSpell:disable */
4
+ /**
5
+ * EPCIS 2.0 disposition types.
6
+ *
7
+ * See EPCIS CVB for more details.
8
+ */
9
+ // eslint-disable-next-line @typescript-eslint/naming-convention
10
+ export const DispositionTypes = {
11
+ Active: "active",
12
+ ContainerClosed: "container_closed",
13
+ Damaged: "damaged",
14
+ Destroyed: "destroyed",
15
+ Dispensed: "dispensed",
16
+ Disposed: "disposed",
17
+ Encoded: "encoded",
18
+ Expired: "expired",
19
+ InProgress: "in_progress",
20
+ InTransit: "in_transit",
21
+ Inactive: "inactive",
22
+ NoPedigreeMatch: "no_pedigree_match",
23
+ NonSellableOther: "non_sellable_other",
24
+ PartiallyDispensed: "partially_dispensed",
25
+ Recalled: "recalled",
26
+ Reserved: "reserved",
27
+ RetailSold: "retail_sold",
28
+ Returned: "returned",
29
+ SellableAccessible: "sellable_accessible",
30
+ SellableNotAccessible: "sellable_not_accessible",
31
+ Stolen: "stolen",
32
+ Unknown: "unknown",
33
+ Available: "available",
34
+ CompletenessVerified: "completeness_verified",
35
+ CompletenessInferred: "completeness_inferred",
36
+ Conformant: "conformant",
37
+ ContainerOpen: "container_open",
38
+ MismatchInstance: "mismatch_instance",
39
+ MismatchClass: "mismatch_class",
40
+ MismatchQuantity: "mismatch_quantity",
41
+ NeedsReplacement: "needs_replacement",
42
+ NonConformant: "non_conformant",
43
+ Unavailable: "unavailable"
44
+ };
45
+ //# sourceMappingURL=dispositionTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dispositionTypes.js","sourceRoot":"","sources":["../../../../src/models/epcis20/dispositionTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,oBAAoB;AAEpB;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,MAAM,EAAE,QAAQ;IAEhB,eAAe,EAAE,kBAAkB;IAEnC,OAAO,EAAE,SAAS;IAElB,SAAS,EAAE,WAAW;IAEtB,SAAS,EAAE,WAAW;IAEtB,QAAQ,EAAE,UAAU;IAEpB,OAAO,EAAE,SAAS;IAElB,OAAO,EAAE,SAAS;IAElB,UAAU,EAAE,aAAa;IAEzB,SAAS,EAAE,YAAY;IAEvB,QAAQ,EAAE,UAAU;IAEpB,eAAe,EAAE,mBAAmB;IAEpC,gBAAgB,EAAE,oBAAoB;IAEtC,kBAAkB,EAAE,qBAAqB;IAEzC,QAAQ,EAAE,UAAU;IAEpB,QAAQ,EAAE,UAAU;IAEpB,UAAU,EAAE,aAAa;IAEzB,QAAQ,EAAE,UAAU;IAEpB,kBAAkB,EAAE,qBAAqB;IAEzC,qBAAqB,EAAE,yBAAyB;IAEhD,MAAM,EAAE,QAAQ;IAEhB,OAAO,EAAE,SAAS;IAElB,SAAS,EAAE,WAAW;IAEtB,oBAAoB,EAAE,uBAAuB;IAE7C,oBAAoB,EAAE,uBAAuB;IAE7C,UAAU,EAAE,YAAY;IAExB,aAAa,EAAE,gBAAgB;IAE/B,gBAAgB,EAAE,mBAAmB;IAErC,aAAa,EAAE,gBAAgB;IAE/B,gBAAgB,EAAE,mBAAmB;IAErC,gBAAgB,EAAE,mBAAmB;IAErC,aAAa,EAAE,gBAAgB;IAE/B,WAAW,EAAE,aAAa;CACjB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n/* cSpell:disable */\n\n/**\n * EPCIS 2.0 disposition types.\n *\n * See EPCIS CVB for more details.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DispositionTypes = {\n\tActive: \"active\",\n\n\tContainerClosed: \"container_closed\",\n\n\tDamaged: \"damaged\",\n\n\tDestroyed: \"destroyed\",\n\n\tDispensed: \"dispensed\",\n\n\tDisposed: \"disposed\",\n\n\tEncoded: \"encoded\",\n\n\tExpired: \"expired\",\n\n\tInProgress: \"in_progress\",\n\n\tInTransit: \"in_transit\",\n\n\tInactive: \"inactive\",\n\n\tNoPedigreeMatch: \"no_pedigree_match\",\n\n\tNonSellableOther: \"non_sellable_other\",\n\n\tPartiallyDispensed: \"partially_dispensed\",\n\n\tRecalled: \"recalled\",\n\n\tReserved: \"reserved\",\n\n\tRetailSold: \"retail_sold\",\n\n\tReturned: \"returned\",\n\n\tSellableAccessible: \"sellable_accessible\",\n\n\tSellableNotAccessible: \"sellable_not_accessible\",\n\n\tStolen: \"stolen\",\n\n\tUnknown: \"unknown\",\n\n\tAvailable: \"available\",\n\n\tCompletenessVerified: \"completeness_verified\",\n\n\tCompletenessInferred: \"completeness_inferred\",\n\n\tConformant: \"conformant\",\n\n\tContainerOpen: \"container_open\",\n\n\tMismatchInstance: \"mismatch_instance\",\n\n\tMismatchClass: \"mismatch_class\",\n\n\tMismatchQuantity: \"mismatch_quantity\",\n\n\tNeedsReplacement: \"needs_replacement\",\n\n\tNonConformant: \"non_conformant\",\n\n\tUnavailable: \"unavailable\"\n} as const;\n\n/**\n * EPCIS 2.0 disposition types.\n */\nexport type DispositionTypes = (typeof DispositionTypes)[keyof typeof DispositionTypes];\n"]}
@@ -0,0 +1,11 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * EPCIS Error types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const EpcisErrorTypes = {
8
+ ValidationFailed: "epcisException:ValidationException",
9
+ NoSuchResource: "epcisException:NoSuchResourceException"
10
+ };
11
+ //# sourceMappingURL=epcisErrorTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"epcisErrorTypes.js","sourceRoot":"","sources":["../../../../src/models/epcis20/epcisErrorTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC9B,gBAAgB,EAAE,oCAAoC;IAEtD,cAAc,EAAE,wCAAwC;CAC/C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * EPCIS Error types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EpcisErrorTypes = {\n\tValidationFailed: \"epcisException:ValidationException\",\n\n\tNoSuchResource: \"epcisException:NoSuchResourceException\"\n} as const;\n\n/**\n * EPCIS Error types.\n */\nexport type EpcisErrorTypes = (typeof EpcisErrorTypes)[keyof typeof EpcisErrorTypes];\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=epcisEventUnionType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"epcisEventUnionType.js","sourceRoot":"","sources":["../../../../src/models/epcis20/epcisEventUnionType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IAggregationEvent } from \"./IAggregationEvent.js\";\nimport type { IAssociationEvent } from \"./IAssociationEvent.js\";\nimport type { IObjectEvent } from \"./IObjectEvent.js\";\n\n/**\n * The type that subsumes an EPCIS Event.\n */\nexport type EpcisEventUnionType = IObjectEvent | IAssociationEvent | IAggregationEvent;\n"]}
@@ -0,0 +1,29 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * EPCIS 2.0 event types.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const EventTypes = {
8
+ /**
9
+ * ObjectEvent.
10
+ */
11
+ ObjectEvent: "ObjectEvent",
12
+ /**
13
+ * Aggregation Event.
14
+ */
15
+ AggregationEvent: "AggregationEvent",
16
+ /**
17
+ * Association Event.
18
+ */
19
+ AssociationEvent: "AssociationEvent",
20
+ /**
21
+ * Transformation Event.
22
+ */
23
+ TransformationEvent: "TransformationEvent",
24
+ /**
25
+ * Transaction Event.
26
+ */
27
+ TransactionEvent: "TransactionEvent"
28
+ };
29
+ //# sourceMappingURL=eventTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventTypes.js","sourceRoot":"","sources":["../../../../src/models/epcis20/eventTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,WAAW,EAAE,aAAa;IAE1B;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IAEpC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;IAEpC;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,gBAAgB,EAAE,kBAAkB;CAC3B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * EPCIS 2.0 event types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const EventTypes = {\n\t/**\n\t * ObjectEvent.\n\t */\n\tObjectEvent: \"ObjectEvent\",\n\n\t/**\n\t * Aggregation Event.\n\t */\n\tAggregationEvent: \"AggregationEvent\",\n\n\t/**\n\t * Association Event.\n\t */\n\tAssociationEvent: \"AssociationEvent\",\n\n\t/**\n\t * Transformation Event.\n\t */\n\tTransformationEvent: \"TransformationEvent\",\n\n\t/**\n\t * Transaction Event.\n\t */\n\tTransactionEvent: \"TransactionEvent\"\n} as const;\n\n/**\n * EPCIS 2.0 event types.\n */\nexport type EventTypes = (typeof EventTypes)[keyof typeof EventTypes];\n"]}
@@ -0,0 +1,13 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The contexts of GS1.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const GS1Contexts = {
8
+ /**
9
+ * The context root for the GS1 types.
10
+ */
11
+ ContextRoot: "https://gs1.org/voc/"
12
+ };
13
+ //# sourceMappingURL=gs1Contexts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gs1Contexts.js","sourceRoot":"","sources":["../../../../src/models/gs1/gs1Contexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B;;OAEG;IACH,WAAW,EAAE,sBAAsB;CAC1B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of GS1.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const GS1Contexts = {\n\t/**\n\t * The context root for the GS1 types.\n\t */\n\tContextRoot: \"https://gs1.org/voc/\"\n} as const;\n\n/**\n * The contexts of GS1.\n */\nexport type GS1Contexts = (typeof GS1Contexts)[keyof typeof GS1Contexts];\n"]}
@@ -0,0 +1,90 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /* cSpell:disable */
4
+ /**
5
+ * GS1 EPC Identifiers.
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/naming-convention
8
+ export const Gs1IdTypes = {
9
+ /**
10
+ * GTIN - Trade Item.
11
+ */
12
+ Gtin: "sgtin",
13
+ /**
14
+ * SSCC - Logistics Unit.
15
+ */
16
+ Sscc: "sscc",
17
+ /**
18
+ * GLN - Location.
19
+ */
20
+ Gln: "sgln",
21
+ /**
22
+ * GRAI - Returnable Asset.
23
+ */
24
+ Grai: "grai",
25
+ /**
26
+ * GIAI - Fixed Asset.
27
+ */
28
+ Giai: "giai",
29
+ /**
30
+ * GSRN - Recipient - Hospital Admission or Club Membership.
31
+ */
32
+ GsrnRecipient: "gsrn",
33
+ /**
34
+ * GSRN - Provider - Medical Caregiver or Loyalty Club.
35
+ */
36
+ GsrnProvider: "gsrnp",
37
+ /**
38
+ * GDTI - Document.
39
+ */
40
+ Gtdi: "gtdi",
41
+ /**
42
+ * Technical Industries for unique identification of parts and components.
43
+ */
44
+ None: "cpi",
45
+ /**
46
+ * GCN - Coupon.
47
+ */
48
+ Gcn: "sgcn",
49
+ /**
50
+ * Logical grouping of goods intended for transport as a whole assigned by a freight forwarder.
51
+ */
52
+ Ginc: "ginc",
53
+ /**
54
+ * Logical grouping of logistic units travelling under one dispatch advice and/or bill of lading.
55
+ */
56
+ Gsin: "gsin",
57
+ /**
58
+ * One of multiple pieces comprising, and subordinate to, a whole.
59
+ */
60
+ Ai: "itip",
61
+ /**
62
+ * Pack identification to combat illicit trade.
63
+ */
64
+ GtinTpx: "upui",
65
+ /**
66
+ * Identification of Economic Operator, Owning party or processing party in CoC/CoO.
67
+ */
68
+ GlnAi: "pgln",
69
+ /**
70
+ * Unspecified.
71
+ */
72
+ Unspecified: "gid",
73
+ /**
74
+ * US Dept of Defense supply chain.
75
+ */
76
+ UsDod: "usdod",
77
+ /**
78
+ * Aerospace and Defense sector for unique identification of aircraft and other parts and items.
79
+ */
80
+ AerospaceDefence: "adi",
81
+ /**
82
+ * Intermodal shipping containers.
83
+ */
84
+ Intermodal: "bic",
85
+ /**
86
+ * Vessel Identification.
87
+ */
88
+ Vessel: "imovn"
89
+ };
90
+ //# sourceMappingURL=gs1IdTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gs1IdTypes.js","sourceRoot":"","sources":["../../../../src/models/gs1/gs1IdTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,oBAAoB;AACpB;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,UAAU,GAAG;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO;IAEb;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,GAAG,EAAE,MAAM;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,aAAa,EAAE,MAAM;IAErB;;OAEG;IACH,YAAY,EAAE,OAAO;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,KAAK;IAEX;;OAEG;IACH,GAAG,EAAE,MAAM;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,EAAE,EAAE,MAAM;IAEV;;OAEG;IACH,OAAO,EAAE,MAAM;IAEf;;OAEG;IACH,KAAK,EAAE,MAAM;IAEb;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,KAAK,EAAE,OAAO;IAEd;;OAEG;IACH,gBAAgB,EAAE,KAAK;IAEvB;;OAEG;IACH,UAAU,EAAE,KAAK;IAEjB;;OAEG;IACH,MAAM,EAAE,OAAO;CACN,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n/* cSpell:disable */\n/**\n * GS1 EPC Identifiers.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Gs1IdTypes = {\n\t/**\n\t * GTIN - Trade Item.\n\t */\n\tGtin: \"sgtin\",\n\n\t/**\n\t * SSCC - Logistics Unit.\n\t */\n\tSscc: \"sscc\",\n\n\t/**\n\t * GLN - Location.\n\t */\n\tGln: \"sgln\",\n\n\t/**\n\t * GRAI - Returnable Asset.\n\t */\n\tGrai: \"grai\",\n\n\t/**\n\t * GIAI - Fixed Asset.\n\t */\n\tGiai: \"giai\",\n\n\t/**\n\t * GSRN - Recipient - Hospital Admission or Club Membership.\n\t */\n\tGsrnRecipient: \"gsrn\",\n\n\t/**\n\t * GSRN - Provider - Medical Caregiver or Loyalty Club.\n\t */\n\tGsrnProvider: \"gsrnp\",\n\n\t/**\n\t * GDTI - Document.\n\t */\n\tGtdi: \"gtdi\",\n\n\t/**\n\t * Technical Industries for unique identification of parts and components.\n\t */\n\tNone: \"cpi\",\n\n\t/**\n\t * GCN - Coupon.\n\t */\n\tGcn: \"sgcn\",\n\n\t/**\n\t * Logical grouping of goods intended for transport as a whole assigned by a freight forwarder.\n\t */\n\tGinc: \"ginc\",\n\n\t/**\n\t * Logical grouping of logistic units travelling under one dispatch advice and/or bill of lading.\n\t */\n\tGsin: \"gsin\",\n\n\t/**\n\t * One of multiple pieces comprising, and subordinate to, a whole.\n\t */\n\tAi: \"itip\",\n\n\t/**\n\t * Pack identification to combat illicit trade.\n\t */\n\tGtinTpx: \"upui\",\n\n\t/**\n\t * Identification of Economic Operator, Owning party or processing party in CoC/CoO.\n\t */\n\tGlnAi: \"pgln\",\n\n\t/**\n\t * Unspecified.\n\t */\n\tUnspecified: \"gid\",\n\n\t/**\n\t * US Dept of Defense supply chain.\n\t */\n\tUsDod: \"usdod\",\n\n\t/**\n\t * Aerospace and Defense sector for unique identification of aircraft and other parts and items.\n\t */\n\tAerospaceDefence: \"adi\",\n\n\t/**\n\t * Intermodal shipping containers.\n\t */\n\tIntermodal: \"bic\",\n\n\t/**\n\t * Vessel Identification.\n\t */\n\tVessel: \"imovn\"\n} as const;\n\n/**\n * GS1 EPC Identifiers\n */\nexport type Gs1IdTypes = (typeof Gs1IdTypes)[keyof typeof Gs1IdTypes];\n"]}
@@ -0,0 +1,26 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { Gs1IdTypes } from "./gs1IdTypes.js";
4
+ /**
5
+ * The types of GS1 Identifier data.
6
+ */
7
+ // eslint-disable-next-line @typescript-eslint/naming-convention
8
+ export const Gs1IdentifierTypes = {
9
+ /**
10
+ * Identifier epc id namespace.
11
+ */
12
+ EpcId: "epc:id",
13
+ /**
14
+ * Identifier epc:id:gtin namespace.
15
+ */
16
+ EpcIdGtin: `epc:id:${Gs1IdTypes.Gtin}`,
17
+ /**
18
+ * Identifier epc:id:sgln namespace.
19
+ */
20
+ EpcIdGln: `epc:id:${Gs1IdTypes.Gln}`,
21
+ /**
22
+ * Identifier epc id namespace.
23
+ */
24
+ EpcClass: "epc:class"
25
+ };
26
+ //# sourceMappingURL=gs1IdentifierTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gs1IdentifierTypes.js","sourceRoot":"","sources":["../../../../src/models/gs1/gs1IdentifierTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IACjC;;OAEG;IACH,KAAK,EAAE,QAAQ;IAEf;;OAEG;IACH,SAAS,EAAE,UAAU,UAAU,CAAC,IAAI,EAAE;IAEtC;;OAEG;IACH,QAAQ,EAAE,UAAU,UAAU,CAAC,GAAG,EAAE;IAEpC;;OAEG;IACH,QAAQ,EAAE,WAAW;CACZ,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Gs1IdTypes } from \"./gs1IdTypes.js\";\n\n/**\n * The types of GS1 Identifier data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Gs1IdentifierTypes = {\n\t/**\n\t * Identifier epc id namespace.\n\t */\n\tEpcId: \"epc:id\",\n\n\t/**\n\t * Identifier epc:id:gtin namespace.\n\t */\n\tEpcIdGtin: `epc:id:${Gs1IdTypes.Gtin}`,\n\n\t/**\n\t * Identifier epc:id:sgln namespace.\n\t */\n\tEpcIdGln: `epc:id:${Gs1IdTypes.Gln}`,\n\n\t/**\n\t * Identifier epc id namespace.\n\t */\n\tEpcClass: \"epc:class\"\n} as const;\n\n/**\n * The types of GS1 Identifier data.\n */\nexport type Gs1IdentifierTypes = (typeof Gs1IdentifierTypes)[keyof typeof Gs1IdentifierTypes];\n"]}
@@ -0,0 +1,13 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The types of GS1 data.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const Gs1Types = {
8
+ /**
9
+ * Represents Location Master Data.
10
+ */
11
+ LocationMasterData: "gs1_location_masterdata"
12
+ };
13
+ //# sourceMappingURL=gs1Types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gs1Types.js","sourceRoot":"","sources":["../../../../src/models/gs1/gs1Types.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,QAAQ,GAAG;IACvB;;OAEG;IACH,kBAAkB,EAAE,yBAAyB;CACpC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of GS1 data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const Gs1Types = {\n\t/**\n\t * Represents Location Master Data.\n\t */\n\tLocationMasterData: \"gs1_location_masterdata\"\n} as const;\n\n/**\n * The types of GS1 data.\n */\nexport type Gs1Types = (typeof Gs1Types)[keyof typeof Gs1Types];\n"]}
@@ -0,0 +1,143 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Sub Site Attributes.
5
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
6
+ * Section 10.3.2 .
7
+ */
8
+ // eslint-disable-next-line @typescript-eslint/naming-convention
9
+ export const SubSiteAttributes = {
10
+ /**
11
+ * Electronics.
12
+ */
13
+ Electronics: "401",
14
+ /**
15
+ * Cold Storage.
16
+ */
17
+ ColdStorage: "402",
18
+ /**
19
+ * Shelf.
20
+ */
21
+ Shelf: "403",
22
+ /**
23
+ * Frozen.
24
+ */
25
+ Frozen: "404",
26
+ /**
27
+ * Fresh.
28
+ */
29
+ Fresh: "405",
30
+ /**
31
+ * Promotion.
32
+ */
33
+ Promotion: "406",
34
+ /**
35
+ * End Cap.
36
+ */
37
+ EndCap: "407",
38
+ /**
39
+ * Point of Sale.
40
+ */
41
+ PointOfSale: "408",
42
+ /**
43
+ * Security.
44
+ */
45
+ Security: "409",
46
+ /**
47
+ * General Mdse.
48
+ */
49
+ GeneralMdse: "411",
50
+ /**
51
+ * Grocery.
52
+ */
53
+ Grocery: "412",
54
+ /**
55
+ * Box crusher.
56
+ */
57
+ BoxCrusher: "413",
58
+ /**
59
+ * Dock/Door.
60
+ */
61
+ DockDoor: "414",
62
+ /**
63
+ * Conveyor Belt.
64
+ */
65
+ ConveyorBelt: "415",
66
+ /**
67
+ * Pallet Wrapper.
68
+ */
69
+ PalletWrapper: "416",
70
+ /**
71
+ * Fixed Reader.
72
+ */
73
+ FixedReader: "417",
74
+ /**
75
+ * Mobile Reader.
76
+ */
77
+ MobileReader: "418",
78
+ /**
79
+ * Shelf Storage.
80
+ */
81
+ ShelfStorage: "419",
82
+ /**
83
+ * Returns.
84
+ */
85
+ Returns: "420",
86
+ /**
87
+ * Staging.
88
+ */
89
+ Staging: "421",
90
+ /**
91
+ * Assembly.
92
+ */
93
+ Assembly: "422",
94
+ /**
95
+ * Lay-Away.
96
+ */
97
+ LayAway: "423",
98
+ /**
99
+ * Dispenser.
100
+ */
101
+ Dispenser: "424",
102
+ /**
103
+ * Quarantine.
104
+ */
105
+ Quarantine: "425",
106
+ /**
107
+ * Controlled Substance.
108
+ */
109
+ ControlledSubstance: "426",
110
+ /**
111
+ * Recalled Product.
112
+ */
113
+ RecalledProduct: "427",
114
+ /**
115
+ * Quality Control.
116
+ */
117
+ QualityControl: "428",
118
+ /**
119
+ * Printing Room.
120
+ */
121
+ PrintingRoom: "429",
122
+ /**
123
+ * Loading Dock.
124
+ */
125
+ LoadingDock: "420",
126
+ /**
127
+ * Entrance Gate.
128
+ */
129
+ EntranceGate: "431",
130
+ /**
131
+ * Exit Gate.
132
+ */
133
+ ExitGate: "432",
134
+ /**
135
+ * Gate.
136
+ */
137
+ Gate: "433",
138
+ /**
139
+ * Read Point Verification Spot.
140
+ */
141
+ ReadPointVerificationSpot: "434"
142
+ };
143
+ //# sourceMappingURL=subSiteAttributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subSiteAttributes.js","sourceRoot":"","sources":["../../../../src/models/gs1/subSiteAttributes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,KAAK,EAAE,KAAK;IAEZ;;OAEG;IACH,MAAM,EAAE,KAAK;IAEb;;OAEG;IACH,KAAK,EAAE,KAAK;IAEZ;;OAEG;IACH,SAAS,EAAE,KAAK;IAEhB;;OAEG;IACH,MAAM,EAAE,KAAK;IAEb;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,QAAQ,EAAE,KAAK;IAEf;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,OAAO,EAAE,KAAK;IAEd;;OAEG;IACH,UAAU,EAAE,KAAK;IAEjB;;OAEG;IACH,QAAQ,EAAE,KAAK;IAEf;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,aAAa,EAAE,KAAK;IAEpB;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,OAAO,EAAE,KAAK;IAEd;;OAEG;IACH,OAAO,EAAE,KAAK;IAEd;;OAEG;IACH,QAAQ,EAAE,KAAK;IAEf;;OAEG;IACH,OAAO,EAAE,KAAK;IAEd;;OAEG;IACH,SAAS,EAAE,KAAK;IAEhB;;OAEG;IACH,UAAU,EAAE,KAAK;IAEjB;;OAEG;IACH,mBAAmB,EAAE,KAAK;IAE1B;;OAEG;IACH,eAAe,EAAE,KAAK;IAEtB;;OAEG;IACH,cAAc,EAAE,KAAK;IAErB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,QAAQ,EAAE,KAAK;IAEf;;OAEG;IACH,IAAI,EAAE,KAAK;IAEX;;OAEG;IACH,yBAAyB,EAAE,KAAK;CACvB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Sub Site Attributes.\n * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .\n * Section 10.3.2 .\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SubSiteAttributes = {\n\t/**\n\t * Electronics.\n\t */\n\tElectronics: \"401\",\n\n\t/**\n\t * Cold Storage.\n\t */\n\tColdStorage: \"402\",\n\n\t/**\n\t * Shelf.\n\t */\n\tShelf: \"403\",\n\n\t/**\n\t * Frozen.\n\t */\n\tFrozen: \"404\",\n\n\t/**\n\t * Fresh.\n\t */\n\tFresh: \"405\",\n\n\t/**\n\t * Promotion.\n\t */\n\tPromotion: \"406\",\n\n\t/**\n\t * End Cap.\n\t */\n\tEndCap: \"407\",\n\n\t/**\n\t * Point of Sale.\n\t */\n\tPointOfSale: \"408\",\n\n\t/**\n\t * Security.\n\t */\n\tSecurity: \"409\",\n\n\t/**\n\t * General Mdse.\n\t */\n\tGeneralMdse: \"411\",\n\n\t/**\n\t * Grocery.\n\t */\n\tGrocery: \"412\",\n\n\t/**\n\t * Box crusher.\n\t */\n\tBoxCrusher: \"413\",\n\n\t/**\n\t * Dock/Door.\n\t */\n\tDockDoor: \"414\",\n\n\t/**\n\t * Conveyor Belt.\n\t */\n\tConveyorBelt: \"415\",\n\n\t/**\n\t * Pallet Wrapper.\n\t */\n\tPalletWrapper: \"416\",\n\n\t/**\n\t * Fixed Reader.\n\t */\n\tFixedReader: \"417\",\n\n\t/**\n\t * Mobile Reader.\n\t */\n\tMobileReader: \"418\",\n\n\t/**\n\t * Shelf Storage.\n\t */\n\tShelfStorage: \"419\",\n\n\t/**\n\t * Returns.\n\t */\n\tReturns: \"420\",\n\n\t/**\n\t * Staging.\n\t */\n\tStaging: \"421\",\n\n\t/**\n\t * Assembly.\n\t */\n\tAssembly: \"422\",\n\n\t/**\n\t * Lay-Away.\n\t */\n\tLayAway: \"423\",\n\n\t/**\n\t * Dispenser.\n\t */\n\tDispenser: \"424\",\n\n\t/**\n\t * Quarantine.\n\t */\n\tQuarantine: \"425\",\n\n\t/**\n\t * Controlled Substance.\n\t */\n\tControlledSubstance: \"426\",\n\n\t/**\n\t * Recalled Product.\n\t */\n\tRecalledProduct: \"427\",\n\n\t/**\n\t * Quality Control.\n\t */\n\tQualityControl: \"428\",\n\n\t/**\n\t * Printing Room.\n\t */\n\tPrintingRoom: \"429\",\n\n\t/**\n\t * Loading Dock.\n\t */\n\tLoadingDock: \"420\",\n\n\t/**\n\t * Entrance Gate.\n\t */\n\tEntranceGate: \"431\",\n\n\t/**\n\t * Exit Gate.\n\t */\n\tExitGate: \"432\",\n\n\t/**\n\t * Gate.\n\t */\n\tGate: \"433\",\n\n\t/**\n\t * Read Point Verification Spot.\n\t */\n\tReadPointVerificationSpot: \"434\"\n} as const;\n\n/**\n * Sub Site Attributes.\n * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .\n * Section 10.3.2 .\n */\nexport type SubSiteAttributes = (typeof SubSiteAttributes)[keyof typeof SubSiteAttributes];\n"]}
@@ -0,0 +1,75 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * Sub Site Identifier Types.
5
+ * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .
6
+ * Section 10.3.1 .
7
+ */
8
+ // eslint-disable-next-line @typescript-eslint/naming-convention
9
+ export const SubSiteTypes = {
10
+ /**
11
+ * The Backroom.
12
+ */
13
+ Backroom: "201",
14
+ /**
15
+ * The Storage Area.
16
+ */
17
+ StorageArea: "202",
18
+ /**
19
+ * The Sales Floor.
20
+ */
21
+ SalesFloor: "203",
22
+ /**
23
+ * The Returns Area.
24
+ */
25
+ ReturnsArea: "207",
26
+ /**
27
+ * The Production Area.
28
+ */
29
+ ProductionArea: "208",
30
+ /**
31
+ * The Receiving Area.
32
+ */
33
+ ReceivingArea: "209",
34
+ /**
35
+ * The Shipping Area.
36
+ */
37
+ ShippingArea: "210",
38
+ /**
39
+ * The Sales Floor Transition Area.
40
+ */
41
+ SalesFloorTransitionArea: "211",
42
+ /**
43
+ * The Customer Pick-Up Area.
44
+ */
45
+ CustomerPickupArea: "212",
46
+ /**
47
+ * The Yard.
48
+ */
49
+ Yard: "213",
50
+ /**
51
+ * The Container Deck.
52
+ */
53
+ ContainerDeck: "214",
54
+ /**
55
+ * The Cargo Terminal.
56
+ */
57
+ CargoTerminal: "215",
58
+ /**
59
+ * The Packaging Area.
60
+ */
61
+ PackagingArea: "251",
62
+ /**
63
+ * The Picking Area.
64
+ */
65
+ PickingArea: "252",
66
+ /**
67
+ * The Pharmacy Area.
68
+ */
69
+ PharmacyArea: "253",
70
+ /**
71
+ * Undefined.
72
+ */
73
+ Undefined: "299"
74
+ };
75
+ //# sourceMappingURL=subSiteTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subSiteTypes.js","sourceRoot":"","sources":["../../../../src/models/gs1/subSiteTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,KAAK;IAEf;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,UAAU,EAAE,KAAK;IAEjB;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,cAAc,EAAE,KAAK;IAErB;;OAEG;IACH,aAAa,EAAE,KAAK;IAEpB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,wBAAwB,EAAE,KAAK;IAE/B;;OAEG;IACH,kBAAkB,EAAE,KAAK;IAEzB;;OAEG;IACH,IAAI,EAAE,KAAK;IAEX;;OAEG;IACH,aAAa,EAAE,KAAK;IAEpB;;OAEG;IACH,aAAa,EAAE,KAAK;IAEpB;;OAEG;IACH,aAAa,EAAE,KAAK;IAEpB;;OAEG;IACH,WAAW,EAAE,KAAK;IAElB;;OAEG;IACH,YAAY,EAAE,KAAK;IAEnB;;OAEG;IACH,SAAS,EAAE,KAAK;CACP,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Sub Site Identifier Types.\n * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .\n * Section 10.3.1 .\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SubSiteTypes = {\n\t/**\n\t * The Backroom.\n\t */\n\tBackroom: \"201\",\n\n\t/**\n\t * The Storage Area.\n\t */\n\tStorageArea: \"202\",\n\n\t/**\n\t * The Sales Floor.\n\t */\n\tSalesFloor: \"203\",\n\n\t/**\n\t * The Returns Area.\n\t */\n\tReturnsArea: \"207\",\n\n\t/**\n\t * The Production Area.\n\t */\n\tProductionArea: \"208\",\n\n\t/**\n\t * The Receiving Area.\n\t */\n\tReceivingArea: \"209\",\n\n\t/**\n\t * The Shipping Area.\n\t */\n\tShippingArea: \"210\",\n\n\t/**\n\t * The Sales Floor Transition Area.\n\t */\n\tSalesFloorTransitionArea: \"211\",\n\n\t/**\n\t * The Customer Pick-Up Area.\n\t */\n\tCustomerPickupArea: \"212\",\n\n\t/**\n\t * The Yard.\n\t */\n\tYard: \"213\",\n\n\t/**\n\t * The Container Deck.\n\t */\n\tContainerDeck: \"214\",\n\n\t/**\n\t * The Cargo Terminal.\n\t */\n\tCargoTerminal: \"215\",\n\n\t/**\n\t * The Packaging Area.\n\t */\n\tPackagingArea: \"251\",\n\n\t/**\n\t * The Picking Area.\n\t */\n\tPickingArea: \"252\",\n\n\t/**\n\t * The Pharmacy Area.\n\t */\n\tPharmacyArea: \"253\",\n\n\t/**\n\t * Undefined.\n\t */\n\tUndefined: \"299\"\n} as const;\n\n/**\n * Sub Site Identifier Types.\n * Spec https://www.gs1.org/sites/default/files/docs/epc/CBV-Standard-1-2-1-r-2017-05-05.pdf .\n * Section 10.3.1 .\n */\nexport type SubSiteTypes = (typeof SubSiteTypes)[keyof typeof SubSiteTypes];\n"]}
@@ -0,0 +1,144 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ import { Is, Urn, Validation } from "@twin.org/core";
4
+ import { Gs1IdTypes } from "../models/gs1/gs1IdTypes.js";
5
+ /**
6
+ * Validation for GS1 identifiers.
7
+ */
8
+ export class Gs1IdentifiersValidation {
9
+ /**
10
+ * Validate if the property is a valid epc.
11
+ * @param propertyName The name of the property being validated.
12
+ * @param value The value to test.
13
+ * @param failures The list of failures to add to.
14
+ * @returns True if the value is valid epc.
15
+ */
16
+ static epcId(propertyName, value, failures) {
17
+ const is = Urn.validate("value", value, failures);
18
+ if (is) {
19
+ const urn = Urn.fromValidString(value);
20
+ const specificParts = urn.namespaceSpecific().split(":");
21
+ if (specificParts.length < 2) {
22
+ failures.push({
23
+ property: propertyName,
24
+ reason: "validation.gs1IncorrectSegmentCount"
25
+ });
26
+ }
27
+ else {
28
+ const isValid = Validation.arrayOneOf(propertyName, specificParts[1], Object.values(Gs1IdTypes), failures);
29
+ if (isValid) {
30
+ switch (specificParts[1]) {
31
+ case Gs1IdTypes.Gtin:
32
+ Gs1IdentifiersValidation.epcIdGtin(propertyName, urn, failures);
33
+ break;
34
+ case Gs1IdTypes.Gln:
35
+ Gs1IdentifiersValidation.epcIdGln(propertyName, urn, failures);
36
+ break;
37
+ }
38
+ }
39
+ }
40
+ }
41
+ return is;
42
+ }
43
+ /**
44
+ * Validate if the property is a valid epc id gtin.
45
+ * @param propertyName The name of the property being validated.
46
+ * @param value The value to test.
47
+ * @param failures The list of failures to add to.
48
+ * @returns True if the value is valid epc.
49
+ */
50
+ static epcIdGtin(propertyName, value, failures) {
51
+ const is = Urn.validate("value", value, failures);
52
+ if (is) {
53
+ const gtin = Gs1IdentifiersValidation.extractEpcIdGtin(value);
54
+ if (Is.undefined(gtin)) {
55
+ failures.push({
56
+ property: propertyName,
57
+ reason: "validation.gs1ValueIncorrect"
58
+ });
59
+ return false;
60
+ }
61
+ }
62
+ return is;
63
+ }
64
+ /**
65
+ * Validate if the property is a valid epc id gln.
66
+ * @param propertyName The name of the property being validated.
67
+ * @param value The value to test.
68
+ * @param failures The list of failures to add to.
69
+ * @returns True if the value is valid epc.
70
+ */
71
+ static epcIdGln(propertyName, value, failures) {
72
+ const is = Urn.validate("value", value, failures);
73
+ if (is) {
74
+ const gtin = Gs1IdentifiersValidation.extractEpcIdGln(value);
75
+ if (Is.undefined(gtin)) {
76
+ failures.push({
77
+ property: propertyName,
78
+ reason: "validation.gs1ValueIncorrect"
79
+ });
80
+ return false;
81
+ }
82
+ }
83
+ return is;
84
+ }
85
+ /**
86
+ * Validate if the property is a valid epc class.
87
+ * @param propertyName The name of the property being validated.
88
+ * @param value The value to test.
89
+ * @param failures The list of failures to add to.
90
+ * @returns True if the value is valid epc.
91
+ */
92
+ static epcClass(propertyName, value, failures) {
93
+ const is = Urn.validate("value", value, failures);
94
+ if (is) {
95
+ const extracted = Gs1IdentifiersValidation.extractEpcClassUri(value);
96
+ if (Is.undefined(extracted)) {
97
+ failures.push({
98
+ property: propertyName,
99
+ reason: "validation.gs1EpcClassIncorrect"
100
+ });
101
+ return false;
102
+ }
103
+ }
104
+ return is;
105
+ }
106
+ /**
107
+ * Extract the EPC gtin from the URI.
108
+ * @param epc The uri to extract from.
109
+ * @returns The extracted data or undefined.
110
+ */
111
+ static extractEpcIdGtin(epc) {
112
+ const parts = /^urn:epc:id:sgtin:(\d+)\.(\d+)\.([\w!%'()*+,-.:;=]+)/.exec(epc);
113
+ if (parts && parts.length >= 3 && parts[1].length + parts[2].length === 13) {
114
+ return parts.slice(1).join(".");
115
+ }
116
+ }
117
+ /**
118
+ * Extract the EPC gln from the URI.
119
+ * @param epc The uri to extract from.
120
+ * @returns The extracted data or undefined.
121
+ */
122
+ static extractEpcIdGln(epc) {
123
+ const parts = /^urn:epc:id:sgln:(\d+)\.(\d+)\.([\w!%'()*+,-.:;=]+)/.exec(epc);
124
+ if (parts && parts.length >= 3 && parts[1].length + parts[2].length === 12) {
125
+ return parts.slice(1).join(".");
126
+ }
127
+ }
128
+ /**
129
+ * Extract The EPC Class from the URI.
130
+ * @param epc The uri to extract from.
131
+ * @returns The extracted data or undefined.
132
+ */
133
+ static extractEpcClassUri(epc) {
134
+ const parts = /^urn:epc:class:lgtin:(\d+)\.(\d+)\.([\w!%'()*+,-.:;=]+)/.exec(epc);
135
+ if (parts?.length === 4 && parts[1].length + parts[2].length === 13) {
136
+ return {
137
+ companyPrefix: parts[1],
138
+ itemRefAndIndicator: parts[2],
139
+ lot: parts[3]
140
+ };
141
+ }
142
+ }
143
+ }
144
+ //# sourceMappingURL=gs1IdentifiersValidation.js.map