@movable/rollup-plugin-manifest-validator 3.2.0-app-validation

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.mocharc.yml +3 -0
  2. package/babel.config.json +11 -0
  3. package/dist/apps/index.js +15 -0
  4. package/dist/apps/plugins/app-manifest-validator.js +44 -0
  5. package/dist/apps/utils/app-manifest-validator.js +44 -0
  6. package/dist/apps/validators/ajvCompiler.js +43 -0
  7. package/dist/apps/validators/erroringValidator.js +16 -0
  8. package/dist/apps/validators/index.js +23 -0
  9. package/dist/apps/validators/warningValidator.js +16 -0
  10. package/dist/index.js +21 -0
  11. package/dist/packages/index.js +15 -0
  12. package/dist/packages/plugins/package-manifest-validator.js +44 -0
  13. package/dist/packages/utils/package-manifest-validator.js +44 -0
  14. package/dist/packages/validators/ajvCompiler.js +43 -0
  15. package/dist/packages/validators/erroringValidator.js +16 -0
  16. package/dist/packages/validators/index.js +23 -0
  17. package/dist/packages/validators/warningValidator.js +16 -0
  18. package/dist/schemas/enums.js +14 -0
  19. package/dist/schemas/erroringSchemaApps.js +809 -0
  20. package/dist/schemas/erroringSchemaPackages.js +17 -0
  21. package/dist/schemas/index.js +39 -0
  22. package/dist/schemas/warningSchemaApps.js +8 -0
  23. package/dist/schemas/warningSchemaPackages.js +504 -0
  24. package/package.json +42 -0
  25. package/src/apps/index.js +3 -0
  26. package/src/apps/plugins/app-manifest-validator.js +22 -0
  27. package/src/apps/utils/app-manifest-validator.js +31 -0
  28. package/src/apps/validators/ajvCompiler.js +28 -0
  29. package/src/apps/validators/erroringValidator.js +4 -0
  30. package/src/apps/validators/index.js +4 -0
  31. package/src/apps/validators/warningValidator.js +4 -0
  32. package/src/index.js +4 -0
  33. package/src/packages/index.js +3 -0
  34. package/src/packages/plugins/package-manifest-validator.js +19 -0
  35. package/src/packages/utils/package-manifest-validator.js +31 -0
  36. package/src/packages/validators/ajvCompiler.js +28 -0
  37. package/src/packages/validators/erroringValidator.js +4 -0
  38. package/src/packages/validators/index.js +4 -0
  39. package/src/packages/validators/warningValidator.js +4 -0
  40. package/src/schemas/enums.js +130 -0
  41. package/src/schemas/erroringSchemaApps.js +468 -0
  42. package/src/schemas/erroringSchemaPackages.js +8 -0
  43. package/src/schemas/index.js +6 -0
  44. package/src/schemas/warningSchemaApps.js +1 -0
  45. package/src/schemas/warningSchemaPackages.js +304 -0
  46. package/test/fixtures/blankFile.js +0 -0
  47. package/test/fixtures/invalidField.yml +3 -0
  48. package/test/fixtures/master-app-manifest.yml +72 -0
  49. package/test/fixtures/master-package-manifest.yml +100 -0
  50. package/test/fixtures/noName.yml +1 -0
  51. package/test/helpers/lib.js +10 -0
  52. package/test/plugins/app-manifest-validation.js +34 -0
  53. package/test/plugins/package-manifest-validation.js +62 -0
  54. package/test/utils/app-manifest-validation.js +785 -0
  55. package/test/utils/package-manifest-validation.js +1515 -0
