@data-fair/lib-common-types 1.19.6 → 1.19.8
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.
|
@@ -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/notification","x-exports":["types","validate"],"title":"Notification","type":"object","additionalProperties":false,"required":["title","topic","
|
|
8
|
+
const schema16 = {"$id":"https://github.com/data-fair/lib/notification","x-exports":["types","validate"],"title":"Notification","type":"object","additionalProperties":false,"required":["title","topic","recipient","date"],"properties":{"_id":{"type":"string","title":"Globally unique id"},"eventId":{"type":"string","title":"Globally unique id of the event source of this notification"},"origin":{"type":"string","title":"Site d'origine de la souscription","readOnly":true},"title":{"type":"string","title":"Titre"},"body":{"type":"string","title":"Contenu"},"htmlBody":{"type":"string","title":"Contenu HTML"},"locale":{"type":"string","title":"Langue de la notification","enum":["fr","en"]},"icon":{"type":"string","title":"URL de l'icone de la notification"},"sender":{"$ref":"https://github.com/data-fair/lib/event#/$defs/sender"},"topic":{"$ref":"https://github.com/data-fair/lib/event#/$defs/topicRef"},"recipient":{"type":"object","required":["id"],"properties":{"id":{"type":"string","description":"The unique id of the user"},"name":{"type":"string","description":"The display name of the user"}}},"outputs":{"type":"array","title":"Sorties","items":{"type":"string","oneOf":[{"const":"devices","title":"recevoir la notification sur vos appareils configurés"},{"const":"email","title":"recevoir la notification par email"}]}},"url":{"type":"string","title":"défini explicitement ou calculé à partir de subscription.urlTemplate et event.urlParams"},"date":{"type":"string","description":"reception date","format":"date-time"},"new":{"readOnly":true,"type":"boolean"},"extra":{"type":"object","description":"propriétés libres qui varient en fonction du type de notification"}}};
|
|
9
9
|
const schema18 = {"type":"object","title":"Emitter","additionalProperties":false,"required":["type","id"],"properties":{"type":{"type":"string","enum":["user","organization"],"title":"Type"},"id":{"type":"string","description":"The unique id of the user or organization"},"name":{"type":"string","description":"The display name of the user or organization"},"role":{"type":"string","description":"If this is set and owner is an organization, this restrict ownership to users of this organization having this role or admin role"},"department":{"type":"string","description":"If this is set and owner is an organization, this gives ownership to users of this organization that belong to this department"},"departmentName":{"type":"string","description":"The display name of the department"}}};
|
|
10
10
|
const schema19 = {"type":"object","additionalProperties":false,"required":["key"],"properties":{"key":{"type":"string","title":"Topic key"},"title":{"type":"string","title":"Topic title"}}};
|
|
11
11
|
const func2 = Object.prototype.hasOwnProperty;
|
|
@@ -36,8 +36,8 @@ vErrors.push(err1);
|
|
|
36
36
|
}
|
|
37
37
|
errors++;
|
|
38
38
|
}
|
|
39
|
-
if(data.
|
|
40
|
-
const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "
|
|
39
|
+
if(data.recipient === undefined){
|
|
40
|
+
const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "recipient"},message:"must have required property '"+"recipient"+"'"};
|
|
41
41
|
if(vErrors === null){
|
|
42
42
|
vErrors = [err2];
|
|
43
43
|
}
|
|
@@ -46,8 +46,8 @@ vErrors.push(err2);
|
|
|
46
46
|
}
|
|
47
47
|
errors++;
|
|
48
48
|
}
|
|
49
|
-
if(data.
|
|
50
|
-
const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "
|
|
49
|
+
if(data.date === undefined){
|
|
50
|
+
const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "date"},message:"must have required property '"+"date"+"'"};
|
|
51
51
|
if(vErrors === null){
|
|
52
52
|
vErrors = [err3];
|
|
53
53
|
}
|
|
@@ -56,96 +56,86 @@ vErrors.push(err3);
|
|
|
56
56
|
}
|
|
57
57
|
errors++;
|
|
58
58
|
}
|
|
59
|
-
if(data.date === undefined){
|
|
60
|
-
const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "date"},message:"must have required property '"+"date"+"'"};
|
|
61
|
-
if(vErrors === null){
|
|
62
|
-
vErrors = [err4];
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
vErrors.push(err4);
|
|
66
|
-
}
|
|
67
|
-
errors++;
|
|
68
|
-
}
|
|
69
59
|
for(const key0 in data){
|
|
70
60
|
if(!(func2.call(schema16.properties, key0))){
|
|
71
|
-
const
|
|
61
|
+
const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};
|
|
72
62
|
if(vErrors === null){
|
|
73
|
-
vErrors = [
|
|
63
|
+
vErrors = [err4];
|
|
74
64
|
}
|
|
75
65
|
else {
|
|
76
|
-
vErrors.push(
|
|
66
|
+
vErrors.push(err4);
|
|
77
67
|
}
|
|
78
68
|
errors++;
|
|
79
69
|
}
|
|
80
70
|
}
|
|
81
71
|
if(data._id !== undefined){
|
|
82
72
|
if(typeof data._id !== "string"){
|
|
83
|
-
const
|
|
73
|
+
const err5 = {instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
84
74
|
if(vErrors === null){
|
|
85
|
-
vErrors = [
|
|
75
|
+
vErrors = [err5];
|
|
86
76
|
}
|
|
87
77
|
else {
|
|
88
|
-
vErrors.push(
|
|
78
|
+
vErrors.push(err5);
|
|
89
79
|
}
|
|
90
80
|
errors++;
|
|
91
81
|
}
|
|
92
82
|
}
|
|
93
83
|
if(data.eventId !== undefined){
|
|
94
84
|
if(typeof data.eventId !== "string"){
|
|
95
|
-
const
|
|
85
|
+
const err6 = {instancePath:instancePath+"/eventId",schemaPath:"#/properties/eventId/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
96
86
|
if(vErrors === null){
|
|
97
|
-
vErrors = [
|
|
87
|
+
vErrors = [err6];
|
|
98
88
|
}
|
|
99
89
|
else {
|
|
100
|
-
vErrors.push(
|
|
90
|
+
vErrors.push(err6);
|
|
101
91
|
}
|
|
102
92
|
errors++;
|
|
103
93
|
}
|
|
104
94
|
}
|
|
105
95
|
if(data.origin !== undefined){
|
|
106
96
|
if(typeof data.origin !== "string"){
|
|
107
|
-
const
|
|
97
|
+
const err7 = {instancePath:instancePath+"/origin",schemaPath:"#/properties/origin/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
108
98
|
if(vErrors === null){
|
|
109
|
-
vErrors = [
|
|
99
|
+
vErrors = [err7];
|
|
110
100
|
}
|
|
111
101
|
else {
|
|
112
|
-
vErrors.push(
|
|
102
|
+
vErrors.push(err7);
|
|
113
103
|
}
|
|
114
104
|
errors++;
|
|
115
105
|
}
|
|
116
106
|
}
|
|
117
107
|
if(data.title !== undefined){
|
|
118
108
|
if(typeof data.title !== "string"){
|
|
119
|
-
const
|
|
109
|
+
const err8 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
120
110
|
if(vErrors === null){
|
|
121
|
-
vErrors = [
|
|
111
|
+
vErrors = [err8];
|
|
122
112
|
}
|
|
123
113
|
else {
|
|
124
|
-
vErrors.push(
|
|
114
|
+
vErrors.push(err8);
|
|
125
115
|
}
|
|
126
116
|
errors++;
|
|
127
117
|
}
|
|
128
118
|
}
|
|
129
119
|
if(data.body !== undefined){
|
|
130
120
|
if(typeof data.body !== "string"){
|
|
131
|
-
const
|
|
121
|
+
const err9 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
132
122
|
if(vErrors === null){
|
|
133
|
-
vErrors = [
|
|
123
|
+
vErrors = [err9];
|
|
134
124
|
}
|
|
135
125
|
else {
|
|
136
|
-
vErrors.push(
|
|
126
|
+
vErrors.push(err9);
|
|
137
127
|
}
|
|
138
128
|
errors++;
|
|
139
129
|
}
|
|
140
130
|
}
|
|
141
131
|
if(data.htmlBody !== undefined){
|
|
142
132
|
if(typeof data.htmlBody !== "string"){
|
|
143
|
-
const
|
|
133
|
+
const err10 = {instancePath:instancePath+"/htmlBody",schemaPath:"#/properties/htmlBody/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
144
134
|
if(vErrors === null){
|
|
145
|
-
vErrors = [
|
|
135
|
+
vErrors = [err10];
|
|
146
136
|
}
|
|
147
137
|
else {
|
|
148
|
-
vErrors.push(
|
|
138
|
+
vErrors.push(err10);
|
|
149
139
|
}
|
|
150
140
|
errors++;
|
|
151
141
|
}
|
|
@@ -153,34 +143,34 @@ errors++;
|
|
|
153
143
|
if(data.locale !== undefined){
|
|
154
144
|
let data6 = data.locale;
|
|
155
145
|
if(typeof data6 !== "string"){
|
|
156
|
-
const
|
|
146
|
+
const err11 = {instancePath:instancePath+"/locale",schemaPath:"#/properties/locale/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
157
147
|
if(vErrors === null){
|
|
158
|
-
vErrors = [
|
|
148
|
+
vErrors = [err11];
|
|
159
149
|
}
|
|
160
150
|
else {
|
|
161
|
-
vErrors.push(
|
|
151
|
+
vErrors.push(err11);
|
|
162
152
|
}
|
|
163
153
|
errors++;
|
|
164
154
|
}
|
|
165
155
|
if(!((data6 === "fr") || (data6 === "en"))){
|
|
166
|
-
const
|
|
156
|
+
const err12 = {instancePath:instancePath+"/locale",schemaPath:"#/properties/locale/enum",keyword:"enum",params:{allowedValues: schema16.properties.locale.enum},message:"must be equal to one of the allowed values"};
|
|
167
157
|
if(vErrors === null){
|
|
168
|
-
vErrors = [
|
|
158
|
+
vErrors = [err12];
|
|
169
159
|
}
|
|
170
160
|
else {
|
|
171
|
-
vErrors.push(
|
|
161
|
+
vErrors.push(err12);
|
|
172
162
|
}
|
|
173
163
|
errors++;
|
|
174
164
|
}
|
|
175
165
|
}
|
|
176
166
|
if(data.icon !== undefined){
|
|
177
167
|
if(typeof data.icon !== "string"){
|
|
178
|
-
const
|
|
168
|
+
const err13 = {instancePath:instancePath+"/icon",schemaPath:"#/properties/icon/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
179
169
|
if(vErrors === null){
|
|
180
|
-
vErrors = [
|
|
170
|
+
vErrors = [err13];
|
|
181
171
|
}
|
|
182
172
|
else {
|
|
183
|
-
vErrors.push(
|
|
173
|
+
vErrors.push(err13);
|
|
184
174
|
}
|
|
185
175
|
errors++;
|
|
186
176
|
}
|
|
@@ -189,33 +179,33 @@ if(data.sender !== undefined){
|
|
|
189
179
|
let data8 = data.sender;
|
|
190
180
|
if(data8 && typeof data8 == "object" && !Array.isArray(data8)){
|
|
191
181
|
if(data8.type === undefined){
|
|
192
|
-
const
|
|
182
|
+
const err14 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};
|
|
193
183
|
if(vErrors === null){
|
|
194
|
-
vErrors = [
|
|
184
|
+
vErrors = [err14];
|
|
195
185
|
}
|
|
196
186
|
else {
|
|
197
|
-
vErrors.push(
|
|
187
|
+
vErrors.push(err14);
|
|
198
188
|
}
|
|
199
189
|
errors++;
|
|
200
190
|
}
|
|
201
191
|
if(data8.id === undefined){
|
|
202
|
-
const
|
|
192
|
+
const err15 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};
|
|
203
193
|
if(vErrors === null){
|
|
204
|
-
vErrors = [
|
|
194
|
+
vErrors = [err15];
|
|
205
195
|
}
|
|
206
196
|
else {
|
|
207
|
-
vErrors.push(
|
|
197
|
+
vErrors.push(err15);
|
|
208
198
|
}
|
|
209
199
|
errors++;
|
|
210
200
|
}
|
|
211
201
|
for(const key1 in data8){
|
|
212
202
|
if(!((((((key1 === "type") || (key1 === "id")) || (key1 === "name")) || (key1 === "role")) || (key1 === "department")) || (key1 === "departmentName"))){
|
|
213
|
-
const
|
|
203
|
+
const err16 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};
|
|
214
204
|
if(vErrors === null){
|
|
215
|
-
vErrors = [
|
|
205
|
+
vErrors = [err16];
|
|
216
206
|
}
|
|
217
207
|
else {
|
|
218
|
-
vErrors.push(
|
|
208
|
+
vErrors.push(err16);
|
|
219
209
|
}
|
|
220
210
|
errors++;
|
|
221
211
|
}
|
|
@@ -223,94 +213,94 @@ errors++;
|
|
|
223
213
|
if(data8.type !== undefined){
|
|
224
214
|
let data9 = data8.type;
|
|
225
215
|
if(typeof data9 !== "string"){
|
|
226
|
-
const
|
|
216
|
+
const err17 = {instancePath:instancePath+"/sender/type",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
227
217
|
if(vErrors === null){
|
|
228
|
-
vErrors = [
|
|
218
|
+
vErrors = [err17];
|
|
229
219
|
}
|
|
230
220
|
else {
|
|
231
|
-
vErrors.push(
|
|
221
|
+
vErrors.push(err17);
|
|
232
222
|
}
|
|
233
223
|
errors++;
|
|
234
224
|
}
|
|
235
225
|
if(!((data9 === "user") || (data9 === "organization"))){
|
|
236
|
-
const
|
|
226
|
+
const err18 = {instancePath:instancePath+"/sender/type",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/type/enum",keyword:"enum",params:{allowedValues: schema18.properties.type.enum},message:"must be equal to one of the allowed values"};
|
|
237
227
|
if(vErrors === null){
|
|
238
|
-
vErrors = [
|
|
228
|
+
vErrors = [err18];
|
|
239
229
|
}
|
|
240
230
|
else {
|
|
241
|
-
vErrors.push(
|
|
231
|
+
vErrors.push(err18);
|
|
242
232
|
}
|
|
243
233
|
errors++;
|
|
244
234
|
}
|
|
245
235
|
}
|
|
246
236
|
if(data8.id !== undefined){
|
|
247
237
|
if(typeof data8.id !== "string"){
|
|
248
|
-
const
|
|
238
|
+
const err19 = {instancePath:instancePath+"/sender/id",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
249
239
|
if(vErrors === null){
|
|
250
|
-
vErrors = [
|
|
240
|
+
vErrors = [err19];
|
|
251
241
|
}
|
|
252
242
|
else {
|
|
253
|
-
vErrors.push(
|
|
243
|
+
vErrors.push(err19);
|
|
254
244
|
}
|
|
255
245
|
errors++;
|
|
256
246
|
}
|
|
257
247
|
}
|
|
258
248
|
if(data8.name !== undefined){
|
|
259
249
|
if(typeof data8.name !== "string"){
|
|
260
|
-
const
|
|
250
|
+
const err20 = {instancePath:instancePath+"/sender/name",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
261
251
|
if(vErrors === null){
|
|
262
|
-
vErrors = [
|
|
252
|
+
vErrors = [err20];
|
|
263
253
|
}
|
|
264
254
|
else {
|
|
265
|
-
vErrors.push(
|
|
255
|
+
vErrors.push(err20);
|
|
266
256
|
}
|
|
267
257
|
errors++;
|
|
268
258
|
}
|
|
269
259
|
}
|
|
270
260
|
if(data8.role !== undefined){
|
|
271
261
|
if(typeof data8.role !== "string"){
|
|
272
|
-
const
|
|
262
|
+
const err21 = {instancePath:instancePath+"/sender/role",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/role/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
273
263
|
if(vErrors === null){
|
|
274
|
-
vErrors = [
|
|
264
|
+
vErrors = [err21];
|
|
275
265
|
}
|
|
276
266
|
else {
|
|
277
|
-
vErrors.push(
|
|
267
|
+
vErrors.push(err21);
|
|
278
268
|
}
|
|
279
269
|
errors++;
|
|
280
270
|
}
|
|
281
271
|
}
|
|
282
272
|
if(data8.department !== undefined){
|
|
283
273
|
if(typeof data8.department !== "string"){
|
|
284
|
-
const
|
|
274
|
+
const err22 = {instancePath:instancePath+"/sender/department",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/department/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
285
275
|
if(vErrors === null){
|
|
286
|
-
vErrors = [
|
|
276
|
+
vErrors = [err22];
|
|
287
277
|
}
|
|
288
278
|
else {
|
|
289
|
-
vErrors.push(
|
|
279
|
+
vErrors.push(err22);
|
|
290
280
|
}
|
|
291
281
|
errors++;
|
|
292
282
|
}
|
|
293
283
|
}
|
|
294
284
|
if(data8.departmentName !== undefined){
|
|
295
285
|
if(typeof data8.departmentName !== "string"){
|
|
296
|
-
const
|
|
286
|
+
const err23 = {instancePath:instancePath+"/sender/departmentName",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/properties/departmentName/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
297
287
|
if(vErrors === null){
|
|
298
|
-
vErrors = [
|
|
288
|
+
vErrors = [err23];
|
|
299
289
|
}
|
|
300
290
|
else {
|
|
301
|
-
vErrors.push(
|
|
291
|
+
vErrors.push(err23);
|
|
302
292
|
}
|
|
303
293
|
errors++;
|
|
304
294
|
}
|
|
305
295
|
}
|
|
306
296
|
}
|
|
307
297
|
else {
|
|
308
|
-
const
|
|
298
|
+
const err24 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
309
299
|
if(vErrors === null){
|
|
310
|
-
vErrors = [
|
|
300
|
+
vErrors = [err24];
|
|
311
301
|
}
|
|
312
302
|
else {
|
|
313
|
-
vErrors.push(
|
|
303
|
+
vErrors.push(err24);
|
|
314
304
|
}
|
|
315
305
|
errors++;
|
|
316
306
|
}
|
|
@@ -319,59 +309,59 @@ if(data.topic !== undefined){
|
|
|
319
309
|
let data15 = data.topic;
|
|
320
310
|
if(data15 && typeof data15 == "object" && !Array.isArray(data15)){
|
|
321
311
|
if(data15.key === undefined){
|
|
322
|
-
const
|
|
312
|
+
const err25 = {instancePath:instancePath+"/topic",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/required",keyword:"required",params:{missingProperty: "key"},message:"must have required property '"+"key"+"'"};
|
|
323
313
|
if(vErrors === null){
|
|
324
|
-
vErrors = [
|
|
314
|
+
vErrors = [err25];
|
|
325
315
|
}
|
|
326
316
|
else {
|
|
327
|
-
vErrors.push(
|
|
317
|
+
vErrors.push(err25);
|
|
328
318
|
}
|
|
329
319
|
errors++;
|
|
330
320
|
}
|
|
331
321
|
for(const key2 in data15){
|
|
332
322
|
if(!((key2 === "key") || (key2 === "title"))){
|
|
333
|
-
const
|
|
323
|
+
const err26 = {instancePath:instancePath+"/topic",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};
|
|
334
324
|
if(vErrors === null){
|
|
335
|
-
vErrors = [
|
|
325
|
+
vErrors = [err26];
|
|
336
326
|
}
|
|
337
327
|
else {
|
|
338
|
-
vErrors.push(
|
|
328
|
+
vErrors.push(err26);
|
|
339
329
|
}
|
|
340
330
|
errors++;
|
|
341
331
|
}
|
|
342
332
|
}
|
|
343
333
|
if(data15.key !== undefined){
|
|
344
334
|
if(typeof data15.key !== "string"){
|
|
345
|
-
const
|
|
335
|
+
const err27 = {instancePath:instancePath+"/topic/key",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/properties/key/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
346
336
|
if(vErrors === null){
|
|
347
|
-
vErrors = [
|
|
337
|
+
vErrors = [err27];
|
|
348
338
|
}
|
|
349
339
|
else {
|
|
350
|
-
vErrors.push(
|
|
340
|
+
vErrors.push(err27);
|
|
351
341
|
}
|
|
352
342
|
errors++;
|
|
353
343
|
}
|
|
354
344
|
}
|
|
355
345
|
if(data15.title !== undefined){
|
|
356
346
|
if(typeof data15.title !== "string"){
|
|
357
|
-
const
|
|
347
|
+
const err28 = {instancePath:instancePath+"/topic/title",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
358
348
|
if(vErrors === null){
|
|
359
|
-
vErrors = [
|
|
349
|
+
vErrors = [err28];
|
|
360
350
|
}
|
|
361
351
|
else {
|
|
362
|
-
vErrors.push(
|
|
352
|
+
vErrors.push(err28);
|
|
363
353
|
}
|
|
364
354
|
errors++;
|
|
365
355
|
}
|
|
366
356
|
}
|
|
367
357
|
}
|
|
368
358
|
else {
|
|
369
|
-
const
|
|
359
|
+
const err29 = {instancePath:instancePath+"/topic",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
370
360
|
if(vErrors === null){
|
|
371
|
-
vErrors = [
|
|
361
|
+
vErrors = [err29];
|
|
372
362
|
}
|
|
373
363
|
else {
|
|
374
|
-
vErrors.push(
|
|
364
|
+
vErrors.push(err29);
|
|
375
365
|
}
|
|
376
366
|
errors++;
|
|
377
367
|
}
|
|
@@ -380,47 +370,47 @@ if(data.recipient !== undefined){
|
|
|
380
370
|
let data18 = data.recipient;
|
|
381
371
|
if(data18 && typeof data18 == "object" && !Array.isArray(data18)){
|
|
382
372
|
if(data18.id === undefined){
|
|
383
|
-
const
|
|
373
|
+
const err30 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};
|
|
384
374
|
if(vErrors === null){
|
|
385
|
-
vErrors = [
|
|
375
|
+
vErrors = [err30];
|
|
386
376
|
}
|
|
387
377
|
else {
|
|
388
|
-
vErrors.push(
|
|
378
|
+
vErrors.push(err30);
|
|
389
379
|
}
|
|
390
380
|
errors++;
|
|
391
381
|
}
|
|
392
382
|
if(data18.id !== undefined){
|
|
393
383
|
if(typeof data18.id !== "string"){
|
|
394
|
-
const
|
|
384
|
+
const err31 = {instancePath:instancePath+"/recipient/id",schemaPath:"#/properties/recipient/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
395
385
|
if(vErrors === null){
|
|
396
|
-
vErrors = [
|
|
386
|
+
vErrors = [err31];
|
|
397
387
|
}
|
|
398
388
|
else {
|
|
399
|
-
vErrors.push(
|
|
389
|
+
vErrors.push(err31);
|
|
400
390
|
}
|
|
401
391
|
errors++;
|
|
402
392
|
}
|
|
403
393
|
}
|
|
404
394
|
if(data18.name !== undefined){
|
|
405
395
|
if(typeof data18.name !== "string"){
|
|
406
|
-
const
|
|
396
|
+
const err32 = {instancePath:instancePath+"/recipient/name",schemaPath:"#/properties/recipient/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
407
397
|
if(vErrors === null){
|
|
408
|
-
vErrors = [
|
|
398
|
+
vErrors = [err32];
|
|
409
399
|
}
|
|
410
400
|
else {
|
|
411
|
-
vErrors.push(
|
|
401
|
+
vErrors.push(err32);
|
|
412
402
|
}
|
|
413
403
|
errors++;
|
|
414
404
|
}
|
|
415
405
|
}
|
|
416
406
|
}
|
|
417
407
|
else {
|
|
418
|
-
const
|
|
408
|
+
const err33 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
419
409
|
if(vErrors === null){
|
|
420
|
-
vErrors = [
|
|
410
|
+
vErrors = [err33];
|
|
421
411
|
}
|
|
422
412
|
else {
|
|
423
|
-
vErrors.push(
|
|
413
|
+
vErrors.push(err33);
|
|
424
414
|
}
|
|
425
415
|
errors++;
|
|
426
416
|
}
|
|
@@ -432,12 +422,12 @@ const len0 = data21.length;
|
|
|
432
422
|
for(let i0=0; i0<len0; i0++){
|
|
433
423
|
let data22 = data21[i0];
|
|
434
424
|
if(typeof data22 !== "string"){
|
|
435
|
-
const
|
|
425
|
+
const err34 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
436
426
|
if(vErrors === null){
|
|
437
|
-
vErrors = [
|
|
427
|
+
vErrors = [err34];
|
|
438
428
|
}
|
|
439
429
|
else {
|
|
440
|
-
vErrors.push(
|
|
430
|
+
vErrors.push(err34);
|
|
441
431
|
}
|
|
442
432
|
errors++;
|
|
443
433
|
}
|
|
@@ -446,12 +436,12 @@ let valid8 = false;
|
|
|
446
436
|
let passing0 = null;
|
|
447
437
|
const _errs53 = errors;
|
|
448
438
|
if("devices" !== data22){
|
|
449
|
-
const
|
|
439
|
+
const err35 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf/0/const",keyword:"const",params:{allowedValue: "devices"},message:"must be equal to constant"};
|
|
450
440
|
if(vErrors === null){
|
|
451
|
-
vErrors = [
|
|
441
|
+
vErrors = [err35];
|
|
452
442
|
}
|
|
453
443
|
else {
|
|
454
|
-
vErrors.push(
|
|
444
|
+
vErrors.push(err35);
|
|
455
445
|
}
|
|
456
446
|
errors++;
|
|
457
447
|
}
|
|
@@ -462,12 +452,12 @@ passing0 = 0;
|
|
|
462
452
|
}
|
|
463
453
|
const _errs54 = errors;
|
|
464
454
|
if("email" !== data22){
|
|
465
|
-
const
|
|
455
|
+
const err36 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf/1/const",keyword:"const",params:{allowedValue: "email"},message:"must be equal to constant"};
|
|
466
456
|
if(vErrors === null){
|
|
467
|
-
vErrors = [
|
|
457
|
+
vErrors = [err36];
|
|
468
458
|
}
|
|
469
459
|
else {
|
|
470
|
-
vErrors.push(
|
|
460
|
+
vErrors.push(err36);
|
|
471
461
|
}
|
|
472
462
|
errors++;
|
|
473
463
|
}
|
|
@@ -483,12 +473,12 @@ passing0 = 1;
|
|
|
483
473
|
}
|
|
484
474
|
}
|
|
485
475
|
if(!valid8){
|
|
486
|
-
const
|
|
476
|
+
const err37 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};
|
|
487
477
|
if(vErrors === null){
|
|
488
|
-
vErrors = [
|
|
478
|
+
vErrors = [err37];
|
|
489
479
|
}
|
|
490
480
|
else {
|
|
491
|
-
vErrors.push(
|
|
481
|
+
vErrors.push(err37);
|
|
492
482
|
}
|
|
493
483
|
errors++;
|
|
494
484
|
}
|
|
@@ -506,24 +496,24 @@ vErrors = null;
|
|
|
506
496
|
}
|
|
507
497
|
}
|
|
508
498
|
else {
|
|
509
|
-
const
|
|
499
|
+
const err38 = {instancePath:instancePath+"/outputs",schemaPath:"#/properties/outputs/type",keyword:"type",params:{type: "array"},message:"must be array"};
|
|
510
500
|
if(vErrors === null){
|
|
511
|
-
vErrors = [
|
|
501
|
+
vErrors = [err38];
|
|
512
502
|
}
|
|
513
503
|
else {
|
|
514
|
-
vErrors.push(
|
|
504
|
+
vErrors.push(err38);
|
|
515
505
|
}
|
|
516
506
|
errors++;
|
|
517
507
|
}
|
|
518
508
|
}
|
|
519
509
|
if(data.url !== undefined){
|
|
520
510
|
if(typeof data.url !== "string"){
|
|
521
|
-
const
|
|
511
|
+
const err39 = {instancePath:instancePath+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
522
512
|
if(vErrors === null){
|
|
523
|
-
vErrors = [
|
|
513
|
+
vErrors = [err39];
|
|
524
514
|
}
|
|
525
515
|
else {
|
|
526
|
-
vErrors.push(
|
|
516
|
+
vErrors.push(err39);
|
|
527
517
|
}
|
|
528
518
|
errors++;
|
|
529
519
|
}
|
|
@@ -532,35 +522,35 @@ if(data.date !== undefined){
|
|
|
532
522
|
let data24 = data.date;
|
|
533
523
|
if(typeof data24 === "string"){
|
|
534
524
|
if(!(formats0.validate(data24))){
|
|
535
|
-
const
|
|
525
|
+
const err40 = {instancePath:instancePath+"/date",schemaPath:"#/properties/date/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};
|
|
536
526
|
if(vErrors === null){
|
|
537
|
-
vErrors = [
|
|
527
|
+
vErrors = [err40];
|
|
538
528
|
}
|
|
539
529
|
else {
|
|
540
|
-
vErrors.push(
|
|
530
|
+
vErrors.push(err40);
|
|
541
531
|
}
|
|
542
532
|
errors++;
|
|
543
533
|
}
|
|
544
534
|
}
|
|
545
535
|
else {
|
|
546
|
-
const
|
|
536
|
+
const err41 = {instancePath:instancePath+"/date",schemaPath:"#/properties/date/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
547
537
|
if(vErrors === null){
|
|
548
|
-
vErrors = [
|
|
538
|
+
vErrors = [err41];
|
|
549
539
|
}
|
|
550
540
|
else {
|
|
551
|
-
vErrors.push(
|
|
541
|
+
vErrors.push(err41);
|
|
552
542
|
}
|
|
553
543
|
errors++;
|
|
554
544
|
}
|
|
555
545
|
}
|
|
556
546
|
if(data.new !== undefined){
|
|
557
547
|
if(typeof data.new !== "boolean"){
|
|
558
|
-
const
|
|
548
|
+
const err42 = {instancePath:instancePath+"/new",schemaPath:"#/properties/new/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
|
|
559
549
|
if(vErrors === null){
|
|
560
|
-
vErrors = [
|
|
550
|
+
vErrors = [err42];
|
|
561
551
|
}
|
|
562
552
|
else {
|
|
563
|
-
vErrors.push(
|
|
553
|
+
vErrors.push(err42);
|
|
564
554
|
}
|
|
565
555
|
errors++;
|
|
566
556
|
}
|
|
@@ -568,24 +558,24 @@ errors++;
|
|
|
568
558
|
if(data.extra !== undefined){
|
|
569
559
|
let data26 = data.extra;
|
|
570
560
|
if(!(data26 && typeof data26 == "object" && !Array.isArray(data26))){
|
|
571
|
-
const
|
|
561
|
+
const err43 = {instancePath:instancePath+"/extra",schemaPath:"#/properties/extra/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
572
562
|
if(vErrors === null){
|
|
573
|
-
vErrors = [
|
|
563
|
+
vErrors = [err43];
|
|
574
564
|
}
|
|
575
565
|
else {
|
|
576
|
-
vErrors.push(
|
|
566
|
+
vErrors.push(err43);
|
|
577
567
|
}
|
|
578
568
|
errors++;
|
|
579
569
|
}
|
|
580
570
|
}
|
|
581
571
|
}
|
|
582
572
|
else {
|
|
583
|
-
const
|
|
573
|
+
const err44 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
584
574
|
if(vErrors === null){
|
|
585
|
-
vErrors = [
|
|
575
|
+
vErrors = [err44];
|
|
586
576
|
}
|
|
587
577
|
else {
|
|
588
|
-
vErrors.push(
|
|
578
|
+
vErrors.push(err44);
|
|
589
579
|
}
|
|
590
580
|
errors++;
|
|
591
581
|
}
|
package/notification/schema.d.ts
CHANGED
package/notification/schema.js
CHANGED
|
@@ -4,7 +4,7 @@ export default {
|
|
|
4
4
|
title: 'Notification',
|
|
5
5
|
type: 'object',
|
|
6
6
|
additionalProperties: false,
|
|
7
|
-
required: ['title', 'topic', '
|
|
7
|
+
required: ['title', 'topic', 'recipient', 'date'],
|
|
8
8
|
properties: {
|
|
9
9
|
_id: {
|
|
10
10
|
type: 'string',
|
|
@@ -40,13 +40,12 @@ export default {
|
|
|
40
40
|
type: 'string',
|
|
41
41
|
title: 'URL de l\'icone de la notification'
|
|
42
42
|
},
|
|
43
|
-
// sender is the owner of the topic
|
|
43
|
+
// sender is the owner of the topic, topic is global if no sender is given
|
|
44
44
|
sender: { $ref: 'https://github.com/data-fair/lib/event#/$defs/sender' },
|
|
45
45
|
topic: { $ref: 'https://github.com/data-fair/lib/event#/$defs/topicRef' },
|
|
46
46
|
recipient: {
|
|
47
47
|
type: 'object',
|
|
48
48
|
required: ['id'],
|
|
49
|
-
readOnly: true,
|
|
50
49
|
properties: {
|
|
51
50
|
id: {
|
|
52
51
|
type: 'string',
|