@wix/media 1.0.8 → 1.0.10
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/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +11 -2
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +96 -40
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +5 -4
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +22 -16
- package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +69 -16
- package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +178 -24
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +124 -59
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.http.js +30 -27
- package/build/cjs/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.public.d.ts +1 -1
- package/build/cjs/src/media-site-media-v1-folder.public.js +9 -9
- package/build/cjs/src/media-site-media-v1-folder.public.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.types.d.ts +29 -7
- package/build/cjs/src/media-site-media-v1-folder.types.js.map +1 -1
- package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +68 -9
- package/build/cjs/src/media-site-media-v1-folder.universal.js +37 -34
- package/build/cjs/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +11 -2
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +60 -5
- package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +5 -4
- package/build/es/src/media-site-media-v1-file-descriptor.public.js +8 -3
- package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +69 -16
- package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +1 -1
- package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +178 -24
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +77 -13
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.http.js +9 -6
- package/build/es/src/media-site-media-v1-folder.http.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.public.d.ts +1 -1
- package/build/es/src/media-site-media-v1-folder.public.js +1 -1
- package/build/es/src/media-site-media-v1-folder.public.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.types.d.ts +29 -7
- package/build/es/src/media-site-media-v1-folder.types.js.map +1 -1
- package/build/es/src/media-site-media-v1-folder.universal.d.ts +68 -9
- package/build/es/src/media-site-media-v1-folder.universal.js +10 -7
- package/build/es/src/media-site-media-v1-folder.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,43 +1,86 @@
|
|
|
1
1
|
export interface FileDescriptor {
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* File ID. Generated when a file is uploaded to the Media Manager.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
3
6
|
id?: string;
|
|
4
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* File name as it appears in the Media Manager.
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
5
11
|
displayName?: string;
|
|
6
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Static URL of the file.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
7
16
|
url?: string;
|
|
8
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* ID of the file's parent folder.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
9
21
|
parentFolderId?: string | null;
|
|
10
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* File hash.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
11
26
|
hash?: string;
|
|
12
27
|
/**
|
|
13
28
|
* Whether the link to the uploaded file is public or private. Private links require a token.
|
|
14
29
|
* @readonly
|
|
15
30
|
*/
|
|
16
31
|
private?: boolean;
|
|
17
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Media file type.
|
|
34
|
+
* @readonly
|
|
35
|
+
*/
|
|
18
36
|
mediaType?: MediaType;
|
|
19
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Media file content.
|
|
39
|
+
* @readonly
|
|
40
|
+
*/
|
|
20
41
|
media?: FileMedia;
|
|
21
42
|
/**
|
|
22
43
|
* Status of the file that was uploaded.
|
|
23
44
|
* * `FAILED`: The file failed to upload, for example, during media post processing.
|
|
24
45
|
* * `READY`: The file uploaded, finished all processing, and is ready for use.
|
|
25
46
|
* * `PENDING`: The file is processing and the URLs are not yet available. This response is returned when importing a file.
|
|
47
|
+
* @readonly
|
|
26
48
|
*/
|
|
27
49
|
operationStatus?: OperationStatus;
|
|
28
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* URL where the file was uploaded from.
|
|
52
|
+
* @readonly
|
|
53
|
+
*/
|
|
29
54
|
sourceUrl?: string | null;
|
|
30
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* URL of the file's thumbnail.
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
31
59
|
thumbnailUrl?: string | null;
|
|
32
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images.
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
33
64
|
labels?: string[];
|
|
34
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Date and time the file was created.
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
35
69
|
createdDate?: Date;
|
|
36
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Date and time the file was updated.
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
37
74
|
updatedDate?: Date;
|
|
38
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* The Wix site ID where the media file is stored.
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
39
79
|
siteId?: string;
|
|
40
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* State of the file.
|
|
82
|
+
* @readonly
|
|
83
|
+
*/
|
|
41
84
|
state?: State;
|
|
42
85
|
}
|
|
43
86
|
export declare enum MediaType {
|
|
@@ -315,6 +358,16 @@ export interface UpdateFileResponse {
|
|
|
315
358
|
/** Information about the updated file. */
|
|
316
359
|
file?: FileDescriptor;
|
|
317
360
|
}
|
|
361
|
+
export interface UpdateFileDescriptorRequest {
|
|
362
|
+
/** A partial file object, see updatable properties in the FileDescriptor object */
|
|
363
|
+
file: FileDescriptor;
|
|
364
|
+
/** field mask */
|
|
365
|
+
fieldMask?: string[];
|
|
366
|
+
}
|
|
367
|
+
export interface UpdateFileDescriptorResponse {
|
|
368
|
+
/** Information about the updated file. */
|
|
369
|
+
file?: FileDescriptor;
|
|
370
|
+
}
|
|
318
371
|
export interface GenerateFileUploadUrlRequest {
|
|
319
372
|
/** File mime type. */
|
|
320
373
|
mimeType: string | null;
|
|
@@ -406,7 +459,7 @@ export interface ImportFileResponse {
|
|
|
406
459
|
}
|
|
407
460
|
export interface BulkImportFilesRequest {
|
|
408
461
|
/** Information about the files to import. */
|
|
409
|
-
importFileRequests
|
|
462
|
+
importFileRequests: ImportFileRequest[];
|
|
410
463
|
}
|
|
411
464
|
export interface BulkImportFilesResponse {
|
|
412
465
|
/** Information about the imported files. */
|
|
@@ -531,7 +584,7 @@ export interface GenerateWebSocketTokenResponse {
|
|
|
531
584
|
}
|
|
532
585
|
export interface BulkDeleteFilesRequest {
|
|
533
586
|
/** IDs of the files to move to the Media Manager's trash bin. */
|
|
534
|
-
fileIds
|
|
587
|
+
fileIds: string[];
|
|
535
588
|
/**
|
|
536
589
|
* Whether the specified files are permanently deleted. <br />
|
|
537
590
|
* Default: `false`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media-site-media-v1-file-descriptor.types.js","sourceRoot":"","sources":["../../../src/media-site-media-v1-file-descriptor.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"media-site-media-v1-file-descriptor.types.js","sourceRoot":"","sources":["../../../src/media-site-media-v1-file-descriptor.types.ts"],"names":[],"mappings":"AAsFA,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,gCAAmB,CAAA;IACnB,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,4BAAe,CAAA;IACf,kCAAqB,CAAA;IACrB,8BAAiB,CAAA;AACnB,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AA4KD,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,uCAAuC;IACvC,oCAAiB,CAAA;IACjB,oCAAoC;IACpC,kCAAe,CAAA;IACf,kEAAkE;IAClE,sCAAmB,CAAA;AACrB,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAED,MAAM,CAAN,IAAY,KAGX;AAHD,WAAY,KAAK;IACf,kBAAS,CAAA;IACT,4BAAmB,CAAA;AACrB,CAAC,EAHW,KAAK,KAAL,KAAK,QAGhB;AAiLD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,wEAAwE;IACxE,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAgFD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA2DD,MAAM,CAAN,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,6BAA6B;IAC7B,uCAAyB,CAAA;IACzB,sCAAsC;IACtC,uCAAyB,CAAA;IACzB,kCAAkC;IAClC,2DAA6C,CAAA;AAC/C,CAAC,EAPW,UAAU,KAAV,UAAU,QAOrB;AAgBD,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,2BAAW,CAAA;IACX,6BAAa,CAAA;AACf,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
|
|
@@ -5,15 +5,30 @@ export declare const __debug: {
|
|
|
5
5
|
};
|
|
6
6
|
};
|
|
7
7
|
export interface FileDescriptor {
|
|
8
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* File ID. Generated when a file is uploaded to the Media Manager.
|
|
10
|
+
* @readonly
|
|
11
|
+
*/
|
|
9
12
|
_id?: string;
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* File name as it appears in the Media Manager.
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
11
17
|
displayName?: string;
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* Static URL of the file.
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
13
22
|
url?: string;
|
|
14
|
-
/**
|
|
23
|
+
/**
|
|
24
|
+
* ID of the file's parent folder.
|
|
25
|
+
* @readonly
|
|
26
|
+
*/
|
|
15
27
|
parentFolderId?: string | null;
|
|
16
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* File hash.
|
|
30
|
+
* @readonly
|
|
31
|
+
*/
|
|
17
32
|
hash?: string;
|
|
18
33
|
/**
|
|
19
34
|
* Whether the link to the uploaded file is public or private. Private links require a token.
|
|
@@ -24,9 +39,13 @@ export interface FileDescriptor {
|
|
|
24
39
|
* Media file type.
|
|
25
40
|
*
|
|
26
41
|
* Supported values: `"IMAGE"`, `"VIDEO"`, `"AUDIO"`, `"DOCUMENT"`, `"VECTOR"`
|
|
42
|
+
* @readonly
|
|
27
43
|
*/
|
|
28
44
|
mediaType?: MediaType;
|
|
29
|
-
/**
|
|
45
|
+
/**
|
|
46
|
+
* Media file content.
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
30
49
|
media?: FileMedia;
|
|
31
50
|
/**
|
|
32
51
|
* Status of the file that was uploaded.
|
|
@@ -35,24 +54,44 @@ export interface FileDescriptor {
|
|
|
35
54
|
* * `FAILED`: The file failed to upload, for example, during media post processing.
|
|
36
55
|
* * `READY`: The file uploaded, finished all processing, and is ready for use.
|
|
37
56
|
* * `PENDING`: The file is processing and the URLs are not yet available. This response is returned when importing a file.
|
|
57
|
+
* @readonly
|
|
38
58
|
*/
|
|
39
59
|
operationStatus?: OperationStatus;
|
|
40
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* URL where the file was uploaded from.
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
41
64
|
sourceUrl?: string | null;
|
|
42
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* URL of the file's thumbnail.
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
43
69
|
thumbnailUrl?: string | null;
|
|
44
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images.
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
45
74
|
labels?: string[];
|
|
46
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* Date and time the file was created.
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
47
79
|
_createdDate?: Date;
|
|
48
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Date and time the file was updated.
|
|
82
|
+
* @readonly
|
|
83
|
+
*/
|
|
49
84
|
_updatedDate?: Date;
|
|
50
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* The Wix site ID where the media file is stored.
|
|
87
|
+
* @readonly
|
|
88
|
+
*/
|
|
51
89
|
siteId?: string;
|
|
52
90
|
/**
|
|
53
91
|
* State of the file.
|
|
54
92
|
*
|
|
55
93
|
* Supported values: `"OK"`, `"DELETED"`
|
|
94
|
+
* @readonly
|
|
56
95
|
*/
|
|
57
96
|
state?: State;
|
|
58
97
|
}
|
|
@@ -275,6 +314,16 @@ export interface UpdateFileResponse {
|
|
|
275
314
|
/** Information about the updated file. */
|
|
276
315
|
file?: FileDescriptor;
|
|
277
316
|
}
|
|
317
|
+
export interface UpdateFileDescriptorRequest {
|
|
318
|
+
/** A partial file object, see updatable properties in the FileDescriptor object */
|
|
319
|
+
file: FileDescriptor;
|
|
320
|
+
/** field mask */
|
|
321
|
+
fieldMask?: string[];
|
|
322
|
+
}
|
|
323
|
+
export interface UpdateFileDescriptorResponse {
|
|
324
|
+
/** Information about the updated file. */
|
|
325
|
+
file?: FileDescriptor;
|
|
326
|
+
}
|
|
278
327
|
export interface GenerateFileUploadUrlRequest {
|
|
279
328
|
/** File mime type. */
|
|
280
329
|
mimeType: string | null;
|
|
@@ -374,7 +423,7 @@ export interface ImportFileResponse {
|
|
|
374
423
|
}
|
|
375
424
|
export interface BulkImportFilesRequest {
|
|
376
425
|
/** Information about the files to import. */
|
|
377
|
-
importFileRequests
|
|
426
|
+
importFileRequests: ImportFileRequest[];
|
|
378
427
|
}
|
|
379
428
|
export interface BulkImportFilesResponse {
|
|
380
429
|
/** Information about the imported files. */
|
|
@@ -503,7 +552,7 @@ export interface GenerateWebSocketTokenResponse {
|
|
|
503
552
|
}
|
|
504
553
|
export interface BulkDeleteFilesRequest {
|
|
505
554
|
/** IDs of the files to move to the Media Manager's trash bin. */
|
|
506
|
-
fileIds
|
|
555
|
+
fileIds: string[];
|
|
507
556
|
/**
|
|
508
557
|
* Whether the specified files are permanently deleted. <br />
|
|
509
558
|
* Default: `false`
|
|
@@ -606,7 +655,8 @@ export interface GenerateFileDownloadUrlOptions {
|
|
|
606
655
|
*/
|
|
607
656
|
export declare function getFileDescriptor(fileId: string): Promise<GetFileDescriptorResponse>;
|
|
608
657
|
/**
|
|
609
|
-
* Gets information about
|
|
658
|
+
* Gets information about the specified files in the Media Manager.
|
|
659
|
+
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
610
660
|
* @param fileIds - File IDs.
|
|
611
661
|
* @public
|
|
612
662
|
* @documentationMaturity preview
|
|
@@ -637,6 +687,112 @@ export interface UpdateFileOptions {
|
|
|
637
687
|
/** Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images. */
|
|
638
688
|
labels?: string[] | null;
|
|
639
689
|
}
|
|
690
|
+
/**
|
|
691
|
+
* Updates a file. <br />
|
|
692
|
+
* Supported fields: displayName, parentFolderId, labels. Any unsupported field will be ignored
|
|
693
|
+
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
694
|
+
* @param _id - File ID. Generated when a file is uploaded to the Media Manager.
|
|
695
|
+
* @public
|
|
696
|
+
* @documentationMaturity preview
|
|
697
|
+
* @requiredField _id
|
|
698
|
+
* @requiredField file
|
|
699
|
+
*/
|
|
700
|
+
export declare function updateFileDescriptor(_id: string, file: UpdateFileDescriptorFile, options?: UpdateFileDescriptorOptions): Promise<UpdateFileDescriptorResponse>;
|
|
701
|
+
export interface UpdateFileDescriptorFile {
|
|
702
|
+
/**
|
|
703
|
+
* File ID. Generated when a file is uploaded to the Media Manager.
|
|
704
|
+
* @readonly
|
|
705
|
+
*/
|
|
706
|
+
_id?: string;
|
|
707
|
+
/**
|
|
708
|
+
* File name as it appears in the Media Manager.
|
|
709
|
+
* @readonly
|
|
710
|
+
*/
|
|
711
|
+
displayName?: string;
|
|
712
|
+
/**
|
|
713
|
+
* Static URL of the file.
|
|
714
|
+
* @readonly
|
|
715
|
+
*/
|
|
716
|
+
url?: string;
|
|
717
|
+
/**
|
|
718
|
+
* ID of the file's parent folder.
|
|
719
|
+
* @readonly
|
|
720
|
+
*/
|
|
721
|
+
parentFolderId?: string | null;
|
|
722
|
+
/**
|
|
723
|
+
* File hash.
|
|
724
|
+
* @readonly
|
|
725
|
+
*/
|
|
726
|
+
hash?: string;
|
|
727
|
+
/**
|
|
728
|
+
* Whether the link to the uploaded file is public or private. Private links require a token.
|
|
729
|
+
* @readonly
|
|
730
|
+
*/
|
|
731
|
+
private?: boolean;
|
|
732
|
+
/**
|
|
733
|
+
* Media file type.
|
|
734
|
+
*
|
|
735
|
+
* Supported values: `"IMAGE"`, `"VIDEO"`, `"AUDIO"`, `"DOCUMENT"`, `"VECTOR"`
|
|
736
|
+
* @readonly
|
|
737
|
+
*/
|
|
738
|
+
mediaType?: MediaType;
|
|
739
|
+
/**
|
|
740
|
+
* Media file content.
|
|
741
|
+
* @readonly
|
|
742
|
+
*/
|
|
743
|
+
media?: FileMedia;
|
|
744
|
+
/**
|
|
745
|
+
* Status of the file that was uploaded.
|
|
746
|
+
*
|
|
747
|
+
* Supported values: `"FAILED"`, `"READY"`, `"PENDING"`
|
|
748
|
+
* * `FAILED`: The file failed to upload, for example, during media post processing.
|
|
749
|
+
* * `READY`: The file uploaded, finished all processing, and is ready for use.
|
|
750
|
+
* * `PENDING`: The file is processing and the URLs are not yet available. This response is returned when importing a file.
|
|
751
|
+
* @readonly
|
|
752
|
+
*/
|
|
753
|
+
operationStatus?: OperationStatus;
|
|
754
|
+
/**
|
|
755
|
+
* URL where the file was uploaded from.
|
|
756
|
+
* @readonly
|
|
757
|
+
*/
|
|
758
|
+
sourceUrl?: string | null;
|
|
759
|
+
/**
|
|
760
|
+
* URL of the file's thumbnail.
|
|
761
|
+
* @readonly
|
|
762
|
+
*/
|
|
763
|
+
thumbnailUrl?: string | null;
|
|
764
|
+
/**
|
|
765
|
+
* Labels assigned to media files that describe and categorize them. Provided by the user, or generated by [Google Vision API](https://cloud.google.com/vision/docs/drag-and-drop) for images.
|
|
766
|
+
* @readonly
|
|
767
|
+
*/
|
|
768
|
+
labels?: string[];
|
|
769
|
+
/**
|
|
770
|
+
* Date and time the file was created.
|
|
771
|
+
* @readonly
|
|
772
|
+
*/
|
|
773
|
+
_createdDate?: Date;
|
|
774
|
+
/**
|
|
775
|
+
* Date and time the file was updated.
|
|
776
|
+
* @readonly
|
|
777
|
+
*/
|
|
778
|
+
_updatedDate?: Date;
|
|
779
|
+
/**
|
|
780
|
+
* The Wix site ID where the media file is stored.
|
|
781
|
+
* @readonly
|
|
782
|
+
*/
|
|
783
|
+
siteId?: string;
|
|
784
|
+
/**
|
|
785
|
+
* State of the file.
|
|
786
|
+
*
|
|
787
|
+
* Supported values: `"OK"`, `"DELETED"`
|
|
788
|
+
* @readonly
|
|
789
|
+
*/
|
|
790
|
+
state?: State;
|
|
791
|
+
}
|
|
792
|
+
export interface UpdateFileDescriptorOptions {
|
|
793
|
+
/** field mask */
|
|
794
|
+
fieldMask?: string[];
|
|
795
|
+
}
|
|
640
796
|
/**
|
|
641
797
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
642
798
|
*
|
|
@@ -774,16 +930,14 @@ export interface ImportFileOptions {
|
|
|
774
930
|
* >**Notes:**
|
|
775
931
|
* > - This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
776
932
|
* > - The `media` property isn't returned in the `files` response object.
|
|
933
|
+
* @param importFileRequests - Information about the files to import.
|
|
777
934
|
* @public
|
|
778
935
|
* @documentationMaturity preview
|
|
779
|
-
* @requiredField
|
|
936
|
+
* @requiredField importFileRequests
|
|
937
|
+
* @requiredField importFileRequests.url
|
|
780
938
|
* @param options - Options to use when uploading multiple files.
|
|
781
939
|
*/
|
|
782
|
-
export declare function bulkImportFiles(
|
|
783
|
-
export interface BulkImportFilesOptions {
|
|
784
|
-
/** Information about the files to import. */
|
|
785
|
-
importFileRequests?: ImportFileRequest[];
|
|
786
|
-
}
|
|
940
|
+
export declare function bulkImportFiles(importFileRequests: ImportFileRequest[]): Promise<BulkImportFilesResponse>;
|
|
787
941
|
/**
|
|
788
942
|
* Retrieves a list of files in the Media Manager.
|
|
789
943
|
*
|
|
@@ -898,14 +1052,14 @@ export interface GenerateVideoStreamingUrlOptions {
|
|
|
898
1052
|
*
|
|
899
1053
|
*
|
|
900
1054
|
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
1055
|
+
* @param fileIds - IDs of the files to move to the Media Manager's trash bin.
|
|
901
1056
|
* @public
|
|
902
1057
|
* @documentationMaturity preview
|
|
1058
|
+
* @requiredField fileIds
|
|
903
1059
|
* @param options - Options to use when deleting files.
|
|
904
1060
|
*/
|
|
905
|
-
export declare function bulkDeleteFiles(options?: BulkDeleteFilesOptions): Promise<void>;
|
|
1061
|
+
export declare function bulkDeleteFiles(fileIds: string[], options?: BulkDeleteFilesOptions): Promise<void>;
|
|
906
1062
|
export interface BulkDeleteFilesOptions {
|
|
907
|
-
/** IDs of the files to move to the Media Manager's trash bin. */
|
|
908
|
-
fileIds?: string[];
|
|
909
1063
|
/**
|
|
910
1064
|
* Whether the specified files are permanently deleted. <br />
|
|
911
1065
|
* Default: `false`
|
|
@@ -113,6 +113,8 @@ const _listFilesRequest = {};
|
|
|
113
113
|
const _listFilesResponse = { files: '_fileDescriptor' };
|
|
114
114
|
const _searchFilesRequest = {};
|
|
115
115
|
const _searchFilesResponse = { files: '_fileDescriptor' };
|
|
116
|
+
const _updateFileDescriptorRequest = { file: '_fileDescriptor' };
|
|
117
|
+
const _updateFileDescriptorResponse = { file: '_fileDescriptor' };
|
|
116
118
|
const _updateFileRequest = {};
|
|
117
119
|
const _updateFileResponse = { file: '_fileDescriptor' };
|
|
118
120
|
/**
|
|
@@ -286,7 +288,8 @@ export function getFileDescriptor(fileId) {
|
|
|
286
288
|
});
|
|
287
289
|
}
|
|
288
290
|
/**
|
|
289
|
-
* Gets information about
|
|
291
|
+
* Gets information about the specified files in the Media Manager.
|
|
292
|
+
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
290
293
|
* @param fileIds - File IDs.
|
|
291
294
|
* @public
|
|
292
295
|
* @documentationMaturity preview
|
|
@@ -396,6 +399,64 @@ export function updateFile(fileId, options) {
|
|
|
396
399
|
}
|
|
397
400
|
});
|
|
398
401
|
}
|
|
402
|
+
/**
|
|
403
|
+
* Updates a file. <br />
|
|
404
|
+
* Supported fields: displayName, parentFolderId, labels. Any unsupported field will be ignored
|
|
405
|
+
* You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
|
|
406
|
+
* @param _id - File ID. Generated when a file is uploaded to the Media Manager.
|
|
407
|
+
* @public
|
|
408
|
+
* @documentationMaturity preview
|
|
409
|
+
* @requiredField _id
|
|
410
|
+
* @requiredField file
|
|
411
|
+
*/
|
|
412
|
+
export function updateFileDescriptor(_id, file, options) {
|
|
413
|
+
var _a, _b, _c;
|
|
414
|
+
return __awaiter(this, arguments, void 0, function* () {
|
|
415
|
+
const requestTransformation = {
|
|
416
|
+
file: { '*': '$[1]', id: '$[0]' },
|
|
417
|
+
fieldMask: '$[2].fieldMask',
|
|
418
|
+
};
|
|
419
|
+
const responseTransformation = '$';
|
|
420
|
+
// @ts-ignore
|
|
421
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
422
|
+
const { toAmbassadorRequest } = serializer({
|
|
423
|
+
rootSchema: _updateFileDescriptorRequest,
|
|
424
|
+
depSchemas: { _audioV2, _fileDescriptor, _fileMedia, _imageMedia },
|
|
425
|
+
fqdnTransformation: {
|
|
426
|
+
paths: [...['file']],
|
|
427
|
+
transformation: _fromVeloEntity,
|
|
428
|
+
},
|
|
429
|
+
customTransformation: requestTransformation,
|
|
430
|
+
});
|
|
431
|
+
const { fromJSON } = serializer({
|
|
432
|
+
rootSchema: _updateFileDescriptorResponse,
|
|
433
|
+
depSchemas: { _audioV2, _fileDescriptor, _fileMedia, _imageMedia },
|
|
434
|
+
fqdnTransformation: {
|
|
435
|
+
paths: [...['file']],
|
|
436
|
+
transformation: _toVeloEntity,
|
|
437
|
+
},
|
|
438
|
+
customTransformation: responseTransformation,
|
|
439
|
+
});
|
|
440
|
+
const payload = toAmbassadorRequest([_id, file, options]);
|
|
441
|
+
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.updateFileDescriptor(payload);
|
|
442
|
+
__log(`"UpdateFileDescriptor" sending request with: ${__inspect(reqOpts)}`);
|
|
443
|
+
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
444
|
+
try {
|
|
445
|
+
const result = yield httpClient.request(reqOpts);
|
|
446
|
+
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
447
|
+
return fromJSON(result.data);
|
|
448
|
+
}
|
|
449
|
+
catch (err) {
|
|
450
|
+
const transformedError = transformError(err, requestTransformation, [
|
|
451
|
+
'_id',
|
|
452
|
+
'file',
|
|
453
|
+
'options',
|
|
454
|
+
]);
|
|
455
|
+
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
456
|
+
throw transformedError;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
}
|
|
399
460
|
/**
|
|
400
461
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
401
462
|
*
|
|
@@ -618,17 +679,17 @@ export function importFile(url, options) {
|
|
|
618
679
|
* >**Notes:**
|
|
619
680
|
* > - This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
620
681
|
* > - The `media` property isn't returned in the `files` response object.
|
|
682
|
+
* @param importFileRequests - Information about the files to import.
|
|
621
683
|
* @public
|
|
622
684
|
* @documentationMaturity preview
|
|
623
|
-
* @requiredField
|
|
685
|
+
* @requiredField importFileRequests
|
|
686
|
+
* @requiredField importFileRequests.url
|
|
624
687
|
* @param options - Options to use when uploading multiple files.
|
|
625
688
|
*/
|
|
626
|
-
export function bulkImportFiles(
|
|
689
|
+
export function bulkImportFiles(importFileRequests) {
|
|
627
690
|
var _a, _b, _c;
|
|
628
691
|
return __awaiter(this, arguments, void 0, function* () {
|
|
629
|
-
const requestTransformation = {
|
|
630
|
-
importFileRequests: '$[0].importFileRequests',
|
|
631
|
-
};
|
|
692
|
+
const requestTransformation = { importFileRequests: '$[0]' };
|
|
632
693
|
const responseTransformation = '$';
|
|
633
694
|
// @ts-ignore
|
|
634
695
|
const { httpClient, sideEffects } = arguments[1];
|
|
@@ -650,7 +711,7 @@ export function bulkImportFiles(options) {
|
|
|
650
711
|
},
|
|
651
712
|
customTransformation: responseTransformation,
|
|
652
713
|
});
|
|
653
|
-
const payload = toAmbassadorRequest([
|
|
714
|
+
const payload = toAmbassadorRequest([importFileRequests]);
|
|
654
715
|
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFiles(payload);
|
|
655
716
|
__log(`"BulkImportFiles" sending request with: ${__inspect(reqOpts)}`);
|
|
656
717
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
@@ -661,7 +722,7 @@ export function bulkImportFiles(options) {
|
|
|
661
722
|
}
|
|
662
723
|
catch (err) {
|
|
663
724
|
const transformedError = transformError(err, requestTransformation, [
|
|
664
|
-
'
|
|
725
|
+
'importFileRequests',
|
|
665
726
|
]);
|
|
666
727
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
667
728
|
throw transformedError;
|
|
@@ -858,20 +919,22 @@ export function generateVideoStreamingUrl(fileId, options) {
|
|
|
858
919
|
*
|
|
859
920
|
*
|
|
860
921
|
* >**Note:** This function is restricted and only runs if you elevate permissions using the [`wix-auth.elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.
|
|
922
|
+
* @param fileIds - IDs of the files to move to the Media Manager's trash bin.
|
|
861
923
|
* @public
|
|
862
924
|
* @documentationMaturity preview
|
|
925
|
+
* @requiredField fileIds
|
|
863
926
|
* @param options - Options to use when deleting files.
|
|
864
927
|
*/
|
|
865
|
-
export function bulkDeleteFiles(options) {
|
|
928
|
+
export function bulkDeleteFiles(fileIds, options) {
|
|
866
929
|
var _a, _b, _c;
|
|
867
930
|
return __awaiter(this, arguments, void 0, function* () {
|
|
868
931
|
const requestTransformation = {
|
|
869
|
-
fileIds: '$[0]
|
|
870
|
-
permanent: '$[
|
|
932
|
+
fileIds: '$[0]',
|
|
933
|
+
permanent: '$[1].permanent',
|
|
871
934
|
};
|
|
872
935
|
const responseTransformation = '$';
|
|
873
936
|
// @ts-ignore
|
|
874
|
-
const { httpClient, sideEffects } = arguments[
|
|
937
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
875
938
|
const { toAmbassadorRequest } = serializer({
|
|
876
939
|
rootSchema: _bulkDeleteFilesRequest,
|
|
877
940
|
depSchemas: {},
|
|
@@ -890,7 +953,7 @@ export function bulkDeleteFiles(options) {
|
|
|
890
953
|
},
|
|
891
954
|
customTransformation: responseTransformation,
|
|
892
955
|
});
|
|
893
|
-
const payload = toAmbassadorRequest([options]);
|
|
956
|
+
const payload = toAmbassadorRequest([fileIds, options]);
|
|
894
957
|
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkDeleteFiles(payload);
|
|
895
958
|
__log(`"BulkDeleteFiles" sending request with: ${__inspect(reqOpts)}`);
|
|
896
959
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
@@ -901,6 +964,7 @@ export function bulkDeleteFiles(options) {
|
|
|
901
964
|
}
|
|
902
965
|
catch (err) {
|
|
903
966
|
const transformedError = transformError(err, requestTransformation, [
|
|
967
|
+
'fileIds',
|
|
904
968
|
'options',
|
|
905
969
|
]);
|
|
906
970
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|