@squiz/dx-json-schema-lib 1.21.1-alpha.2 → 1.21.1-alpha.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/.npm/_logs/2023-03-16T10_16_41_384Z-debug-0.log +37 -0
  2. package/lib/JsonValidationService.d.ts +1 -1
  3. package/lib/JsonValidationService.js +23 -5
  4. package/lib/JsonValidationService.js.map +1 -1
  5. package/lib/JsonValidationService.spec.js +469 -426
  6. package/lib/JsonValidationService.spec.js.map +1 -1
  7. package/lib/index.d.ts +6 -1
  8. package/lib/index.js +6 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/jsonTypeResolution/{arbitraryTypeResolution.d.ts → TypeResolver.d.ts} +7 -12
  11. package/lib/jsonTypeResolution/{arbitraryTypeResolution.js → TypeResolver.js} +17 -17
  12. package/lib/jsonTypeResolution/TypeResolver.js.map +1 -0
  13. package/lib/jsonTypeResolution/{arbitraryTypeResolution.spec.js → TypeResolver.spec.js} +12 -39
  14. package/lib/jsonTypeResolution/TypeResolver.spec.js.map +1 -0
  15. package/lib/jsonTypeResolution/TypeResolverBuilder.d.ts +12 -0
  16. package/lib/jsonTypeResolution/TypeResolverBuilder.js +32 -0
  17. package/lib/jsonTypeResolution/TypeResolverBuilder.js.map +1 -0
  18. package/lib/manifest/v1/DxContentMetaSchema.json +117 -2
  19. package/lib/manifest/v1/MatrixAssetSchema.json +390 -0
  20. package/lib/manifest/v1/__test__/schemas/inputStringWithFormat.json +29 -0
  21. package/lib/manifest/v1/subSchemas.d.ts +2 -1
  22. package/lib/manifest/v1/subSchemas.js +3 -1
  23. package/lib/manifest/v1/subSchemas.js.map +1 -1
  24. package/lib/manifest/v1/v1.d.ts +405 -4
  25. package/lib/manifest/v1/v1.json +48 -0
  26. package/lib/primitiveTypes/FormattedText.d.ts +8 -0
  27. package/lib/primitiveTypes/FormattedText.js +21 -0
  28. package/lib/primitiveTypes/FormattedText.js.map +1 -0
  29. package/lib/primitiveTypes/SquizImage.d.ts +26 -0
  30. package/lib/primitiveTypes/SquizImage.js +105 -0
  31. package/lib/primitiveTypes/SquizImage.js.map +1 -0
  32. package/lib/primitiveTypes/index.d.ts +2 -0
  33. package/lib/primitiveTypes/index.js +19 -0
  34. package/lib/primitiveTypes/index.js.map +1 -0
  35. package/lib/resolvableTypes/MatrixAsset.d.ts +9 -0
  36. package/lib/resolvableTypes/MatrixAsset.js +21 -0
  37. package/lib/resolvableTypes/MatrixAsset.js.map +1 -0
  38. package/lib/resolvableTypes/index.d.ts +1 -0
  39. package/lib/resolvableTypes/index.js +18 -0
  40. package/lib/resolvableTypes/index.js.map +1 -0
  41. package/lib/validators/customFormatValidators.d.ts +2 -0
  42. package/lib/validators/customFormatValidators.js +14 -0
  43. package/lib/validators/customFormatValidators.js.map +1 -0
  44. package/lib/validators/utils/matrixAssetValidator.d.ts +2 -0
  45. package/lib/validators/utils/matrixAssetValidator.js +11 -0
  46. package/lib/validators/utils/matrixAssetValidator.js.map +1 -0
  47. package/lib/validators/utils/matrixAssetValidator.spec.d.ts +1 -0
  48. package/lib/validators/utils/matrixAssetValidator.spec.js +43 -0
  49. package/lib/validators/utils/matrixAssetValidator.spec.js.map +1 -0
  50. package/package.json +5 -4
  51. package/src/JsonValidationService.spec.ts +596 -533
  52. package/src/JsonValidationService.ts +28 -10
  53. package/src/index.ts +8 -1
  54. package/src/jsonTypeResolution/{arbitraryTypeResolution.spec.ts → TypeResolver.spec.ts} +23 -70
  55. package/src/jsonTypeResolution/{arbitraryTypeResolution.ts → TypeResolver.ts} +27 -23
  56. package/src/jsonTypeResolution/TypeResolverBuilder.ts +43 -0
  57. package/src/manifest/v1/DxContentMetaSchema.json +117 -2
  58. package/src/manifest/v1/MatrixAssetSchema.json +391 -0
  59. package/src/manifest/v1/__test__/schemas/inputStringWithFormat.json +29 -0
  60. package/src/manifest/v1/subSchemas.ts +2 -1
  61. package/src/manifest/v1/v1.json +48 -0
  62. package/src/manifest/v1/v1.ts +657 -6
  63. package/src/primitiveTypes/FormattedText.ts +24 -0
  64. package/src/primitiveTypes/SquizImage.ts +128 -0
  65. package/src/primitiveTypes/index.ts +2 -0
  66. package/src/resolvableTypes/MatrixAsset.ts +24 -0
  67. package/src/resolvableTypes/index.ts +1 -0
  68. package/src/validators/customFormatValidators.ts +15 -0
  69. package/src/validators/utils/matrixAssetValidator.spec.ts +49 -0
  70. package/src/validators/utils/matrixAssetValidator.ts +8 -0
  71. package/tsconfig.tsbuildinfo +1 -1
  72. package/.npm/_logs/2023-03-02T03_26_09_372Z-debug-0.log +0 -39
  73. package/lib/jsonTypeResolution/arbitraryTypeResolution.js.map +0 -1
  74. package/lib/jsonTypeResolution/arbitraryTypeResolution.spec.js.map +0 -1
  75. package/lib/jsonTypeResolution/index.d.ts +0 -76
  76. package/lib/jsonTypeResolution/index.js +0 -35
  77. package/lib/jsonTypeResolution/index.js.map +0 -1
  78. package/lib/jsonTypeResolution/primitiveTypes.d.ts +0 -10
  79. package/lib/jsonTypeResolution/primitiveTypes.js +0 -27
  80. package/lib/jsonTypeResolution/primitiveTypes.js.map +0 -1
  81. package/lib/jsonTypeResolution/resolvableTypes.d.ts +0 -12
  82. package/lib/jsonTypeResolution/resolvableTypes.js +0 -30
  83. package/lib/jsonTypeResolution/resolvableTypes.js.map +0 -1
  84. package/src/jsonTypeResolution/index.ts +0 -16
  85. package/src/jsonTypeResolution/primitiveTypes.ts +0 -32
  86. package/src/jsonTypeResolution/resolvableTypes.ts +0 -37
  87. /package/lib/jsonTypeResolution/{arbitraryTypeResolution.spec.d.ts → TypeResolver.spec.d.ts} +0 -0
