@wix/media 1.0.9 → 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 +7 -1
- package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +58 -5
- 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 +9 -3
- 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 +176 -23
- package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +77 -13
- 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 +9 -6
- 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 +1 -1
- 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 +10 -7
- 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 +7 -1
- package/build/es/src/media-site-media-v1-file-descriptor.http.js +56 -4
- 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 +176 -23
- package/build/es/src/media-site-media-v1-file-descriptor.universal.js +75 -12
- 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`
|
|
@@ -638,6 +687,112 @@ export interface UpdateFileOptions {
|
|
|
638
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. */
|
|
639
688
|
labels?: string[] | null;
|
|
640
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
|
+
}
|
|
641
796
|
/**
|
|
642
797
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
643
798
|
*
|
|
@@ -775,16 +930,14 @@ export interface ImportFileOptions {
|
|
|
775
930
|
* >**Notes:**
|
|
776
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.
|
|
777
932
|
* > - The `media` property isn't returned in the `files` response object.
|
|
933
|
+
* @param importFileRequests - Information about the files to import.
|
|
778
934
|
* @public
|
|
779
935
|
* @documentationMaturity preview
|
|
780
|
-
* @requiredField
|
|
936
|
+
* @requiredField importFileRequests
|
|
937
|
+
* @requiredField importFileRequests.url
|
|
781
938
|
* @param options - Options to use when uploading multiple files.
|
|
782
939
|
*/
|
|
783
|
-
export declare function bulkImportFiles(
|
|
784
|
-
export interface BulkImportFilesOptions {
|
|
785
|
-
/** Information about the files to import. */
|
|
786
|
-
importFileRequests?: ImportFileRequest[];
|
|
787
|
-
}
|
|
940
|
+
export declare function bulkImportFiles(importFileRequests: ImportFileRequest[]): Promise<BulkImportFilesResponse>;
|
|
788
941
|
/**
|
|
789
942
|
* Retrieves a list of files in the Media Manager.
|
|
790
943
|
*
|
|
@@ -899,14 +1052,14 @@ export interface GenerateVideoStreamingUrlOptions {
|
|
|
899
1052
|
*
|
|
900
1053
|
*
|
|
901
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.
|
|
902
1056
|
* @public
|
|
903
1057
|
* @documentationMaturity preview
|
|
1058
|
+
* @requiredField fileIds
|
|
904
1059
|
* @param options - Options to use when deleting files.
|
|
905
1060
|
*/
|
|
906
|
-
export declare function bulkDeleteFiles(options?: BulkDeleteFilesOptions): Promise<void>;
|
|
1061
|
+
export declare function bulkDeleteFiles(fileIds: string[], options?: BulkDeleteFilesOptions): Promise<void>;
|
|
907
1062
|
export interface BulkDeleteFilesOptions {
|
|
908
|
-
/** IDs of the files to move to the Media Manager's trash bin. */
|
|
909
|
-
fileIds?: string[];
|
|
910
1063
|
/**
|
|
911
1064
|
* Whether the specified files are permanently deleted. <br />
|
|
912
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
|
/**
|
|
@@ -397,6 +399,64 @@ export function updateFile(fileId, options) {
|
|
|
397
399
|
}
|
|
398
400
|
});
|
|
399
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
|
+
}
|
|
400
460
|
/**
|
|
401
461
|
* Generates an upload URL to allow external clients to upload a file to the Media Manager.
|
|
402
462
|
*
|
|
@@ -619,17 +679,17 @@ export function importFile(url, options) {
|
|
|
619
679
|
* >**Notes:**
|
|
620
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.
|
|
621
681
|
* > - The `media` property isn't returned in the `files` response object.
|
|
682
|
+
* @param importFileRequests - Information about the files to import.
|
|
622
683
|
* @public
|
|
623
684
|
* @documentationMaturity preview
|
|
624
|
-
* @requiredField
|
|
685
|
+
* @requiredField importFileRequests
|
|
686
|
+
* @requiredField importFileRequests.url
|
|
625
687
|
* @param options - Options to use when uploading multiple files.
|
|
626
688
|
*/
|
|
627
|
-
export function bulkImportFiles(
|
|
689
|
+
export function bulkImportFiles(importFileRequests) {
|
|
628
690
|
var _a, _b, _c;
|
|
629
691
|
return __awaiter(this, arguments, void 0, function* () {
|
|
630
|
-
const requestTransformation = {
|
|
631
|
-
importFileRequests: '$[0].importFileRequests',
|
|
632
|
-
};
|
|
692
|
+
const requestTransformation = { importFileRequests: '$[0]' };
|
|
633
693
|
const responseTransformation = '$';
|
|
634
694
|
// @ts-ignore
|
|
635
695
|
const { httpClient, sideEffects } = arguments[1];
|
|
@@ -651,7 +711,7 @@ export function bulkImportFiles(options) {
|
|
|
651
711
|
},
|
|
652
712
|
customTransformation: responseTransformation,
|
|
653
713
|
});
|
|
654
|
-
const payload = toAmbassadorRequest([
|
|
714
|
+
const payload = toAmbassadorRequest([importFileRequests]);
|
|
655
715
|
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkImportFiles(payload);
|
|
656
716
|
__log(`"BulkImportFiles" sending request with: ${__inspect(reqOpts)}`);
|
|
657
717
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
@@ -662,7 +722,7 @@ export function bulkImportFiles(options) {
|
|
|
662
722
|
}
|
|
663
723
|
catch (err) {
|
|
664
724
|
const transformedError = transformError(err, requestTransformation, [
|
|
665
|
-
'
|
|
725
|
+
'importFileRequests',
|
|
666
726
|
]);
|
|
667
727
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
668
728
|
throw transformedError;
|
|
@@ -859,20 +919,22 @@ export function generateVideoStreamingUrl(fileId, options) {
|
|
|
859
919
|
*
|
|
860
920
|
*
|
|
861
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.
|
|
862
923
|
* @public
|
|
863
924
|
* @documentationMaturity preview
|
|
925
|
+
* @requiredField fileIds
|
|
864
926
|
* @param options - Options to use when deleting files.
|
|
865
927
|
*/
|
|
866
|
-
export function bulkDeleteFiles(options) {
|
|
928
|
+
export function bulkDeleteFiles(fileIds, options) {
|
|
867
929
|
var _a, _b, _c;
|
|
868
930
|
return __awaiter(this, arguments, void 0, function* () {
|
|
869
931
|
const requestTransformation = {
|
|
870
|
-
fileIds: '$[0]
|
|
871
|
-
permanent: '$[
|
|
932
|
+
fileIds: '$[0]',
|
|
933
|
+
permanent: '$[1].permanent',
|
|
872
934
|
};
|
|
873
935
|
const responseTransformation = '$';
|
|
874
936
|
// @ts-ignore
|
|
875
|
-
const { httpClient, sideEffects } = arguments[
|
|
937
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
876
938
|
const { toAmbassadorRequest } = serializer({
|
|
877
939
|
rootSchema: _bulkDeleteFilesRequest,
|
|
878
940
|
depSchemas: {},
|
|
@@ -891,7 +953,7 @@ export function bulkDeleteFiles(options) {
|
|
|
891
953
|
},
|
|
892
954
|
customTransformation: responseTransformation,
|
|
893
955
|
});
|
|
894
|
-
const payload = toAmbassadorRequest([options]);
|
|
956
|
+
const payload = toAmbassadorRequest([fileIds, options]);
|
|
895
957
|
const reqOpts = ambassadorWixMediaSiteMediaV1FileDescriptor.bulkDeleteFiles(payload);
|
|
896
958
|
__log(`"BulkDeleteFiles" sending request with: ${__inspect(reqOpts)}`);
|
|
897
959
|
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
@@ -902,6 +964,7 @@ export function bulkDeleteFiles(options) {
|
|
|
902
964
|
}
|
|
903
965
|
catch (err) {
|
|
904
966
|
const transformedError = transformError(err, requestTransformation, [
|
|
967
|
+
'fileIds',
|
|
905
968
|
'options',
|
|
906
969
|
]);
|
|
907
970
|
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|