@data-fair/lib-common-types 1.0.0 → 1.1.0

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.
@@ -6,8 +6,7 @@ import { assertValid as assertValidGeneric } from '@data-fair/lib-node/validatio
6
6
 
7
7
  export const schemaExports = [
8
8
  "types",
9
- "validate",
10
- "schema"
9
+ "validate"
11
10
  ]
12
11
 
13
12
  export { validate } from './validate.js'
@@ -18,168 +17,3 @@ export const returnValid = (data, options) => {
18
17
  assertValid(data, options)
19
18
  return data
20
19
  }
21
-
22
- export const schema = {
23
- "$id": "https://github.com/data-fair/lib/session-state",
24
- "x-exports": [
25
- "types",
26
- "validate",
27
- "schema"
28
- ],
29
- "type": "object",
30
- "title": "session state",
31
- "additionalProperties": false,
32
- "properties": {
33
- "user": {
34
- "$ref": "#/$defs/user"
35
- },
36
- "organization": {
37
- "$ref": "#/$defs/organizationMembership"
38
- },
39
- "account": {
40
- "$ref": "#/$defs/account"
41
- },
42
- "accountRole": {
43
- "type": "string"
44
- },
45
- "lang": {
46
- "type": "string"
47
- },
48
- "dark": {
49
- "type": "boolean"
50
- }
51
- },
52
- "$defs": {
53
- "organizationMembership": {
54
- "type": "object",
55
- "additionalProperties": false,
56
- "required": [
57
- "id",
58
- "name",
59
- "role"
60
- ],
61
- "properties": {
62
- "id": {
63
- "type": "string"
64
- },
65
- "name": {
66
- "type": "string"
67
- },
68
- "role": {
69
- "type": "string"
70
- },
71
- "department": {
72
- "type": "string"
73
- },
74
- "departmentName": {
75
- "type": "string"
76
- },
77
- "dflt": {
78
- "type": "boolean"
79
- }
80
- }
81
- },
82
- "userRef": {
83
- "type": "object",
84
- "additionalProperties": false,
85
- "required": [
86
- "id",
87
- "name"
88
- ],
89
- "properties": {
90
- "id": {
91
- "type": "string"
92
- },
93
- "name": {
94
- "type": "string"
95
- }
96
- }
97
- },
98
- "user": {
99
- "type": "object",
100
- "additionalProperties": false,
101
- "required": [
102
- "email",
103
- "id",
104
- "name",
105
- "organizations"
106
- ],
107
- "properties": {
108
- "email": {
109
- "type": "string",
110
- "format": "email"
111
- },
112
- "id": {
113
- "type": "string"
114
- },
115
- "name": {
116
- "type": "string"
117
- },
118
- "organizations": {
119
- "type": "array",
120
- "items": {
121
- "$ref": "#/$defs/organizationMembership"
122
- }
123
- },
124
- "isAdmin": {
125
- "type": "integer",
126
- "enum": [
127
- 0,
128
- 1
129
- ]
130
- },
131
- "adminMode": {
132
- "type": "integer",
133
- "enum": [
134
- 0,
135
- 1
136
- ]
137
- },
138
- "asAdmin": {
139
- "$ref": "#/$defs/userRef"
140
- },
141
- "pd": {
142
- "type": "string",
143
- "format": "date"
144
- },
145
- "ipa": {
146
- "type": "integer",
147
- "enum": [
148
- 0,
149
- 1
150
- ]
151
- }
152
- }
153
- },
154
- "account": {
155
- "type": "object",
156
- "additionalProperties": false,
157
- "required": [
158
- "type",
159
- "id",
160
- "name"
161
- ],
162
- "properties": {
163
- "type": {
164
- "type": "string",
165
- "enum": [
166
- "user",
167
- "organization"
168
- ]
169
- },
170
- "id": {
171
- "type": "string"
172
- },
173
- "name": {
174
- "type": "string"
175
- },
176
- "department": {
177
- "type": "string"
178
- },
179
- "departmentName": {
180
- "type": "string"
181
- }
182
- }
183
- }
184
- }
185
- }
@@ -5,7 +5,7 @@ import { fullFormats } from "ajv-formats/dist/formats.js";
5
5
  "use strict";
