@data-fair/lib-common-types 1.19.5 → 1.19.6
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.
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
export const schemaExports: string[]
|
|
3
3
|
|
|
4
4
|
// see https://github.com/bcherny/json-schema-to-typescript/issues/439 if some types are not exported
|
|
5
|
+
export type GloballyUniqueId = string;
|
|
5
6
|
export type GloballyUniqueIdOfTheEventSourceOfThisNotification = string;
|
|
6
7
|
export type SiteDOrigineDeLaSouscription = string;
|
|
7
8
|
export type Titre = string;
|
|
@@ -15,9 +16,10 @@ export type TopicTitle = string;
|
|
|
15
16
|
export type RecevoirLaNotificationSurVosAppareilsConfigures = "devices";
|
|
16
17
|
export type RecevoirLaNotificationParEmail = "email";
|
|
17
18
|
export type Sorties = ((RecevoirLaNotificationSurVosAppareilsConfigures | RecevoirLaNotificationParEmail) & string)[];
|
|
18
|
-
export type
|
|
19
|
+
export type DefiniExplicitementOuCalculeAPartirDeSubscriptionUrlTemplateEtEventUrlParams = string;
|
|
19
20
|
|
|
20
21
|
export type Notification = {
|
|
22
|
+
_id?: GloballyUniqueId;
|
|
21
23
|
eventId?: GloballyUniqueIdOfTheEventSourceOfThisNotification;
|
|
22
24
|
origin?: SiteDOrigineDeLaSouscription;
|
|
23
25
|
title: Titre;
|
|
@@ -39,7 +41,7 @@ export type Notification = {
|
|
|
39
41
|
[k: string]: unknown;
|
|
40
42
|
};
|
|
41
43
|
outputs?: Sorties;
|
|
42
|
-
url?:
|
|
44
|
+
url?: DefiniExplicitementOuCalculeAPartirDeSubscriptionUrlTemplateEtEventUrlParams;
|
|
43
45
|
/**
|
|
44
46
|
* reception date
|
|
45
47
|
*/
|
|
@@ -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","sender","recipient","date"],"properties":{"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"],"readOnly":true,"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":"calculé à partir de subscription.urlTemplate et event.urlParams"
|
|
8
|
+
const schema16 = {"$id":"https://github.com/data-fair/lib/notification","x-exports":["types","validate"],"title":"Notification","type":"object","additionalProperties":false,"required":["title","topic","sender","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"],"readOnly":true,"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;
|
|
@@ -78,9 +78,9 @@ vErrors.push(err5);
|
|
|
78
78
|
errors++;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
if(data.
|
|
82
|
-
if(typeof data.
|
|
83
|
-
const err6 = {instancePath:instancePath+"/
|
|
81
|
+
if(data._id !== undefined){
|
|
82
|
+
if(typeof data._id !== "string"){
|
|
83
|
+
const err6 = {instancePath:instancePath+"/_id",schemaPath:"#/properties/_id/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
84
84
|
if(vErrors === null){
|
|
85
85
|
vErrors = [err6];
|
|
86
86
|
}
|
|
@@ -90,9 +90,9 @@ vErrors.push(err6);
|
|
|
90
90
|
errors++;
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
-
if(data.
|
|
94
|
-
if(typeof data.
|
|
95
|
-
const err7 = {instancePath:instancePath+"/
|
|
93
|
+
if(data.eventId !== undefined){
|
|
94
|
+
if(typeof data.eventId !== "string"){
|
|
95
|
+
const err7 = {instancePath:instancePath+"/eventId",schemaPath:"#/properties/eventId/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
96
96
|
if(vErrors === null){
|
|
97
97
|
vErrors = [err7];
|
|
98
98
|
}
|
|
@@ -102,9 +102,9 @@ vErrors.push(err7);
|
|
|
102
102
|
errors++;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
if(data.
|
|
106
|
-
if(typeof data.
|
|
107
|
-
const err8 = {instancePath:instancePath+"/
|
|
105
|
+
if(data.origin !== undefined){
|
|
106
|
+
if(typeof data.origin !== "string"){
|
|
107
|
+
const err8 = {instancePath:instancePath+"/origin",schemaPath:"#/properties/origin/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
108
108
|
if(vErrors === null){
|
|
109
109
|
vErrors = [err8];
|
|
110
110
|
}
|
|
@@ -114,9 +114,9 @@ vErrors.push(err8);
|
|
|
114
114
|
errors++;
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
if(data.
|
|
118
|
-
if(typeof data.
|
|
119
|
-
const err9 = {instancePath:instancePath+"/
|
|
117
|
+
if(data.title !== undefined){
|
|
118
|
+
if(typeof data.title !== "string"){
|
|
119
|
+
const err9 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
120
120
|
if(vErrors === null){
|
|
121
121
|
vErrors = [err9];
|
|
122
122
|
}
|
|
@@ -126,9 +126,9 @@ vErrors.push(err9);
|
|
|
126
126
|
errors++;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
if(data.
|
|
130
|
-
if(typeof data.
|
|
131
|
-
const err10 = {instancePath:instancePath+"/
|
|
129
|
+
if(data.body !== undefined){
|
|
130
|
+
if(typeof data.body !== "string"){
|
|
131
|
+
const err10 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
132
132
|
if(vErrors === null){
|
|
133
133
|
vErrors = [err10];
|
|
134
134
|
}
|
|
@@ -138,10 +138,9 @@ vErrors.push(err10);
|
|
|
138
138
|
errors++;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
|
-
if(data.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const err11 = {instancePath:instancePath+"/locale",schemaPath:"#/properties/locale/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
141
|
+
if(data.htmlBody !== undefined){
|
|
142
|
+
if(typeof data.htmlBody !== "string"){
|
|
143
|
+
const err11 = {instancePath:instancePath+"/htmlBody",schemaPath:"#/properties/htmlBody/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
145
144
|
if(vErrors === null){
|
|
146
145
|
vErrors = [err11];
|
|
147
146
|
}
|
|
@@ -150,8 +149,11 @@ vErrors.push(err11);
|
|
|
150
149
|
}
|
|
151
150
|
errors++;
|
|
152
151
|
}
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
}
|
|
153
|
+
if(data.locale !== undefined){
|
|
154
|
+
let data6 = data.locale;
|
|
155
|
+
if(typeof data6 !== "string"){
|
|
156
|
+
const err12 = {instancePath:instancePath+"/locale",schemaPath:"#/properties/locale/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
155
157
|
if(vErrors === null){
|
|
156
158
|
vErrors = [err12];
|
|
157
159
|
}
|
|
@@ -160,10 +162,8 @@ vErrors.push(err12);
|
|
|
160
162
|
}
|
|
161
163
|
errors++;
|
|
162
164
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if(typeof data.icon !== "string"){
|
|
166
|
-
const err13 = {instancePath:instancePath+"/icon",schemaPath:"#/properties/icon/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
165
|
+
if(!((data6 === "fr") || (data6 === "en"))){
|
|
166
|
+
const err13 = {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
167
|
if(vErrors === null){
|
|
168
168
|
vErrors = [err13];
|
|
169
169
|
}
|
|
@@ -173,11 +173,9 @@ vErrors.push(err13);
|
|
|
173
173
|
errors++;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
if(data.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if(data7.type === undefined){
|
|
180
|
-
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"+"'"};
|
|
176
|
+
if(data.icon !== undefined){
|
|
177
|
+
if(typeof data.icon !== "string"){
|
|
178
|
+
const err14 = {instancePath:instancePath+"/icon",schemaPath:"#/properties/icon/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
181
179
|
if(vErrors === null){
|
|
182
180
|
vErrors = [err14];
|
|
183
181
|
}
|
|
@@ -186,8 +184,12 @@ vErrors.push(err14);
|
|
|
186
184
|
}
|
|
187
185
|
errors++;
|
|
188
186
|
}
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
}
|
|
188
|
+
if(data.sender !== undefined){
|
|
189
|
+
let data8 = data.sender;
|
|
190
|
+
if(data8 && typeof data8 == "object" && !Array.isArray(data8)){
|
|
191
|
+
if(data8.type === undefined){
|
|
192
|
+
const err15 = {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"+"'"};
|
|
191
193
|
if(vErrors === null){
|
|
192
194
|
vErrors = [err15];
|
|
193
195
|
}
|
|
@@ -196,9 +198,8 @@ vErrors.push(err15);
|
|
|
196
198
|
}
|
|
197
199
|
errors++;
|
|
198
200
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
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"};
|
|
201
|
+
if(data8.id === undefined){
|
|
202
|
+
const err16 = {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"+"'"};
|
|
202
203
|
if(vErrors === null){
|
|
203
204
|
vErrors = [err16];
|
|
204
205
|
}
|
|
@@ -207,11 +208,9 @@ vErrors.push(err16);
|
|
|
207
208
|
}
|
|
208
209
|
errors++;
|
|
209
210
|
}
|
|
210
|
-
|
|
211
|
-
if(
|
|
212
|
-
|
|
213
|
-
if(typeof data8 !== "string"){
|
|
214
|
-
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"};
|
|
211
|
+
for(const key1 in data8){
|
|
212
|
+
if(!((((((key1 === "type") || (key1 === "id")) || (key1 === "name")) || (key1 === "role")) || (key1 === "department")) || (key1 === "departmentName"))){
|
|
213
|
+
const err17 = {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"};
|
|
215
214
|
if(vErrors === null){
|
|
216
215
|
vErrors = [err17];
|
|
217
216
|
}
|
|
@@ -220,8 +219,11 @@ vErrors.push(err17);
|
|
|
220
219
|
}
|
|
221
220
|
errors++;
|
|
222
221
|
}
|
|
223
|
-
|
|
224
|
-
|
|
222
|
+
}
|
|
223
|
+
if(data8.type !== undefined){
|
|
224
|
+
let data9 = data8.type;
|
|
225
|
+
if(typeof data9 !== "string"){
|
|
226
|
+
const err18 = {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"};
|
|
225
227
|
if(vErrors === null){
|
|
226
228
|
vErrors = [err18];
|
|
227
229
|
}
|
|
@@ -230,10 +232,8 @@ vErrors.push(err18);
|
|
|
230
232
|
}
|
|
231
233
|
errors++;
|
|
232
234
|
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
if(typeof data7.id !== "string"){
|
|
236
|
-
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"};
|
|
235
|
+
if(!((data9 === "user") || (data9 === "organization"))){
|
|
236
|
+
const err19 = {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
237
|
if(vErrors === null){
|
|
238
238
|
vErrors = [err19];
|
|
239
239
|
}
|
|
@@ -243,9 +243,9 @@ vErrors.push(err19);
|
|
|
243
243
|
errors++;
|
|
244
244
|
}
|
|
245
245
|
}
|
|
246
|
-
if(
|
|
247
|
-
if(typeof
|
|
248
|
-
const err20 = {instancePath:instancePath+"/sender/
|
|
246
|
+
if(data8.id !== undefined){
|
|
247
|
+
if(typeof data8.id !== "string"){
|
|
248
|
+
const err20 = {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
249
|
if(vErrors === null){
|
|
250
250
|
vErrors = [err20];
|
|
251
251
|
}
|
|
@@ -255,9 +255,9 @@ vErrors.push(err20);
|
|
|
255
255
|
errors++;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
if(
|
|
259
|
-
if(typeof
|
|
260
|
-
const err21 = {instancePath:instancePath+"/sender/
|
|
258
|
+
if(data8.name !== undefined){
|
|
259
|
+
if(typeof data8.name !== "string"){
|
|
260
|
+
const err21 = {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
261
|
if(vErrors === null){
|
|
262
262
|
vErrors = [err21];
|
|
263
263
|
}
|
|
@@ -267,9 +267,9 @@ vErrors.push(err21);
|
|
|
267
267
|
errors++;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
if(
|
|
271
|
-
if(typeof
|
|
272
|
-
const err22 = {instancePath:instancePath+"/sender/
|
|
270
|
+
if(data8.role !== undefined){
|
|
271
|
+
if(typeof data8.role !== "string"){
|
|
272
|
+
const err22 = {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
273
|
if(vErrors === null){
|
|
274
274
|
vErrors = [err22];
|
|
275
275
|
}
|
|
@@ -279,9 +279,9 @@ vErrors.push(err22);
|
|
|
279
279
|
errors++;
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
-
if(
|
|
283
|
-
if(typeof
|
|
284
|
-
const err23 = {instancePath:instancePath+"/sender/
|
|
282
|
+
if(data8.department !== undefined){
|
|
283
|
+
if(typeof data8.department !== "string"){
|
|
284
|
+
const err23 = {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
285
|
if(vErrors === null){
|
|
286
286
|
vErrors = [err23];
|
|
287
287
|
}
|
|
@@ -291,9 +291,9 @@ vErrors.push(err23);
|
|
|
291
291
|
errors++;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
const err24 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/type",keyword:"type",params:{type: "
|
|
294
|
+
if(data8.departmentName !== undefined){
|
|
295
|
+
if(typeof data8.departmentName !== "string"){
|
|
296
|
+
const err24 = {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
297
|
if(vErrors === null){
|
|
298
298
|
vErrors = [err24];
|
|
299
299
|
}
|
|
@@ -303,11 +303,9 @@ vErrors.push(err24);
|
|
|
303
303
|
errors++;
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
if(data14.key === undefined){
|
|
310
|
-
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"+"'"};
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
const err25 = {instancePath:instancePath+"/sender",schemaPath:"https://github.com/data-fair/lib/event#/$defs/sender/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
311
309
|
if(vErrors === null){
|
|
312
310
|
vErrors = [err25];
|
|
313
311
|
}
|
|
@@ -316,9 +314,12 @@ vErrors.push(err25);
|
|
|
316
314
|
}
|
|
317
315
|
errors++;
|
|
318
316
|
}
|
|
319
|
-
|
|
320
|
-
if(
|
|
321
|
-
|
|
317
|
+
}
|
|
318
|
+
if(data.topic !== undefined){
|
|
319
|
+
let data15 = data.topic;
|
|
320
|
+
if(data15 && typeof data15 == "object" && !Array.isArray(data15)){
|
|
321
|
+
if(data15.key === undefined){
|
|
322
|
+
const err26 = {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"+"'"};
|
|
322
323
|
if(vErrors === null){
|
|
323
324
|
vErrors = [err26];
|
|
324
325
|
}
|
|
@@ -327,10 +328,9 @@ vErrors.push(err26);
|
|
|
327
328
|
}
|
|
328
329
|
errors++;
|
|
329
330
|
}
|
|
330
|
-
|
|
331
|
-
if(
|
|
332
|
-
|
|
333
|
-
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"};
|
|
331
|
+
for(const key2 in data15){
|
|
332
|
+
if(!((key2 === "key") || (key2 === "title"))){
|
|
333
|
+
const err27 = {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
334
|
if(vErrors === null){
|
|
335
335
|
vErrors = [err27];
|
|
336
336
|
}
|
|
@@ -340,9 +340,9 @@ vErrors.push(err27);
|
|
|
340
340
|
errors++;
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
if(
|
|
344
|
-
if(typeof
|
|
345
|
-
const err28 = {instancePath:instancePath+"/topic/
|
|
343
|
+
if(data15.key !== undefined){
|
|
344
|
+
if(typeof data15.key !== "string"){
|
|
345
|
+
const err28 = {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
346
|
if(vErrors === null){
|
|
347
347
|
vErrors = [err28];
|
|
348
348
|
}
|
|
@@ -352,9 +352,9 @@ vErrors.push(err28);
|
|
|
352
352
|
errors++;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const err29 = {instancePath:instancePath+"/topic",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/type",keyword:"type",params:{type: "
|
|
355
|
+
if(data15.title !== undefined){
|
|
356
|
+
if(typeof data15.title !== "string"){
|
|
357
|
+
const err29 = {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
358
|
if(vErrors === null){
|
|
359
359
|
vErrors = [err29];
|
|
360
360
|
}
|
|
@@ -364,11 +364,9 @@ vErrors.push(err29);
|
|
|
364
364
|
errors++;
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
if(data17.id === undefined){
|
|
371
|
-
const err30 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
const err30 = {instancePath:instancePath+"/topic",schemaPath:"https://github.com/data-fair/lib/event#/$defs/topicRef/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
372
370
|
if(vErrors === null){
|
|
373
371
|
vErrors = [err30];
|
|
374
372
|
}
|
|
@@ -377,9 +375,12 @@ vErrors.push(err30);
|
|
|
377
375
|
}
|
|
378
376
|
errors++;
|
|
379
377
|
}
|
|
380
|
-
|
|
381
|
-
if(
|
|
382
|
-
|
|
378
|
+
}
|
|
379
|
+
if(data.recipient !== undefined){
|
|
380
|
+
let data18 = data.recipient;
|
|
381
|
+
if(data18 && typeof data18 == "object" && !Array.isArray(data18)){
|
|
382
|
+
if(data18.id === undefined){
|
|
383
|
+
const err31 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};
|
|
383
384
|
if(vErrors === null){
|
|
384
385
|
vErrors = [err31];
|
|
385
386
|
}
|
|
@@ -388,10 +389,9 @@ vErrors.push(err31);
|
|
|
388
389
|
}
|
|
389
390
|
errors++;
|
|
390
391
|
}
|
|
391
|
-
|
|
392
|
-
if(
|
|
393
|
-
|
|
394
|
-
const err32 = {instancePath:instancePath+"/recipient/name",schemaPath:"#/properties/recipient/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
392
|
+
if(data18.id !== undefined){
|
|
393
|
+
if(typeof data18.id !== "string"){
|
|
394
|
+
const err32 = {instancePath:instancePath+"/recipient/id",schemaPath:"#/properties/recipient/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
395
395
|
if(vErrors === null){
|
|
396
396
|
vErrors = [err32];
|
|
397
397
|
}
|
|
@@ -401,9 +401,9 @@ vErrors.push(err32);
|
|
|
401
401
|
errors++;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
const err33 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/type",keyword:"type",params:{type: "
|
|
404
|
+
if(data18.name !== undefined){
|
|
405
|
+
if(typeof data18.name !== "string"){
|
|
406
|
+
const err33 = {instancePath:instancePath+"/recipient/name",schemaPath:"#/properties/recipient/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
407
407
|
if(vErrors === null){
|
|
408
408
|
vErrors = [err33];
|
|
409
409
|
}
|
|
@@ -413,14 +413,9 @@ vErrors.push(err33);
|
|
|
413
413
|
errors++;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const len0 = data20.length;
|
|
420
|
-
for(let i0=0; i0<len0; i0++){
|
|
421
|
-
let data21 = data20[i0];
|
|
422
|
-
if(typeof data21 !== "string"){
|
|
423
|
-
const err34 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
const err34 = {instancePath:instancePath+"/recipient",schemaPath:"#/properties/recipient/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
424
419
|
if(vErrors === null){
|
|
425
420
|
vErrors = [err34];
|
|
426
421
|
}
|
|
@@ -429,12 +424,15 @@ vErrors.push(err34);
|
|
|
429
424
|
}
|
|
430
425
|
errors++;
|
|
431
426
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
let
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
427
|
+
}
|
|
428
|
+
if(data.outputs !== undefined){
|
|
429
|
+
let data21 = data.outputs;
|
|
430
|
+
if(Array.isArray(data21)){
|
|
431
|
+
const len0 = data21.length;
|
|
432
|
+
for(let i0=0; i0<len0; i0++){
|
|
433
|
+
let data22 = data21[i0];
|
|
434
|
+
if(typeof data22 !== "string"){
|
|
435
|
+
const err35 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
438
436
|
if(vErrors === null){
|
|
439
437
|
vErrors = [err35];
|
|
440
438
|
}
|
|
@@ -443,23 +441,37 @@ vErrors.push(err35);
|
|
|
443
441
|
}
|
|
444
442
|
errors++;
|
|
445
443
|
}
|
|
446
|
-
|
|
444
|
+
const _errs52 = errors;
|
|
445
|
+
let valid8 = false;
|
|
446
|
+
let passing0 = null;
|
|
447
|
+
const _errs53 = errors;
|
|
448
|
+
if("devices" !== data22){
|
|
449
|
+
const err36 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf/0/const",keyword:"const",params:{allowedValue: "devices"},message:"must be equal to constant"};
|
|
450
|
+
if(vErrors === null){
|
|
451
|
+
vErrors = [err36];
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
vErrors.push(err36);
|
|
455
|
+
}
|
|
456
|
+
errors++;
|
|
457
|
+
}
|
|
458
|
+
var _valid0 = _errs53 === errors;
|
|
447
459
|
if(_valid0){
|
|
448
460
|
valid8 = true;
|
|
449
461
|
passing0 = 0;
|
|
450
462
|
}
|
|
451
|
-
const
|
|
452
|
-
if("email" !==
|
|
453
|
-
const
|
|
463
|
+
const _errs54 = errors;
|
|
464
|
+
if("email" !== data22){
|
|
465
|
+
const err37 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf/1/const",keyword:"const",params:{allowedValue: "email"},message:"must be equal to constant"};
|
|
454
466
|
if(vErrors === null){
|
|
455
|
-
vErrors = [
|
|
467
|
+
vErrors = [err37];
|
|
456
468
|
}
|
|
457
469
|
else {
|
|
458
|
-
vErrors.push(
|
|
470
|
+
vErrors.push(err37);
|
|
459
471
|
}
|
|
460
472
|
errors++;
|
|
461
473
|
}
|
|
462
|
-
var _valid0 =
|
|
474
|
+
var _valid0 = _errs54 === errors;
|
|
463
475
|
if(_valid0 && valid8){
|
|
464
476
|
valid8 = false;
|
|
465
477
|
passing0 = [passing0, 1];
|
|
@@ -471,20 +483,20 @@ passing0 = 1;
|
|
|
471
483
|
}
|
|
472
484
|
}
|
|
473
485
|
if(!valid8){
|
|
474
|
-
const
|
|
486
|
+
const err38 = {instancePath:instancePath+"/outputs/" + i0,schemaPath:"#/properties/outputs/items/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};
|
|
475
487
|
if(vErrors === null){
|
|
476
|
-
vErrors = [
|
|
488
|
+
vErrors = [err38];
|
|
477
489
|
}
|
|
478
490
|
else {
|
|
479
|
-
vErrors.push(
|
|
491
|
+
vErrors.push(err38);
|
|
480
492
|
}
|
|
481
493
|
errors++;
|
|
482
494
|
}
|
|
483
495
|
else {
|
|
484
|
-
errors =
|
|
496
|
+
errors = _errs52;
|
|
485
497
|
if(vErrors !== null){
|
|
486
|
-
if(
|
|
487
|
-
vErrors.length =
|
|
498
|
+
if(_errs52){
|
|
499
|
+
vErrors.length = _errs52;
|
|
488
500
|
}
|
|
489
501
|
else {
|
|
490
502
|
vErrors = null;
|
|
@@ -494,86 +506,86 @@ vErrors = null;
|
|
|
494
506
|
}
|
|
495
507
|
}
|
|
496
508
|
else {
|
|
497
|
-
const
|
|
509
|
+
const err39 = {instancePath:instancePath+"/outputs",schemaPath:"#/properties/outputs/type",keyword:"type",params:{type: "array"},message:"must be array"};
|
|
498
510
|
if(vErrors === null){
|
|
499
|
-
vErrors = [
|
|
511
|
+
vErrors = [err39];
|
|
500
512
|
}
|
|
501
513
|
else {
|
|
502
|
-
vErrors.push(
|
|
514
|
+
vErrors.push(err39);
|
|
503
515
|
}
|
|
504
516
|
errors++;
|
|
505
517
|
}
|
|
506
518
|
}
|
|
507
519
|
if(data.url !== undefined){
|
|
508
520
|
if(typeof data.url !== "string"){
|
|
509
|
-
const
|
|
521
|
+
const err40 = {instancePath:instancePath+"/url",schemaPath:"#/properties/url/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
510
522
|
if(vErrors === null){
|
|
511
|
-
vErrors = [
|
|
523
|
+
vErrors = [err40];
|
|
512
524
|
}
|
|
513
525
|
else {
|
|
514
|
-
vErrors.push(
|
|
526
|
+
vErrors.push(err40);
|
|
515
527
|
}
|
|
516
528
|
errors++;
|
|
517
529
|
}
|
|
518
530
|
}
|
|
519
531
|
if(data.date !== undefined){
|
|
520
|
-
let
|
|
521
|
-
if(typeof
|
|
522
|
-
if(!(formats0.validate(
|
|
523
|
-
const
|
|
532
|
+
let data24 = data.date;
|
|
533
|
+
if(typeof data24 === "string"){
|
|
534
|
+
if(!(formats0.validate(data24))){
|
|
535
|
+
const err41 = {instancePath:instancePath+"/date",schemaPath:"#/properties/date/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};
|
|
524
536
|
if(vErrors === null){
|
|
525
|
-
vErrors = [
|
|
537
|
+
vErrors = [err41];
|
|
526
538
|
}
|
|
527
539
|
else {
|
|
528
|
-
vErrors.push(
|
|
540
|
+
vErrors.push(err41);
|
|
529
541
|
}
|
|
530
542
|
errors++;
|
|
531
543
|
}
|
|
532
544
|
}
|
|
533
545
|
else {
|
|
534
|
-
const
|
|
546
|
+
const err42 = {instancePath:instancePath+"/date",schemaPath:"#/properties/date/type",keyword:"type",params:{type: "string"},message:"must be string"};
|
|
535
547
|
if(vErrors === null){
|
|
536
|
-
vErrors = [
|
|
548
|
+
vErrors = [err42];
|
|
537
549
|
}
|
|
538
550
|
else {
|
|
539
|
-
vErrors.push(
|
|
551
|
+
vErrors.push(err42);
|
|
540
552
|
}
|
|
541
553
|
errors++;
|
|
542
554
|
}
|
|
543
555
|
}
|
|
544
556
|
if(data.new !== undefined){
|
|
545
557
|
if(typeof data.new !== "boolean"){
|
|
546
|
-
const
|
|
558
|
+
const err43 = {instancePath:instancePath+"/new",schemaPath:"#/properties/new/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
|
|
547
559
|
if(vErrors === null){
|
|
548
|
-
vErrors = [
|
|
560
|
+
vErrors = [err43];
|
|
549
561
|
}
|
|
550
562
|
else {
|
|
551
|
-
vErrors.push(
|
|
563
|
+
vErrors.push(err43);
|
|
552
564
|
}
|
|
553
565
|
errors++;
|
|
554
566
|
}
|
|
555
567
|
}
|
|
556
568
|
if(data.extra !== undefined){
|
|
557
|
-
let
|
|
558
|
-
if(!(
|
|
559
|
-
const
|
|
569
|
+
let data26 = data.extra;
|
|
570
|
+
if(!(data26 && typeof data26 == "object" && !Array.isArray(data26))){
|
|
571
|
+
const err44 = {instancePath:instancePath+"/extra",schemaPath:"#/properties/extra/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
560
572
|
if(vErrors === null){
|
|
561
|
-
vErrors = [
|
|
573
|
+
vErrors = [err44];
|
|
562
574
|
}
|
|
563
575
|
else {
|
|
564
|
-
vErrors.push(
|
|
576
|
+
vErrors.push(err44);
|
|
565
577
|
}
|
|
566
578
|
errors++;
|
|
567
579
|
}
|
|
568
580
|
}
|
|
569
581
|
}
|
|
570
582
|
else {
|
|
571
|
-
const
|
|
583
|
+
const err45 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};
|
|
572
584
|
if(vErrors === null){
|
|
573
|
-
vErrors = [
|
|
585
|
+
vErrors = [err45];
|
|
574
586
|
}
|
|
575
587
|
else {
|
|
576
|
-
vErrors.push(
|
|
588
|
+
vErrors.push(err45);
|
|
577
589
|
}
|
|
578
590
|
errors++;
|
|
579
591
|
}
|
package/notification/schema.d.ts
CHANGED
|
@@ -6,6 +6,10 @@ declare const _default: {
|
|
|
6
6
|
additionalProperties: boolean;
|
|
7
7
|
required: string[];
|
|
8
8
|
properties: {
|
|
9
|
+
_id: {
|
|
10
|
+
type: string;
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
9
13
|
eventId: {
|
|
10
14
|
type: string;
|
|
11
15
|
title: string;
|
|
@@ -71,10 +75,8 @@ declare const _default: {
|
|
|
71
75
|
url: {
|
|
72
76
|
type: string;
|
|
73
77
|
title: string;
|
|
74
|
-
readOnly: boolean;
|
|
75
78
|
};
|
|
76
79
|
date: {
|
|
77
|
-
readOnly: boolean;
|
|
78
80
|
type: string;
|
|
79
81
|
description: string;
|
|
80
82
|
format: string;
|
package/notification/schema.js
CHANGED
|
@@ -6,6 +6,10 @@ export default {
|
|
|
6
6
|
additionalProperties: false,
|
|
7
7
|
required: ['title', 'topic', 'sender', 'recipient', 'date'],
|
|
8
8
|
properties: {
|
|
9
|
+
_id: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
title: 'Globally unique id'
|
|
12
|
+
},
|
|
9
13
|
eventId: {
|
|
10
14
|
type: 'string',
|
|
11
15
|
title: 'Globally unique id of the event source of this notification'
|
|
@@ -70,11 +74,9 @@ export default {
|
|
|
70
74
|
},
|
|
71
75
|
url: {
|
|
72
76
|
type: 'string',
|
|
73
|
-
title: 'calculé à partir de subscription.urlTemplate et event.urlParams',
|
|
74
|
-
readOnly: true
|
|
77
|
+
title: 'défini explicitement ou calculé à partir de subscription.urlTemplate et event.urlParams',
|
|
75
78
|
},
|
|
76
79
|
date: {
|
|
77
|
-
readOnly: true,
|
|
78
80
|
type: 'string',
|
|
79
81
|
description: 'reception date',
|
|
80
82
|
format: 'date-time'
|