@@ -59,8 +59,9 @@ export type CoreSchemaMetaSchema2 = {
59
59
  * @minItems 1
60
60
  */
61
61
  enum?: true[];
62
- type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText') | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')[];
63
- format?: string;
62
+ type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage') | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')[];
63
+ format?: 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'json-pointer' | 'matrix-asset-uri' | 'multi-line' | 'password' | 'phone' | 'regex' | 'relative-json-pointer' | 'uri-reference' | 'uri-template' | 'uri' | 'uuid';
64
+ matrixAssetTypes?: ('audioFile' | 'bodycopyContainer' | 'bodycopyDiv' | 'calendarEventsSearchPage' | 'contentContainerTemplate' | 'contentTypeMarkdown' | 'contentTypeNestContent' | 'contentTypeRawHtml' | 'contentTypeSnippet' | 'contentTypeWysiwyg' | 'cssFileFolder' | 'cssFile' | 'customForm' | 'dataRecord' | 'designAreaAssetLineage' | 'designAreaBody' | 'designAreaMenuNormal' | 'designAreaNestContent' | 'designCssCustomisation' | 'designCss' | 'designCustomisation' | 'designScss' | 'design' | 'docx' | 'excelDoc' | 'file' | 'folder' | 'gitBridge' | 'googleAnalyticsConnector' | 'googleAnalyticsView' | 'image' | 'jsFileFolder' | 'jsFile' | 'jsonWebToken' | 'layoutManager' | 'layout' | 'link' | 'metadataFieldDate' | 'metadataFieldRelatedAsset' | 'metadataFieldSelect' | 'metadataFieldText' | 'metadataFieldWysiwyg' | 'metadataSchema' | 'metadataSection' | 'newsItem' | 'oauthAccountManager' | 'pageAccountManager' | 'pageAssetListing' | 'pageCalendarEventsSearch' | 'pageCalendar' | 'pagePasswordReset' | 'pageRemoteContent' | 'pageRestResourceJs' | 'pageRestResourceOauthSession' | 'pageRestResourceOauthTwoLegged' | 'pageRestResource' | 'pageSiteMap' | 'pageStandard' | 'paintLayoutBodycopy' | 'paintLayoutPage' | 'pdfFile' | 'pdf' | 'persona' | 'powerpointDoc' | 'pptx' | 'redirectPage' | 'regex' | 'regularExpression' | 'rtfFile' | 'samlAccountManager' | 'saml2Acs' | 'saml2Sls' | 'searchPage' | 'site' | 'textFile' | 'TriggerTypes?' | 'userGroup' | 'wordDoc' | 'workflowSchema' | 'workflowStepCondition' | 'workflowStep' | 'workflowStream' | 'xlsx' | 'xmlFile')[];
64
65
  contentMediaType?: string;
