@vidispine/vdt-js 22.4.0-pre.9 → 23.1.0-pre.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +169 -102
- package/dist/index.es.js +459 -737
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +461 -737
- package/dist/index.js.map +1 -1
- package/package.json +19 -19
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const parseKeyValuePairTypes: (keyValuePairTypes: KeyValuePairType[]) =>
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Const object with VidiCore role names
|
|
17
17
|
*
|
|
18
18
|
* @category Auth
|
|
19
19
|
*/
|
|
@@ -127,36 +127,37 @@ declare const ROLE_NAMES: {
|
|
|
127
127
|
readonly USER: "_user";
|
|
128
128
|
readonly VXA: "_vxa";
|
|
129
129
|
readonly VXA_READ: "_vxa_read";
|
|
130
|
-
};
|
|
130
|
+
};
|
|
131
|
+
type RoleNameTypes = keyof typeof ROLE_NAMES;
|
|
131
132
|
|
|
132
|
-
|
|
133
|
+
type InputValueTypes = string | boolean | number | Date;
|
|
133
134
|
/** Possible input values for the field value */
|
|
134
|
-
|
|
135
|
+
type InputValue = InputValueTypes | InputValueTypes[];
|
|
135
136
|
/** Input value object for the field value */
|
|
136
|
-
|
|
137
|
+
type InputValueObject = {
|
|
137
138
|
value: string | InputValue;
|
|
138
139
|
} & Omit<MetadataValueType, 'value'>;
|
|
139
|
-
|
|
140
|
+
type InputFieldValue = InputValueObject | InputValue | InputValueObject[] | InputValue[];
|
|
140
141
|
/** Input object to create field of */
|
|
141
|
-
|
|
142
|
+
type InputFieldObject = {
|
|
142
143
|
value: InputFieldValue;
|
|
143
144
|
} & MetadataFieldValueType;
|
|
144
145
|
/** Input to create a field of */
|
|
145
|
-
|
|
146
|
+
type InputField = InputFieldValue | InputFieldObject;
|
|
146
147
|
/** Input to create one or multiple groups and/or fields of */
|
|
147
|
-
|
|
148
|
+
type InputGroupsOrFields = InputGroup | InputGroup[] | InputField | InputField[];
|
|
148
149
|
/** Input object to create group of */
|
|
149
|
-
|
|
150
|
+
type InputGroup = {
|
|
150
151
|
[groupOrFieldName: string]: InputGroupsOrFields;
|
|
151
152
|
} & Partial<MetadataGroupValueType>;
|
|
152
153
|
/** Input to create a timespan of */
|
|
153
|
-
|
|
154
|
+
type InputTimespan = {
|
|
154
155
|
start?: string | number;
|
|
155
156
|
end?: string | number;
|
|
156
157
|
base?: string;
|
|
157
158
|
[groupOrFieldName: string]: InputGroupsOrFields;
|
|
158
159
|
};
|
|
159
|
-
|
|
160
|
+
type CreateMetadataTypeInput = InputTimespan | InputTimespan[];
|
|
160
161
|
/**
|
|
161
162
|
* Create a VidiCore metadata object from a more dense/simplified structure
|
|
162
163
|
*
|
|
@@ -167,44 +168,44 @@ declare type CreateMetadataTypeInput = InputTimespan | InputTimespan[];
|
|
|
167
168
|
*/
|
|
168
169
|
declare const createMetadataType: (input: CreateMetadataTypeInput) => MetadataType;
|
|
169
170
|
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
type ParsedValueAttributes = Partial<Omit<MetadataValueType, 'value'>>;
|
|
172
|
+
type ParsedValue<TOptions> = TOptions extends {
|
|
172
173
|
includeValueAttributes?: false;
|
|
173
174
|
} ? string : {
|
|
174
175
|
value: string;
|
|
175
176
|
} & ParsedValueAttributes;
|
|
176
|
-
|
|
177
|
+
type ParseValueOptions = {
|
|
177
178
|
includeValueAttributes?: boolean | (keyof ParsedValueAttributes)[];
|
|
178
179
|
};
|
|
179
180
|
|
|
180
|
-
|
|
181
|
+
type ParsedValueList<TOptions> = TOptions extends {
|
|
181
182
|
joinValue?: string;
|
|
182
183
|
includeValueAttributes?: false;
|
|
183
184
|
} ? string : TOptions extends {
|
|
184
185
|
arrayOnSingleValue?: true;
|
|
185
186
|
} ? ParsedValue<TOptions>[] : ParsedValue<TOptions> | ParsedValue<TOptions>[];
|
|
186
|
-
|
|
187
|
+
type ParseValueListOptions = {
|
|
187
188
|
joinValue?: string;
|
|
188
189
|
arrayOnSingleValue?: boolean;
|
|
189
190
|
} & ParseValueOptions;
|
|
190
191
|
|
|
191
|
-
|
|
192
|
-
|
|
192
|
+
type ParsedFieldAttributes = Partial<Omit<MetadataFieldValueType, 'value'>>;
|
|
193
|
+
type ParsedFieldObject<TOptions> = {
|
|
193
194
|
value: ParsedValueList<TOptions>;
|
|
194
195
|
} & ParsedFieldAttributes;
|
|
195
|
-
|
|
196
|
+
type ParsedField<TOptions> = TOptions extends {
|
|
196
197
|
includeFieldAttributes?: false;
|
|
197
198
|
} ? ParsedValueList<TOptions> : ParsedFieldObject<TOptions>;
|
|
198
|
-
|
|
199
|
+
type ParseFieldOptions = {
|
|
199
200
|
includeFieldAttributes?: boolean | (keyof ParsedFieldAttributes)[];
|
|
200
201
|
} & ParseValueListOptions;
|
|
201
202
|
|
|
202
|
-
|
|
203
|
+
type ParseFieldListOptions = {
|
|
203
204
|
fieldAsList?: boolean;
|
|
204
205
|
arrayOnSingleField?: boolean;
|
|
205
206
|
overrideField?: boolean;
|
|
206
207
|
} & ParseFieldOptions;
|
|
207
|
-
|
|
208
|
+
type ParsedFieldList<TOptions> = TOptions extends {
|
|
208
209
|
fieldAsList?: true;
|
|
209
210
|
} ? ParsedField<TOptions>[] : TOptions extends {
|
|
210
211
|
arrayOnSingle?: true;
|
|
@@ -227,13 +228,12 @@ declare type ParsedFieldList<TOptions> = TOptions extends {
|
|
|
227
228
|
* Parse a metadata field list according to selected options
|
|
228
229
|
*
|
|
229
230
|
* @remarks
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
* - with
|
|
234
|
-
* - with `
|
|
235
|
-
* - with `
|
|
236
|
-
* - with `overrideField` enabled - Override so it returns the latest "duplicated" field it parses
|
|
231
|
+
* When parsing duplicate fields (same field name in the same field list) it will:
|
|
232
|
+
* - with default options: combine field values to one array within the same field name key
|
|
233
|
+
* - with `joinValue` enabled: join values within each field (returns array with string for each field value)
|
|
234
|
+
* - with `fieldAsList` enabled: separate fields in the list/array (as usual, even if not duplicate)
|
|
235
|
+
* - with `includeFieldAttributes` enabled: return an array of field objects
|
|
236
|
+
* - with `overrideField` enabled: return the latest duplicated field it parses
|
|
237
237
|
*
|
|
238
238
|
* @param fieldList Field list to parse
|
|
239
239
|
* @param [options=defaultOptions] Options for how to parse the field list
|
|
@@ -243,14 +243,14 @@ declare type ParsedFieldList<TOptions> = TOptions extends {
|
|
|
243
243
|
*/
|
|
244
244
|
declare const parseFieldList: <TOptions extends ParseFieldListOptions = ParseFieldListOptions>(fieldList: MetadataFieldValueType[], options?: TOptions) => ParsedFieldList<TOptions>;
|
|
245
245
|
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
type ParsedGroupAttributes = Omit<MetadataGroupValueType, 'field' | 'group'>;
|
|
247
|
+
type ParseGroupOptions = {
|
|
248
248
|
includeGroupAttributes?: boolean | (keyof ParsedGroupAttributes)[];
|
|
249
249
|
groupAsList?: boolean;
|
|
250
250
|
arrayOnSingleGroup?: boolean;
|
|
251
251
|
overrideGroup?: boolean;
|
|
252
252
|
} & ParseFieldListOptions;
|
|
253
|
-
|
|
253
|
+
type ParsedGroup<TOptions> = ((TOptions extends {
|
|
254
254
|
groupAsList?: true;
|
|
255
255
|
} ? {
|
|
256
256
|
group?: ParsedGroupList<TOptions>;
|
|
@@ -263,8 +263,8 @@ declare type ParsedGroup<TOptions> = ((TOptions extends {
|
|
|
263
263
|
} : {
|
|
264
264
|
[name: string]: ParsedFieldList<TOptions>;
|
|
265
265
|
})) & ParsedGroupAttributes;
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
type ParseGroupListOptions = ParseGroupOptions;
|
|
267
|
+
type ParsedGroupList<TOptions> = TOptions extends {
|
|
268
268
|
groupAsList?: true;
|
|
269
269
|
} ? ParsedGroup<TOptions>[] : TOptions extends {
|
|
270
270
|
arrayOnSingle?: true;
|
|
@@ -287,10 +287,10 @@ declare type ParsedGroupList<TOptions> = TOptions extends {
|
|
|
287
287
|
* Parse a metadata group list according to selected options
|
|
288
288
|
*
|
|
289
289
|
* @remarks
|
|
290
|
-
* Parsing duplicate groups (
|
|
291
|
-
* - with default options
|
|
292
|
-
* - with `groupAsList` enabled
|
|
293
|
-
* - with `overrideGroup` enabled
|
|
290
|
+
* Parsing duplicate groups (same group name in the same group list) it will:
|
|
291
|
+
* - with default options: combine group objects to one array within the same group name key
|
|
292
|
+
* - with `groupAsList` enabled: return separate group objects in a list/array (as usual, even if not duplicate)
|
|
293
|
+
* - with `overrideGroup` enabled: return the latest duplicated group it parses
|
|
294
294
|
*
|
|
295
295
|
* @param groupList Group list to parse
|
|
296
296
|
* @param options options for how to parse list
|
|
@@ -300,7 +300,7 @@ declare type ParsedGroupList<TOptions> = TOptions extends {
|
|
|
300
300
|
*/
|
|
301
301
|
declare const parseGroupList: <TOptions extends ParseGroupOptions = ParseGroupOptions>(groupList: MetadataGroupValueType[], options?: TOptions) => ParsedGroupList<TOptions>;
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
type ParsedTimespanAttributes = Omit<MetadataType['timespan'][number], 'field' | 'group'>;
|
|
304
304
|
/**
|
|
305
305
|
* __includeTimespanAttributes__:
|
|
306
306
|
* Include attributes on timespan
|
|
@@ -314,12 +314,12 @@ declare type ParsedTimespanAttributes = Omit<MetadataType['timespan'][number], '
|
|
|
314
314
|
*
|
|
315
315
|
* @defaultValue `{ includeTimespanAttributes: false, arrayOnSingle: true, flat: false }`
|
|
316
316
|
*/
|
|
317
|
-
|
|
317
|
+
type ParseTimespanOptions = {
|
|
318
318
|
includeTimespanAttributes?: boolean | (keyof ParsedTimespanAttributes)[];
|
|
319
319
|
arrayOnSingle?: boolean;
|
|
320
320
|
flat?: boolean;
|
|
321
321
|
} & ParseGroupListOptions;
|
|
322
|
-
|
|
322
|
+
type ParsedTimespan<TOptions> = ((TOptions extends {
|
|
323
323
|
groupAsList?: true;
|
|
324
324
|
} ? {
|
|
325
325
|
group?: ParsedGroupList<TOptions>;
|
|
@@ -349,7 +349,7 @@ declare type ParsedTimespan<TOptions> = ((TOptions extends {
|
|
|
349
349
|
*/
|
|
350
350
|
declare const parseTimespan: <TOptions extends ParseTimespanOptions = ParseTimespanOptions>(timespan: MetadataType['timespan'][number], options?: TOptions) => ParsedTimespan<TOptions>;
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
type ParsedTimespanList<TOptions> = TOptions extends {
|
|
353
353
|
timespanAsList?: true;
|
|
354
354
|
} ? ParsedTimespan<TOptions>[] : TOptions extends {
|
|
355
355
|
flat?: true;
|
|
@@ -359,7 +359,7 @@ declare type ParsedTimespanList<TOptions> = TOptions extends {
|
|
|
359
359
|
} ? ParsedTimespan<TOptions> : {
|
|
360
360
|
[timespanKey: string]: ParsedTimespan<TOptions>[];
|
|
361
361
|
};
|
|
362
|
-
|
|
362
|
+
type ParseTimespanListOptions = {
|
|
363
363
|
timespanAsList?: boolean;
|
|
364
364
|
joinTimespan?: string;
|
|
365
365
|
sortTimespan?: boolean;
|
|
@@ -380,10 +380,10 @@ declare type ParseTimespanListOptions = {
|
|
|
380
380
|
*/
|
|
381
381
|
declare const parseTimespanList: <TOptions extends ParseTimespanListOptions = ParseTimespanListOptions>(timespanList: MetadataType['timespan'], options?: TOptions) => ParsedTimespanList<TOptions>;
|
|
382
382
|
|
|
383
|
-
|
|
383
|
+
type ParsedMetadataAttributes = Partial<Omit<MetadataType, 'timespan' | 'revision'> & {
|
|
384
384
|
revision?: string[];
|
|
385
385
|
}>;
|
|
386
|
-
|
|
386
|
+
type ParsedMetadataType<TOptions> = (TOptions extends {
|
|
387
387
|
timespanAsList?: true;
|
|
388
388
|
} ? {
|
|
389
389
|
timespan: ParsedTimespanList<TOptions>;
|
|
@@ -394,7 +394,7 @@ declare type ParsedMetadataType<TOptions> = (TOptions extends {
|
|
|
394
394
|
}) & (TOptions extends {
|
|
395
395
|
includeMetadataAttributes?: true | string[];
|
|
396
396
|
} ? ParsedMetadataAttributes : {});
|
|
397
|
-
|
|
397
|
+
type ParseMetadataTypeOptions = {
|
|
398
398
|
includeMetadataAttributes?: boolean | (keyof ParsedMetadataAttributes)[];
|
|
399
399
|
flat?: boolean;
|
|
400
400
|
} & ParseTimespanListOptions;
|
|
@@ -430,7 +430,7 @@ declare const parseSimpleMetadataType: (simpleMetadataType: SimpleMetadataType)
|
|
|
430
430
|
[key: string]: string;
|
|
431
431
|
};
|
|
432
432
|
|
|
433
|
-
|
|
433
|
+
type MetadataTypeToWebVttOptions = {
|
|
434
434
|
subtitleGroup?: string;
|
|
435
435
|
subtitleField?: string;
|
|
436
436
|
};
|
|
@@ -446,17 +446,19 @@ declare type MetadataTypeToWebVttOptions = {
|
|
|
446
446
|
declare const metadataTypeToWebVtt: (metadataType: MetadataType, options?: MetadataTypeToWebVttOptions) => string;
|
|
447
447
|
|
|
448
448
|
/**
|
|
449
|
-
* Array with all available
|
|
449
|
+
* Array with all available VidiCore system/default field group names
|
|
450
450
|
*
|
|
451
451
|
* @category Metadata
|
|
452
452
|
*/
|
|
453
|
-
declare const
|
|
453
|
+
declare const SYSTEM_FIELDGROUPS: readonly ["stl_subtitle", "stl_tti", "stl_gsi", "mrk_marker", "pho_validation", "pho_resource", "pho_error", "facedetect_rect", "facedetect_face", "originalTrackFilename", "stl_gsiHeader"];
|
|
454
|
+
|
|
454
455
|
/**
|
|
455
|
-
* Array with all available
|
|
456
|
+
* Array with all available VidiCore system/default field names (including transient)
|
|
456
457
|
*
|
|
457
458
|
* @category Metadata
|
|
458
459
|
*/
|
|
459
|
-
declare const
|
|
460
|
+
declare const SYSTEM_FIELDS: readonly ["title", "user", "shapeTag", "representativeThumbnail", "representativeThumbnailNoAuth", "representativeItems", "itemId", "collectionId", "mediaType", "mimeType", "created", "startTimeCode", "startSeconds", "fieldValidationError", "schemaValidationError", "originalFilename", "originalUri", "originalAudioCodec", "originalVideoCodec", "originalHeight", "originalWidth", "originalFormat", "durationSeconds", "durationTimeCode", "solr-index", "__user", "__collection", "__collection_size", "__ancestor_collection", "__ancestor_collection_size", "__shape", "__shape_size", "__shape_last_added", "__placeholder_shape_size", "__version", "__version_count", "__storage", "__storage_size", "__shapetag_{tag}_hash_{hash}", "__storage_{tag}", "__storage_{tag}_size", "__storagegroup", "__storagegroup_size", "__sequence", "__sequence_size", "__metadata_last_modified", "__external_id", "__deletion_lock_id", "__deletion_lock_expiry", "__child_collection", "__child_collection_size", "__parent_collection", "__parent_collection_size", "__items_size", "stl_text", "stl_justification", "stl_xrelative", "stl_yrelative", "stl_vertical", "stl_verticalbase", "stl_horizontalbase", "stl_sizerelative", "stl_color", "stl_outline", "stl_outlinecolor", "stl_outlinesize", "stl_font", "stl_service", "stl_tti", "stl_gsi", "cct", "tcd", "tcf", "oet", "cd", "mnc", "cpn", "dfc", "tcp", "tcs", "tet", "tnb", "tnd", "en", "co", "tng", "rd", "mnr", "dsc", "opt", "lc", "tpt", "tn", "slr", "tns", "rn", "pub", "dsn", "ecd", "mrk_zerolength", "mrk_text", "mrk_color", "pho_resource_name", "pho_error_level", "pho_error_code", "pho_error_description", "facedetect_rect_width", "facedetect_rect_height", "facedetect_rect_y", "facedetect_rect_x", "facedetect_pid", "facedetect_rect", "trackId", "eidr_actor", "eidr_alternateId", "eidr_countryOfOrigin", "eidr_director", "eidr_id", "eidr_referentType", "eidr_releaseDate", "eidr_resourceName", "eidr_status", "eidr_sync", "ttml_div", "ttml_root", "vxa_collection_id", "vxaId", "vxaLocalPath", "tco", "cs", "ebn", "tf", "cf", "sgn", "tci", "jc", "vp", "sn"];
|
|
461
|
+
|
|
460
462
|
/**
|
|
461
463
|
* Array with all available metadata field value attributes
|
|
462
464
|
*
|
|
@@ -465,20 +467,21 @@ declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
|
|
|
465
467
|
declare const FIELD_VALUE_ATTRIBUTE_KEYS: (keyof MetadataValueType)[];
|
|
466
468
|
|
|
467
469
|
/**
|
|
468
|
-
* Array with all available
|
|
470
|
+
* Array with all available metadata field attributes
|
|
469
471
|
*
|
|
470
472
|
* @category Metadata
|
|
471
473
|
*/
|
|
472
|
-
declare const
|
|
474
|
+
declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
|
|
475
|
+
|
|
473
476
|
/**
|
|
474
|
-
* Array with all available
|
|
477
|
+
* Array with all available metadata group attributes
|
|
475
478
|
*
|
|
476
479
|
* @category Metadata
|
|
477
480
|
*/
|
|
478
|
-
declare const
|
|
481
|
+
declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
|
|
479
482
|
|
|
480
|
-
|
|
481
|
-
|
|
483
|
+
type CreateFacetTypeFieldList = string[];
|
|
484
|
+
type CreateFacetTypeOptions = {
|
|
482
485
|
count: boolean;
|
|
483
486
|
};
|
|
484
487
|
/**
|
|
@@ -497,11 +500,11 @@ declare const createFacetType: (fieldList?: CreateFacetTypeFieldList, options?:
|
|
|
497
500
|
exclude: CreateFacetTypeFieldList;
|
|
498
501
|
}[];
|
|
499
502
|
|
|
500
|
-
|
|
503
|
+
type ParsedFacetTypeCount = {
|
|
501
504
|
[fieldValue: string]: number;
|
|
502
505
|
};
|
|
503
506
|
/** Parsed facet type */
|
|
504
|
-
|
|
507
|
+
type ParsedFacetType = {
|
|
505
508
|
[fieldName: string]: ParsedFacetTypeCount;
|
|
506
509
|
};
|
|
507
510
|
/**
|
|
@@ -514,12 +517,12 @@ declare type ParsedFacetType = {
|
|
|
514
517
|
*/
|
|
515
518
|
declare const parseFacetType: (facetType?: FacetType[]) => ParsedFacetType;
|
|
516
519
|
|
|
517
|
-
|
|
520
|
+
type ParseHighlightTimespanOptions = {
|
|
518
521
|
arrayOnSingle?: boolean;
|
|
519
522
|
timespanAsList?: boolean;
|
|
520
523
|
joinValue?: string;
|
|
521
524
|
};
|
|
522
|
-
|
|
525
|
+
type ParsedHighlightTimespan = {
|
|
523
526
|
start?: string;
|
|
524
527
|
end?: string;
|
|
525
528
|
[key: string]: string | string[];
|
|
@@ -534,7 +537,7 @@ declare type ParsedHighlightTimespan = {
|
|
|
534
537
|
*/
|
|
535
538
|
declare const parseHighlightTimespan: (timespan: SearchResultEntryTimespanType, options: ParseHighlightTimespanOptions) => ParsedHighlightTimespan;
|
|
536
539
|
|
|
537
|
-
|
|
540
|
+
type ParseHighlightTimespanListOptions = {
|
|
538
541
|
timespanAsList?: boolean;
|
|
539
542
|
joinTimespan?: string;
|
|
540
543
|
flat?: boolean;
|
|
@@ -551,28 +554,42 @@ declare type ParseHighlightTimespanListOptions = {
|
|
|
551
554
|
*/
|
|
552
555
|
declare const parseHighlightTimespanList: (highlightTimespanList?: SearchResultEntryTimespanType[], options?: ParseHighlightTimespanListOptions) => ParsedHighlightTimespan | ParsedHighlightTimespan[];
|
|
553
556
|
|
|
557
|
+
/**
|
|
558
|
+
* Parse Vidicore "NOW" constants to a date object
|
|
559
|
+
*
|
|
560
|
+
* Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
|
|
561
|
+
*
|
|
562
|
+
* @remarks
|
|
563
|
+
* Returns an approximate date since it's created client side
|
|
564
|
+
*
|
|
565
|
+
* @param value A "NOW" constant
|
|
566
|
+
* @returns A date from the NOW constant
|
|
567
|
+
*
|
|
568
|
+
* @category Search
|
|
569
|
+
*/
|
|
554
570
|
declare const parseNowDate: (value?: string) => Date;
|
|
555
571
|
|
|
556
|
-
|
|
572
|
+
type ParsedBaseMediaInfoType = {
|
|
557
573
|
Bit_rate_mode?: string;
|
|
558
574
|
Source?: string;
|
|
559
575
|
} & {
|
|
560
576
|
[key: string]: string;
|
|
561
577
|
};
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
578
|
+
type ParsedAudioMediaInfoType = ParsedBaseMediaInfoType;
|
|
579
|
+
type ParsedBinaryMediaInfoType = ParsedBaseMediaInfoType;
|
|
580
|
+
type ParsedVideoMediaInfoType = ParsedBaseMediaInfoType & {
|
|
565
581
|
Format_Settings_GOP?: string;
|
|
566
582
|
intra_dc_precision?: string;
|
|
567
583
|
};
|
|
568
584
|
|
|
569
|
-
|
|
585
|
+
type ParsedAudioComponentType = {
|
|
570
586
|
audioFormat?: string;
|
|
571
587
|
audioCodec?: string;
|
|
572
588
|
audioSamplerate?: string;
|
|
573
589
|
audioSamplerateSamples?: number;
|
|
574
590
|
audioBitDepth?: string;
|
|
575
591
|
audioBitrate?: string;
|
|
592
|
+
audioBitrateKbps?: number;
|
|
576
593
|
audioBitRateMode?: string;
|
|
577
594
|
audioChannels?: number;
|
|
578
595
|
audioMetadata?: {
|
|
@@ -589,7 +606,7 @@ declare type ParsedAudioComponentType = {
|
|
|
589
606
|
*/
|
|
590
607
|
declare const parseAudioComponent: (audioComponentType: AudioComponentType) => ParsedAudioComponentType;
|
|
591
608
|
|
|
592
|
-
|
|
609
|
+
type ParsedBinaryComponentType = {
|
|
593
610
|
binaryMetadata?: {
|
|
594
611
|
[key: string]: string;
|
|
595
612
|
};
|
|
@@ -604,7 +621,7 @@ declare type ParsedBinaryComponentType = {
|
|
|
604
621
|
*/
|
|
605
622
|
declare const parseBinaryComponent: (binaryComponentType?: BinaryComponentType) => ParsedBinaryComponentType;
|
|
606
623
|
|
|
607
|
-
|
|
624
|
+
type ParsedFileType = {
|
|
608
625
|
uri?: string;
|
|
609
626
|
hash?: string;
|
|
610
627
|
fileSize?: string;
|
|
@@ -616,6 +633,9 @@ declare type ParsedFileType = {
|
|
|
616
633
|
/**
|
|
617
634
|
* Parses a VidiCore file object
|
|
618
635
|
*
|
|
636
|
+
* @remarks
|
|
637
|
+
* File sizes are parsed with JEDEC standard (base 2)
|
|
638
|
+
*
|
|
619
639
|
* @param fileType VidiCore file object
|
|
620
640
|
* @returns A parsed file object
|
|
621
641
|
*
|
|
@@ -626,7 +646,7 @@ declare const parseFileType: (fileType: FileType) => ParsedFileType;
|
|
|
626
646
|
/**
|
|
627
647
|
* Parsed container component
|
|
628
648
|
*/
|
|
629
|
-
|
|
649
|
+
type ParsedContainerComponentType = {
|
|
630
650
|
containerFormat?: string;
|
|
631
651
|
videoFormat?: string;
|
|
632
652
|
audioFormat?: string;
|
|
@@ -650,7 +670,7 @@ declare type ParsedContainerComponentType = {
|
|
|
650
670
|
*/
|
|
651
671
|
declare const parseContainerComponent: (containerComponentType?: ContainerComponentType) => ParsedContainerComponentType;
|
|
652
672
|
|
|
653
|
-
|
|
673
|
+
type TimeBaseInput = {
|
|
654
674
|
numerator?: number | string;
|
|
655
675
|
denominator?: number | string;
|
|
656
676
|
};
|
|
@@ -680,6 +700,7 @@ declare class TimeBase {
|
|
|
680
700
|
*
|
|
681
701
|
* @remarks
|
|
682
702
|
* Default format: denominator(:numerator if > 1)
|
|
703
|
+
*
|
|
683
704
|
* `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
|
|
684
705
|
*
|
|
685
706
|
* @param options For how to display it as text
|
|
@@ -699,6 +720,7 @@ declare class TimeBase {
|
|
|
699
720
|
* - `number` gives that amount of decimal places
|
|
700
721
|
*
|
|
701
722
|
* Default format: rate with two decimals if needed (i.e. decimals are > 0)
|
|
723
|
+
*
|
|
702
724
|
* Option precedence (when all true): `constant` > `rounded` > `fixed`
|
|
703
725
|
*
|
|
704
726
|
* @param options For how to display it as rate
|
|
@@ -755,11 +777,11 @@ declare const formatTimeBaseText: (timeBaseText?: string | number) => TimeBase;
|
|
|
755
777
|
*/
|
|
756
778
|
declare const formatTimeBaseType: (timeBase: TimeBaseInput) => TimeBase;
|
|
757
779
|
|
|
758
|
-
|
|
780
|
+
type TimeCodeInput = {
|
|
759
781
|
samples?: number | string;
|
|
760
782
|
timeBase?: string | TimeBaseInput | TimeBase;
|
|
761
783
|
};
|
|
762
|
-
|
|
784
|
+
type TimeCodeInputOptions = {
|
|
763
785
|
dropFrame?: boolean;
|
|
764
786
|
frameSeparator?: string;
|
|
765
787
|
};
|
|
@@ -823,6 +845,7 @@ declare class TimeCode {
|
|
|
823
845
|
*
|
|
824
846
|
* @remarks
|
|
825
847
|
* Default format: samples@denominator(:numerator if > 1)
|
|
848
|
+
*
|
|
826
849
|
* `constant` has precedence over `fraction` if both are true
|
|
827
850
|
*
|
|
828
851
|
* @param options Options for how to format text
|
|
@@ -912,13 +935,15 @@ declare class TimeCode {
|
|
|
912
935
|
};
|
|
913
936
|
}
|
|
914
937
|
|
|
915
|
-
|
|
938
|
+
type FormatTimeCodeSecondsOptions = {
|
|
916
939
|
timeBase?: number | string | TimeBaseInput;
|
|
917
940
|
useGCD?: boolean;
|
|
918
941
|
} & TimeCodeInputOptions;
|
|
919
942
|
/**
|
|
920
943
|
* Format seconds to TimeCode object
|
|
921
|
-
*
|
|
944
|
+
*
|
|
945
|
+
* @remarks
|
|
946
|
+
* Input time base is always considered as 1:1 since it expects seconds as input
|
|
922
947
|
*
|
|
923
948
|
* Note: Max 15 digits accuracy (double precision float64), e.g.
|
|
924
949
|
* - 10^6 seconds can have 10^9 decimals (nanosecond) precision
|
|
@@ -933,7 +958,7 @@ declare type FormatTimeCodeSecondsOptions = {
|
|
|
933
958
|
*/
|
|
934
959
|
declare const formatTimeCodeSeconds: (seconds: string | number, options?: FormatTimeCodeSecondsOptions) => TimeCode;
|
|
935
960
|
|
|
936
|
-
|
|
961
|
+
type FormatTimeCodeSmpteOptions = {
|
|
937
962
|
timeBase?: number | string | TimeBaseInput;
|
|
938
963
|
exceedingMode?: 'add' | 'ignore' | 'error';
|
|
939
964
|
dropFrame?: boolean;
|
|
@@ -955,7 +980,7 @@ declare type FormatTimeCodeSmpteOptions = {
|
|
|
955
980
|
*/
|
|
956
981
|
declare const formatTimeCodeSmpte: (smpte: string, options?: FormatTimeCodeSmpteOptions) => TimeCode;
|
|
957
982
|
|
|
958
|
-
|
|
983
|
+
type FormatTimeCodeTextOptions = {
|
|
959
984
|
timeBase?: number | string | TimeBaseInput;
|
|
960
985
|
} & TimeCodeInputOptions;
|
|
961
986
|
/**
|
|
@@ -967,7 +992,7 @@ declare type FormatTimeCodeTextOptions = {
|
|
|
967
992
|
*/
|
|
968
993
|
declare const formatTimeCodeText: (timeCodeText?: number | string, options?: FormatTimeCodeTextOptions) => TimeCode;
|
|
969
994
|
|
|
970
|
-
|
|
995
|
+
type CreateTimeCodeOptions = TimeCodeInputOptions | FormatTimeCodeSmpteOptions | FormatTimeCodeSecondsOptions | FormatTimeCodeTextOptions;
|
|
971
996
|
/**
|
|
972
997
|
* Create a TimeCode instance from smpte, seconds/samples, timeCode object or string
|
|
973
998
|
*
|
|
@@ -990,7 +1015,7 @@ declare const createTimeCode: (timeCode: TimeCodeInput | string | number, option
|
|
|
990
1015
|
*/
|
|
991
1016
|
declare const formatTimeCodeType: (timeCode: TimeCodeInput, options?: TimeCodeInputOptions) => TimeCode;
|
|
992
1017
|
|
|
993
|
-
|
|
1018
|
+
type ParsedVideoComponentType = {
|
|
994
1019
|
videoFormat?: string;
|
|
995
1020
|
dimension?: string;
|
|
996
1021
|
frameRate?: string | number;
|
|
@@ -1001,6 +1026,7 @@ declare type ParsedVideoComponentType = {
|
|
|
1001
1026
|
videoCodec?: string;
|
|
1002
1027
|
smpte?: string;
|
|
1003
1028
|
videoBitrate?: string;
|
|
1029
|
+
videoBitrateMbps?: number;
|
|
1004
1030
|
fieldOrder?: string;
|
|
1005
1031
|
colorSpace?: string;
|
|
1006
1032
|
chromaSubsampling?: string;
|
|
@@ -1020,7 +1046,7 @@ declare type ParsedVideoComponentType = {
|
|
|
1020
1046
|
*/
|
|
1021
1047
|
declare const parseVideoComponent: (videoComponentType?: VideoComponentType) => ParsedVideoComponentType;
|
|
1022
1048
|
|
|
1023
|
-
|
|
1049
|
+
type ParsedShapeType = {
|
|
1024
1050
|
uri?: string;
|
|
1025
1051
|
tag?: string;
|
|
1026
1052
|
mimeType?: string;
|
|
@@ -1041,14 +1067,33 @@ declare type ParsedShapeType = {
|
|
|
1041
1067
|
*/
|
|
1042
1068
|
declare const parseShapeType: (shapeType?: ShapeType) => ParsedShapeType;
|
|
1043
1069
|
|
|
1070
|
+
/**
|
|
1071
|
+
* Const object with document types
|
|
1072
|
+
*
|
|
1073
|
+
* @category Shape
|
|
1074
|
+
*/
|
|
1044
1075
|
declare const DOCUMENT_TYPES: {
|
|
1045
1076
|
readonly PDF: "PDF";
|
|
1046
1077
|
readonly TEXT: "TEXT";
|
|
1047
1078
|
readonly MSWORD: "MSWORD";
|
|
1048
1079
|
readonly JSON: "JSON";
|
|
1049
1080
|
readonly XML: "XML";
|
|
1050
|
-
};
|
|
1051
|
-
|
|
1081
|
+
};
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Const object with media types
|
|
1085
|
+
*
|
|
1086
|
+
* @category Shape
|
|
1087
|
+
*/
|
|
1088
|
+
declare const SHAPE_MEDIA_TYPES: {
|
|
1089
|
+
readonly IMAGE: "IMAGE";
|
|
1090
|
+
readonly AUDIO: "AUDIO";
|
|
1091
|
+
readonly VIDEO: "VIDEO";
|
|
1092
|
+
readonly DOCUMENT: "DOCUMENT";
|
|
1093
|
+
readonly BINARY: "BINARY";
|
|
1094
|
+
};
|
|
1095
|
+
|
|
1096
|
+
type DocumentType = keyof typeof DOCUMENT_TYPES;
|
|
1052
1097
|
/**
|
|
1053
1098
|
* Return a const for the document type of a shape (looks at mimeType)
|
|
1054
1099
|
*
|
|
@@ -1059,14 +1104,14 @@ declare type DocumentType = keyof typeof DOCUMENT_TYPES;
|
|
|
1059
1104
|
*/
|
|
1060
1105
|
declare const getShapeDocumentType: (shape?: ShapeType) => DocumentType;
|
|
1061
1106
|
|
|
1062
|
-
|
|
1107
|
+
type FilteredShapeListObject = {
|
|
1063
1108
|
src: string;
|
|
1064
1109
|
type: string;
|
|
1065
1110
|
shape: ShapeType;
|
|
1066
1111
|
parsedShape: ParsedShapeType;
|
|
1067
1112
|
[key: string]: string | ParsedShapeType | ShapeType;
|
|
1068
1113
|
};
|
|
1069
|
-
|
|
1114
|
+
type FilterShapeSourceOption = {
|
|
1070
1115
|
sortPriority?: Function;
|
|
1071
1116
|
allowedMimeTypes?: string[];
|
|
1072
1117
|
allowedMethods?: string[];
|
|
@@ -1086,14 +1131,7 @@ declare type FilterShapeSourceOption = {
|
|
|
1086
1131
|
*/
|
|
1087
1132
|
declare const filterShapeSource: (itemType: ItemType, options: FilterShapeSourceOption) => FilteredShapeListObject[];
|
|
1088
1133
|
|
|
1089
|
-
|
|
1090
|
-
readonly IMAGE: "IMAGE";
|
|
1091
|
-
readonly AUDIO: "AUDIO";
|
|
1092
|
-
readonly VIDEO: "VIDEO";
|
|
1093
|
-
readonly DOCUMENT: "DOCUMENT";
|
|
1094
|
-
readonly BINARY: "BINARY";
|
|
1095
|
-
};
|
|
1096
|
-
declare type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
|
|
1134
|
+
type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
|
|
1097
1135
|
/**
|
|
1098
1136
|
* Returns a const for which media type a shape has
|
|
1099
1137
|
*
|
|
@@ -1104,6 +1142,38 @@ declare type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
|
|
|
1104
1142
|
*/
|
|
1105
1143
|
declare const getShapeMediaType: (shape: ShapeType) => ShapeMediaType;
|
|
1106
1144
|
|
|
1145
|
+
/**
|
|
1146
|
+
* Const object with all file states in VidiCore
|
|
1147
|
+
* (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
|
|
1148
|
+
*
|
|
1149
|
+
* @category File
|
|
1150
|
+
*/
|
|
1151
|
+
declare const FILE_STATES: {
|
|
1152
|
+
/** Just created, not used. */
|
|
1153
|
+
readonly NONE: "NONE";
|
|
1154
|
+
/** Discovered or created, not yet marked as finished. */
|
|
1155
|
+
readonly OPEN: "OPEN";
|
|
1156
|
+
/** File does no longer grow. */
|
|
1157
|
+
readonly CLOSED: "CLOSED";
|
|
1158
|
+
/** The current state is not known. */
|
|
1159
|
+
readonly UNKNOWN: "UNKNOWN";
|
|
1160
|
+
/** File is missing from the file system/storage. */
|
|
1161
|
+
readonly MISSING: "MISSING";
|
|
1162
|
+
/** File has been missing for a longer period. Candidate for restoration from archive. */
|
|
1163
|
+
readonly LOST: "LOST";
|
|
1164
|
+
/** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
|
|
1165
|
+
readonly TO_APPEAR: "TO_APPEAR";
|
|
1166
|
+
/** The file is no longer in use, and will be deleted at the next clean-up sweep. */
|
|
1167
|
+
readonly TO_BE_DELETED: "TO_BE_DELETED";
|
|
1168
|
+
/** File is in use by transfer subsystem or transcoder. */
|
|
1169
|
+
readonly BEING_READ: "BEING_READ";
|
|
1170
|
+
/** File is archived. */
|
|
1171
|
+
readonly ARCHIVED: "ARCHIVED";
|
|
1172
|
+
/** File will be synchronized by multi-site agent. */
|
|
1173
|
+
readonly AWAITING_SYNC: "AWAITING_SYNC";
|
|
1174
|
+
};
|
|
1175
|
+
type FileStateTypes = keyof typeof FILE_STATES;
|
|
1176
|
+
|
|
1107
1177
|
/**
|
|
1108
1178
|
* Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
|
|
1109
1179
|
*
|
|
@@ -1121,7 +1191,7 @@ declare const findNearestThumbnail: (itemType: ItemType, timeCode: TimeCode | Ti
|
|
|
1121
1191
|
/**
|
|
1122
1192
|
* TODO
|
|
1123
1193
|
*/
|
|
1124
|
-
|
|
1194
|
+
type ParsedMediaConvertTranscodePreset = {
|
|
1125
1195
|
description?: string;
|
|
1126
1196
|
containerFormat?: any;
|
|
1127
1197
|
videoFormat?: string;
|
|
@@ -1148,10 +1218,7 @@ declare type ParsedMediaConvertTranscodePreset = {
|
|
|
1148
1218
|
*/
|
|
1149
1219
|
declare const parseMediaConvertPreset: (mediaconvert: TranscodePresetType['mediaconvert']) => ParsedMediaConvertTranscodePreset;
|
|
1150
1220
|
|
|
1151
|
-
|
|
1152
|
-
* TODO
|
|
1153
|
-
*/
|
|
1154
|
-
declare type ParsedTranscodePreset = {
|
|
1221
|
+
type ParsedTranscodePreset = {
|
|
1155
1222
|
description?: string;
|
|
1156
1223
|
containerFormat?: any;
|
|
1157
1224
|
videoFormat?: string;
|
|
@@ -1170,13 +1237,13 @@ declare type ParsedTranscodePreset = {
|
|
|
1170
1237
|
audioChannels?: number;
|
|
1171
1238
|
};
|
|
1172
1239
|
/**
|
|
1173
|
-
*
|
|
1240
|
+
* Parse a VidiCore transcode preset
|
|
1174
1241
|
*
|
|
1175
|
-
* @param transcodePresetType
|
|
1176
|
-
* @returns
|
|
1242
|
+
* @param transcodePresetType a VidiCore transcode preset
|
|
1243
|
+
* @returns A parsed transcode preset
|
|
1177
1244
|
*
|
|
1178
1245
|
* @category Transcode
|
|
1179
1246
|
*/
|
|
1180
1247
|
declare const parseTranscodePreset: (transcodePresetType: TranscodePresetType) => ParsedTranscodePreset;
|
|
1181
1248
|
|
|
1182
|
-
export { CreateFacetTypeFieldList, CreateFacetTypeOptions, CreateMetadataTypeInput, CreateTimeCodeOptions, DocumentType, FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, FilterShapeSourceOption, FilteredShapeListObject, FormatTimeCodeSecondsOptions, FormatTimeCodeSmpteOptions, FormatTimeCodeTextOptions, GROUP_ATTRIBUTE_KEYS, InputField, InputFieldObject, InputFieldValue, InputGroup, InputGroupsOrFields, InputTimespan, InputValue, InputValueObject, InputValueTypes, MetadataTypeToWebVttOptions, ParseFieldListOptions, ParseFieldOptions, ParseGroupListOptions, ParseGroupOptions, ParseHighlightTimespanListOptions, ParseHighlightTimespanOptions, ParseMetadataTypeOptions, ParseTimespanListOptions, ParseTimespanOptions, ParseValueListOptions, ParseValueOptions, ParsedAudioComponentType, ParsedAudioMediaInfoType, ParsedBaseMediaInfoType, ParsedBinaryComponentType, ParsedBinaryMediaInfoType, ParsedContainerComponentType, ParsedFacetType, ParsedFacetTypeCount, ParsedField, ParsedFieldAttributes, ParsedFieldList, ParsedFieldObject, ParsedFileType, ParsedGroup, ParsedGroupAttributes, ParsedGroupList, ParsedHighlightTimespan, ParsedMediaConvertTranscodePreset, ParsedMetadataAttributes, ParsedMetadataType, ParsedShapeType, ParsedTimespan, ParsedTimespanAttributes, ParsedTimespanList, ParsedTranscodePreset, ParsedValue, ParsedValueAttributes, ParsedValueList, ParsedVideoComponentType, ParsedVideoMediaInfoType, ROLE_NAMES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, ShapeMediaType, TimeBase, TimeBaseInput, TimeCode, TimeCodeInput, TimeCodeInputOptions, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
|
|
1249
|
+
export { CreateFacetTypeFieldList, CreateFacetTypeOptions, CreateMetadataTypeInput, CreateTimeCodeOptions, DOCUMENT_TYPES, DocumentType, FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, FILE_STATES, FileStateTypes, FilterShapeSourceOption, FilteredShapeListObject, FormatTimeCodeSecondsOptions, FormatTimeCodeSmpteOptions, FormatTimeCodeTextOptions, GROUP_ATTRIBUTE_KEYS, InputField, InputFieldObject, InputFieldValue, InputGroup, InputGroupsOrFields, InputTimespan, InputValue, InputValueObject, InputValueTypes, MetadataTypeToWebVttOptions, ParseFieldListOptions, ParseFieldOptions, ParseGroupListOptions, ParseGroupOptions, ParseHighlightTimespanListOptions, ParseHighlightTimespanOptions, ParseMetadataTypeOptions, ParseTimespanListOptions, ParseTimespanOptions, ParseValueListOptions, ParseValueOptions, ParsedAudioComponentType, ParsedAudioMediaInfoType, ParsedBaseMediaInfoType, ParsedBinaryComponentType, ParsedBinaryMediaInfoType, ParsedContainerComponentType, ParsedFacetType, ParsedFacetTypeCount, ParsedField, ParsedFieldAttributes, ParsedFieldList, ParsedFieldObject, ParsedFileType, ParsedGroup, ParsedGroupAttributes, ParsedGroupList, ParsedHighlightTimespan, ParsedMediaConvertTranscodePreset, ParsedMetadataAttributes, ParsedMetadataType, ParsedShapeType, ParsedTimespan, ParsedTimespanAttributes, ParsedTimespanList, ParsedTranscodePreset, ParsedValue, ParsedValueAttributes, ParsedValueList, ParsedVideoComponentType, ParsedVideoMediaInfoType, ROLE_NAMES, RoleNameTypes, SHAPE_MEDIA_TYPES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, ShapeMediaType, TimeBase, TimeBaseInput, TimeCode, TimeCodeInput, TimeCodeInputOptions, createFacetType, createMetadataType, createTimeBase, createTimeCode, filterShapeSource, findNearestThumbnail, formatTimeBaseText, formatTimeBaseType, formatTimeCodeSeconds, formatTimeCodeSmpte, formatTimeCodeText, formatTimeCodeType, getShapeDocumentType, getShapeMediaType, metadataTypeToWebVtt, parseAudioComponent, parseBinaryComponent, parseContainerComponent, parseFacetType, parseFieldList, parseFileType, parseGroupList, parseHighlightTimespan, parseHighlightTimespanList, parseKeyValuePairTypes as parseKeyValuePairType, parseMediaConvertPreset, parseMetadataType, parseNowDate, parseShapeType, parseSimpleMetadataType, parseTimespan, parseTimespanList, parseTranscodePreset, parseVideoComponent };
|