oca_package 1.0.6 → 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.
Files changed (2) hide show
  1. package/README.md +74 -94
  2. package/package.json +4 -3
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
- ordering_overlay: {
23
- type: 'ordering',
24
- attribute_ordering: ['i', 'd'],
25
- entry_codes_ordering: {
26
- i: ['Google', 'ISNI', 'ORCiD', 'ResearcherID', 'Scopus'],
27
- d: ['001', '002', '003', '004', '005'],
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: 'OCAA11JSON0008bc_',
47
+ v: 'OCAA11JSON000637_',
36
48
  bundle: {
37
- v: 'OCAS11JSON00089f_',
38
- d: 'ECpSix7tE3wyQM5jH5oaqdizR77rWdQ_BDP3AJn-Jykz',
49
+ v: 'OCAS11JSON000425_',
50
+ d: 'EDDBSQuhzsJtE9ksQxpWYVBblWwHhhtNxemYFeEFY1qX',
39
51
  capture_base: {
40
- d: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
41
- type: 'spec/capture_base/1.0',
52
+ d: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
53
+ type: 'spec/capture_base/1.1',
42
54
  attributes: {
43
- d: 'Text',
44
- i: 'Text',
45
- passed: 'Boolean',
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: 'EDQVwDAmYssKbGCcLYjYB_Kg5LPOgCTdT3ODzvXqKc1A',
74
- capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
75
- type: 'spec/overlays/entry/1.0',
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
- d: {
79
- '001': 'code1',
80
- '002': 'code2',
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: 'EHrwr6xT_k3PHwd0y8RbIPGe0hDaELjJbjrKs_o8LfGY',
97
- capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
98
- type: 'spec/overlays/entry_code/1.0',
78
+ d: 'EEdyjFBfM8YWXXsWmM0ojxSqU3fTCEUYSUTP9rlC_D5_',
79
+ capture_base: 'ELdpxPMcAE_-DsvUpkmjcM3OQ8QyHNlH1q6xJb-5Dih9',
80
+ type: 'spec/overlays/entry_code/1.1',
99
81
  attribute_entry_codes: {
100
- d: ['001', '002', '003', '004', '005'],
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: 'EOxvie-zslkGmFzVqYAzTVtO7RyFXAG8aCqE0OougnGV',
135
- capture_base: 'EBnF9U9XW1EqteIW0ucAR4CsTUqojvfIWkeifsLRuOUW',
136
- type: 'spec/overlays/meta/1.0',
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: 'Entrance credential',
139
- name: 'Entrance credential',
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.generateOcaPackage()).d).toBe('EAMvqPRrf6F_8aERtYd02F3ts_e9fmh5th1e_4JDkqZn');
128
+ expect(JSON.parse(oca_package.GenerateOcaPackage()).d).toBe('EG5L9MmzrvRdscWysJKw7tfwutGD0MSkFNsbULms3AmV');
149
129
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oca_package",
3
- "version": "1.0.6",
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
- "oca.js": "^0.5.4",
56
- "saidify": "^0.2.2"
56
+ "saidify": "^0.2.2",
57
+ "util": "^0.12.5"
57
58
  }
58
59
  }