65
66
  contentEncoding?: string;
66
67
  if?: CoreSchemaMetaSchema2;
@@ -200,6 +201,26 @@ export interface ComponentManifest {
200
201
  previews?: {
201
202
  [k: string]: PreviewDefinition;
202
203
  };
204
+ /**
205
+ * Mocked uri objects used in the preview
206
+ */
207
+ mockedUris?: {
208
+ /**
209
+ * Property for defining the mock URI object
210
+ */
211
+ [k: string]: {
212
+ type: 'file';
213
+ /**
214
+ * Path to uri object
215
+ */
216
+ path: string;
217
+ [k: string]: unknown;
218
+ } | {
219
+ type: 'inline';
220
+ value: MatrixAssetSchema;
221
+ [k: string]: unknown;
222
+ };
223
+ };
203
224
  }
204
225
  /**
205
226
  * Icon for the component in Matrix and the DXP
@@ -279,8 +300,9 @@ export interface CoreSchemaMetaSchema1 {
279
300
  * @minItems 1
280
301
  */
281
302
  enum?: true[];
282
- type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText') | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')[];
283
- format?: string;
303
+ type?: ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage') | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')[];
304
+ format?: 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'json-pointer' | 'matrix-asset-uri' | 'multi-line' | 'password' | 'phone' | 'regex' | 'relative-json-pointer' | 'uri-reference' | 'uri-template' | 'uri' | 'uuid';
305
+ matrixAssetTypes?: ('audioFile' | 'bodycopyContainer' | 'bodycopyDiv' | 'calendarEventsSearchPage' | 'contentContainerTemplate' | 'contentTypeMarkdown' | 'contentTypeNestContent' | 'contentTypeRawHtml' | 'contentTypeSnippet' | 'contentTypeWysiwyg' | 'cssFileFolder' | 'cssFile' | 'customForm' | 'dataRecord' | 'designAreaAssetLineage' | 'designAreaBody' | 'designAreaMenuNormal' | 'designAreaNestContent' | 'designCssCustomisation' | 'designCss' | 'designCustomisation' | 'designScss' | 'design' | 'docx' | 'excelDoc' | 'file' | 'folder' | 'gitBridge' | 'googleAnalyticsConnector' | 'googleAnalyticsView' | 'image' | 'jsFileFolder' | 'jsFile' | 'jsonWebToken' | 'layoutManager' | 'layout' | 'link' | 'metadataFieldDate' | 'metadataFieldRelatedAsset' | 'metadataFieldSelect' | 'metadataFieldText' | 'metadataFieldWysiwyg' | 'metadataSchema' | 'metadataSection' | 'newsItem' | 'oauthAccountManager' | 'pageAccountManager' | 'pageAssetListing' | 'pageCalendarEventsSearch' | 'pageCalendar' | 'pagePasswordReset' | 'pageRemoteContent' | 'pageRestResourceJs' | 'pageRestResourceOauthSession' | 'pageRestResourceOauthTwoLegged' | 'pageRestResource' | 'pageSiteMap' | 'pageStandard' | 'paintLayoutBodycopy' | 'paintLayoutPage' | 'pdfFile' | 'pdf' | 'persona' | 'powerpointDoc' | 'pptx' | 'redirectPage' | 'regex' | 'regularExpression' | 'rtfFile' | 'samlAccountManager' | 'saml2Acs' | 'saml2Sls' | 'searchPage' | 'site' | 'textFile' | 'TriggerTypes?' | 'userGroup' | 'wordDoc' | 'workflowSchema' | 'workflowStepCondition' | 'workflowStep' | 'workflowStream' | 'xlsx' | 'xmlFile')[];
284
306
  contentMediaType?: string;
