@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
@@ -63,9 +63,121 @@ export type CoreSchemaMetaSchema2 =
63
63
  */
64
64
  enum?: true[];
65
65
  type?:
66
- | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')
67
- | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')[];
68
- format?: string;
66
+ | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')
67
+ | (
68
+ | 'array'
69
+ | 'boolean'
70
+ | 'integer'
71
+ | 'null'
72
+ | 'number'
73
+ | 'object'
74
+ | 'string'
75
+ | 'FormattedText'
76
+ | 'SquizImage'
77
+ )[];
78
+ format?:
79
+ | 'date-time'
80
+ | 'email'
81
+ | 'hostname'
82
+ | 'ipv4'
83
+ | 'ipv6'
84
+ | 'json-pointer'
85
+ | 'matrix-asset-uri'
86
+ | 'multi-line'
87
+ | 'password'
88
+ | 'phone'
89
+ | 'regex'
90
+ | 'relative-json-pointer'
91
+ | 'uri-reference'
92
+ | 'uri-template'
93
+ | 'uri'
94
+ | 'uuid';
95
+ matrixAssetTypes?: (
96
+ | 'audioFile'
97
+ | 'bodycopyContainer'
98
+ | 'bodycopyDiv'
99
+ | 'calendarEventsSearchPage'
100
+ | 'contentContainerTemplate'
101
+ | 'contentTypeMarkdown'
102
+ | 'contentTypeNestContent'
103
+ | 'contentTypeRawHtml'
104
+ | 'contentTypeSnippet'
105
+ | 'contentTypeWysiwyg'
106
+ | 'cssFileFolder'
107
+ | 'cssFile'
108
+ | 'customForm'
109
+ | 'dataRecord'
110
+ | 'designAreaAssetLineage'
111
+ | 'designAreaBody'
112
+ | 'designAreaMenuNormal'
113
+ | 'designAreaNestContent'
114
+ | 'designCssCustomisation'
115
+ | 'designCss'
116
+ | 'designCustomisation'
117
+ | 'designScss'
118
+ | 'design'
119
+ | 'docx'
120
+ | 'excelDoc'
121
+ | 'file'
122
+ | 'folder'
123
+ | 'gitBridge'
124
+ | 'googleAnalyticsConnector'
125
+ | 'googleAnalyticsView'
126
+ | 'image'
127
+ | 'jsFileFolder'
128
+ | 'jsFile'
129
+ | 'jsonWebToken'
130
+ | 'layoutManager'
131
+ | 'layout'
132
+ | 'link'
133
+ | 'metadataFieldDate'
134
+ | 'metadataFieldRelatedAsset'
135
+ | 'metadataFieldSelect'
136
+ | 'metadataFieldText'
137
+ | 'metadataFieldWysiwyg'
138
+ | 'metadataSchema'
139
+ | 'metadataSection'
140
+ | 'newsItem'
141
+ | 'oauthAccountManager'
142
+ | 'pageAccountManager'
143
+ | 'pageAssetListing'
144
+ | 'pageCalendarEventsSearch'
145
+ | 'pageCalendar'
146
+ | 'pagePasswordReset'
147
+ | 'pageRemoteContent'
148
+ | 'pageRestResourceJs'
149
+ | 'pageRestResourceOauthSession'
150
+ | 'pageRestResourceOauthTwoLegged'
151
+ | 'pageRestResource'
152
+ | 'pageSiteMap'
153
+ | 'pageStandard'
154
+ | 'paintLayoutBodycopy'
155
+ | 'paintLayoutPage'
156
+ | 'pdfFile'
157
+ | 'pdf'
158
+ | 'persona'
159
+ | 'powerpointDoc'
160
+ | 'pptx'
161
+ | 'redirectPage'
162
+ | 'regex'
163
+ | 'regularExpression'
164
+ | 'rtfFile'
165
+ | 'samlAccountManager'
166
+ | 'saml2Acs'
167
+ | 'saml2Sls'
168
+ | 'searchPage'
169
+ | 'site'
170
+ | 'textFile'
171
+ | 'TriggerTypes?'
172
+ | 'userGroup'
173
+ | 'wordDoc'
174
+ | 'workflowSchema'
175
+ | 'workflowStepCondition'
176
+ | 'workflowStep'
177
+ | 'workflowStream'
178
+ | 'xlsx'
179
+ | 'xmlFile'
180
+ )[];
69
181
  contentMediaType?: string;
