openchs-models 1.33.12 → 1.33.20
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/.circleci/config.yml +21 -24
- package/.github/workflows/publish_to_npm.yml +30 -0
- package/.nvmrc +1 -1
- package/dist/Schema.js +14 -1
- package/package.json +2 -2
package/.circleci/config.yml
CHANGED
|
@@ -3,7 +3,7 @@ version: 2
|
|
|
3
3
|
defaults: &defaults
|
|
4
4
|
working_directory: ~/repo
|
|
5
5
|
docker:
|
|
6
|
-
- image: cimg/node:
|
|
6
|
+
- image: cimg/node:20.19.5
|
|
7
7
|
|
|
8
8
|
jobs:
|
|
9
9
|
build:
|
|
@@ -39,34 +39,31 @@ jobs:
|
|
|
39
39
|
- persist_to_workspace:
|
|
40
40
|
root: ~/repo
|
|
41
41
|
paths: .
|
|
42
|
-
publish:
|
|
43
|
-
<<: *defaults
|
|
44
|
-
steps:
|
|
45
|
-
- attach_workspace:
|
|
46
|
-
at: ~/repo
|
|
47
|
-
- run:
|
|
48
|
-
name: Authenticate with registry
|
|
49
|
-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
|
50
|
-
- run:
|
|
51
|
-
name: Publish package
|
|
52
|
-
command: npm publish
|
|
42
|
+
# publish:
|
|
43
|
+
# <<: *defaults
|
|
44
|
+
# steps:
|
|
45
|
+
# - attach_workspace:
|
|
46
|
+
# at: ~/repo
|
|
47
|
+
# - run:
|
|
48
|
+
# name: Authenticate with registry
|
|
49
|
+
# command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
|
|
50
|
+
# - run:
|
|
51
|
+
# name: Publish package
|
|
52
|
+
# command: npm publish
|
|
53
53
|
|
|
54
54
|
workflows:
|
|
55
55
|
version: 2
|
|
56
56
|
test_deploy:
|
|
57
57
|
jobs:
|
|
58
|
-
- build
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
only: /^v.*/
|
|
68
|
-
branches:
|
|
69
|
-
ignore: /.*/
|
|
58
|
+
- build
|
|
59
|
+
# - publish:
|
|
60
|
+
# requires:
|
|
61
|
+
# - build
|
|
62
|
+
# filters:
|
|
63
|
+
# tags:
|
|
64
|
+
# only: /^v.*/
|
|
65
|
+
# branches:
|
|
66
|
+
# ignore: /.*/
|
|
70
67
|
|
|
71
68
|
notify:
|
|
72
69
|
webhooks:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Publish Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
id-token: write # Required for OIDC
|
|
10
|
+
contents: read
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: '20'
|
|
21
|
+
registry-url: 'https://registry.npmjs.org'
|
|
22
|
+
- name: Update npm
|
|
23
|
+
run: npm install -g npm@latest
|
|
24
|
+
- name: Install yarn
|
|
25
|
+
run: npm install -g yarn
|
|
26
|
+
- run: yarn install
|
|
27
|
+
- run: yarn build
|
|
28
|
+
- run: yarn validate:schemas
|
|
29
|
+
- run: yarn test
|
|
30
|
+
- run: npm publish --verbose
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v20
|
package/dist/Schema.js
CHANGED
|
@@ -177,7 +177,7 @@ function createRealmConfig() {
|
|
|
177
177
|
return doCompact;
|
|
178
178
|
},
|
|
179
179
|
//order is important, should be arranged according to the dependency
|
|
180
|
-
schemaVersion:
|
|
180
|
+
schemaVersion: 205,
|
|
181
181
|
onMigration: function (oldDB, newDB) {
|
|
182
182
|
console.log("[AvniModels.Schema]", `Running migration with old schema version: ${oldDB.schemaVersion} and new schema version: ${newDB.schemaVersion}`);
|
|
183
183
|
if (oldDB.schemaVersion === VersionWithEmbeddedMigrationProblem) throw new Error(`Update from schema version ${VersionWithEmbeddedMigrationProblem} is not allowed. Please uninstall and install app.`);
|
|
@@ -760,6 +760,19 @@ function createRealmConfig() {
|
|
|
760
760
|
}
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
+
if (oldDB.schemaVersion < 205) {
|
|
764
|
+
_lodash.default.forEach(newDB.objects("Concept"), concept => {
|
|
765
|
+
const oldConcept = oldDB.objects("Concept").filtered(`uuid = "${concept.uuid}"`)[0];
|
|
766
|
+
if (oldConcept && oldConcept.mediaUrl && oldConcept.mediaType) {
|
|
767
|
+
const conceptMedia = {
|
|
768
|
+
uuid: _General.default.randomUUID(),
|
|
769
|
+
url: oldConcept.mediaUrl,
|
|
770
|
+
type: oldConcept.mediaType
|
|
771
|
+
};
|
|
772
|
+
concept.media.push(conceptMedia);
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
}
|
|
763
776
|
}
|
|
764
777
|
};
|
|
765
778
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openchs-models",
|
|
3
3
|
"description": "OpenCHS data model to be used by front end clients",
|
|
4
|
-
"version": "1.33.
|
|
4
|
+
"version": "1.33.20",
|
|
5
5
|
"private": false,
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/
|
|
8
|
+
"url": "git+https://github.com/avniproject/avni-models.git"
|
|
9
9
|
},
|
|
10
10
|
"main": "dist/index.js",
|
|
11
11
|
"scripts": {
|