@spotify/backstage-plugin-pulse-common 0.6.2 → 0.7.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.
- package/CHANGELOG.md +18 -0
- package/dist/index.cjs.js +22 -1
- package/dist/index.d.ts +556 -30
- package/dist/index.esm.js +22 -1
- package/package.json +17 -6
- package/src/templates/schema/survey-template-schema.json +651 -0
package/dist/index.d.ts
CHANGED
|
@@ -62,33 +62,32 @@ interface SurveyTemplate {
|
|
|
62
62
|
/**
|
|
63
63
|
* The survey sections, in the order they will appear in the survey
|
|
64
64
|
*/
|
|
65
|
-
sections:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}[];
|
|
65
|
+
sections: Section[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A survey section.
|
|
69
|
+
* @public */
|
|
70
|
+
interface Section {
|
|
71
|
+
/**
|
|
72
|
+
* The id of this section
|
|
73
|
+
*/
|
|
74
|
+
id: string;
|
|
75
|
+
/**
|
|
76
|
+
* The name of this section
|
|
77
|
+
*/
|
|
78
|
+
name: string;
|
|
79
|
+
/**
|
|
80
|
+
* An optional boolean expression that decides if the surveyee should see the questions in this section.
|
|
81
|
+
*/
|
|
82
|
+
display_logic?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The questions in the section (all in one page)
|
|
85
|
+
*/
|
|
86
|
+
questions?: Question[];
|
|
87
|
+
/**
|
|
88
|
+
* The questions in the section, split into pages
|
|
89
|
+
*/
|
|
90
|
+
pages?: Page[];
|
|
92
91
|
}
|
|
93
92
|
/** @public */
|
|
94
93
|
interface Question {
|
|
@@ -198,8 +197,7 @@ interface Statement {
|
|
|
198
197
|
}
|
|
199
198
|
/**
|
|
200
199
|
* Configuration of the display order randomization of choices, statements or groups.
|
|
201
|
-
*/
|
|
202
|
-
/** @public */
|
|
200
|
+
* @public */
|
|
203
201
|
interface Randomization {
|
|
204
202
|
/**
|
|
205
203
|
* The type of randomization: randomize all items, a subset of them, or using constrained randomization
|
|
@@ -241,10 +239,538 @@ interface Choice {
|
|
|
241
239
|
*/
|
|
242
240
|
exclusive_answer?: boolean;
|
|
243
241
|
}
|
|
242
|
+
/** @public */
|
|
243
|
+
interface Page {
|
|
244
|
+
/**
|
|
245
|
+
* The questions on the page
|
|
246
|
+
*/
|
|
247
|
+
questions: Question[];
|
|
248
|
+
}
|
|
244
249
|
|
|
245
250
|
/** @public */
|
|
246
251
|
declare const validateTemplate: (template: SurveyTemplate) => void;
|
|
247
252
|
|
|
253
|
+
/** @public */
|
|
254
|
+
declare const templateSchema: {
|
|
255
|
+
$id: string;
|
|
256
|
+
$schema: string;
|
|
257
|
+
title: string;
|
|
258
|
+
type: string;
|
|
259
|
+
properties: {
|
|
260
|
+
template: {
|
|
261
|
+
type: string;
|
|
262
|
+
description: string;
|
|
263
|
+
properties: {
|
|
264
|
+
id: {
|
|
265
|
+
type: string;
|
|
266
|
+
description: string;
|
|
267
|
+
format: string;
|
|
268
|
+
pattern: string;
|
|
269
|
+
minLength: number;
|
|
270
|
+
};
|
|
271
|
+
version: {
|
|
272
|
+
type: string;
|
|
273
|
+
format: string;
|
|
274
|
+
pattern: string;
|
|
275
|
+
description: string;
|
|
276
|
+
};
|
|
277
|
+
name: {
|
|
278
|
+
type: string;
|
|
279
|
+
description: string;
|
|
280
|
+
minLength: number;
|
|
281
|
+
};
|
|
282
|
+
description: {
|
|
283
|
+
type: string;
|
|
284
|
+
description: string;
|
|
285
|
+
};
|
|
286
|
+
owner: {
|
|
287
|
+
type: string;
|
|
288
|
+
description: string;
|
|
289
|
+
minLength: number;
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
required: string[];
|
|
293
|
+
additionalProperties: boolean;
|
|
294
|
+
};
|
|
295
|
+
parameters: {
|
|
296
|
+
type: string;
|
|
297
|
+
description: string;
|
|
298
|
+
items: {
|
|
299
|
+
type: string;
|
|
300
|
+
properties: {
|
|
301
|
+
id: {
|
|
302
|
+
type: string;
|
|
303
|
+
description: string;
|
|
304
|
+
format: string;
|
|
305
|
+
pattern: string;
|
|
306
|
+
};
|
|
307
|
+
description: {
|
|
308
|
+
type: string;
|
|
309
|
+
description: string;
|
|
310
|
+
};
|
|
311
|
+
format: {
|
|
312
|
+
type: string;
|
|
313
|
+
enum: string[];
|
|
314
|
+
description: string;
|
|
315
|
+
};
|
|
316
|
+
default: {
|
|
317
|
+
type: string[];
|
|
318
|
+
description: string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
required: string[];
|
|
322
|
+
oneOf: {
|
|
323
|
+
required: string[];
|
|
324
|
+
}[];
|
|
325
|
+
additionalProperties: boolean;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
macros: {
|
|
329
|
+
type: string;
|
|
330
|
+
description: string;
|
|
331
|
+
additionalProperties: {
|
|
332
|
+
type: string;
|
|
333
|
+
};
|
|
334
|
+
};
|
|
335
|
+
sections: {
|
|
336
|
+
type: string;
|
|
337
|
+
description: string;
|
|
338
|
+
items: {
|
|
339
|
+
$ref: string;
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
additionalProperties: boolean;
|
|
344
|
+
required: string[];
|
|
345
|
+
$defs: {
|
|
346
|
+
section: {
|
|
347
|
+
type: string;
|
|
348
|
+
description: string;
|
|
349
|
+
properties: {
|
|
350
|
+
id: {
|
|
351
|
+
type: string;
|
|
352
|
+
description: string;
|
|
353
|
+
format: string;
|
|
354
|
+
pattern: string;
|
|
355
|
+
};
|
|
356
|
+
name: {
|
|
357
|
+
type: string;
|
|
358
|
+
description: string;
|
|
359
|
+
};
|
|
360
|
+
display_logic: {
|
|
361
|
+
type: string;
|
|
362
|
+
description: string;
|
|
363
|
+
};
|
|
364
|
+
questions: {
|
|
365
|
+
type: string;
|
|
366
|
+
description: string;
|
|
367
|
+
items: {
|
|
368
|
+
$ref: string;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
pages: {
|
|
372
|
+
type: string;
|
|
373
|
+
description: string;
|
|
374
|
+
items: {
|
|
375
|
+
$ref: string;
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
additionalProperties: boolean;
|
|
380
|
+
required: string[];
|
|
381
|
+
oneOf: {
|
|
382
|
+
required: string[];
|
|
383
|
+
}[];
|
|
384
|
+
};
|
|
385
|
+
page: {
|
|
386
|
+
type: string;
|
|
387
|
+
properties: {
|
|
388
|
+
questions: {
|
|
389
|
+
type: string;
|
|
390
|
+
description: string;
|
|
391
|
+
items: {
|
|
392
|
+
$ref: string;
|
|
393
|
+
};
|
|
394
|
+
};
|
|
395
|
+
};
|
|
396
|
+
required: string[];
|
|
397
|
+
additionalProperties: boolean;
|
|
398
|
+
};
|
|
399
|
+
question: {
|
|
400
|
+
type: string;
|
|
401
|
+
properties: {
|
|
402
|
+
id: {
|
|
403
|
+
type: string;
|
|
404
|
+
description: string;
|
|
405
|
+
pattern: string;
|
|
406
|
+
};
|
|
407
|
+
text: {
|
|
408
|
+
type: string;
|
|
409
|
+
description: string;
|
|
410
|
+
};
|
|
411
|
+
text_html: {
|
|
412
|
+
type: string;
|
|
413
|
+
description: string;
|
|
414
|
+
};
|
|
415
|
+
type: {
|
|
416
|
+
type: string;
|
|
417
|
+
enum: string[];
|
|
418
|
+
description: string;
|
|
419
|
+
};
|
|
420
|
+
layout: {
|
|
421
|
+
type: string;
|
|
422
|
+
enum: string[];
|
|
423
|
+
description: string;
|
|
424
|
+
};
|
|
425
|
+
display_logic: {
|
|
426
|
+
type: string;
|
|
427
|
+
description: string;
|
|
428
|
+
};
|
|
429
|
+
display_logic_in_page: {
|
|
430
|
+
type: string;
|
|
431
|
+
description: string;
|
|
432
|
+
};
|
|
433
|
+
required: {
|
|
434
|
+
type: string;
|
|
435
|
+
enum: string[];
|
|
436
|
+
description: string;
|
|
437
|
+
};
|
|
438
|
+
validation: {
|
|
439
|
+
type: string;
|
|
440
|
+
description: string;
|
|
441
|
+
properties: {
|
|
442
|
+
min_choices: {
|
|
443
|
+
type: string;
|
|
444
|
+
description: string;
|
|
445
|
+
};
|
|
446
|
+
max_choices: {
|
|
447
|
+
type: string;
|
|
448
|
+
description: string;
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
additionalProperties: boolean;
|
|
452
|
+
};
|
|
453
|
+
statements: {
|
|
454
|
+
type: string;
|
|
455
|
+
items: {
|
|
456
|
+
$ref: string;
|
|
457
|
+
};
|
|
458
|
+
};
|
|
459
|
+
dynamic_statements: {
|
|
460
|
+
type: string;
|
|
461
|
+
description: string;
|
|
462
|
+
pattern: string;
|
|
463
|
+
};
|
|
464
|
+
statement_groups: {
|
|
465
|
+
type: string;
|
|
466
|
+
items: {
|
|
467
|
+
type: string;
|
|
468
|
+
properties: {
|
|
469
|
+
statements: {
|
|
470
|
+
type: string;
|
|
471
|
+
items: {
|
|
472
|
+
$ref: string;
|
|
473
|
+
};
|
|
474
|
+
};
|
|
475
|
+
id: {
|
|
476
|
+
type: string;
|
|
477
|
+
description: string;
|
|
478
|
+
};
|
|
479
|
+
display: {
|
|
480
|
+
type: string;
|
|
481
|
+
description: string;
|
|
482
|
+
};
|
|
483
|
+
display_logic: {
|
|
484
|
+
type: string;
|
|
485
|
+
description: string;
|
|
486
|
+
};
|
|
487
|
+
randomization: {
|
|
488
|
+
$ref: string;
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
required: string[];
|
|
492
|
+
additionalProperties: boolean;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
495
|
+
choices: {
|
|
496
|
+
type: string;
|
|
497
|
+
items: {
|
|
498
|
+
$ref: string;
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
dynamic_choices: {
|
|
502
|
+
type: string;
|
|
503
|
+
description: string;
|
|
504
|
+
pattern: string;
|
|
505
|
+
};
|
|
506
|
+
choice_groups: {
|
|
507
|
+
type: string;
|
|
508
|
+
items: {
|
|
509
|
+
type: string;
|
|
510
|
+
properties: {
|
|
511
|
+
choices: {
|
|
512
|
+
type: string;
|
|
513
|
+
items: {
|
|
514
|
+
$ref: string;
|
|
515
|
+
};
|
|
516
|
+
};
|
|
517
|
+
id: {
|
|
518
|
+
type: string;
|
|
519
|
+
description: string;
|
|
520
|
+
};
|
|
521
|
+
display: {
|
|
522
|
+
type: string;
|
|
523
|
+
description: string;
|
|
524
|
+
};
|
|
525
|
+
display_logic: {
|
|
526
|
+
type: string;
|
|
527
|
+
description: string;
|
|
528
|
+
};
|
|
529
|
+
randomization: {
|
|
530
|
+
$ref: string;
|
|
531
|
+
};
|
|
532
|
+
};
|
|
533
|
+
required: string[];
|
|
534
|
+
additionalProperties: boolean;
|
|
535
|
+
};
|
|
536
|
+
};
|
|
537
|
+
randomization: {
|
|
538
|
+
$ref: string;
|
|
539
|
+
};
|
|
540
|
+
};
|
|
541
|
+
additionalProperties: boolean;
|
|
542
|
+
allOf: ({
|
|
543
|
+
oneOf: {
|
|
544
|
+
required: string[];
|
|
545
|
+
}[];
|
|
546
|
+
} | {
|
|
547
|
+
oneOf: {
|
|
548
|
+
$ref: string;
|
|
549
|
+
}[];
|
|
550
|
+
})[];
|
|
551
|
+
};
|
|
552
|
+
"question-mc-horizontal": {
|
|
553
|
+
type: string;
|
|
554
|
+
properties: {
|
|
555
|
+
type: {
|
|
556
|
+
enum: string[];
|
|
557
|
+
};
|
|
558
|
+
position: {
|
|
559
|
+
const: string;
|
|
560
|
+
};
|
|
561
|
+
};
|
|
562
|
+
required: string[];
|
|
563
|
+
not: {
|
|
564
|
+
anyOf: {
|
|
565
|
+
required: string[];
|
|
566
|
+
}[];
|
|
567
|
+
};
|
|
568
|
+
};
|
|
569
|
+
"question-mc-vertical": {
|
|
570
|
+
type: string;
|
|
571
|
+
properties: {
|
|
572
|
+
type: {
|
|
573
|
+
enum: string[];
|
|
574
|
+
};
|
|
575
|
+
position: {
|
|
576
|
+
const: string;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
required: string[];
|
|
580
|
+
not: {
|
|
581
|
+
anyOf: {
|
|
582
|
+
required: string[];
|
|
583
|
+
}[];
|
|
584
|
+
};
|
|
585
|
+
oneOf: ({
|
|
586
|
+
anyOf: {
|
|
587
|
+
required: string[];
|
|
588
|
+
}[];
|
|
589
|
+
not: {
|
|
590
|
+
required: string[];
|
|
591
|
+
anyOf?: undefined;
|
|
592
|
+
};
|
|
593
|
+
required?: undefined;
|
|
594
|
+
} | {
|
|
595
|
+
required: string[];
|
|
596
|
+
not: {
|
|
597
|
+
anyOf: {
|
|
598
|
+
required: string[];
|
|
599
|
+
}[];
|
|
600
|
+
required?: undefined;
|
|
601
|
+
};
|
|
602
|
+
anyOf?: undefined;
|
|
603
|
+
})[];
|
|
604
|
+
};
|
|
605
|
+
"question-matrix": {
|
|
606
|
+
type: string;
|
|
607
|
+
properties: {
|
|
608
|
+
type: {
|
|
609
|
+
enum: string[];
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
required: string[];
|
|
613
|
+
not: {
|
|
614
|
+
anyOf: {
|
|
615
|
+
required: string[];
|
|
616
|
+
}[];
|
|
617
|
+
};
|
|
618
|
+
oneOf: ({
|
|
619
|
+
anyOf: {
|
|
620
|
+
required: string[];
|
|
621
|
+
}[];
|
|
622
|
+
not: {
|
|
623
|
+
required: string[];
|
|
624
|
+
anyOf?: undefined;
|
|
625
|
+
};
|
|
626
|
+
required?: undefined;
|
|
627
|
+
} | {
|
|
628
|
+
required: string[];
|
|
629
|
+
not: {
|
|
630
|
+
anyOf: {
|
|
631
|
+
required: string[];
|
|
632
|
+
}[];
|
|
633
|
+
required?: undefined;
|
|
634
|
+
};
|
|
635
|
+
anyOf?: undefined;
|
|
636
|
+
})[];
|
|
637
|
+
};
|
|
638
|
+
"question-text": {
|
|
639
|
+
type: string;
|
|
640
|
+
properties: {
|
|
641
|
+
type: {
|
|
642
|
+
enum: string[];
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
required: string[];
|
|
646
|
+
not: {
|
|
647
|
+
anyOf: {
|
|
648
|
+
required: string[];
|
|
649
|
+
}[];
|
|
650
|
+
};
|
|
651
|
+
};
|
|
652
|
+
"question-description": {
|
|
653
|
+
type: string;
|
|
654
|
+
properties: {
|
|
655
|
+
type: {
|
|
656
|
+
const: string;
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
not: {
|
|
660
|
+
anyOf: {
|
|
661
|
+
required: string[];
|
|
662
|
+
}[];
|
|
663
|
+
};
|
|
664
|
+
};
|
|
665
|
+
statement: {
|
|
666
|
+
type: string;
|
|
667
|
+
properties: {
|
|
668
|
+
id: {
|
|
669
|
+
type: string;
|
|
670
|
+
pattern: string;
|
|
671
|
+
description: string;
|
|
672
|
+
};
|
|
673
|
+
display: {
|
|
674
|
+
type: string;
|
|
675
|
+
description: string;
|
|
676
|
+
};
|
|
677
|
+
display_logic: {
|
|
678
|
+
type: string;
|
|
679
|
+
description: string;
|
|
680
|
+
};
|
|
681
|
+
};
|
|
682
|
+
required: string[];
|
|
683
|
+
additionalProperties: boolean;
|
|
684
|
+
};
|
|
685
|
+
choice: {
|
|
686
|
+
type: string;
|
|
687
|
+
properties: {
|
|
688
|
+
display: {
|
|
689
|
+
type: string;
|
|
690
|
+
description: string;
|
|
691
|
+
};
|
|
692
|
+
id: {
|
|
693
|
+
type: string;
|
|
694
|
+
pattern: string;
|
|
695
|
+
description: string;
|
|
696
|
+
};
|
|
697
|
+
value: {
|
|
698
|
+
type: string;
|
|
699
|
+
description: string;
|
|
700
|
+
};
|
|
701
|
+
display_logic: {
|
|
702
|
+
type: string;
|
|
703
|
+
description: string;
|
|
704
|
+
};
|
|
705
|
+
text: {
|
|
706
|
+
type: string;
|
|
707
|
+
enum: string[];
|
|
708
|
+
description: string;
|
|
709
|
+
};
|
|
710
|
+
exclusive_answer: {
|
|
711
|
+
type: string;
|
|
712
|
+
description: string;
|
|
713
|
+
};
|
|
714
|
+
};
|
|
715
|
+
required: string[];
|
|
716
|
+
oneOf: {
|
|
717
|
+
required: string[];
|
|
718
|
+
}[];
|
|
719
|
+
additionalProperties: boolean;
|
|
720
|
+
};
|
|
721
|
+
randomization: {
|
|
722
|
+
type: string;
|
|
723
|
+
description: string;
|
|
724
|
+
properties: {
|
|
725
|
+
type: {
|
|
726
|
+
type: string;
|
|
727
|
+
description: string;
|
|
728
|
+
enum: string[];
|
|
729
|
+
};
|
|
730
|
+
total: {
|
|
731
|
+
type: string;
|
|
732
|
+
description: string;
|
|
733
|
+
};
|
|
734
|
+
order: {
|
|
735
|
+
type: string;
|
|
736
|
+
description: string;
|
|
737
|
+
};
|
|
738
|
+
};
|
|
739
|
+
required: string[];
|
|
740
|
+
oneOf: ({
|
|
741
|
+
properties: {
|
|
742
|
+
type: {
|
|
743
|
+
const: string;
|
|
744
|
+
};
|
|
745
|
+
};
|
|
746
|
+
not: {
|
|
747
|
+
required: string[];
|
|
748
|
+
};
|
|
749
|
+
required?: undefined;
|
|
750
|
+
} | {
|
|
751
|
+
properties: {
|
|
752
|
+
type: {
|
|
753
|
+
const: string;
|
|
754
|
+
};
|
|
755
|
+
};
|
|
756
|
+
required: string[];
|
|
757
|
+
not: {
|
|
758
|
+
required: string[];
|
|
759
|
+
};
|
|
760
|
+
} | {
|
|
761
|
+
properties: {
|
|
762
|
+
type: {
|
|
763
|
+
const: string;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
required: string[];
|
|
767
|
+
not?: undefined;
|
|
768
|
+
})[];
|
|
769
|
+
additionalProperties: boolean;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
|
|
248
774
|
/** @public */
|
|
249
775
|
declare const DEFAULT_TEMPLATE_ID = "pulse_default_alpha";
|
|
250
776
|
|
|
@@ -255,4 +781,4 @@ declare const permissions: {
|
|
|
255
781
|
surveyAdministerPermission: _backstage_plugin_permission_common.BasicPermission;
|
|
256
782
|
};
|
|
257
783
|
|
|
258
|
-
export { Choice, DEFAULT_TEMPLATE_ID, Question, Randomization, Statement, SurveyTemplate, permissions, validateTemplate };
|
|
784
|
+
export { Choice, DEFAULT_TEMPLATE_ID, Page, Question, Randomization, Section, Statement, SurveyTemplate, permissions, templateSchema, validateTemplate };
|