@squiz/dx-json-schema-lib 1.21.1-alpha.3 → 1.21.1-alpha.31
Sign up to get free protection for your applications and to get access to all the features.
- package/.npm/_logs/2023-03-22T03_52_09_815Z-debug-0.log +37 -0
- package/lib/JsonValidationService.d.ts +1 -1
- package/lib/JsonValidationService.js +18 -5
- package/lib/JsonValidationService.js.map +1 -1
- package/lib/JsonValidationService.spec.js +444 -445
- package/lib/JsonValidationService.spec.js.map +1 -1
- package/lib/index.d.ts +6 -1
- package/lib/index.js +6 -1
- package/lib/index.js.map +1 -1
- package/lib/jsonTypeResolution/{arbitraryTypeResolution.d.ts → TypeResolver.d.ts} +7 -12
- package/lib/jsonTypeResolution/{arbitraryTypeResolution.js → TypeResolver.js} +17 -17
- package/lib/jsonTypeResolution/TypeResolver.js.map +1 -0
- package/lib/jsonTypeResolution/{arbitraryTypeResolution.spec.js → TypeResolver.spec.js} +12 -39
- package/lib/jsonTypeResolution/TypeResolver.spec.js.map +1 -0
- package/lib/jsonTypeResolution/TypeResolverBuilder.d.ts +12 -0
- package/lib/jsonTypeResolution/TypeResolverBuilder.js +32 -0
- package/lib/jsonTypeResolution/TypeResolverBuilder.js.map +1 -0
- package/lib/manifest/v1/DxContentMetaSchema.json +1 -1
- package/lib/manifest/v1/MatrixAssetSchema.json +390 -0
- package/lib/manifest/v1/subSchemas.d.ts +2 -1
- package/lib/manifest/v1/subSchemas.js +3 -1
- package/lib/manifest/v1/subSchemas.js.map +1 -1
- package/lib/manifest/v1/v1.d.ts +401 -2
- package/lib/manifest/v1/v1.json +48 -0
- package/lib/primitiveTypes/FormattedText.d.ts +8 -0
- package/lib/primitiveTypes/FormattedText.js +21 -0
- package/lib/primitiveTypes/FormattedText.js.map +1 -0
- package/lib/primitiveTypes/SquizImage.d.ts +26 -0
- package/lib/primitiveTypes/SquizImage.js +105 -0
- package/lib/primitiveTypes/SquizImage.js.map +1 -0
- package/lib/primitiveTypes/index.d.ts +2 -0
- package/lib/primitiveTypes/index.js +19 -0
- package/lib/primitiveTypes/index.js.map +1 -0
- package/lib/resolvableTypes/MatrixAsset.d.ts +9 -0
- package/lib/resolvableTypes/MatrixAsset.js +21 -0
- package/lib/resolvableTypes/MatrixAsset.js.map +1 -0
- package/lib/resolvableTypes/index.d.ts +1 -0
- package/lib/resolvableTypes/index.js +18 -0
- package/lib/resolvableTypes/index.js.map +1 -0
- package/package.json +5 -4
- package/src/JsonValidationService.spec.ts +585 -584
- package/src/JsonValidationService.ts +23 -9
- package/src/index.ts +8 -1
- package/src/jsonTypeResolution/{arbitraryTypeResolution.spec.ts → TypeResolver.spec.ts} +23 -70
- package/src/jsonTypeResolution/{arbitraryTypeResolution.ts → TypeResolver.ts} +27 -23
- package/src/jsonTypeResolution/TypeResolverBuilder.ts +43 -0
- package/src/manifest/v1/DxContentMetaSchema.json +1 -1
- package/src/manifest/v1/MatrixAssetSchema.json +391 -0
- package/src/manifest/v1/subSchemas.ts +2 -1
- package/src/manifest/v1/v1.json +48 -0
- package/src/manifest/v1/v1.ts +451 -4
- package/src/primitiveTypes/FormattedText.ts +24 -0
- package/src/primitiveTypes/SquizImage.ts +128 -0
- package/src/primitiveTypes/index.ts +2 -0
- package/src/resolvableTypes/MatrixAsset.ts +24 -0
- package/src/resolvableTypes/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/.npm/_logs/2023-03-03T02_38_06_635Z-debug-0.log +0 -39
- package/lib/jsonTypeResolution/arbitraryTypeResolution.js.map +0 -1
- package/lib/jsonTypeResolution/arbitraryTypeResolution.spec.js.map +0 -1
- package/lib/jsonTypeResolution/index.d.ts +0 -76
- package/lib/jsonTypeResolution/index.js +0 -35
- package/lib/jsonTypeResolution/index.js.map +0 -1
- package/lib/jsonTypeResolution/primitiveTypes.d.ts +0 -10
- package/lib/jsonTypeResolution/primitiveTypes.js +0 -27
- package/lib/jsonTypeResolution/primitiveTypes.js.map +0 -1
- package/lib/jsonTypeResolution/resolvableTypes.d.ts +0 -12
- package/lib/jsonTypeResolution/resolvableTypes.js +0 -30
- package/lib/jsonTypeResolution/resolvableTypes.js.map +0 -1
- package/src/jsonTypeResolution/index.ts +0 -16
- package/src/jsonTypeResolution/primitiveTypes.ts +0 -32
- package/src/jsonTypeResolution/resolvableTypes.ts +0 -37
- /package/lib/jsonTypeResolution/{arbitraryTypeResolution.spec.d.ts → TypeResolver.spec.d.ts} +0 -0
package/src/manifest/v1/v1.ts
CHANGED
@@ -63,8 +63,18 @@ export type CoreSchemaMetaSchema2 =
|
|
63
63
|
*/
|
64
64
|
enum?: true[];
|
65
65
|
type?:
|
66
|
-
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')
|
67
|
-
| (
|
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
|
+
)[];
|
68
78
|
format?:
|
69
79
|
| 'date-time'
|
70
80
|
| 'email'
|
@@ -313,6 +323,28 @@ export interface ComponentManifest {
|
|
313
323
|
previews?: {
|
314
324
|
[k: string]: PreviewDefinition;
|
315
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
|
+
};
|
316
348
|
}
|
317
349
|
/**
|
318
350
|
* Icon for the component in Matrix and the DXP
|
@@ -2631,8 +2663,8 @@ export interface CoreSchemaMetaSchema1 {
|
|
2631
2663
|
*/
|
2632
2664
|
enum?: true[];
|
2633
2665
|
type?:
|
2634
|
-
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')
|
2635
|
-
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText')[];
|
2666
|
+
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')
|
2667
|
+
| ('array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string' | 'FormattedText' | 'SquizImage')[];
|
2636
2668
|
format?:
|
2637
2669
|
| 'date-time'
|
2638
2670
|
| 'email'
|
@@ -2932,3 +2964,418 @@ export interface FunctionPreviewConfiguration {
|
|
2932
2964
|
export interface ResponseHeaders2 {
|
2933
2965
|
[k: string]: string;
|
2934
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;
|
@@ -0,0 +1,128 @@
|
|
1
|
+
import { PrimitiveType } from '../jsonTypeResolution/TypeResolver';
|
2
|
+
|
3
|
+
interface SquizImageData {
|
4
|
+
width: number;
|
5
|
+
height: number;
|
6
|
+
url: string;
|
7
|
+
mimeType: string;
|
8
|
+
byteSize: number;
|
9
|
+
sha1Hash: string;
|
10
|
+
aspectRatio: string; // Enforced validation of something like /\d+:\d+/
|
11
|
+
}
|
12
|
+
|
13
|
+
interface SquizImageShape {
|
14
|
+
name: string;
|
15
|
+
alt?: string;
|
16
|
+
caption?: string;
|
17
|
+
|
18
|
+
exif?: import('exif').ExifData;
|
19
|
+
|
20
|
+
imageVariations: {
|
21
|
+
original: SquizImageData;
|
22
|
+
small?: SquizImageData[];
|
23
|
+
medium?: SquizImageData[];
|
24
|
+
large?: SquizImageData[];
|
25
|
+
aspectRatios?: SquizImageData[];
|
26
|
+
};
|
27
|
+
}
|
28
|
+
export const SquizImageType = PrimitiveType<SquizImageShape, 'SquizImage'>({
|
29
|
+
title: 'SquizImage',
|
30
|
+
type: 'object',
|
31
|
+
properties: {
|
32
|
+
name: {
|
33
|
+
type: 'string',
|
34
|
+
},
|
35
|
+
alt: {
|
36
|
+
type: 'string',
|
37
|
+
},
|
38
|
+
caption: {
|
39
|
+
type: 'string',
|
40
|
+
},
|
41
|
+
exif: {
|
42
|
+
type: 'object',
|
43
|
+
properties: {
|
44
|
+
image: {
|
45
|
+
type: 'object',
|
46
|
+
},
|
47
|
+
thumbnail: {
|
48
|
+
type: 'object',
|
49
|
+
},
|
50
|
+
exif: {
|
51
|
+
type: 'object',
|
52
|
+
},
|
53
|
+
gps: {
|
54
|
+
type: 'object',
|
55
|
+
},
|
56
|
+
interoperability: {
|
57
|
+
type: 'object',
|
58
|
+
},
|
59
|
+
makernote: {
|
60
|
+
type: 'object',
|
61
|
+
},
|
62
|
+
},
|
63
|
+
required: ['image', 'thumbnail', 'exif', 'gps', 'interoperability', 'makernote'],
|
64
|
+
},
|
65
|
+
imageVariations: {
|
66
|
+
type: 'object',
|
67
|
+
properties: {
|
68
|
+
original: { $ref: '#/definitions/SquizImageData' },
|
69
|
+
small: {
|
70
|
+
type: 'array',
|
71
|
+
items: {
|
72
|
+
$ref: '#/definitions/SquizImageData',
|
73
|
+
},
|
74
|
+
},
|
75
|
+
medium: {
|
76
|
+
type: 'array',
|
77
|
+
items: {
|
78
|
+
$ref: '#/definitions/SquizImageData',
|
79
|
+
},
|
80
|
+
},
|
81
|
+
large: {
|
82
|
+
type: 'array',
|
83
|
+
items: {
|
84
|
+
$ref: '#/definitions/SquizImageData',
|
85
|
+
},
|
86
|
+
},
|
87
|
+
aspectRatios: {
|
88
|
+
type: 'array',
|
89
|
+
items: {
|
90
|
+
$ref: '#/definitions/SquizImageData',
|
91
|
+
},
|
92
|
+
},
|
93
|
+
},
|
94
|
+
required: ['original'],
|
95
|
+
},
|
96
|
+
},
|
97
|
+
required: ['name', 'imageVariations'],
|
98
|
+
definitions: {
|
99
|
+
SquizImageData: {
|
100
|
+
type: 'object',
|
101
|
+
properties: {
|
102
|
+
width: {
|
103
|
+
type: 'number',
|
104
|
+
},
|
105
|
+
height: {
|
106
|
+
type: 'number',
|
107
|
+
},
|
108
|
+
url: {
|
109
|
+
type: 'string',
|
110
|
+
},
|
111
|
+
mimeType: {
|
112
|
+
type: 'string',
|
113
|
+
},
|
114
|
+
byteSize: {
|
115
|
+
type: 'number',
|
116
|
+
},
|
117
|
+
sha1Hash: {
|
118
|
+
type: 'string',
|
119
|
+
},
|
120
|
+
aspectRatio: {
|
121
|
+
type: 'string',
|
122
|
+
},
|
123
|
+
},
|
124
|
+
required: ['width', 'height', 'url', 'mimeType', 'byteSize', 'sha1Hash', 'aspectRatio'],
|
125
|
+
},
|
126
|
+
},
|
127
|
+
});
|
128
|
+
export type SquizImageType = typeof SquizImageType;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { ResolvableType } from '../jsonTypeResolution/TypeResolver';
|
2
|
+
|
3
|
+
interface MatrixAssetShape {
|
4
|
+
matrixAssetId: string;
|
5
|
+
matrixIdentifier: string;
|
6
|
+
matrixDomain?: string;
|
7
|
+
}
|
8
|
+
export const MatrixAssetType = ResolvableType<MatrixAssetShape, 'MatrixAsset'>({
|
9
|
+
title: 'MatrixAsset',
|
10
|
+
type: 'object',
|
11
|
+
properties: {
|
12
|
+
matrixAssetId: {
|
13
|
+
type: 'string',
|
14
|
+
},
|
15
|
+
matrixIdentifier: {
|
16
|
+
type: 'string',
|
17
|
+
},
|
18
|
+
matrixDomain: {
|
19
|
+
type: 'string',
|
20
|
+
},
|
21
|
+
},
|
22
|
+
required: ['matrixAssetId', 'matrixIdentifier'],
|
23
|
+
});
|
24
|
+
export type MatrixAssetType = typeof MatrixAssetType;
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './MatrixAsset';
|