@vidispine/vdt-js 22.4.0 → 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 CHANGED
@@ -13,7 +13,7 @@ declare const parseKeyValuePairTypes: (keyValuePairTypes: KeyValuePairType[]) =>
13
13
  };
14
14
 
15
15
  /**
16
- * Object with all name of roles in VidiCore
16
+ * Const object with VidiCore role names
17
17
  *
18
18
  * @category Auth
19
19
  */
@@ -127,7 +127,8 @@ 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 */
@@ -445,17 +446,19 @@ type MetadataTypeToWebVttOptions = {
445
446
  declare const metadataTypeToWebVtt: (metadataType: MetadataType, options?: MetadataTypeToWebVttOptions) => string;
446
447
 
447
448
  /**
448
- * Array with all available metadata group attributes
449
+ * Array with all available VidiCore system/default field group names
449
450
  *
450
451
  * @category Metadata
451
452
  */
452
- declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
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
+
453
455
  /**
454
- * Array with all available metadata group attributes
456
+ * Array with all available VidiCore system/default field names (including transient)
455
457
  *
456
458
  * @category Metadata
457
459
  */
458
- declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
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
+
459
462
  /**
460
463
  * Array with all available metadata field value attributes
461
464
  *
@@ -464,17 +467,18 @@ declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
464
467
  declare const FIELD_VALUE_ATTRIBUTE_KEYS: (keyof MetadataValueType)[];
465
468
 
466
469
  /**
467
- * Array with all available VidiCore system/default field group names
470
+ * Array with all available metadata field attributes
468
471
  *
469
472
  * @category Metadata
470
473
  */
471
- 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"];
474
+ declare const FIELD_ATTRIBUTE_KEYS: (keyof MetadataFieldValueType)[];
475
+
472
476
  /**
473
- * Array with all available VidiCore system/default field group names
477
+ * Array with all available metadata group attributes
474
478
  *
475
479
  * @category Metadata
476
480
  */
477
- 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"];
481
+ declare const GROUP_ATTRIBUTE_KEYS: (keyof MetadataGroupValueType)[];
478
482
 
479
483
  type CreateFacetTypeFieldList = string[];
480
484
  type CreateFacetTypeOptions = {
@@ -550,6 +554,19 @@ type ParseHighlightTimespanListOptions = {
550
554
  */
551
555
  declare const parseHighlightTimespanList: (highlightTimespanList?: SearchResultEntryTimespanType[], options?: ParseHighlightTimespanListOptions) => ParsedHighlightTimespan | ParsedHighlightTimespan[];
552
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
+ */
553
570
  declare const parseNowDate: (value?: string) => Date;
554
571
 
555
572
  type ParsedBaseMediaInfoType = {
@@ -572,6 +589,7 @@ type ParsedAudioComponentType = {
572
589
  audioSamplerateSamples?: number;
573
590
  audioBitDepth?: string;
574
591
  audioBitrate?: string;
592
+ audioBitrateKbps?: number;
575
593
  audioBitRateMode?: string;
576
594
  audioChannels?: number;
577
595
  audioMetadata?: {
@@ -615,6 +633,9 @@ type ParsedFileType = {
615
633
  /**
616
634
  * Parses a VidiCore file object
617
635
  *
636
+ * @remarks
637
+ * File sizes are parsed with JEDEC standard (base 2)
638
+ *
618
639
  * @param fileType VidiCore file object
619
640
  * @returns A parsed file object
620
641
  *
@@ -679,6 +700,7 @@ declare class TimeBase {
679
700
  *
680
701
  * @remarks
681
702
  * Default format: denominator(:numerator if > 1)
703
+ *
682
704
  * `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
683
705
  *
684
706
  * @param options For how to display it as text
@@ -698,6 +720,7 @@ declare class TimeBase {
698
720
  * - `number` gives that amount of decimal places
699
721
  *
700
722
  * Default format: rate with two decimals if needed (i.e. decimals are > 0)
723
+ *
701
724
  * Option precedence (when all true): `constant` > `rounded` > `fixed`
702
725
  *
703
726
  * @param options For how to display it as rate
@@ -822,6 +845,7 @@ declare class TimeCode {
822
845
  *
823
846
  * @remarks
824
847
  * Default format: samples@denominator(:numerator if > 1)
848
+ *
825
849
  * `constant` has precedence over `fraction` if both are true
826
850
  *
827
851
  * @param options Options for how to format text
@@ -917,7 +941,9 @@ type FormatTimeCodeSecondsOptions = {
917
941
  } & TimeCodeInputOptions;
918
942
  /**
919
943
  * Format seconds to TimeCode object
920
- * Input time base is always 1:1 since it expects seconds as input
944
+ *
945
+ * @remarks
946
+ * Input time base is always considered as 1:1 since it expects seconds as input
921
947
  *
922
948
  * Note: Max 15 digits accuracy (double precision float64), e.g.
923
949
  * - 10^6 seconds can have 10^9 decimals (nanosecond) precision
@@ -1000,6 +1026,7 @@ type ParsedVideoComponentType = {
1000
1026
  videoCodec?: string;
1001
1027
  smpte?: string;
1002
1028
  videoBitrate?: string;
1029
+ videoBitrateMbps?: number;
1003
1030
  fieldOrder?: string;
1004
1031
  colorSpace?: string;
1005
1032
  chromaSubsampling?: string;
@@ -1040,13 +1067,32 @@ type ParsedShapeType = {
1040
1067
  */
1041
1068
  declare const parseShapeType: (shapeType?: ShapeType) => ParsedShapeType;
1042
1069
 
1070
+ /**
1071
+ * Const object with document types
1072
+ *
1073
+ * @category Shape
1074
+ */
1043
1075
  declare const DOCUMENT_TYPES: {
1044
1076
  readonly PDF: "PDF";
1045
1077
  readonly TEXT: "TEXT";
1046
1078
  readonly MSWORD: "MSWORD";
1047
1079
  readonly JSON: "JSON";
1048
1080
  readonly XML: "XML";
1049
- };
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
+
1050
1096
  type DocumentType = keyof typeof DOCUMENT_TYPES;
1051
1097
  /**
1052
1098
  * Return a const for the document type of a shape (looks at mimeType)
@@ -1085,13 +1131,6 @@ type FilterShapeSourceOption = {
1085
1131
  */
1086
1132
  declare const filterShapeSource: (itemType: ItemType, options: FilterShapeSourceOption) => FilteredShapeListObject[];
1087
1133
 
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
1134
  type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
1096
1135
  /**
1097
1136
  * Returns a const for which media type a shape has
@@ -1103,6 +1142,38 @@ type ShapeMediaType = keyof typeof SHAPE_MEDIA_TYPES;
1103
1142
  */
1104
1143
  declare const getShapeMediaType: (shape: ShapeType) => ShapeMediaType;
1105
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
+
1106
1177
  /**
1107
1178
  * Find the thumbnail uri in a VidiCore item object that's nearest a timeCode
1108
1179
  *
@@ -1175,4 +1246,4 @@ type ParsedTranscodePreset = {
1175
1246
  */
1176
1247
  declare const parseTranscodePreset: (transcodePresetType: TranscodePresetType) => ParsedTranscodePreset;
1177
1248
 
1178
- 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 };
package/dist/index.es.js CHANGED
@@ -5,7 +5,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';
5
5
  import _typeof from '@babel/runtime/helpers/typeof';
6
6
  import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
7
7
  import _createClass from '@babel/runtime/helpers/createClass';
8
- import parseFileSize from 'filesize';
8
+ import { filesize } from 'filesize';
9
9
 
10
10
  var gcd = function gcd(a, b) {
11
11
  return b ? gcd(b, a % b) : a;
@@ -43,7 +43,7 @@ var parseKeyValuePairTypes = function parseKeyValuePairTypes(keyValuePairTypes)
43
43
  };
44
44
 
45
45
  /**
46
- * Object with all name of roles in VidiCore
46
+ * Const object with VidiCore role names
47
47
  *
48
48
  * @category Auth
49
49
  */
@@ -159,43 +159,43 @@ var ROLE_NAMES = {
159
159
  VXA_READ: '_vxa_read'
160
160
  };
161
161
 
162
- var SHARED_ATTRIBUTE_KEYS = ['uuid', 'user', 'timestamp', 'change', 'conflict', 'mode'];
163
- var SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS = ['name', 'id', 'referenced', 'data', 'inheritance'];
164
-
165
162
  /**
166
- * Array with all available metadata group attributes
163
+ * Array with all available VidiCore system/default field group names
167
164
  *
168
165
  * @category Metadata
169
166
  */
170
- var GROUP_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS, ['cycle', 'field', 'group']);
167
+ var SYSTEM_FIELDGROUPS = ['stl_subtitle', 'stl_tti', 'stl_gsi', 'mrk_marker', 'pho_validation', 'pho_resource', 'pho_error', 'facedetect_rect', 'facedetect_face', 'originalTrackFilename', 'stl_gsiHeader'];
171
168
 
172
169
  /**
173
- * Array with all available metadata group attributes
170
+ * Array with all available VidiCore system/default field names (including transient)
174
171
  *
175
172
  * @category Metadata
176
173
  */
177
- var FIELD_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS, ['value', 'reference', 'type', 'track']);
174
+ var SYSTEM_FIELDS = ['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'];
175
+
176
+ var SHARED_ATTRIBUTE_KEYS = ['uuid', 'user', 'timestamp', 'change', 'conflict', 'mode'];
177
+ var SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS = ['name', 'id', 'referenced', 'data', 'inheritance'];
178
178
 
179
179
  /**
180
180
  * Array with all available metadata field value attributes
181
181
  *
182
182
  * @category Metadata
183
183
  */
184
- var FIELD_VALUE_ATTRIBUTE_KEYS = [].concat(SHARED_ATTRIBUTE_KEYS, ['value', 'lang']);
184
+ var FIELD_VALUE_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), ['value', 'lang']);
185
185
 
186
186
  /**
187
- * Array with all available VidiCore system/default field group names
187
+ * Array with all available metadata field attributes
188
188
  *
189
189
  * @category Metadata
190
190
  */
191
- var SYSTEM_FIELDGROUPS = ['stl_subtitle', 'stl_tti', 'stl_gsi', 'mrk_marker', 'pho_validation', 'pho_resource', 'pho_error', 'facedetect_rect', 'facedetect_face', 'originalTrackFilename', 'stl_gsiHeader'];
191
+ var FIELD_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), _toConsumableArray(SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS), ['value', 'reference', 'type', 'track']);
192
192
 