70
182
  contentEncoding?: string;
71
183
  if?: CoreSchemaMetaSchema2;
@@ -211,6 +323,28 @@ export interface ComponentManifest {
211
323
  previews?: {
212
324
  [k: string]: PreviewDefinition;
213
325
  };
326
+ /**
327
+ * Mocked uri objects used in the preview
328
+ */
329
+ mockedUris?: {
330
+ /**
331
+ * Property for defining the mock URI object
332
+ */
333
+ [k: string]:
334
+ | {
335
+ type: 'file';
336
+ /**
337
+ * Path to uri object
338
+ */
339
+ path: string;
340
+ [k: string]: unknown;
341
+ }
342
+ | {
343
+ type: 'inline';
344
+ value: MatrixAssetSchema;
345
+ [k: string]: unknown;
346
+ };
347
+ };
214
348
  }
215
349
  /**
216
350
  * Icon for the component in Matrix and the DXP
@@ -2529,9 +2663,111 @@ export interface CoreSchemaMetaSchema1 {
2529
2663
  */
2530
2664
  enum?: true[];
2531
2665
  type?:
2532
- | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')
2533
- | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')[];
2534
- format?: string;
2666
+ | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')
2667
+ | ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')[];
2668
+ format?:
2669
+ | 'date-time'
2670
+ | 'email'
2671
+ | 'hostname'
2672
+ | 'ipv4'
2673
+ | 'ipv6'
2674
+ | 'json-pointer'
2675
+ | 'matrix-asset-uri'
2676
+ | 'multi-line'
2677
+ | 'password'
2678
+ | 'phone'
2679
+ | 'regex'
2680
+ | 'relative-json-pointer'
2681
+ | 'uri-reference'
2682
+ | 'uri-template'
2683
+ | 'uri'
2684
+ | 'uuid';
2685
+ matrixAssetTypes?: (
2686
+ | 'audioFile'
2687
+ | 'bodycopyContainer'
2688
+ | 'bodycopyDiv'
2689
+ | 'calendarEventsSearchPage'
2690
+ | 'contentContainerTemplate'
2691
+ | 'contentTypeMarkdown'
2692
+ | 'contentTypeNestContent'
2693
+ | 'contentTypeRawHtml'
2694
+ | 'contentTypeSnippet'
2695
+ | 'contentTypeWysiwyg'
2696
+ | 'cssFileFolder'
2697
+ | 'cssFile'
2698
+ | 'customForm'
2699
+ | 'dataRecord'
2700
+ | 'designAreaAssetLineage'
2701
+ | 'designAreaBody'
2702
+ | 'designAreaMenuNormal'
2703
+ | 'designAreaNestContent'
2704
+ | 'designCssCustomisation'
2705
+ | 'designCss'
2706
+ | 'designCustomisation'
2707
+ | 'designScss'
2708
+ | 'design'
2709
+ | 'docx'
2710
+ | 'excelDoc'
2711
+ | 'file'
2712
+ | 'folder'
2713
+ | 'gitBridge'
2714
+ | 'googleAnalyticsConnector'
2715
+ | 'googleAnalyticsView'
2716
+ | 'image'
2717
+ | 'jsFileFolder'
2718
+ | 'jsFile'
2719
+ | 'jsonWebToken'
2720
+ | 'layoutManager'
2721
+ | 'layout'
2722
+ | 'link'
2723
+ | 'metadataFieldDate'
2724
+ | 'metadataFieldRelatedAsset'
2725
+ | 'metadataFieldSelect'
2726
+ | 'metadataFieldText'
2727
+ | 'metadataFieldWysiwyg'
2728
+ | 'metadataSchema'
2729
+ | 'metadataSection'
2730
+ | 'newsItem'
2731
+ | 'oauthAccountManager'
2732
+ | 'pageAccountManager'
2733
+ | 'pageAssetListing'
2734
+ | 'pageCalendarEventsSearch'
2735
+ | 'pageCalendar'
2736
+ | 'pagePasswordReset'
2737
+ | 'pageRemoteContent'
2738
+ | 'pageRestResourceJs'
2739
+ | 'pageRestResourceOauthSession'
2740
+ | 'pageRestResourceOauthTwoLegged'
2741
+ | 'pageRestResource'
2742
+ | 'pageSiteMap'
2743
+ | 'pageStandard'
2744
+ | 'paintLayoutBodycopy'
2745
+ | 'paintLayoutPage'
2746
+ | 'pdfFile'
2747
+ | 'pdf'
2748
+ | 'persona'
2749
+ | 'powerpointDoc'
2750
+ | 'pptx'
2751
+ | 'redirectPage'
2752
+ | 'regex'
2753
+ | 'regularExpression'
2754
+ | 'rtfFile'
2755
+ | 'samlAccountManager'
2756
+ | 'saml2Acs'
2757
+ | 'saml2Sls'
2758
+ | 'searchPage'
2759
+ | 'site'
2760
+ | 'textFile'
2761
+ | 'TriggerTypes?'
2762
+ | 'userGroup'
2763
+ | 'wordDoc'
2764
+ | 'workflowSchema'
2765
+ | 'workflowStepCondition'
2766
+ | 'workflowStep'
2767
+ | 'workflowStream'
2768
+ | 'xlsx'
2769
+ | 'xmlFile'
2770
+ )[];
2535
2771
  contentMediaType?: string;
