oca_package 1.0.1 → 1.0.2
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/README.md +67 -68
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,131 +13,130 @@ npm i oca_package
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
```typescript
|
|
16
|
-
|
|
17
|
-
import {
|
|
16
|
+
import { OcaPackage } from 'oca_package';
|
|
17
|
+
import { except } from 'vitest'; // make sure to install vitest or use any other testing library
|
|
18
18
|
|
|
19
19
|
const extension = {
|
|
20
20
|
extensions: [
|
|
21
21
|
{
|
|
22
22
|
ordering_overlay: {
|
|
23
|
-
type:
|
|
24
|
-
ordering_attributes: [
|
|
23
|
+
type: 'ordering',
|
|
24
|
+
ordering_attributes: ['i', 'd'],
|
|
25
25
|
ordering_entry_codes: {
|
|
26
|
-
i: [
|
|
27
|
-
d: [
|
|
26
|
+
i: ['Google', 'ISNI', 'ORCiD', 'ResearcherID', 'Scopus'],
|
|
27
|
+
d: ['001', '002', '003', '004', '005'],
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
],
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
34
|
const oca_bundle = {
|
|
36
|
-
v:
|
|
35
|
+
v: 'OCAA11JSON0008bc_',
|
|
37
36
|
bundle: {
|
|
38
|
-
v:
|
|
39
|
-
d:
|
|
37
|
+
v: 'OCAS11JSON00089f_',
|
|
38
|
+
d: 'ECpSix7tE3wyQM5jH5oaqdizR77rWdQ_BDP3AJn-Jykz',
|
|
40
39
|
capture_base: {
|
|
41
|
-
d:
|
|
42
|
-
type:
|
|
40
|
+
d: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
41
|
+
type: 'spec/capture_base/1.0',
|
|
43
42
|
attributes: {
|
|
44
|
-
d:
|
|
45
|
-
i:
|
|
46
|
-
passed:
|
|
43
|
+
d: 'Text',
|
|
44
|
+
i: 'Text',
|
|
45
|
+
passed: 'Boolean',
|
|
47
46
|
},
|
|
48
|
-
classification:
|
|
47
|
+
classification: '',
|
|
49
48
|
flagged_attributes: [],
|
|
50
49
|
},
|
|
51
50
|
overlays: {
|
|
52
51
|
character_encoding: {
|
|
53
|
-
d:
|
|
54
|
-
capture_base:
|
|
55
|
-
type:
|
|
52
|
+
d: 'ED6Eio9KG2jHdFg3gXQpc0PX2xEI7aHnGDOpjU6VBfjs',
|
|
53
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
54
|
+
type: 'spec/overlays/character_encoding/1.0',
|
|
56
55
|
attribute_character_encoding: {
|
|
57
|
-
d:
|
|
58
|
-
i:
|
|
59
|
-
passed:
|
|
56
|
+
d: 'utf-8',
|
|
57
|
+
i: 'utf-8',
|
|
58
|
+
passed: 'utf-8',
|
|
60
59
|
},
|
|
61
60
|
},
|
|
62
61
|
conformance: {
|
|
63
|
-
d:
|
|
64
|
-
capture_base:
|
|
65
|
-
type:
|
|
62
|
+
d: 'EJSRe8DnLonKf6GVT_bC1QHoY0lQOG6-ldqxu7pqVCU8',
|
|
63
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
64
|
+
type: 'spec/overlays/conformance/1.0',
|
|
66
65
|
attribute_conformance: {
|
|
67
|
-
d:
|
|
68
|
-
i:
|
|
69
|
-
passed:
|
|
66
|
+
d: 'M',
|
|
67
|
+
i: 'M',
|
|
68
|
+
passed: 'M',
|
|
70
69
|
},
|
|
71
70
|
},
|
|
72
71
|
entry: [
|
|
73
72
|
{
|
|
74
|
-
d:
|
|
75
|
-
capture_base:
|
|
76
|
-
type:
|
|
77
|
-
language:
|
|
73
|
+
d: 'EDQVwDAmYssKbGCcLYjYB_Kg5LPOgCTdT3ODzvXqKc1A',
|
|
74
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
75
|
+
type: 'spec/overlays/entry/1.0',
|
|
76
|
+
language: 'eng',
|
|
78
77
|
attribute_entries: {
|
|
79
78
|
d: {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
'001': 'code1',
|
|
80
|
+
'002': 'code2',
|
|
81
|
+
'003': 'code3',
|
|
82
|
+
'004': 'code4',
|
|
83
|
+
'005': 'code5',
|
|
85
84
|
},
|
|
86
85
|
i: {
|
|
87
|
-
G:
|
|
88
|
-
I:
|
|
89
|
-
O:
|
|
90
|
-
R:
|
|
91
|
-
S:
|
|
86
|
+
G: 'Google',
|
|
87
|
+
I: 'ISNI',
|
|
88
|
+
O: 'ORCiD',
|
|
89
|
+
R: 'ResearcherID',
|
|
90
|
+
S: 'Scopus',
|
|
92
91
|
},
|
|
93
92
|
},
|
|
94
93
|
},
|
|
95
94
|
],
|
|
96
95
|
entry_code: {
|
|
97
|
-
d:
|
|
98
|
-
capture_base:
|
|
99
|
-
type:
|
|
96
|
+
d: 'EHrwr6xT_k3PHwd0y8RbIPGe0hDaELjJbjrKs_o8LfGY',
|
|
97
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
98
|
+
type: 'spec/overlays/entry_code/1.0',
|
|
100
99
|
attribute_entry_codes: {
|
|
101
|
-
d: [
|
|
102
|
-
i: [
|
|
100
|
+
d: ['001', '002', '003', '004', '005'],
|
|
101
|
+
i: ['G', 'I', 'O', 'R', 'S'],
|
|
103
102
|
},
|
|
104
103
|
},
|
|
105
104
|
information: [
|
|
106
105
|
{
|
|
107
|
-
d:
|
|
108
|
-
capture_base:
|
|
109
|
-
type:
|
|
110
|
-
language:
|
|
106
|
+
d: 'EIBXpVvka3_4lheeajtitiafIP78Ig8LDMVX9dXpCC2l',
|
|
107
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
108
|
+
type: 'spec/overlays/information/1.0',
|
|
109
|
+
language: 'eng',
|
|
111
110
|
attribute_information: {
|
|
112
|
-
d:
|
|
113
|
-
i:
|
|
114
|
-
passed:
|
|
111
|
+
d: 'Schema digest',
|
|
112
|
+
i: 'Credential Issuee',
|
|
113
|
+
passed: 'Enables or disables passing',
|
|
115
114
|
},
|
|
116
115
|
},
|
|
117
116
|
],
|
|
118
117
|
label: [
|
|
119
118
|
{
|
|
120
|
-
d:
|
|
121
|
-
capture_base:
|
|
122
|
-
type:
|
|
123
|
-
language:
|
|
119
|
+
d: 'ECZc26INzjxVbNo7-hln6xN3HW3e1r6NGDmA5ogRo6ef',
|
|
120
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
121
|
+
type: 'spec/overlays/label/1.0',
|
|
122
|
+
language: 'eng',
|
|
124
123
|
attribute_categories: [],
|
|
125
124
|
attribute_labels: {
|
|
126
|
-
d:
|
|
127
|
-
i:
|
|
128
|
-
passed:
|
|
125
|
+
d: 'Schema digest',
|
|
126
|
+
i: 'Credential Issuee',
|
|
127
|
+
passed: 'Passed',
|
|
129
128
|
},
|
|
130
129
|
category_labels: {},
|
|
131
130
|
},
|
|
132
131
|
],
|
|
133
132
|
meta: [
|
|
134
133
|
{
|
|
135
|
-
d:
|
|
136
|
-
capture_base:
|
|
137
|
-
type:
|
|
138
|
-
language:
|
|
139
|
-
description:
|
|
140
|
-
name:
|
|
134
|
+
d: 'EOxvie-zslkGmFzVqYAzTVtO7RyFXAG8aCqE0OougnGV',
|
|
135
|
+
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
136
|
+
type: 'spec/overlays/meta/1.0',
|
|
137
|
+
language: 'eng',
|
|
138
|
+
description: 'Entrance credential',
|
|
139
|
+
name: 'Entrance credential',
|
|
141
140
|
},
|
|
142
141
|
],
|
|
143
142
|
},
|
|
@@ -146,5 +145,5 @@ const oca_bundle = {
|
|
|
146
145
|
};
|
|
147
146
|
|
|
148
147
|
const oca_package = new OcaPackage(extension, oca_bundle);
|
|
149
|
-
|
|
148
|
+
expect(JSON.parse(oca_package).d).toBe('EBpX82P-HmRjGe3Qr-zQbQmvN7uqxVh0Xt_nM61I9oqA');
|
|
150
149
|
```
|