285
307
  contentEncoding?: string;
286
308
  if?: CoreSchemaMetaSchema2;
@@ -457,3 +479,382 @@ export interface FunctionPreviewConfiguration {
457
479
  export interface ResponseHeaders2 {
458
480
  [k: string]: string;
459
481
  }
482
+ /**
483
+ * Inline URI object
484
+ */
485
+ export interface MatrixAssetSchema {
486
+ /**
487
+ * The asset ID.
488
+ */
489
+ id: string;
490
+ /**
491
+ * The asset type code.
492
+ */
493
+ type: string;
494
+ /**
495
+ * The asset type friendly name.
496
+ */
497
+ type_name: string;
498
+ /**
499
+ * The asset semantic version.
500
+ */
501
+ version: string;
502
+ /**
503
+ * The asset standard field name.
504
+ */
505
+ name: string;
506
+ /**
507
+ * The asset standard field short name.
508
+ */
509
+ short_name: string;
510
+ /**
511
+ * A object representing the asset status of the asset resource.
512
+ */
513
+ status: {
514
+ /**
515
+ * The bitwise id of the asset status
516
+ */
517
+ id: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256;
518
+ /**
519
+ * The type code of the asset status
520
+ */
521
+ code: 'archived' | 'under_construction' | 'pending_approval' | 'approved' | 'live' | 'live_approval' | 'editing' | 'editing_approval' | 'editing_approved';
522
+ /**
523
+ * The description of the asset status
524
+ */
525
+ name?: 'Archived' | 'Under Construction' | 'Pending Approval' | 'Approved To Go Live' | 'Live' | 'Up For Review' | 'Safe Editing' | 'Safe Editing Pending Approval' | 'Safe Edit Approved To Go Live';
526
+ };
527
+ /**
528
+ * A object representing when the asset status was created.
529
+ */
530
+ created: {
531
+ /**
532
+ * The creation date of the asset in ISO 8601 format.
533
+ */
534
+ date: string | null;
535
+ /**
536
+ * The asset ID of the User that created the asset.
537
+ */
538
+ user_id: string | null;
539
+ };
540
+ /**
541
+ * A object representing when the asset status was last updated.
542
+ */
543
+ updated: {
544
+ /**
545
+ * The last updated date of the asset in ISO 8601 format.
546
+ */
547
+ date: string | null;
548
+ /**
549
+ * The asset ID of the User that last updated the asset.
550
+ */
551
+ user_id: string | null;
552
+ };
553
+ /**
554
+ * A object representing when the asset status was last published.
555
+ */
556
+ published: {
557
+ /**
558
+ * The last published date of the asset in ISO 8601 format.
559
+ */
560
+ date: string | null;
561
+ /**
562
+ * The asset ID of the User that last published the asset.
563
+ */
564
+ user_id: string | null;
565
+ };
566
+ /**
567
+ * A object representing when the asset status was last changed.
568
+ */
569
+ status_changed?: {
570
+ /**
571
+ * The last date the state of the asset was changed in ISO 8601 format.
572
+ */
573
+ date: string | null;
574
+ /**
575
+ * The asset ID of the User that last changed the asset status.
576
+ */
577
+ user_id: string | null;
578
+ };
579
+ /**
580
+ * The primary URL for the asset.
581
+ */
582
+ url: string;
583
+ /**
584
+ * All URLs for the asset including the primary URL.
585
+ */
586
+ urls: string[];
587
+ /**
588
+ * List of attributes for the asset in key-value form.
589
+ */
590
+ attributes: {
591
+ [k: string]: unknown;
592
+ };
593
+ /**
594
+ * List of metadata values in key-value form.
595
+ */
596
+ metadata?: {
597
+ [k: string]: string[];
598
+ };
599
+ /**
600
+ * The contents for the asset (excluding file assets).
601
+ */
602
+ contents?: string;
603
+ /**
604
+ * The thumbnail image associated with the asset, shows a subset data of an image or image variety.
605
+ */
606
+ thumbnail?: {
607
+ /**
608
+ * The asset ID of the Image asset of the file.
609
+ */
610
+ asset_id?: string;
611
+ /**
612
+ * The accessible URL of the thumbnail image file.
613
+ */
614
+ url?: string;
615
+ /**
616
+ * The file name of the thumbnail image.
617
+ */
618
+ file_name?: string;
619
+ /**
620
+ * The image file width in pixels.
621
+ */
622
+ width?: number;
623
+ /**
624
+ * The image file height in pixels.
625
+ */
626
+ height?: number;
627
+ /**
628
+ * The file type of the image file, generally its extension.
629
+ */
630
+ file_type?: string;
631
+ /**
632
+ * The file size in bytes
633
+ */
634
+ file_size?: number;
635
+ /**
636
+ * The file size in human readable format
637
+ */
638
+ file_size_readable?: number;
639
+ /**
640
+ * The friendly name of the file asset
641
+ */
642
+ title?: string;
643
+ /**
644
+ * The alt attribute of the Image asset
645
+ */
646
+ alt?: string;
647
+ [k: string]: unknown;
648
+ };
649
+ /**
650
+ * All direct dependent child assets of the asset in normalized asset format.
651
+ */
652
+ include_dependents?: MatrixAssetSchema1[];
653
+ /**
654
+ * Additional data of an arbitrary nature related to the requested asset, which may include derived information or special child asset information.
655
+ */
656
+ additional: AssetAdditionalInfo | FileAdditionalInfo | ImageAdditionalInfo | CalendarEventAdditionalInfo;
657
+ [k: string]: unknown;
658
+ }
659
+ export interface MatrixAssetSchema1 {
660
+ /**
661
+ * The asset ID.
662
+ */
663
+ id: string;
664
+ /**
665
+ * The asset type code.
666
+ */
667
+ type: string;
668
+ /**
669
+ * The asset type friendly name.
670
+ */
671
+ type_name: string;
672
+ /**
673
+ * The asset semantic version.
674
+ */
675
+ version: string;
676
+ /**
677
+ * The asset standard field name.
678
+ */
679
+ name: string;
680
+ /**
681
+ * The asset standard field short name.
682
+ */
683
+ short_name: string;
684
+ /**
685
+ * A object representing the asset status of the asset resource.
686
+ */
687
+ status: {
688
+ /**
689
+ * The bitwise id of the asset status
690
+ */
691
+ id: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256;
692
+ /**
693
+ * The type code of the asset status
694
+ */
695
+ code: 'archived' | 'under_construction' | 'pending_approval' | 'approved' | 'live' | 'live_approval' | 'editing' | 'editing_approval' | 'editing_approved';
696
+ /**
697
+ * The description of the asset status
698
+ */
699
+ name?: 'Archived' | 'Under Construction' | 'Pending Approval' | 'Approved To Go Live' | 'Live' | 'Up For Review' | 'Safe Editing' | 'Safe Editing Pending Approval' | 'Safe Edit Approved To Go Live';
700
+ };
701
+ /**
702
+ * A object representing when the asset status was created.
703
+ */
704
+ created: {
705
+ /**
706
+ * The creation date of the asset in ISO 8601 format.
707
+ */
708
+ date: string | null;
709
+ /**
710
+ * The asset ID of the User that created the asset.
711
+ */
712
+ user_id: string | null;
713
+ };
714
+ /**
715
+ * A object representing when the asset status was last updated.
716
+ */
717
+ updated: {
718
+ /**
719
+ * The last updated date of the asset in ISO 8601 format.
720
+ */
721
+ date: string | null;
722
+ /**
723
+ * The asset ID of the User that last updated the asset.
724
+ */
725
+ user_id: string | null;
726
+ };
727
+ /**
728
+ * A object representing when the asset status was last published.
729
+ */
730
+ published: {
731
+ /**
732
+ * The last published date of the asset in ISO 8601 format.
733
+ */
734
+ date: string | null;
735
+ /**
736
+ * The asset ID of the User that last published the asset.
737
+ */
738
+ user_id: string | null;
739
+ };
740
+ /**
741
+ * A object representing when the asset status was last changed.
742
+ */
743
+ status_changed?: {
744
+ /**
745
+ * The last date the state of the asset was changed in ISO 8601 format.
746
+ */
747
+ date: string | null;
748
+ /**
749
+ * The asset ID of the User that last changed the asset status.
750
+ */
751
+ user_id: string | null;
752
+ };
753
+ /**
754
+ * The primary URL for the asset.
755
+ */
756
+ url: string;
757
+ /**
758
+ * All URLs for the asset including the primary URL.
759
+ */
760
+ urls: string[];
761
+ /**
762
+ * List of attributes for the asset in key-value form.
763
+ */
764
+ attributes: {
765
+ [k: string]: unknown;
766
+ };
767
+ /**
768
+ * List of metadata values in key-value form.
769
+ */
770
+ metadata?: {
771
+ [k: string]: string[];
772
+ };
773
+ /**
774
+ * The contents for the asset (excluding file assets).
775
+ */
776
+ contents?: string;
777
+ /**
778
+ * The thumbnail image associated with the asset, shows a subset data of an image or image variety.
779
+ */
780
+ thumbnail?: {
781
+ /**
782
+ * The asset ID of the Image asset of the file.
783
+ */
784
+ asset_id?: string;
785
+ /**
786
+ * The accessible URL of the thumbnail image file.
787
+ */
788
+ url?: string;
789
+ /**
790
+ * The file name of the thumbnail image.
791
+ */
792
+ file_name?: string;
793
+ /**
794
+ * The image file width in pixels.
795
+ */
796
+ width?: number;
797
+ /**
798
+ * The image file height in pixels.
799
+ */
800
+ height?: number;
801
+ /**
802
+ * The file type of the image file, generally its extension.
803
+ */
804
+ file_type?: string;
805
+ /**
806
+ * The file size in bytes
807
+ */
808
+ file_size?: number;
809
+ /**
810
+ * The file size in human readable format
811
+ */
812
+ file_size_readable?: number;
813
+ /**
814
+ * The friendly name of the file asset
815
+ */
816
+ title?: string;
817
+ /**
818
+ * The alt attribute of the Image asset
819
+ */
820
+ alt?: string;
821
+ [k: string]: unknown;
822
+ };
823
+ /**
824
+ * All direct dependent child assets of the asset in normalized asset format.
825
+ */
826
+ include_dependents?: MatrixAssetSchema1[];
827
+ /**
828
+ * Additional data of an arbitrary nature related to the requested asset, which may include derived information or special child asset information.
829
+ */
830
+ additional: AssetAdditionalInfo | FileAdditionalInfo | ImageAdditionalInfo | CalendarEventAdditionalInfo;
831
+ [k: string]: unknown;
832
+ }
833
+ export interface AssetAdditionalInfo {
834
+ [k: string]: unknown;
835
+ }
836
+ export interface FileAdditionalInfo {
837
+ file_info: {
838
+ file_name?: string;
839
+ size_readable?: string;
840
+ size_bytes?: number;
841
+ width?: number;
842
+ height?: number;
843
+ modified_readable?: string;
844
+ modified_unix?: number;
845
+ [k: string]: unknown;
846
+ };
847
+ [k: string]: unknown;
848
+ }
849
+ export interface ImageAdditionalInfo {
850
+ varieties: MatrixAssetSchema1[];
851
+ [k: string]: unknown;
852
+ }
853
+ export interface CalendarEventAdditionalInfo {
854
+ event_info: {
855
+ duration?: number;
856
+ frequency?: string;
857
+ [k: string]: unknown;
858
+ };
859
+ [k: string]: unknown;
860
+ }
@@ -361,6 +361,54 @@
361
361
  }
