Skip to content

Commit

Permalink
Merge pull request #36 from evrythng/latest_schema_updates
Browse files Browse the repository at this point in the history
Updated default context
  • Loading branch information
clementh59 authored Jul 8, 2022
2 parents d834a70 + 566f667 commit 64ff0db
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import * as epcis from 'epcis2.js';

Or use a simple script tag to load it from the CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/epcis2.js@2.2.0/dist/epcis2.browser.js"></script>
<script src="https://cdn.jsdelivr.net/npm/epcis2.js@2.3.0/dist/epcis2.browser.js"></script>
```

Then use in a browser `script` tag using the `epcis2` global variable:
Expand Down
12 changes: 6 additions & 6 deletions example/node_example/example_with_creation_from_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { ObjectEvent, setup, EPCISDocument, capture, fieldNames, eventEpcRelType
// you can override the global parameter with the setup function
setup({
apiUrl: 'https://api.evrythng.io/v2/epcis/',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0/epcis-context.jsonld',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
EPCISDocumentSchemaVersion: '2.0',
headers: {
'content-type': 'application/json',
Expand All @@ -17,9 +17,9 @@ setup({
const sendACaptureRequestExample = async () => {
const epcisDocument = new EPCISDocument({
'@context': [
'https://gs1.github.io/EPCIS/epcis-context.jsonld',
'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
{
example: 'http://ns.example.com/epcis/',
example: 'http://ns.example.com/epcis/'
},
],
type: 'EPCISDocument',
Expand Down Expand Up @@ -64,12 +64,12 @@ const sendACaptureRequestExample = async () => {
console.log(`EPCISDocument is valid ? ${epcisDocument.isValid()}`);
console.log(`ObjectEvent is valid ? ${epcisDocument.eventList[0].isValid()}`);


console.log(`field names of an EPCIS Document:`);
console.log(fieldNames.epcisDocument);

console.log(`example of constants from constants.js:`);
console.log(eventEpcRelType)
console.log(eventEpcRelType);
};

sendACaptureRequestExample();
2 changes: 1 addition & 1 deletion example/node_example/example_with_creation_from_setters.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const {
// you can override the global parameter with the setup function
setup({
apiUrl: 'https://api.evrythng.io/v2/epcis/',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0/epcis-context.jsonld',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
EPCISDocumentSchemaVersion: '2.0',
headers: {
'content-type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion example/node_example/example_with_full_possibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ setup({
},
eventTimeZoneOffset: '-02:00',
timeout: '3000',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0/epcis-context.jsonld',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
EPCISDocumentSchemaVersion: '2.0',
documentValidation: true,
validationMode: 'fast' //'full' otherwise
Expand Down
2 changes: 1 addition & 1 deletion example/react-example/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
// you can override the global parameter with the setup function
setup({
apiUrl: 'https://api.evrythng.io/v2/epcis/',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0/epcis-context.jsonld',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
EPCISDocumentSchemaVersion: '2.0',
headers: {
'content-type': 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion example/web-example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<title>EPCIS2.js demo</title>
<script src="https://cdn.jsdelivr.net/npm/epcis2.js@2.2.0/dist/epcis2.browser.js" defer></script>
<script src="https://cdn.jsdelivr.net/npm/epcis2.js@2.3.0/dist/epcis2.browser.js" defer></script>
<script>
window.onload = () => {
const doc = new epcis2.EPCISDocument();
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "epcis2.js",
"version": "2.2.0",
"version": "2.3.0",
"description": "Javascript SDK for the EPCIS 2.0 standard",
"main": "dist/epcis2.node.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const defaultSettings = {
},
eventTimeZoneOffset: undefined,
timeout: undefined,
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0/epcis-context.jsonld',
EPCISDocumentContext: 'https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld',
EPCISDocumentSchemaVersion: '2.0',
documentValidation: true,
validationMode: 'full',
Expand Down
2 changes: 1 addition & 1 deletion test/data/hashing/epcisDocWithSensorDataObjectEvent.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": ["https://id.gs1.org/epcis-context.jsonld", { "gs1": "https://gs1.org/voc/" }],
"@context": ["https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", { "gs1": "https://gs1.org/voc/" }],
"type": "EPCISDocument",
"creationDate": "2005-07-11T11:30:47+00:00",
"schemaVersion": "1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://id.gs1.org/epcis-context.jsonld",
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"creationDate": "2005-07-11T11:30:47+00:00",
"schemaVersion": "1.2",
Expand Down
2 changes: 1 addition & 1 deletion test/data/hashing/epcisDocWithVariousEventTypes.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://id.gs1.org/epcis-context.jsonld",
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"creationDate": "2005-07-11T11:30:47+00:00",
"schemaVersion": "1.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://id.gs1.org/epcis-context.jsonld",
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"creationDate": "2005-07-11T11:30:47+00:00",
"schemaVersion": "1.2",
Expand Down
2 changes: 1 addition & 1 deletion test/data/hashing/epclist_normalisation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://id.gs1.org/epcis-context.jsonld",
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"creationDate": "2005-07-11T11:30:47+00:00",
"schemaVersion": "1.2",
Expand Down
2 changes: 1 addition & 1 deletion test/data/hashing/event-hash-reference-document.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": "https://id.gs1.org/epcis-context.jsonld",
"@context": "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"type": "EPCISDocument",
"creationDate": "2020-03-03T13:07:51.709+00:00",
"schemaVersion": "1.2",
Expand Down
2 changes: 1 addition & 1 deletion test/data/hashing/event-hash-reference-document2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@context": ["https://id.gs1.org/epcis-context.jsonld", { "gs1": "https://gs1.org/voc/" }],
"@context": ["https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld", { "gs1": "https://gs1.org/voc/" }],
"type": "EPCISDocument",
"creationDate": "2020-04-01T15:00:00+01:00",
"schemaVersion": "2",
Expand Down

0 comments on commit 64ff0db

Please sign in to comment.