@@ -0,0 +1,809 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _enums = require("./enums");
9
+
10
+ const strNumBool = ['string', 'number', 'boolean'];
11
+ var _default = {
12
+ type: 'object',
13
+ additionalProperties: false,
14
+ required: ['name', 'authors'],
15
+ properties: {
16
+ name: {
17
+ type: 'string'
18
+ },
19
+ authors: {
20
+ type: 'array',
21
+ minItems: 1,
22
+ items: {
23
+ type: 'string'
24
+ }
25
+ },
26
+ stats: {
27
+ type: 'object',
28
+ required: ['page_name', 'groups'],
29
+ additionalProperties: false,
30
+ properties: {
31
+ page_name: {
32
+ type: 'string'
33
+ },
34
+ groups: {
35
+ type: 'array',
36
+ items: {
37
+ type: 'object',
38
+ required: ['name', 'events'],
39
+ additionalProperties: false,
40
+ properties: {
41
+ name: {
42
+ type: 'string'
43
+ },
44
+ calculation: {
45
+ enum: ['exclusive']
46
+ },
47
+ format: {
48
+ enum: ['percentage']
49
+ },
50
+ events: {
51
+ type: 'array',
52
+ items: {
53
+ type: 'object',
54
+ required: ['name', 'label'],
55
+ additionalProperties: false,
56
+ properties: {
57
+ name: {
58
+ type: 'string'
59
+ },
60
+ label: {
61
+ type: 'string'
62
+ },
63
+ hide_empty: {
64
+ type: 'boolean'
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ },
74
+ width: {
75
+ type: 'integer',
76
+ minimum: 0,
77
+ maximum: 2000
78
+ },
79
+ height: {
80
+ type: 'integer',
81
+ minimum: 0,
82
+ maximum: 10000
83
+ },
84
+ format: {
85
+ enum: ['auto', 'png', 'jpeg']
86
+ },
87
+ quality: {
88
+ type: 'number',
89
+ minimum: -1,
90
+ maximum: 100
91
+ },
92
+ documentation: {
93
+ type: 'string',
94
+ anyOf: [{
95
+ pattern: '^https?://'
96
+ }, {
97
+ const: ''
98
+ }]
99
+ },
100
+ expose_advanced_options: {
101
+ type: 'boolean'
102
+ },
103
+ description: {
104
+ type: 'string'
105
+ },
106
+ html_file: {
107
+ type: 'string'
108
+ },
109
+ css_file: {
110
+ type: 'string'
111
+ },
112
+ javascript_file: {
113
+ type: 'string'
114
+ },
115
+ data_loader_file: {
116
+ type: 'string'
117
+ },
118
+ label: {
119
+ type: 'string'
120
+ },
121
+ app_gallery_priority: {
122
+ type: 'number'
123
+ },
124
+ signals: {
125
+ type: 'boolean'
126
+ },
127
+ category: {
128
+ enum: ['content: social', 'content: media', 'context: location', 'context: time', 'custom', 'data: rendering', 'augmented reality']
129
+ },
130
+ icon: {
131
+ type: 'string'
132
+ },
133
+ icon_v2: {
134
+ type: 'string'
135
+ },
136
+ query_params: {
137
+ type: 'object',
138
+ additionalProperties: {
139
+ type: 'string'
140
+ }
141
+ },
142
+ hidden_query_params: {
143
+ type: 'object',
144
+ additionalProperties: {
145
+ type: 'string'
146
+ }
147
+ },
148
+ render_types: {
149
+ type: 'array',
150
+ items: {
151
+ enum: ['capturama', 'landing_page']
152
+ }
153
+ },
154
+ fields: {
155
+ type: 'array',
156
+ items: {
157
+ oneOf: [{
158
+ type: 'object',
159
+ additionalProperties: false,
160
+ required: ['name', 'type', 'label'],
161
+ properties: {
162
+ name: {
163
+ type: 'string',
164
+ not: {
165
+ enum: ['id', 'name', 'html', 'width', 'height', 'dataSource']
166
+ }
167
+ },
168
+ type: {
169
+ type: 'string',
170
+ enum: _enums.fieldTypes
171
+ },
172
+ label: {
173
+ type: 'string'
174
+ },
175
+ placeholder: {
176
+ type: ['string', 'number']
177
+ },
178
+ provider: {
179
+ type: 'string',
180
+ enum: ['twitter', 'instagram']
181
+ },
182
+ authorization_url: {
183
+ type: 'string',
184
+ pattern: '^https?://'
185
+ },
186
+ min: {
187
+ type: 'number'
188
+ },
189
+ max: {
190
+ type: 'number'
191
+ },
192
+ description: {
193
+ type: 'string'
194
+ },
195
+ template: {
196
+ type: 'string'
197
+ },
198
+ heading: {
199
+ type: 'string'
200
+ },
201
+ value: {
202
+ type: ['number', 'string', 'boolean']
203
+ },
204
+ options: {
205
+ type: 'array',
206
+ items: {
207
+ required: ['value', 'label'],
208
+ properties: {
209
+ value: {
210
+ type: ['string', 'number', 'boolean', 'null']
211
+ },
212
+ label: {
213
+ type: ['string', 'number']
214
+ }
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }, {
220
+ type: 'object',
221
+ additionalProperties: false,
222
+ required: ['name', 'type'],
223
+ properties: {
224
+ name: {
225
+ type: 'string',
226
+ not: {
227
+ enum: ['id', 'name', 'html', 'width', 'height', 'dataSource']
228
+ }
229
+ },
230
+ type: {
231
+ type: 'string',
232
+ enum: ['hidden']
233
+ },
234
+ label: {
235
+ type: 'string'
236
+ },
237
+ value: {
238
+ type: strNumBool
239
+ }
240
+ }
241
+ }]
242
+ }
243
+ },
244
+ field_headings: {
245
+ type: 'array',
246
+ items: {
247
+ type: 'object',
248
+ required: ['name', 'label'],
249
+ properties: {
250
+ name: {
251
+ type: 'string'
252
+ },
253
+ label: {
254
+ type: 'string'
255
+ },
256
+ toggleable: {
257
+ type: 'boolean'
258
+ },
259
+ default_toggle_collapsed: {
260
+ type: 'boolean'
261
+ }
262
+ }
263
+ }
264
+ },
265
+ package_manifests: {
266
+ type: 'array',
267
+ items: {
268
+ type: 'object',
269
+ additionalProperties: true
270
+ }
271
+ },
272
+ capture_options: {
273
+ type: 'object',
274
+ additionalProperties: false,
275
+ properties: {
276
+ cache_ttl: {
277
+ type: 'string',
278
+ pattern: '^\\d+(s|ms)$'
279
+ },
280
+ timeout: {
281
+ type: 'string',
282
+ pattern: '^\\d+(s|ms)$'
283
+ },
284
+ beta: {
285
+ type: 'boolean'
286
+ },
287
+ capturama_version: {
288
+ type: 'number'
289
+ },
290
+ legacy: {
291
+ type: 'boolean'
292
+ },
293
+ transparent: {
294
+ type: 'boolean'
295
+ },
296
+ animation: {
297
+ type: 'object',
298
+ properties: {
299
+ looping: {
300
+ type: 'boolean'
301
+ },
302
+ step_function: {
303
+ type: 'string'
304
+ },
305
+ streaming: {
306
+ type: 'boolean'
307
+ },
308
+ color_palette: {
309
+ type: 'string',
310
+ enum: ['global', 'local']
311
+ },
312
+ length: {
313
+ type: 'string',
314
+ pattern: '^\\d+(s|ms)$'
315
+ },
316
+ interval: {
317
+ type: 'string',
318
+ pattern: '^\\d+(s|ms)$'
319
+ }
320
+ }
321
+ },
322
+ format: {
323
+ type: 'string',
324
+ enum: ['jpeg', 'png']
325
+ }
326
+ }
327
+ },
328
+ data_loader: {
329
+ type: 'object',
330
+ additionalProperties: false,
331
+ properties: {
332
+ cache_ttl: {
333
+ type: 'string',
334
+ pattern: '^\\d+(s|ms)$'
335
+ },
336
+ timeout: {
337
+ type: 'string',
338
+ pattern: '^\\d+(s|ms)$'
339
+ },
340
+ query_params: {
341
+ type: 'object',
342
+ additionalProperties: {
343
+ type: 'string'
344
+ }
345
+ }
346
+ }
347
+ },
348
+ integration_ids: {
349
+ type: 'array',
350
+ items: {
351
+ type: 'string',
352
+ pattern: '^[a-zA-Z0-9]+$',
353
+ minLength: 15,
354
+ maxLength: 18
355
+ }
356
+ },
357
+ studio_options: {
358
+ type: 'object',
359
+ additionalProperties: false,
360
+ properties: {
361
+ prohibit_custom_params: {
362
+ type: 'boolean'
363
+ },
364
+ can_add_packages: {
365
+ type: 'boolean'
366
+ },
367
+ package_dependencies: {
368
+ type: 'array',
369
+ items: {
370
+ type: 'object',
371
+ required: ['name', 'version'],
372
+ properties: {
373
+ name: {
374
+ type: 'string'
375
+ },
376
+ version: {
377
+ type: 'string'
378
+ }
379
+ }
380
+ }
381
+ },
382
+ cold_state: {
383
+ type: 'object',
384
+ items: {
385
+ type: 'object',
386
+ required: ['packageName', 'name'],
387
+ properties: {
388
+ packageName: {
389
+ type: 'string'
390
+ },
391
+ name: {
392
+ type: 'string'
393
+ }
394
+ }
395
+ }
396
+ },
397
+ framework_version: {
398
+ type: ['string', 'number']
399
+ },
400
+ tools: {
401
+ type: 'array',
402
+ items: {
403
+ type: 'object',
404
+ additionalProperties: false,
405
+ required: ['name', 'type', 'icon'],
406
+ properties: {
407
+ name: {
408
+ type: 'string'
409
+ },
410
+ type: {
411
+ type: 'string'
412
+ },
413
+ icon: {
414
+ type: 'string',
415
+ enum: _enums.studioIcons
416
+ },
417
+ label: {
418
+ type: ['string', 'number']
419
+ },
420
+ class_names: {
421
+ type: 'string'
422
+ },
423
+ locked: {
424
+ type: 'boolean'
425
+ },
426
+ has_source_index: {
427
+ type: 'boolean'
428
+ },
429
+ advanced: {
430
+ type: 'object',
431
+ properties: {
432
+ autoresize: {
433
+ type: 'boolean'
434
+ }
435
+ }
436
+ },
437
+ defaults: {
438
+ properties: {
439
+ richText: {
440
+ type: 'array',
441
+ items: {
442
+ type: 'object',
443
+ required: ['insert'],
444
+ properties: {
445
+ insert: {
446
+ type: 'string'
447
+ },
448
+ attributes: {
449
+ type: 'object'
450
+ }
451
+ }
452
+ }
453
+ },
454
+ previewTokenMap: {
455
+ type: 'object',
456
+ additionalProperties: {
457
+ type: strNumBool
458
+ }
459
+ },
460
+ dynamicProperty: {
461
+ type: 'object',
462
+ required: ['propertyPath'],
463
+ properties: {
464
+ propertyPath: {
465
+ type: 'string'
466
+ },
467
+ propertyPreview: {
468
+ type: 'string'
469
+ },
470
+ propertyFallback: {
471
+ type: 'string'
472
+ },
473
+ propertyGroupKey: {
474
+ type: 'string'
475
+ },
476
+ propertyValue: {
477
+ type: 'string'
478
+ },
479
+ contextOptions: {
480
+ type: 'object',
481
+ required: ['name', 'type'],
482
+ properties: {
483
+ name: {
484
+ type: 'string'
485
+ },
486
+ description: {
487
+ type: 'string'
488
+ },
489
+ type: {
490
+ type: 'string',
491
+ enum: _enums.contextOptionTypes
492
+ },
493
+ defaultValue: {
494
+ type: strNumBool
495
+ },
496
+ options: {
497
+ type: 'array',
498
+ items: {
499
+ type: 'object',
500
+ required: ['value', 'label'],
501
+ properties: {
502
+ value: {
503
+ type: strNumBool
504
+ },
505
+ label: {
506
+ type: 'string'
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+ },
516
+ additionalProperties: {
517
+ type: strNumBool
518
+ }
519
+ },
520
+ fields: {
521
+ type: 'array',
522
+ items: {
523
+ type: 'object',
524
+ required: ['name', 'type'],
525
+ properties: {
526
+ name: {
527
+ type: 'string'
528
+ },
529
+ type: {
530
+ type: 'string',
531
+ enum: ['select', 'textarea', 'text', 'checkbox', 'color', 'image', 'date', 'datetime', 'number', 'radio', 'dynamicProperty']
532
+ },
533
+ label: {
534
+ type: ['string', 'number']
535
+ },
536
+ hidden: {
537
+ type: 'boolean'
538
+ },
539
+ disabled: {
540
+ type: 'boolean'
541
+ },
542
+ placeholder: {
543
+ type: ['number', 'string']
544
+ }
545
+ }
546
+ }
547
+ },
548
+ dynamic_fields: {
549
+ type: 'array',
550
+ items: {
551
+ type: 'object',
552
+ required: ['name', 'type'],
553
+ properties: {
554
+ name: {
555
+ type: 'string'
556
+ },
557
+ type: {
558
+ type: 'string'
559
+ },
560
+ allow_static_option: {
561
+ type: 'boolean'
562
+ },
563
+ label: {
564
+ type: 'string'
565
+ }
566
+ }
567
+ }
568
+ }
569
+ }
570
+ }
571
+ },
572
+ data_options: {
573
+ required: ['label'],
574
+ properties: {
575
+ label: {
576
+ type: ['string', 'number']
577
+ },
578
+ min: {
579
+ type: 'integer'
580
+ },
581
+ max: {
582
+ type: 'integer'
583
+ }
584
+ }
585
+ },
586
+ preview_fields: {
587
+ type: 'array',
588
+ items: {
589
+ enum: ['location', 'date-time']
590
+ }
591
+ },
592
+ element_modifiers: {
593
+ type: 'array',
594
+ items: {
595
+ type: 'object',
596
+ additionalProperties: false,
597
+ required: ['name', 'label'],
598
+ properties: {
599
+ name: {
600
+ type: 'string'
601
+ },
602
+ label: {
603
+ type: 'string'
604
+ },
605
+ description: {
606
+ type: 'string'
607
+ }
608
+ }
609
+ }
610
+ },
611
+ property_groups: {
612
+ type: 'array',
613
+ items: {
614
+ type: 'object',
615
+ required: ['name', 'label', 'properties'],
616
+ properties: {
617
+ name: {
618
+ type: 'string'
619
+ },
620
+ label: {
621
+ type: 'string'
622
+ },
623
+ description: {
624
+ type: 'string'
625
+ },
626
+ properties: {
627
+ type: 'array',
628
+ items: {
629
+ type: 'object',
630
+ required: ['name', 'label'],
631
+ properties: {
632
+ name: {
633
+ type: 'string'
634
+ },
635
+ label: {
636
+ type: 'string'
637
+ },
638
+ options_description: {
639
+ type: 'string'
640
+ },
641
+ type: {
642
+ type: 'string',
643
+ enum: _enums.propertyTypes
644
+ },
645
+ context_options: {
646
+ type: 'array',
647
+ items: {
648
+ type: 'object',
649
+ required: ['name', 'type'],
650
+ properties: {
651
+ name: {
652
+ type: 'string'
653
+ },
654
+ description: {
655
+ type: 'string'
656
+ },
657
+ type: {
658
+ type: 'string',
659
+ enum: _enums.contextOptionTypes
660
+ },
661
+ defaultValue: {
662
+ type: strNumBool
663
+ },
664
+ options: {
665
+ type: 'array',
666
+ items: {
667
+ type: 'object',
668
+ required: ['value', 'label'],
669
+ properties: {
670
+ value: {
671
+ type: strNumBool
672
+ },
673
+ label: {
674
+ type: 'string'
675
+ }
676
+ }
677
+ }
678
+ }
679
+ }
680
+ }
681
+ },
682
+ preview_values: {
683
+ type: 'array',
684
+ items: {
685
+ type: strNumBool
686
+ }
687
+ }
688
+ }
689
+ }
690
+ }
691
+ }
692
+ }
693
+ }
694
+ }
695
+ },
696
+ auto_pass_params: {
697
+ type: 'boolean'
698
+ },
699
+ ignored_query_params: {
700
+ type: 'array',
701
+ items: {
702
+ type: 'string'
703
+ }
704
+ },
705
+ data_source_definitions: {
706
+ type: 'object',
707
+ additionalProperties: {
708
+ type: 'object',
709
+ additionalProperties: false,
710
+ required: ['name', 'type'],
711
+ properties: {
712
+ name: {
713
+ type: 'string'
714
+ },
715
+ type: {
716
+ type: 'string',
717
+ enum: ['ApiDataSource']
718
+ },
719
+ url: {
720
+ type: 'string',
721
+ pattern: '^https?://'
722
+ },
723
+ content_type: {
724
+ type: 'string'
725
+ },
726
+ auth_type: {
727
+ type: 'string',
728
+ enum: ['none', 'basic_http', 'bearer']
729
+ },
730
+ http_method: {
731
+ type: 'string',
732
+ enum: ['GET', 'POST', 'PUT', 'DELETE']
733
+ },
734
+ username: {
735
+ type: 'string'
736
+ },
737
+ password: {
738
+ type: 'string'
739
+ },
740
+ bearer: {
741
+ type: 'string'
742
+ },
743
+ origin: {
744
+ type: 'string'
745
+ },
746
+ accept_type: {
747
+ type: 'string'
748
+ },
749
+ data_type: {
750
+ type: 'string'
751
+ },
752
+ body: {
753
+ type: 'string'
754
+ },
755
+ request_headers: {
756
+ type: 'array',
757
+ items: {
758
+ type: 'object',
759
+ additionalProperties: false,
760
+ required: ['name', 'value'],
761
+ properties: {
762
+ name: {
763
+ type: ['string']
764
+ },
765
+ value: {
766
+ type: ['string']
767
+ }
768
+ }
769
+ }
770
+ },
771
+ sample_responses: {
772
+ type: 'array',
773
+ items: {
774
+ type: 'object',
775
+ additionalProperties: false,
776
+ required: ['name', 'path'],
777
+ properties: {
778
+ name: {
779
+ type: ['string']
780
+ },
781
+ path: {
782
+ type: ['string']
783
+ }
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+ },
790
+ clickthrough_dynamic_property: {
791
+ type: 'object',
792
+ additionalProperties: false,
793
+ required: ['property_path', 'property_group_key'],
794
+ properties: {
795
+ property_path: {
796
+ type: 'string'
797
+ },
798
+ property_group_key: {
799
+ type: 'string'
800
+ },
801
+ context: {
802
+ type: 'object',
803
+ additionalProperties: true
804
+ }
805
+ }
806
+ }
807
+ }
808
+ };
809
+ exports.default = _default;