362
362
  }
363
363
  }
364
+ },
365
+ "mockedUris": {
366
+ "type": "object",
367
+ "description": "Mocked uri objects used in the preview",
368
+ "propertyNames": {
369
+ "type": "string",
370
+ "pattern": "^[a-z0-9_\\-]+:\\/\\/"
371
+ },
372
+ "additionalProperties": {
373
+ "type": "object",
374
+ "description": "Property for defining the mock URI object",
375
+ "properties": {
376
+ "type": {
377
+ "description": "An enum of 'file' or 'inline' for how the uri object is defined",
378
+ "enum": ["file", "inline"]
379
+ }
380
+ },
381
+ "required": ["type"],
382
+ "oneOf": [
383
+ {
384
+ "type": "object",
385
+ "properties": {
386
+ "type": {
387
+ "enum": ["file"]
388
+ },
389
+ "path": {
390
+ "type": "string",
391
+ "format": "uri-reference",
392
+ "description": "Path to uri object"
393
+ }
394
+ },
395
+ "required": ["type", "path"]
396
+ },
397
+ {
398
+ "type": "object",
399
+ "properties": {
400
+ "type": {
401
+ "enum": ["inline"]
402
+ },
403
+ "value": {
404
+ "$ref": "MatrixAssetSchema.json",
405
+ "description": "Inline URI object"
406
+ }
407
+ },
408
+ "required": ["type", "value"]
409
+ }
410
+ ]
411
+ }
364
412
  }