2536
2772
  contentEncoding?: string;
2537
2773
  if?: CoreSchemaMetaSchema2;
@@ -2728,3 +2964,418 @@ export interface FunctionPreviewConfiguration {
2728
2964
  export interface ResponseHeaders2 {
2729
2965
  [k: string]: string;
2730
2966
  }
2967
+ /**
2968
+ * Inline URI object
2969
+ */
2970
+ export interface MatrixAssetSchema {
2971
+ /**
2972
+ * The asset ID.
2973
+ */
2974
+ id: string;
2975
+ /**
2976
+ * The asset type code.
2977
+ */
2978
+ type: string;
2979
+ /**
2980
+ * The asset type friendly name.
2981
+ */
2982
+ type_name: string;
2983
+ /**
2984
+ * The asset semantic version.
2985
+ */
2986
+ version: string;
2987
+ /**
2988
+ * The asset standard field name.
2989
+ */
2990
+ name: string;
2991
+ /**
2992
+ * The asset standard field short name.
2993
+ */
2994
+ short_name: string;
2995
+ /**
2996
+ * A object representing the asset status of the asset resource.
2997
+ */
2998
+ status: {
2999
+ /**
3000
+ * The bitwise id of the asset status
3001
+ */
3002
+ id: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256;
3003
+ /**
3004
+ * The type code of the asset status
3005
+ */
3006
+ code:
3007
+ | 'archived'
3008
+ | 'under_construction'
3009
+ | 'pending_approval'
3010
+ | 'approved'
3011
+ | 'live'
3012
+ | 'live_approval'
3013
+ | 'editing'
3014
+ | 'editing_approval'
3015
+ | 'editing_approved';
3016
+ /**
3017
+ * The description of the asset status
3018
+ */
3019
+ name?:
3020
+ | 'Archived'
3021
+ | 'Under Construction'
3022
+ | 'Pending Approval'
3023
+ | 'Approved To Go Live'
3024
+ | 'Live'
3025
+ | 'Up For Review'
3026
+ | 'Safe Editing'
3027
+ | 'Safe Editing Pending Approval'
3028
+ | 'Safe Edit Approved To Go Live';
3029
+ };
3030
+ /**
3031
+ * A object representing when the asset status was created.
3032
+ */
3033
+ created: {
3034
+ /**
3035
+ * The creation date of the asset in ISO 8601 format.
3036
+ */
3037
+ date: string | null;
3038
+ /**
3039
+ * The asset ID of the User that created the asset.
3040
+ */
3041
+ user_id: string | null;
3042
+ };
3043
+ /**
3044
+ * A object representing when the asset status was last updated.
3045
+ */
3046
+ updated: {
3047
+ /**
3048
+ * The last updated date of the asset in ISO 8601 format.
3049
+ */
3050
+ date: string | null;
3051
+ /**
3052
+ * The asset ID of the User that last updated the asset.
3053
+ */
3054
+ user_id: string | null;
3055
+ };
3056
+ /**
3057
+ * A object representing when the asset status was last published.
3058
+ */
3059
+ published: {
3060
+ /**
3061
+ * The last published date of the asset in ISO 8601 format.
3062
+ */
3063
+ date: string | null;
3064
+ /**
3065
+ * The asset ID of the User that last published the asset.
3066
+ */
3067
+ user_id: string | null;
3068
+ };
3069
+ /**
3070
+ * A object representing when the asset status was last changed.
3071
+ */
3072
+ status_changed?: {
3073
+ /**
3074
+ * The last date the state of the asset was changed in ISO 8601 format.
3075
+ */
3076
+ date: string | null;
3077
+ /**
3078
+ * The asset ID of the User that last changed the asset status.
3079
+ */
3080
+ user_id: string | null;
3081
+ };
3082
+ /**
3083
+ * The primary URL for the asset.
3084
+ */
3085
+ url: string;
3086
+ /**
3087
+ * All URLs for the asset including the primary URL.
3088
+ */
3089
+ urls: string[];
3090
+ /**
3091
+ * List of attributes for the asset in key-value form.
3092
+ */
3093
+ attributes: {
3094
+ [k: string]: unknown;
3095
+ };
3096
+ /**
3097
+ * List of metadata values in key-value form.
3098
+ */
3099
+ metadata?: {
3100
+ [k: string]: string[];
3101
+ };
3102
+ /**
3103
+ * The contents for the asset (excluding file assets).
3104
+ */
3105
+ contents?: string;
3106
+ /**
3107
+ * The thumbnail image associated with the asset, shows a subset data of an image or image variety.
3108
+ */
3109
+ thumbnail?: {
3110
+ /**
3111
+ * The asset ID of the Image asset of the file.
3112
+ */
3113
+ asset_id?: string;
3114
+ /**
3115
+ * The accessible URL of the thumbnail image file.
3116
+ */
3117
+ url?: string;
3118
+ /**
3119
+ * The file name of the thumbnail image.
3120
+ */
3121
+ file_name?: string;
3122
+ /**
3123
+ * The image file width in pixels.
3124
+ */
3125
+ width?: number;
3126
+ /**
3127
+ * The image file height in pixels.
3128
+ */
3129
+ height?: number;
3130
+ /**
3131
+ * The file type of the image file, generally its extension.
3132
+ */
3133
+ file_type?: string;
3134
+ /**
3135
+ * The file size in bytes
3136
+ */
3137
+ file_size?: number;
3138
+ /**
3139
+ * The file size in human readable format
3140
+ */
3141
+ file_size_readable?: number;
3142
+ /**
3143
+ * The friendly name of the file asset
3144
+ */
3145
+ title?: string;
3146
+ /**
3147
+ * The alt attribute of the Image asset
3148
+ */
3149
+ alt?: string;
3150
+ [k: string]: unknown;
3151
+ };
3152
+ /**
3153
+ * All direct dependent child assets of the asset in normalized asset format.
3154
+ */
3155
+ include_dependents?: MatrixAssetSchema1[];
3156
+ /**
3157
+ * Additional data of an arbitrary nature related to the requested asset, which may include derived information or special child asset information.
3158
+ */
3159
+ additional: AssetAdditionalInfo | FileAdditionalInfo | ImageAdditionalInfo | CalendarEventAdditionalInfo;
3160
+ [k: string]: unknown;
3161
+ }
3162
+ export interface MatrixAssetSchema1 {
3163
+ /**
3164
+ * The asset ID.
3165
+ */
3166
+ id: string;
3167
+ /**
3168
+ * The asset type code.
3169
+ */
3170
+ type: string;
3171
+ /**
3172
+ * The asset type friendly name.
3173
+ */
3174
+ type_name: string;
3175
+ /**
3176
+ * The asset semantic version.
3177
+ */
3178
+ version: string;
3179
+ /**
3180
+ * The asset standard field name.
3181
+ */
3182
+ name: string;
3183
+ /**
3184
+ * The asset standard field short name.
3185
+ */
3186
+ short_name: string;
3187
+ /**
3188
+ * A object representing the asset status of the asset resource.
3189
+ */
3190
+ status: {
3191
+ /**
3192
+ * The bitwise id of the asset status
3193
+ */
3194
+ id: 1 | 2 | 4 | 8 | 16 | 32 | 64 | 128 | 256;
3195
+ /**
3196
+ * The type code of the asset status
3197
+ */
3198
+ code:
3199
+ | 'archived'
3200
+ | 'under_construction'
3201
+ | 'pending_approval'
3202
+ | 'approved'
3203
+ | 'live'
3204
+ | 'live_approval'
3205
+ | 'editing'
3206
+ | 'editing_approval'
3207
+ | 'editing_approved';
3208
+ /**
3209
+ * The description of the asset status
3210
+ */
3211
+ name?:
3212
+ | 'Archived'
3213
+ | 'Under Construction'
3214
+ | 'Pending Approval'
3215
+ | 'Approved To Go Live'
3216
+ | 'Live'
3217
+ | 'Up For Review'
3218
+ | 'Safe Editing'
3219
+ | 'Safe Editing Pending Approval'
3220
+ | 'Safe Edit Approved To Go Live';
3221
+ };
3222
+ /**
3223
+ * A object representing when the asset status was created.
3224
+ */
3225
+ created: {
3226
+ /**
3227
+ * The creation date of the asset in ISO 8601 format.
3228
+ */
3229
+ date: string | null;
3230
+ /**
3231
+ * The asset ID of the User that created the asset.
3232
+ */
3233
+ user_id: string | null;
3234
+ };
3235
+ /**
3236
+ * A object representing when the asset status was last updated.
3237
+ */
3238
+ updated: {
3239
+ /**
3240
+ * The last updated date of the asset in ISO 8601 format.
3241
+ */
3242
+ date: string | null;
3243
+ /**
3244
+ * The asset ID of the User that last updated the asset.
3245
+ */
3246
+ user_id: string | null;
3247
+ };
3248
+ /**
3249
+ * A object representing when the asset status was last published.
3250
+ */
3251
+ published: {
3252
+ /**
3253
+ * The last published date of the asset in ISO 8601 format.
3254
+ */
3255
+ date: string | null;
3256
+ /**
3257
+ * The asset ID of the User that last published the asset.
3258
+ */
3259
+ user_id: string | null;
3260
+ };
3261
+ /**
3262
+ * A object representing when the asset status was last changed.
3263
+ */
3264
+ status_changed?: {
3265
+ /**
3266
+ * The last date the state of the asset was changed in ISO 8601 format.
3267
+ */
3268
+ date: string | null;
3269
+ /**
3270
+ * The asset ID of the User that last changed the asset status.
3271
+ */
3272
+ user_id: string | null;
3273
+ };
3274
+ /**
3275
+ * The primary URL for the asset.
3276
+ */
3277
+ url: string;
3278
+ /**
3279
+ * All URLs for the asset including the primary URL.
3280
+ */
3281
+ urls: string[];
3282
+ /**
3283
+ * List of attributes for the asset in key-value form.
3284
+ */
3285
+ attributes: {
3286
+ [k: string]: unknown;
3287
+ };
3288
+ /**
3289
+ * List of metadata values in key-value form.
3290
+ */
3291
+ metadata?: {
3292
+ [k: string]: string[];
3293
+ };
3294
+ /**
3295
+ * The contents for the asset (excluding file assets).
3296
+ */
3297
+ contents?: string;
3298
+ /**
3299
+ * The thumbnail image associated with the asset, shows a subset data of an image or image variety.
3300
+ */
3301
+ thumbnail?: {
3302
+ /**
3303
+ * The asset ID of the Image asset of the file.
3304
+ */
3305
+ asset_id?: string;
3306
+ /**
3307
+ * The accessible URL of the thumbnail image file.
3308
+ */
3309
+ url?: string;
3310
+ /**
3311
+ * The file name of the thumbnail image.
3312
+ */
3313
+ file_name?: string;
3314
+ /**
3315
+ * The image file width in pixels.
3316
+ */
3317
+ width?: number;
3318
+ /**
3319
+ * The image file height in pixels.
3320
+ */
3321
+ height?: number;
3322
+ /**
3323
+ * The file type of the image file, generally its extension.
3324
+ */
3325
+ file_type?: string;
3326
+ /**
3327
+ * The file size in bytes
3328
+ */
3329
+ file_size?: number;
3330
+ /**
3331
+ * The file size in human readable format
3332
+ */
3333
+ file_size_readable?: number;
3334
+ /**
3335
+ * The friendly name of the file asset
3336
+ */
3337
+ title?: string;
3338
+ /**
3339
+ * The alt attribute of the Image asset
3340
+ */
3341
+ alt?: string;
3342
+ [k: string]: unknown;
3343
+ };
3344
+ /**
3345
+ * All direct dependent child assets of the asset in normalized asset format.
3346
+ */
3347
+ include_dependents?: MatrixAssetSchema1[];
3348
+ /**
3349
+ * Additional data of an arbitrary nature related to the requested asset, which may include derived information or special child asset information.
3350
+ */
3351
+ additional: AssetAdditionalInfo | FileAdditionalInfo | ImageAdditionalInfo | CalendarEventAdditionalInfo;
3352
+ [k: string]: unknown;
3353
+ }
3354
+ export interface AssetAdditionalInfo {
3355
+ [k: string]: unknown;
3356
+ }
3357
+ export interface FileAdditionalInfo {
3358
+ file_info: {
3359
+ file_name?: string;
3360
+ size_readable?: string;
3361
+ size_bytes?: number;
3362
+ width?: number;
3363
+ height?: number;
3364
+ modified_readable?: string;
3365
+ modified_unix?: number;
3366
+ [k: string]: unknown;
3367
+ };
3368
+ [k: string]: unknown;
3369
+ }
3370
+ export interface ImageAdditionalInfo {
3371
+ varieties: MatrixAssetSchema1[];
3372
+ [k: string]: unknown;
3373
+ }
3374
+ export interface CalendarEventAdditionalInfo {
3375
+ event_info: {
3376
+ duration?: number;
3377
+ frequency?: string;
3378
+ [k: string]: unknown;
3379
+ };
3380
+ [k: string]: unknown;
3381
+ }
@@ -0,0 +1,24 @@
1
+ import { FORMATTED_TEXT_SCHEMAS } from '..';
2
+ import { BaseFormattedNodes, FormattedText } from '../formatted-text/v1/formattedText';
3
+ import { PrimitiveType } from '../jsonTypeResolution/TypeResolver';
4
+
5
+ export const FormattedTextType = PrimitiveType<FormattedText, 'FormattedText'>({
6
+ ...FORMATTED_TEXT_SCHEMAS.v1,
7
+ title: 'FormattedText',
8
+ });
9
+ export type FormattedTextType = typeof FormattedTextType;
10
+
11
+ export const BaseFormattedTextType = PrimitiveType<BaseFormattedNodes[], 'FormattedText'>({
12
+ ...FORMATTED_TEXT_SCHEMAS.v1,
13
+ items: {
14
+ $ref: '#/definitions/BaseFormattedNodes',
15
+ },
16
+ title: 'FormattedText',
17
+ });
18
+ export type BaseFormattedTextType = typeof BaseFormattedTextType;
19
+
20
+ export const ComponentInputFormattedTextType = PrimitiveType<string, 'FormattedText'>({
21
+ type: 'string',
22
+ title: 'FormattedText',
23
+ });
24
+ export type ComponentInputFormattedTextType = typeof ComponentInputFormattedTextType;