6
6
  export const validate = validate14;
7
7
  export default validate14;
8
- const schema16 = {"$id":"https://github.com/data-fair/lib/session-state","x-exports":["types","validate","schema"],"type":"object","title":"session state","additionalProperties":false,"properties":{"user":{"$ref":"#/$defs/user"},"organization":{"$ref":"#/$defs/organizationMembership"},"account":{"$ref":"#/$defs/account"},"accountRole":{"type":"string"},"lang":{"type":"string"},"dark":{"type":"boolean"}},"$defs":{"organizationMembership":{"type":"object","additionalProperties":false,"required":["id","name","role"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"},"dflt":{"type":"boolean"}}},"userRef":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"user":{"type":"object","additionalProperties":false,"required":["email","id","name","organizations"],"properties":{"email":{"type":"string","format":"email"},"id":{"type":"string"},"name":{"type":"string"},"organizations":{"type":"array","items":{"$ref":"#/$defs/organizationMembership"}},"isAdmin":{"type":"integer","enum":[0,1]},"adminMode":{"type":"integer","enum":[0,1]},"asAdmin":{"$ref":"#/$defs/userRef"},"pd":{"type":"string","format":"date"},"ipa":{"type":"integer","enum":[0,1]}}},"account":{"type":"object","additionalProperties":false,"required":["type","id","name"],"properties":{"type":{"type":"string","enum":["user","organization"]},"id":{"type":"string"},"name":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"}}}}};
8
+ const schema16 = {"$id":"https://github.com/data-fair/lib/session-state","x-exports":["types","validate"],"type":"object","title":"session state","additionalProperties":false,"properties":{"user":{"$ref":"#/$defs/user"},"organization":{"$ref":"#/$defs/organizationMembership"},"account":{"$ref":"#/$defs/account"},"accountRole":{"type":"string"},"lang":{"type":"string"},"dark":{"type":"boolean"}},"$defs":{"organizationMembership":{"type":"object","additionalProperties":false,"required":["id","name","role"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"},"dflt":{"type":"boolean"}}},"userRef":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"user":{"type":"object","additionalProperties":false,"required":["email","id","name","organizations"],"properties":{"email":{"type":"string","format":"email"},"id":{"type":"string"},"name":{"type":"string"},"organizations":{"type":"array","items":{"$ref":"#/$defs/organizationMembership"}},"isAdmin":{"type":"integer","enum":[0,1]},"adminMode":{"type":"integer","enum":[0,1]},"asAdmin":{"$ref":"#/$defs/userRef"},"pd":{"type":"string","format":"date"},"ipa":{"type":"integer","enum":[0,1]}}},"account":{"type":"object","additionalProperties":false,"required":["type","id","name"],"properties":{"type":{"type":"string","enum":["user","organization"]},"id":{"type":"string"},"name":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"}}}}};
9
9
  const schema18 = {"type":"object","additionalProperties":false,"required":["id","name","role"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"},"dflt":{"type":"boolean"}}};
10
10
  const schema21 = {"type":"object","additionalProperties":false,"required":["type","id","name"],"properties":{"type":{"type":"string","enum":["user","organization"]},"id":{"type":"string"},"name":{"type":"string"},"department":{"type":"string"},"departmentName":{"type":"string"}}};
11
11
  const schema17 = {"type":"object","additionalProperties":false,"required":["email","id","name","organizations"],"properties":{"email":{"type":"string","format":"email"},"id":{"type":"string"},"name":{"type":"string"},"organizations":{"type":"array","items":{"$ref":"#/$defs/organizationMembership"}},"isAdmin":{"type":"integer","enum":[0,1]},"adminMode":{"type":"integer","enum":[0,1]},"asAdmin":{"$ref":"#/$defs/userRef"},"pd":{"type":"string","format":"date"},"ipa":{"type":"integer","enum":[0,1]}}};
@@ -0,0 +1,133 @@
1
+ declare const _default: {
2
+ $id: string;
3
+ 'x-exports': string[];
4
+ type: string;
5
+ title: string;
6
+ additionalProperties: boolean;
7
+ properties: {
8
+ user: {
9
+ $ref: string;
10
+ };
11
+ organization: {
12
+ $ref: string;
13
+ };
14
+ account: {
15
+ $ref: string;
16
+ };
17
+ accountRole: {
18
+ type: string;
19
+ };
20
+ lang: {
21
+ type: string;
22
+ };
23
+ dark: {
24
+ type: string;
25
+ };
26
+ };
27
+ $defs: {
28
+ organizationMembership: {
29
+ type: string;
30
+ additionalProperties: boolean;
31
+ required: string[];
32
+ properties: {
33
+ id: {
34
+ type: string;
35
+ };
36
+ name: {
37
+ type: string;
38
+ };
39
+ role: {
40
+ type: string;
41
+ };
42
+ department: {
43
+ type: string;
44
+ };
45
+ departmentName: {
46
+ type: string;
47
+ };
48
+ dflt: {
49
+ type: string;
50
+ };
51
+ };
52
+ };
53
+ userRef: {
54
+ type: string;
55
+ additionalProperties: boolean;
56
+ required: string[];
57
+ properties: {
58
+ id: {
59
+ type: string;
60
+ };
61
+ name: {
62
+ type: string;
63
+ };
64
+ };
65
+ };
66
+ user: {
67
+ type: string;
68
+ additionalProperties: boolean;
69
+ required: string[];
70
+ properties: {
71
+ email: {
72
+ type: string;
73
+ format: string;
74
+ };
75
+ id: {
76
+ type: string;
77
+ };
78
+ name: {
79
+ type: string;
80
+ };
81
+ organizations: {
82
+ type: string;
83
+ items: {
84
+ $ref: string;
85
+ };
86
+ };
87
+ isAdmin: {
88
+ type: string;
89
+ enum: number[];
90
+ };
91
+ adminMode: {
92
+ type: string;
93
+ enum: number[];
94
+ };
95
+ asAdmin: {
96
+ $ref: string;
97
+ };
98
+ pd: {
99
+ type: string;
100
+ format: string;
101
+ };
102
+ ipa: {
103
+ type: string;
104
+ enum: number[];
105
+ };
106
+ };
107
+ };
108
+ account: {
109
+ type: string;
110
+ additionalProperties: boolean;
111
+ required: string[];
112
+ properties: {
113
+ type: {
114
+ type: string;
115
+ enum: string[];
116
+ };
117
+ id: {
118
+ type: string;
119
+ };
120
+ name: {
121
+ type: string;
122
+ };
123
+ department: {
124
+ type: string;
125
+ };
126
+ departmentName: {
127
+ type: string;
128
+ };
129
+ };
130
+ };
131
+ };
132
+ };
133
+ export default _default;
@@ -0,0 +1,157 @@
1
+ export default {
2
+ $id: 'https://github.com/data-fair/lib/session-state',
3
+ 'x-exports': ['types', 'validate'],
4
+ type: 'object',
5
+ title: 'session state',
6
+ additionalProperties: false,
7
+ properties: {
8
+ user: {
9
+ $ref: '#/$defs/user'
10
+ },
11
+ organization: {
12
+ $ref: '#/$defs/organizationMembership'
13
+ },
14
+ account: {
15
+ $ref: '#/$defs/account'
16
+ },
17
+ accountRole: {
18
+ type: 'string'
19
+ },
20
+ lang: {
21
+ type: 'string'
22
+ },
23
+ dark: {
24
+ type: 'boolean'
25
+ }
26
+ },
27
+ $defs: {
28
+ organizationMembership: {
29
+ type: 'object',
30
+ additionalProperties: false,
31
+ required: [
32
+ 'id',
33
+ 'name',
34
+ 'role'
35
+ ],
36
+ properties: {
37
+ id: {
38
+ type: 'string'
39
+ },
40
+ name: {
41
+ type: 'string'
42
+ },
43
+ role: {
44
+ type: 'string'
45
+ },
46
+ department: {
47
+ type: 'string'
48
+ },
49
+ departmentName: {
50
+ type: 'string'
51
+ },
52
+ dflt: {
53
+ type: 'boolean'
54
+ }
55
+ }
56
+ },
57
+ userRef: {
58
+ type: 'object',
59
+ additionalProperties: false,
60
+ required: [
61
+ 'id',
62
+ 'name'
63
+ ],
64
+ properties: {
65
+ id: {
66
+ type: 'string'
67
+ },
68
+ name: {
69
+ type: 'string'
70
+ }
71
+ }
72
+ },
73
+ user: {
74
+ type: 'object',
75
+ additionalProperties: false,
76
+ required: [
77
+ 'email',
78
+ 'id',
79
+ 'name',
80
+ 'organizations'
81
+ ],
82
+ properties: {
83
+ email: {
84
+ type: 'string',
85
+ format: 'email'
86
+ },
87
+ id: {
88
+ type: 'string'
89
+ },
90
+ name: {
91
+ type: 'string'
92
+ },
93
+ organizations: {
94
+ type: 'array',
95
+ items: {
96
+ $ref: '#/$defs/organizationMembership'
97
+ }
98
+ },
99
+ isAdmin: {
100
+ type: 'integer',
101
+ enum: [
102
+ 0,
103
+ 1
104
+ ]
105
+ },
106
+ adminMode: {
107
+ type: 'integer',
108
+ enum: [
109
+ 0,
110
+ 1
111
+ ]
112
+ },
113
+ asAdmin: {
114
+ $ref: '#/$defs/userRef'
115
+ },
116
+ pd: {
117
+ type: 'string',
118
+ format: 'date'
119
+ },
120
+ ipa: {
121
+ type: 'integer',
122
+ enum: [
123
+ 0,
124
+ 1
125
+ ]
126
+ }
127
+ }
128
+ },
129
+ account: {
130
+ type: 'object',
131
+ additionalProperties: false,
132
+ required: [
133
+ 'type',
134
+ 'id',
135
+ 'name'
136
+ ],
137
+ properties: {
138
+ type: {
139
+ type: 'string',
140
+ enum: ['user', 'organization']
141
+ },
142
+ id: {
143
+ type: 'string'
144
+ },
145
+ name: {
146
+ type: 'string'
147
+ },
148
+ department: {
149
+ type: 'string'
150
+ },
151
+ departmentName: {
152
+ type: 'string'
153
+ }
154
+ }
155
+ }
156
+ }
157
+ }
@@ -1,45 +0,0 @@
1
- {
2
- "$id": "https://github.com/data-fair/lib/account",
3
- "x-exports": ["types", "validate", "schema"],
4
- "type":"object",
5
- "title": "account",
6
- "required": ["type", "id", "name"],
7
- "properties":{
8
- "type":{
9
- "type":"string",
10
- "enum": ["user", "organization"]
11
- },
12
- "id":{
13
- "type":"string"
14
- },
15
- "name":{
16
- "type":"string"
17
- },
18
- "department":{
19
- "type":"string"
20
- },
21
- "departmentName":{
22
- "type":"string"
23
- }
24
- },
25
- "$defs": {
26
- "accountKeys": {
27
- "type": "object",
28
- "title": "account keys",
29
- "required": ["type", "id"],
30
- "additionalProperties": false,
31
- "properties": {
32
- "type":{
33
- "type":"string",
34
- "enum": ["user", "organization"]
35
- },
36
- "id": {
37
- "type": "string"
38
- },
39
- "department": {
40
- "type": "string"
41
- }
42
- }
43
- }
44
- }
45
- }
@@ -1,141 +0,0 @@
1
- {
2
- "$id": "https://github.com/data-fair/lib/application",
3
- "title": "Application",
4
- "x-exports": [
5
- "types",
6
- "schema"
7
- ],
8
- "type": "object",
9
- "required": [
10
- "id",
11
- "title",
12
- "exposedUrl",
13
- "href",
14
- "wsUrl",
15
- "owner",
16
- "configuration"
17
- ],
18
- "properties": {
19
- "id": {
20
- "type": "string",
21
- "description": "Globally unique identifier of the application"
22
- },
23
- "title": {
24
- "type": "string",
25
- "description": "Short title of the application"
26
- },
27
- "exposedUrl": {
28
- "type": "string",
29
- "description": "The URL where this application is exposed"
30
- },
31
- "href": {
32
- "type": "string",
33
- "description": "The URL where this resource can be fetched"
34
- },
35
- "wsUrl": {
36
- "type": "string",
37
- "description": "The URL where this application can be accessed through a websocket"
38
- },
39
- "owner": {
40
- "$ref": "https://github.com/data-fair/lib/account#/$defs/accountKeys"
41
- },
42
- "configuration": {
43
- "type": "object",
44
- "description": "A free format configuration object used by applications. A minimal common structure is used to ensure proper linking between applications and datasets and remote services",
45
- "additionalProperties": true,
46
- "properties": {
47
- "datasets": {
48
- "type": "array",
49
- "items": {
50
- "$ref": "#/$defs/dataset"
51
- }
52
- }
53
- }
54
- }
55
- },
56
- "$defs": {
57
- "dataset": {
58
- "type": [
59
- "object",
60
- "null"
61
- ],
62
- "required": [
63
- "href",
64
- "id",
65
- "title",
66
- "finalizedAt"
67
- ],
68
- "properties": {
69
- "href": {
70
- "type": "string"
71
- },
72
- "id": {
73
- "type": "string"
74
- },
75
- "title": {
76
- "type": "string"
77
- },
78
- "key": {
79
- "type": "string",
80
- "description": "Not the id of the dataset, but a key inside this configuration object to define the role of the dataset in this context."
81
- },
82
- "schema": {
83
- "type": "array",
84
- "items": {
85
- "$ref": "#/$defs/field"
86
- }
87
- },
88
- "finalizedAt": {
89
- "type": "string",
90
- "format": "date-time"
91
- }
92
- }
93
- },
94
- "field": {
95
- "type": "object",
96
- "required": [
97
- "key",
98
- "type"
99
- ],
100
- "properties": {
101
- "key": {
102
- "type": "string"
103
- },
104
- "type": {
105
- "type": "string"
106
- },
107
- "format": {
108
- "type": "string"
109
- },
110
- "title": {
111
- "type": "string"
112
- },
113
- "x-originalName": {
114
- "type": "string"
115
- },
116
- "x-group": { "type": "string" },
117
- "x-refersTo": {
118
- "deprecated": true,
119
- "type": ["string", "null"]
120
- },
121
- "x-concept": {
122
- "type": "object",
123
- "properties": {
124
- "id": { "type": "string" },
125
- "title": { "type": "string" },
126
- "primary": { "type": "boolean" }
127
- }
128
- },
129
- "x-labels": {
130
- "type": "object",
131
- "additionalProperties": {
132
- "type": "string"
133
- }
134
- },
135
- "x-labelsRestricted": {
136
- "type": "boolean"
137
- }
138
- }
139
- }
140
- }
141
- }