193
193
  /**
194
- * Array with all available VidiCore system/default field group names
194
+ * Array with all available metadata group attributes
195
195
  *
196
196
  * @category Metadata
197
197
  */
198
- var SYSTEM_FIELDS = ['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'];
198
+ var GROUP_ATTRIBUTE_KEYS = [].concat(_toConsumableArray(SHARED_ATTRIBUTE_KEYS), _toConsumableArray(SHARED_FIELD_AND_GROUP_ATTRIBUTE_KEYS), ['cycle', 'field', 'group']);
199
199
 
200
200
  var _excluded$e = ["value"],
201
201
  _excluded2$2 = ["start", "end", "base"];
@@ -969,6 +969,7 @@ var TimeBase = /*#__PURE__*/function () {
969
969
  *
970
970
  * @remarks
971
971
  * Default format: denominator(:numerator if > 1)
972
+ *
972
973
  * `constant` has precedence over `fraction` if both are true (e.g. NTSC > 30000:1001)
973
974
  *
974
975
  * @param options For how to display it as text
@@ -999,6 +1000,7 @@ var TimeBase = /*#__PURE__*/function () {
999
1000
  * - `number` gives that amount of decimal places
1000
1001
  *
1001
1002
  * Default format: rate with two decimals if needed (i.e. decimals are > 0)
1003
+ *
1002
1004
  * Option precedence (when all true): `constant` > `rounded` > `fixed`
1003
1005
  *
1004
1006
  * @param options For how to display it as rate
@@ -1320,6 +1322,7 @@ var TimeCode = /*#__PURE__*/function () {
1320
1322
  *
1321
1323
  * @remarks
1322
1324
  * Default format: samples@denominator(:numerator if > 1)
1325
+ *
1323
1326
  * `constant` has precedence over `fraction` if both are true
1324
1327
  *
1325
1328
  * @param options Options for how to format text
@@ -1606,7 +1609,9 @@ var getGreatestCommonDivisor = function getGreatestCommonDivisor(num1, num2) {
1606
1609
  var _excluded$5 = ["timeBase", "useGCD"];
1607
1610
  /**
1608
1611
  * Format seconds to TimeCode object
1609
- * Input time base is always 1:1 since it expects seconds as input
1612
+ *
1613
+ * @remarks
1614
+ * Input time base is always considered as 1:1 since it expects seconds as input
1610
1615
  *
1611
1616
  * Note: Max 15 digits accuracy (double precision float64), e.g.
1612
1617
  * - 10^6 seconds can have 10^9 decimals (nanosecond) precision
@@ -2118,6 +2123,19 @@ var parseHighlightTimespanList = function parseHighlightTimespanList() {
2118
2123
  }, {});
2119
2124
  };
2120
2125
 
2126
+ /**
2127
+ * Parse Vidicore "NOW" constants to a date object
2128
+ *
2129
+ * Format: `NOW[+/-][number][HOUR/DAY/MONTH/YEAR(s)]` (e.g. "NOW-2HOURS")
2130
+ *
2131
+ * @remarks
2132
+ * Returns an approximate date since it's created client side
2133
+ *
2134
+ * @param value A "NOW" constant
2135
+ * @returns A date from the NOW constant
2136
+ *
2137
+ * @category Search
2138
+ */
2121
2139
  var parseNowDate = function parseNowDate() {
2122
2140
  var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'NOW';
2123
2141
  if (value.startsWith('NOW')) {
@@ -2176,7 +2194,7 @@ var sampleRateSymbols = {
2176
2194
  B: 'Hz',
2177
2195
  mB: 'mHz'
2178
2196
  };
2179
- var bitRateSymbols = {
2197
+ var bitRateSymbols$1 = {
2180
2198
  kB: 'kbps',
2181
2199
  B: 'bps',
2182
2200
  MB: 'mbps'
@@ -2201,16 +2219,24 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2201
2219
  audioBitRateMode = audioMediaInfo.Bit_rate_mode;
2202
2220
  var audioMetadata = parseKeyValuePairTypes(metadata || []);
2203
2221
  var audioSamplerateSamples = timeBase !== null && timeBase !== void 0 && timeBase.denominator ? ((timeBase === null || timeBase === void 0 ? void 0 : timeBase.denominator) || 1) / ((timeBase === null || timeBase === void 0 ? void 0 : timeBase.numerator) || 1) : undefined;
2204
- var audioSamplerate = audioSamplerateSamples !== undefined ? parseFileSize(audioSamplerateSamples, {
2222
+ var audioSamplerate = audioSamplerateSamples !== undefined ? filesize(audioSamplerateSamples, {
2205
2223
  base: 10,
2206
2224
  round: 1,
2207
2225
  symbols: sampleRateSymbols
2208
2226
  }) : undefined;
2209
- var audioBitrate = bitrate !== undefined ? parseFileSize(bitrate, {
2210
- base: 10,
2211
- round: 2,
2212
- symbols: bitRateSymbols
2213
- }) : undefined;
2227
+ var audioBitrate;
2228
+ var audioBitrateKbps;
2229
+ if (bitrate !== undefined) {
2230
+ var _split;
2231
+ audioBitrate = filesize(bitrate, {
2232
+ round: 2,
2233
+ symbols: bitRateSymbols$1
2234
+ });
2235
+ audioBitrateKbps = Number((_split = filesize(bitrate, {
2236
+ exponent: 1,
2237
+ symbols: bitRateSymbols$1
2238
+ }).split(' kbps')) === null || _split === void 0 ? void 0 : _split[0]);
2239
+ }
2214
2240
  return {
2215
2241
  audioFormat: audioFormat,
2216
2242
  audioCodec: audioCodec,
@@ -2218,6 +2244,7 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2218
2244
  audioSamplerateSamples: audioSamplerateSamples,
2219
2245
  audioBitDepth: audioBitDepth,
2220
2246
  audioBitrate: audioBitrate,
2247
+ audioBitrateKbps: audioBitrateKbps,
2221
2248
  audioBitRateMode: audioBitRateMode,
2222
2249
  audioChannels: audioChannels,
2223
2250
  audioMediaInfo: audioMediaInfo,
@@ -2225,9 +2252,43 @@ var parseAudioComponent = function parseAudioComponent(audioComponentType) {
2225
2252
  };
2226
2253
  };
2227
2254
 
2255
+ /**
2256
+ * Const object with all file states in VidiCore
2257
+ * (see https://apidoc.vidispine.com/latest/storage/storage.html#file-states for more info)
2258
+ *
2259
+ * @category File
2260
+ */
2261
+ var FILE_STATES = {
2262
+ /** Just created, not used. */
2263
+ NONE: 'NONE',
2264
+ /** Discovered or created, not yet marked as finished. */
2265
+ OPEN: 'OPEN',
2266
+ /** File does no longer grow. */
2267
+ CLOSED: 'CLOSED',
2268
+ /** The current state is not known. */
2269
+ UNKNOWN: 'UNKNOWN',
2270
+ /** File is missing from the file system/storage. */
2271
+ MISSING: 'MISSING',
2272
+ /** File has been missing for a longer period. Candidate for restoration from archive. */
2273
+ LOST: 'LOST',
2274
+ /** File will appear on file system/storage, transfer subsystem or transcoder will create it. */
2275
+ TO_APPEAR: 'TO_APPEAR',
2276
+ /** The file is no longer in use, and will be deleted at the next clean-up sweep. */
2277
+ TO_BE_DELETED: 'TO_BE_DELETED',
2278
+ /** File is in use by transfer subsystem or transcoder. */
2279
+ BEING_READ: 'BEING_READ',
2280
+ /** File is archived. */
2281
+ ARCHIVED: 'ARCHIVED',
2282
+ /** File will be synchronized by multi-site agent. */
2283
+ AWAITING_SYNC: 'AWAITING_SYNC'
2284
+ };
2285
+
2228
2286
  /**
2229
2287
  * Parses a VidiCore file object
2230
2288
  *
2289
+ * @remarks
2290
+ * File sizes are parsed with JEDEC standard (base 2)
2291
+ *
2231
2292
  * @param fileType VidiCore file object
2232
2293
  * @returns A parsed file object
2233
2294
  *
@@ -2242,7 +2303,10 @@ var parseFileType = function parseFileType(fileType) {
2242
2303
  fileId = fileType.id;
2243
2304
  var _uriList = _slicedToArray(uriList, 1),
2244
2305
  uri = _uriList[0];
2245
- var fileSize = fileSizeBytes !== undefined ? parseFileSize(fileSizeBytes) : '';
2306
+ var fileSize = fileSizeBytes !== undefined ? filesize(fileSizeBytes, {
2307
+ base: 2,
2308
+ standard: 'jedec'
2309
+ }) : '';
2246
2310
  var fileName = path ? path.split('/').pop() : undefined;
2247
2311
  return {
2248
2312
  uri: uri,
@@ -2357,6 +2421,11 @@ var parseContainerComponent = function parseContainerComponent() {
2357
2421
  return parsedContainerComponentType;
2358
2422
  };
2359
2423
 
2424
+ var bitRateSymbols = {
2425
+ kB: 'kbps',
2426
+ B: 'bps',
2427
+ MB: 'mbps'
2428
+ };
2360
2429
  /**
2361
2430
  * Parses the technical information of a VideoComponentType.
2362
2431
  * @param {Object} videoComponentType - A VideoComponentType from VidiCore.
@@ -2417,9 +2486,19 @@ var parseVideoComponent = function parseVideoComponent() {
2417
2486
  width = _ref.width;
2418
2487
  var aspectRatio = parseAspectRatio(resolution);
2419
2488
  var dimension = "".concat(width, "x").concat(height);
2420
- var videoBitrate = bitrate ? parseFileSize(bitrate, {
2421
- bits: true
2422
- }) : undefined;
2489
+ var videoBitrate;
2490
+ var videoBitrateMbps;
2491
+ if (bitrate !== undefined) {
2492
+ var _split;
2493
+ videoBitrate = filesize(bitrate, {
2494
+ round: 2,
2495
+ symbols: bitRateSymbols
2496
+ });
2497
+ videoBitrateMbps = Number((_split = filesize(bitrate, {
2498
+ exponent: 2,
2499
+ symbols: bitRateSymbols
2500
+ }).split(' mbps')) === null || _split === void 0 ? void 0 : _split[0]);
2501
+ }
2423
2502
  return {
2424
2503
  videoFormat: videoFormat,
2425
2504
  dimension: dimension,
@@ -2431,6 +2510,7 @@ var parseVideoComponent = function parseVideoComponent() {
2431
2510
  videoCodec: videoCodec,
2432
2511
  smpte: smpte,
2433
2512
  videoBitrate: videoBitrate,
2513
+ videoBitrateMbps: videoBitrateMbps,
2434
2514
  fieldOrder: fieldOrder,
2435
2515
  colorSpace: colorSpace,
2436
2516
  chromaSubsampling: chromaSubsampling,
@@ -2497,8 +2577,11 @@ var parseShapeType = function parseShapeType() {
2497
2577
  return parsedShape;
2498
2578
  };
2499
2579
 
2500
- // eslint-disable-next-line import/no-cycle
2501
-
2580
+ /**
2581
+ * Const object with document types
2582
+ *
2583
+ * @category Shape
2584
+ */
2502
2585
  var DOCUMENT_TYPES = {
2503
2586
  PDF: 'PDF',
2504
2587
  TEXT: 'TEXT',
@@ -2506,6 +2589,21 @@ var DOCUMENT_TYPES = {
2506
2589
  JSON: 'JSON',
2507
2590
  XML: 'XML'
2508
2591
  };
2592
+
2593
+ /**
2594
+ * Const object with media types
2595
+ *
2596
+ * @category Shape
2597
+ */
2598
+ var SHAPE_MEDIA_TYPES = {
2599
+ IMAGE: 'IMAGE',
2600
+ AUDIO: 'AUDIO',
2601
+ VIDEO: 'VIDEO',
2602
+ DOCUMENT: 'DOCUMENT',
2603
+ BINARY: 'BINARY'
2604
+ };
2605
+
2606
+ // eslint-disable-next-line import/no-cycle
2509
2607
  /**
2510
2608
  * Return a const for the document type of a shape (looks at mimeType)
2511
2609
  *
@@ -2613,15 +2711,6 @@ var filterShapeSource = function filterShapeSource(itemType, options) {
2613
2711
  return filteredShapeList;
2614
2712
  };
2615
2713
 
2616
- // eslint-disable-next-line import/no-cycle
2617
-
2618
- var SHAPE_MEDIA_TYPES = {
2619
- IMAGE: 'IMAGE',
2620
- AUDIO: 'AUDIO',
2621
- VIDEO: 'VIDEO',
2622
- DOCUMENT: 'DOCUMENT',
2623
- BINARY: 'BINARY'
2624
- };
2625
2714
  /**
2626
2715
  * Returns a const for which media type a shape has
2627
2716
  *
@@ -2819,5 +2908,5 @@ var parseTranscodePreset = function parseTranscodePreset(transcodePresetType) {
2819
2908
  return output;
2820
2909
  };
2821
2910
 
2822
- export { FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, GROUP_ATTRIBUTE_KEYS, ROLE_NAMES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, TimeBase, TimeCode, 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 };
2911
+ export { DOCUMENT_TYPES, FIELD_ATTRIBUTE_KEYS, FIELD_VALUE_ATTRIBUTE_KEYS, FILE_STATES, GROUP_ATTRIBUTE_KEYS, ROLE_NAMES, SHAPE_MEDIA_TYPES, SYSTEM_FIELDGROUPS, SYSTEM_FIELDS, TimeBase, TimeCode, 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 };
2823
2912
  //# sourceMappingURL=index.es.js.map