oca_package 1.0.5 → 1.0.7
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
CHANGED
|
@@ -17,133 +17,113 @@ import { OcaPackage } from 'oca_package';
|
|
|
17
17
|
import { except } from 'vitest'; // make sure to install vitest or use any other testing library
|
|
18
18
|
|
|
19
19
|
const extension = {
|
|
20
|
-
extensions:
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
extensions: {
|
|
21
|
+
adc: {
|
|
22
|
+
EDDBSQuhzsJtE9ksQxpWYVBblWwHhhtNxemYFeEFY1qX: [
|
|
23
|
+
{
|
|
24
|
+
ordering_overlay: {
|
|
25
|
+
type: 'ordering',
|
|
26
|
+
attribute_ordering: ['book.title', 'book.pages', 'book.languages'],
|
|
27
|
+
entry_code_ordering: {
|
|
28
|
+
'book.languages': { 'book.languages': ['nb', 'b'] },
|
|
29
|
+
},
|
|
30
|
+
},
|
|
28
31
|
},
|
|
29
|
-
|
|
32
|
+
],
|
|
33
|
+
EKNGowNlfUGdnAiQ_2PdmzqUB705QgaWxvrYCwovlWqc: [
|
|
34
|
+
{
|
|
35
|
+
ordering_overlay: {
|
|
36
|
+
type: 'ordering',
|
|
37
|
+
attribute_ordering: ['page.number', 'opened'],
|
|
38
|
+
entry_code_ordering: {},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
30
42
|
},
|
|
31
|
-
|
|
43
|
+
},
|
|
32
44
|
};
|
|
33
45
|
|
|
34
46
|
const oca_bundle = {
|
|
35
|
-
v: '
|
|
47
|
+
v: 'OCAA11JSON000637_',
|
|
36
48
|
bundle: {
|
|
37
|
-
v: '
|
|
38
|
-
d: '
|
|
49
|
+
v: 'OCAS11JSON000425_',
|
|
50
|
+
d: 'EDDBSQuhzsJtE9ksQxpWYVBblWwHhhtNxemYFeEFY1qX',
|
|
39
51
|
capture_base: {
|
|
40
|
-
d: '
|
|
41
|
-
type: 'spec/capture_base/1.
|
|
52
|
+
d: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
|
|
53
|
+
type: 'spec/capture_base/1.1',
|
|
42
54
|
attributes: {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
55
|
+
'book.languages': 'Text',
|
|
56
|
+
'book.pages': 'refs:EKNGowNlfUGdnAiQ_2PdmzqUB705QgaWxvrYCwovlWqc',
|
|
57
|
+
'book.title': 'Text',
|
|
46
58
|
},
|
|
47
59
|
classification: '',
|
|
48
60
|
flagged_attributes: [],
|
|
49
61
|
},
|
|
50
62
|
overlays: {
|
|
51
|
-
character_encoding: {
|
|
52
|
-
d: 'ED6Eio9KG2jHdFg3gXQpc0PX2xEI7aHnGDOpjU6VBfjs',
|
|
53
|
-
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
54
|
-
type: 'spec/overlays/character_encoding/1.0',
|
|
55
|
-
attribute_character_encoding: {
|
|
56
|
-
d: 'utf-8',
|
|
57
|
-
i: 'utf-8',
|
|
58
|
-
passed: 'utf-8',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
conformance: {
|
|
62
|
-
d: 'EJSRe8DnLonKf6GVT_bC1QHoY0lQOG6-ldqxu7pqVCU8',
|
|
63
|
-
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
64
|
-
type: 'spec/overlays/conformance/1.0',
|
|
65
|
-
attribute_conformance: {
|
|
66
|
-
d: 'M',
|
|
67
|
-
i: 'M',
|
|
68
|
-
passed: 'M',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
63
|
entry: [
|
|
72
64
|
{
|
|
73
|
-
d: '
|
|
74
|
-
capture_base: '
|
|
75
|
-
type: 'spec/overlays/entry/1.
|
|
65
|
+
d: 'EE1bnxtnlylwYS7rxuMXdoLw1_zWtcQV6qic7S2dBoPD',
|
|
66
|
+
capture_base: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
|
|
67
|
+
type: 'spec/overlays/entry/1.1',
|
|
76
68
|
language: 'eng',
|
|
77
69
|
attribute_entries: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'003': 'code3',
|
|
82
|
-
'004': 'code4',
|
|
83
|
-
'005': 'code5',
|
|
84
|
-
},
|
|
85
|
-
i: {
|
|
86
|
-
G: 'Google',
|
|
87
|
-
I: 'ISNI',
|
|
88
|
-
O: 'ORCiD',
|
|
89
|
-
R: 'ResearcherID',
|
|
90
|
-
S: 'Scopus',
|
|
70
|
+
'book.languages': {
|
|
71
|
+
b: 'bilingual',
|
|
72
|
+
nb: 'non-bilingual',
|
|
91
73
|
},
|
|
92
74
|
},
|
|
93
75
|
},
|
|
94
76
|
],
|
|
95
77
|
entry_code: {
|
|
96
|
-
d: '
|
|
97
|
-
capture_base: '
|
|
98
|
-
type: 'spec/overlays/entry_code/1.
|
|
78
|
+
d: 'EEdyjFBfM8YWXXsWmM0ojxSqU3fTCEUYSUTP9rlC_D5_',
|
|
79
|
+
capture_base: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
|
|
80
|
+
type: 'spec/overlays/entry_code/1.1',
|
|
99
81
|
attribute_entry_codes: {
|
|
100
|
-
|
|
101
|
-
i: ['G', 'I', 'O', 'R', 'S'],
|
|
82
|
+
'book.languages': ['b', 'nb'],
|
|
102
83
|
},
|
|
103
84
|
},
|
|
104
|
-
information: [
|
|
105
|
-
{
|
|
106
|
-
d: 'EIBXpVvka3_4lheeajtitiafIP78Ig8LDMVX9dXpCC2l',
|
|
107
|
-
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
108
|
-
type: 'spec/overlays/information/1.0',
|
|
109
|
-
language: 'eng',
|
|
110
|
-
attribute_information: {
|
|
111
|
-
d: 'Schema digest',
|
|
112
|
-
i: 'Credential Issuee',
|
|
113
|
-
passed: 'Enables or disables passing',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
label: [
|
|
118
|
-
{
|
|
119
|
-
d: 'ECZc26INzjxVbNo7-hln6xN3HW3e1r6NGDmA5ogRo6ef',
|
|
120
|
-
capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
|
|
121
|
-
type: 'spec/overlays/label/1.0',
|
|
122
|
-
language: 'eng',
|
|
123
|
-
attribute_categories: [],
|
|
124
|
-
attribute_labels: {
|
|
125
|
-
d: 'Schema digest',
|
|
126
|
-
i: 'Credential Issuee',
|
|
127
|
-
passed: 'Passed',
|
|
128
|
-
},
|
|
129
|
-
category_labels: {},
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
85
|
meta: [
|
|
133
86
|
{
|
|
134
|
-
d: '
|
|
135
|
-
capture_base: '
|
|
136
|
-
type: 'spec/overlays/meta/1.
|
|
87
|
+
d: 'EPiuBpZGvOlDSPr6nm7L3W-LnkY_F-ykLqMyNyBdm7Kx',
|
|
88
|
+
capture_base: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
|
|
89
|
+
type: 'spec/overlays/meta/1.1',
|
|
137
90
|
language: 'eng',
|
|
138
|
-
description: '
|
|
139
|
-
name: '
|
|
91
|
+
description: 'Book Description',
|
|
92
|
+
name: 'Book of Interest',
|
|
140
93
|
},
|
|
141
94
|
],
|
|
142
95
|
},
|
|
143
96
|
},
|
|
144
|
-
dependencies: [
|
|
97
|
+
dependencies: [
|
|
98
|
+
{
|
|
99
|
+
v: 'OCAS11JSON00020d_',
|
|
100
|
+
d: 'EKNGowNlfUGdnAiQ_2PdmzqUB705QgaWxvrYCwovlWqc',
|
|
101
|
+
capture_base: {
|
|
102
|
+
d: 'ELauJG9lo9hBOPrxGasmTSleHfh8X8TQE_dUDzUMCuJW',
|
|
103
|
+
type: 'spec/capture_base/1.1',
|
|
104
|
+
attributes: {
|
|
105
|
+
opened: 'Boolean',
|
|
106
|
+
'page.number': 'Numeric',
|
|
107
|
+
},
|
|
108
|
+
classification: '',
|
|
109
|
+
flagged_attributes: [],
|
|
110
|
+
},
|
|
111
|
+
overlays: {
|
|
112
|
+
meta: [
|
|
113
|
+
{
|
|
114
|
+
d: 'EFFOiK0t_EDxVABcUGIwQxpDD3Pwgd1gKpITUlipNcB3',
|
|
115
|
+
capture_base: 'ELauJG9lo9hBOPrxGasmTSleHfh8X8TQE_dUDzUMCuJW',
|
|
116
|
+
type: 'spec/overlays/meta/1.1',
|
|
117
|
+
language: 'eng',
|
|
118
|
+
description: 'Page Status',
|
|
119
|
+
name: 'Current Page in the Book',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
],
|
|
145
125
|
};
|
|
146
126
|
|
|
147
127
|
const oca_package = new OcaPackage(extension, oca_bundle);
|
|
148
|
-
expect(JSON.parse(oca_package.
|
|
128
|
+
expect(JSON.parse(oca_package.GenerateOcaPackage()).d).toBe('EG5L9MmzrvRdscWysJKw7tfwutGD0MSkFNsbULms3AmV');
|
|
149
129
|
```
|
|
@@ -20,7 +20,7 @@ class Ordering {
|
|
|
20
20
|
toJSON() {
|
|
21
21
|
return {
|
|
22
22
|
d: '',
|
|
23
|
-
type: 'community/overlays/adc/ordering/1.
|
|
23
|
+
type: 'community/overlays/adc/ordering/1.1',
|
|
24
24
|
capture_base: (0, helpers_js_1.getDigest)(this.oca_bundle),
|
|
25
25
|
attribute_ordering: this.getAttributeOrdering(),
|
|
26
26
|
entry_code_ordering: this.getEntryCodeOrdering(),
|
|
@@ -18,7 +18,7 @@ class Ordering {
|
|
|
18
18
|
toJSON() {
|
|
19
19
|
return {
|
|
20
20
|
d: '',
|
|
21
|
-
type: 'community/overlays/adc/ordering/1.
|
|
21
|
+
type: 'community/overlays/adc/ordering/1.1',
|
|
22
22
|
capture_base: getDigest(this.oca_bundle),
|
|
23
23
|
attribute_ordering: this.getAttributeOrdering(),
|
|
24
24
|
entry_code_ordering: this.getEntryCodeOrdering(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oca_package",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "The wrapper of OCA bundle to generate OCA Package at ADC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -51,8 +51,9 @@
|
|
|
51
51
|
"vitest": "^2.1.5"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
+
"assert": "^2.1.0",
|
|
54
55
|
"canonicalize": "^2.0.0",
|
|
55
|
-
"
|
|
56
|
-
"
|
|
56
|
+
"saidify": "^0.2.2",
|
|
57
|
+
"util": "^0.12.5"
|
|
57
58
|
}
|
|
58
59
|
}
|