365
413
  },
366
414
  "required": ["name", "namespace", "displayName", "description", "version", "functions", "$schema", "mainFunction"],
@@ -0,0 +1,8 @@
1
+ import { BaseFormattedNodes, FormattedText } from '../formatted-text/v1/formattedText';
2
+ import { PrimitiveType } from '../jsonTypeResolution/TypeResolver';
3
+ export declare const FormattedTextType: PrimitiveType<"FormattedText", FormattedText>;
4
+ export type FormattedTextType = typeof FormattedTextType;
5
+ export declare const BaseFormattedTextType: PrimitiveType<"FormattedText", BaseFormattedNodes[]>;
6
+ export type BaseFormattedTextType = typeof BaseFormattedTextType;
7
+ export declare const ComponentInputFormattedTextType: PrimitiveType<"FormattedText", string>;
8
+ export type ComponentInputFormattedTextType = typeof ComponentInputFormattedTextType;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComponentInputFormattedTextType = exports.BaseFormattedTextType = exports.FormattedTextType = void 0;
4
+ const __1 = require("..");
5
+ const TypeResolver_1 = require("../jsonTypeResolution/TypeResolver");
6
+ exports.FormattedTextType = (0, TypeResolver_1.PrimitiveType)({
7
+ ...__1.FORMATTED_TEXT_SCHEMAS.v1,
8
+ title: 'FormattedText',
9
+ });
10
+ exports.BaseFormattedTextType = (0, TypeResolver_1.PrimitiveType)({
11
+ ...__1.FORMATTED_TEXT_SCHEMAS.v1,
12
+ items: {
13
+ $ref: '#/definitions/BaseFormattedNodes',
14
+ },
15
+ title: 'FormattedText',
16
+ });
17
+ exports.ComponentInputFormattedTextType = (0, TypeResolver_1.PrimitiveType)({
18
+ type: 'string',
19
+ title: 'FormattedText',
20
+ });
21
+ //# sourceMappingURL=FormattedText.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FormattedText.js","sourceRoot":"","sources":["../../src/primitiveTypes/FormattedText.ts"],"names":[],"mappings":";;;AAAA,0BAA4C;AAE5C,qEAAmE;AAEtD,QAAA,iBAAiB,GAAG,IAAA,4BAAa,EAAiC;IAC7E,GAAG,0BAAsB,CAAC,EAAE;IAC5B,KAAK,EAAE,eAAe;CACvB,CAAC,CAAC;AAGU,QAAA,qBAAqB,GAAG,IAAA,4BAAa,EAAwC;IACxF,GAAG,0BAAsB,CAAC,EAAE;IAC5B,KAAK,EAAE;QACL,IAAI,EAAE,kCAAkC;KACzC;IACD,KAAK,EAAE,eAAe;CACvB,CAAC,CAAC;AAGU,QAAA,+BAA+B,GAAG,IAAA,4BAAa,EAA0B;IACpF,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,eAAe;CACvB,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { PrimitiveType } from '../jsonTypeResolution/TypeResolver';
2
+ interface SquizImageData {
3
+ width: number;
4
+ height: number;
5
+ url: string;
6
+ mimeType: string;
7
+ byteSize: number;
8
+ sha1Hash: string;
9
+ aspectRatio: string;
10
+ }
11
+ interface SquizImageShape {
12
+ name: string;
13
+ alt?: string;
14
+ caption?: string;
15
+ exif?: import('exif').ExifData;
16
+ imageVariations: {
17
+ original: SquizImageData;
18
+ small?: SquizImageData[];
19
+ medium?: SquizImageData[];
20
+ large?: SquizImageData[];
21
+ aspectRatios?: SquizImageData[];
22
+ };
23
+ }
24
+ export declare const SquizImageType: PrimitiveType<"SquizImage", SquizImageShape>;
25
+ export type SquizImageType = typeof SquizImageType;
26
+ export {};
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SquizImageType = void 0;
4
+ const TypeResolver_1 = require("../jsonTypeResolution/TypeResolver");
5
+ exports.SquizImageType = (0, TypeResolver_1.PrimitiveType)({
6
+ title: 'SquizImage',
7
+ type: 'object',
8
+ properties: {
9
+ name: {
10
+ type: 'string',
11
+ },
12
+ alt: {
13
+ type: 'string',
14
+ },
15
+ caption: {
16
+ type: 'string',
17
+ },
18
+ exif: {
19
+ type: 'object',
20
+ properties: {
21
+ image: {
22
+ type: 'object',
23
+ },
24
+ thumbnail: {
25
+ type: 'object',
26
+ },
27
+ exif: {
28
+ type: 'object',
29
+ },
30
+ gps: {
31
+ type: 'object',
32
+ },
33
+ interoperability: {
34
+ type: 'object',
35
+ },
36
+ makernote: {
37
+ type: 'object',
38
+ },
39
+ },
40
+ required: ['image', 'thumbnail', 'exif', 'gps', 'interoperability', 'makernote'],
41
+ },
42
+ imageVariations: {
43
+ type: 'object',
44
+ properties: {
45
+ original: { $ref: '#/definitions/SquizImageData' },
46
+ small: {
47
+ type: 'array',
48
+ items: {
49
+ $ref: '#/definitions/SquizImageData',
50
+ },
51
+ },
52
+ medium: {
53
+ type: 'array',
54
+ items: {
55
+ $ref: '#/definitions/SquizImageData',
56
+ },
57
+ },
58
+ large: {
59
+ type: 'array',
60
+ items: {
61
+ $ref: '#/definitions/SquizImageData',
62
+ },
63
+ },
64
+ aspectRatios: {
65
+ type: 'array',
66
+ items: {
67
+ $ref: '#/definitions/SquizImageData',
68
+ },
69
+ },
70
+ },
71
+ required: ['original'],
72
+ },
73
+ },
74
+ required: ['name', 'imageVariations'],
75
+ definitions: {
76
+ SquizImageData: {
77
+ type: 'object',
78
+ properties: {
79
+ width: {
80
+ type: 'number',
81
+ },
82
+ height: {
83
+ type: 'number',
84
+ },
85
+ url: {
86
+ type: 'string',
87
+ },
88
+ mimeType: {
89
+ type: 'string',
90
+ },
91
+ byteSize: {
92
+ type: 'number',
93
+ },
94
+ sha1Hash: {
95
+ type: 'string',
96
+ },
97
+ aspectRatio: {
98
+ type: 'string',
99
+ },
100
+ },
101
+ required: ['width', 'height', 'url', 'mimeType', 'byteSize', 'sha1Hash', 'aspectRatio'],
102
+ },
103
+ },
104
+ });
105
+ //# sourceMappingURL=SquizImage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SquizImage.js","sourceRoot":"","sources":["../../src/primitiveTypes/SquizImage.ts"],"names":[],"mappings":";;;AAAA,qEAAmE;AA2BtD,QAAA,cAAc,GAAG,IAAA,4BAAa,EAAgC;IACzE,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;SACf;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;SACf;QACD,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;gBACD,IAAI,EAAE;oBACJ,IAAI,EAAE,QAAQ;iBACf;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACf;gBACD,gBAAgB,EAAE;oBAChB,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAAW,CAAC;SACjF;QACD,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE;gBAClD,KAAK,EAAE;oBACL,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,8BAA8B;qBACrC;iBACF;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,8BAA8B;qBACrC;iBACF;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,8BAA8B;qBACrC;iBACF;gBACD,YAAY,EAAE;oBACZ,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,8BAA8B;qBACrC;iBACF;aACF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,EAAE,iBAAiB,CAAC;IACrC,WAAW,EAAE;QACX,cAAc,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;iBACf;gBACD,GAAG,EAAE;oBACH,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;iBACf;gBACD,WAAW,EAAE;oBACX,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC;SACxF;KACF;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './SquizImage';
2
+ export * from './FormattedText';