@wix/media 1.0.63 → 1.0.64

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.
Files changed (169) hide show
  1. package/build/cjs/context.d.ts +4 -4
  2. package/build/cjs/context.js +4 -4
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +4 -4
  5. package/build/cjs/index.js +4 -4
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +4 -4
  8. package/build/cjs/meta.js +4 -4
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +4 -4
  11. package/build/es/context.js +4 -4
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +4 -4
  14. package/build/es/index.js +4 -4
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +4 -4
  17. package/build/es/meta.js +4 -4
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +14 -9
  20. package/build/cjs/index.typings.d.ts +0 -4
  21. package/build/cjs/index.typings.js +0 -31
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
  24. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -107
  25. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
  26. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
  27. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -245
  28. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
  29. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
  30. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -142
  31. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
  32. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
  33. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -49
  34. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
  35. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
  36. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -22
  37. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
  38. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
  39. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -421
  40. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
  41. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
  42. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -192
  43. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
  44. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
  45. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -446
  46. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
  47. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
  48. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -237
  49. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
  50. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
  51. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -81
  52. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
  53. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
  54. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -27
  55. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
  56. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
  57. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -763
  58. package/build/cjs/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
  59. package/build/cjs/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
  60. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js +0 -277
  61. package/build/cjs/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
  62. package/build/cjs/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
  63. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js +0 -839
  64. package/build/cjs/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
  65. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
  66. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js +0 -332
  67. package/build/cjs/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
  68. package/build/cjs/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
  69. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js +0 -118
  70. package/build/cjs/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
  71. package/build/cjs/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
  72. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js +0 -99
  73. package/build/cjs/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
  74. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
  75. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js +0 -1442
  76. package/build/cjs/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
  77. package/build/cjs/src/media-site-media-v1-folder.context.d.ts +0 -11
  78. package/build/cjs/src/media-site-media-v1-folder.context.js +0 -158
  79. package/build/cjs/src/media-site-media-v1-folder.context.js.map +0 -1
  80. package/build/cjs/src/media-site-media-v1-folder.http.d.ts +0 -81
  81. package/build/cjs/src/media-site-media-v1-folder.http.js +0 -364
  82. package/build/cjs/src/media-site-media-v1-folder.http.js.map +0 -1
  83. package/build/cjs/src/media-site-media-v1-folder.meta.d.ts +0 -27
  84. package/build/cjs/src/media-site-media-v1-folder.meta.js +0 -199
  85. package/build/cjs/src/media-site-media-v1-folder.meta.js.map +0 -1
  86. package/build/cjs/src/media-site-media-v1-folder.public.d.ts +0 -27
  87. package/build/cjs/src/media-site-media-v1-folder.public.js +0 -69
  88. package/build/cjs/src/media-site-media-v1-folder.public.js.map +0 -1
  89. package/build/cjs/src/media-site-media-v1-folder.types.d.ts +0 -335
  90. package/build/cjs/src/media-site-media-v1-folder.types.js +0 -50
  91. package/build/cjs/src/media-site-media-v1-folder.types.js.map +0 -1
  92. package/build/cjs/src/media-site-media-v1-folder.universal.d.ts +0 -603
  93. package/build/cjs/src/media-site-media-v1-folder.universal.js +0 -718
  94. package/build/cjs/src/media-site-media-v1-folder.universal.js.map +0 -1
  95. package/build/es/index.typings.d.ts +0 -4
  96. package/build/es/index.typings.js +0 -5
  97. package/build/es/index.typings.js.map +0 -1
  98. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.d.ts +0 -8
  99. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js +0 -98
  100. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.context.js.map +0 -1
  101. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.d.ts +0 -16
  102. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js +0 -236
  103. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.http.js.map +0 -1
  104. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.d.ts +0 -24
  105. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js +0 -110
  106. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.meta.js.map +0 -1
  107. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.d.ts +0 -26
  108. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js +0 -35
  109. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.public.js.map +0 -1
  110. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.d.ts +0 -221
  111. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js +0 -19
  112. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.types.js.map +0 -1
  113. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.d.ts +0 -315
  114. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js +0 -389
  115. package/build/es/src/media-enterprise-public-media-v1-enterprise-category.universal.js.map +0 -1
  116. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.d.ts +0 -13
  117. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js +0 -178
  118. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.context.js.map +0 -1
  119. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.d.ts +0 -29
  120. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js +0 -432
  121. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.http.js.map +0 -1
  122. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.d.ts +0 -33
  123. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js +0 -200
  124. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.meta.js.map +0 -1
  125. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.d.ts +0 -59
  126. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js +0 -60
  127. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.public.js.map +0 -1
  128. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.d.ts +0 -949
  129. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js +0 -24
  130. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.types.js.map +0 -1
  131. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.d.ts +0 -907
  132. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js +0 -726
  133. package/build/es/src/media-enterprise-public-media-v1-enterprise-item.universal.js.map +0 -1
  134. package/build/es/src/media-site-media-v1-file-descriptor.context.d.ts +0 -18
  135. package/build/es/src/media-site-media-v1-file-descriptor.context.js +0 -258
  136. package/build/es/src/media-site-media-v1-file-descriptor.context.js.map +0 -1
  137. package/build/es/src/media-site-media-v1-file-descriptor.http.d.ts +0 -185
  138. package/build/es/src/media-site-media-v1-file-descriptor.http.js +0 -820
  139. package/build/es/src/media-site-media-v1-file-descriptor.http.js.map +0 -1
  140. package/build/es/src/media-site-media-v1-file-descriptor.meta.d.ts +0 -36
  141. package/build/es/src/media-site-media-v1-file-descriptor.meta.js +0 -290
  142. package/build/es/src/media-site-media-v1-file-descriptor.meta.js.map +0 -1
  143. package/build/es/src/media-site-media-v1-file-descriptor.public.d.ts +0 -136
  144. package/build/es/src/media-site-media-v1-file-descriptor.public.js +0 -85
  145. package/build/es/src/media-site-media-v1-file-descriptor.public.js.map +0 -1
  146. package/build/es/src/media-site-media-v1-file-descriptor.types.d.ts +0 -2017
  147. package/build/es/src/media-site-media-v1-file-descriptor.types.js +0 -96
  148. package/build/es/src/media-site-media-v1-file-descriptor.types.js.map +0 -1
  149. package/build/es/src/media-site-media-v1-file-descriptor.universal.d.ts +0 -2105
  150. package/build/es/src/media-site-media-v1-file-descriptor.universal.js +0 -1400
  151. package/build/es/src/media-site-media-v1-file-descriptor.universal.js.map +0 -1
  152. package/build/es/src/media-site-media-v1-folder.context.d.ts +0 -11
  153. package/build/es/src/media-site-media-v1-folder.context.js +0 -146
  154. package/build/es/src/media-site-media-v1-folder.context.js.map +0 -1
  155. package/build/es/src/media-site-media-v1-folder.http.d.ts +0 -81
  156. package/build/es/src/media-site-media-v1-folder.http.js +0 -352
  157. package/build/es/src/media-site-media-v1-folder.http.js.map +0 -1
  158. package/build/es/src/media-site-media-v1-folder.meta.d.ts +0 -27
  159. package/build/es/src/media-site-media-v1-folder.meta.js +0 -164
  160. package/build/es/src/media-site-media-v1-folder.meta.js.map +0 -1
  161. package/build/es/src/media-site-media-v1-folder.public.d.ts +0 -27
  162. package/build/es/src/media-site-media-v1-folder.public.js +0 -50
  163. package/build/es/src/media-site-media-v1-folder.public.js.map +0 -1
  164. package/build/es/src/media-site-media-v1-folder.types.d.ts +0 -335
  165. package/build/es/src/media-site-media-v1-folder.types.js +0 -47
  166. package/build/es/src/media-site-media-v1-folder.types.js.map +0 -1
  167. package/build/es/src/media-site-media-v1-folder.universal.d.ts +0 -603
  168. package/build/es/src/media-site-media-v1-folder.universal.js +0 -683
  169. package/build/es/src/media-site-media-v1-folder.universal.js.map +0 -1
@@ -1,820 +0,0 @@
1
- import { toURLSearchParams } from '@wix/metro-runtime';
2
- import { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';
3
- import { transformRESTFloatToSDKFloat } from '@wix/sdk-runtime/transformations/float';
4
- import { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
5
- import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';
6
- import { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';
7
- import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
8
- import { resolveUrl } from '@wix/metro-runtime';
9
- function resolveComWixMediaSiteMediaV1FilesServiceUrl(opts) {
10
- const domainToMappings = {
11
- 'apps._base_domain_': [
12
- {
13
- srcPath: '/_api/wix-privatemedia-proxy-server',
14
- destPath: '/api',
15
- },
16
- {
17
- srcPath: '/_api/wix-privatemedia-proxy-server/v1',
18
- destPath: '/v1',
19
- },
20
- ],
21
- 'manage._base_domain_': [
22
- {
23
- srcPath: '/_api/wix-privatemedia-proxy-server',
24
- destPath: '',
25
- },
26
- ],
27
- 'www.wixapis.com': [
28
- {
29
- srcPath: '/site-media/v1',
30
- destPath: '/v1',
31
- },
32
- ],
33
- '*.dev.wix-code.com': [
34
- {
35
- srcPath: '/_api/wix-privatemedia-proxy-server',
36
- destPath: '',
37
- },
38
- ],
39
- 'api._api_base_domain_': [
40
- {
41
- srcPath: '/wix-privatemedia-proxy-server',
42
- destPath: '',
43
- },
44
- ],
45
- 'bo._base_domain_': [
46
- {
47
- srcPath: '/wix-privatemedia-proxy-server',
48
- destPath: '',
49
- },
50
- ],
51
- 'wixbo.ai': [
52
- {
53
- srcPath: '/wix-privatemedia-proxy-server',
54
- destPath: '',
55
- },
56
- ],
57
- _: [
58
- {
59
- srcPath: '/wix-privatemedia-proxy-server',
60
- destPath: '',
61
- },
62
- ],
63
- };
64
- return resolveUrl(Object.assign(opts, { domainToMappings }));
65
- }
66
- /**
67
- * Generates a URL for downloading a compressed file containing specific files in the Media Manager.
68
- *
69
- * The `generateFilesDownloadUrl()` function returns a Promise that resolves to a download URL.
70
- *
71
- * The compressed file can contain up to 1000 files.
72
- *
73
- * To generate one or more temporary URLs for downloading a specific file in the Media Manager, use the `generateFileDownloadUrl()` function.
74
- * You can use the `expirationInMinutes` parameter to set the URL expiration time, making it more secure than the `generateFilesDownloadUrl()` function.
75
- * Therefore, to download private files, use the `generateFileDownloadUrl` function for each private file that you want to generate a download URL for.
76
- */
77
- export function generateFilesDownloadUrl(payload) {
78
- function __generateFilesDownloadUrl({ host }) {
79
- const metadata = {
80
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
81
- method: 'POST',
82
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFilesDownloadUrl',
83
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
84
- protoPath: '/v1/files/generate-download-url',
85
- data: payload,
86
- host,
87
- }),
88
- data: payload,
89
- };
90
- return metadata;
91
- }
92
- return __generateFilesDownloadUrl;
93
- }
94
- /**
95
- * Generates one or more temporary URLs for downloading a specific file in the Media Manager.
96
- *
97
- * The `generateFileDownloadUrl()` function returns a Promise that resolves to an array containing download URLs for the assets specified in the options parameter.
98
- *
99
- * To download different assets of the file, use the `assetKeys` parameter which generates a download URL for each asset.
100
- * If no asset key is specified, it defaults to `src`, which generates one download URL in the original file's format and quality.
101
- *
102
- * Use this function to grant external clients access to a private media file. Use the `expirationInMinutes` parameter to set the URL expiration time, and the `expirationRedirectUrl` parameter to add a redirect URL when the URL expires.
103
- *
104
- * To generate a permanent URL for downloading a compressed file that contains multiple files in the Media Manager, use the `generateFilesDownloadUrl()` function.
105
- * Since this is a permanent URL, it is less secure. Therefore, to download private files, use the `generateFileDownloadUrl()` function for each private file that you want to generate a download URL for.
106
- */
107
- export function generateFileDownloadUrl(payload) {
108
- function __generateFileDownloadUrl({ host }) {
109
- const metadata = {
110
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
111
- method: 'POST',
112
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileDownloadUrl',
113
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
114
- protoPath: '/v1/files/{fileId}/generate-download-url',
115
- data: payload,
116
- host,
117
- }),
118
- data: payload,
119
- };
120
- return metadata;
121
- }
122
- return __generateFileDownloadUrl;
123
- }
124
- /**
125
- * Gets information about the specified file in the Media Manager.
126
- *
127
- *
128
- * The `getFileDescriptor()` function returns a Promise that resolves to the specified file's descriptor.
129
- *
130
- * Use `getFileDescriptors()` to get multiple file descriptors at once.
131
- */
132
- export function getFileDescriptor(payload) {
133
- function __getFileDescriptor({ host }) {
134
- const metadata = {
135
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
136
- method: 'GET',
137
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptor',
138
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
139
- protoPath: '/v1/files/{fileId}',
140
- data: payload,
141
- host,
142
- }),
143
- params: toURLSearchParams(payload),
144
- transformResponse: (payload) => transformPaths(payload, [
145
- {
146
- transformFn: transformRESTTimestampToSDKTimestamp,
147
- paths: [
148
- { path: 'file.createdDate' },
149
- { path: 'file.updatedDate' },
150
- { path: 'file.media.image.image.urlExpirationDate' },
151
- { path: 'file.media.image.previewImage.urlExpirationDate' },
152
- { path: 'file.media.video.urlExpirationDate' },
153
- { path: 'file.media.video.resolutions.urlExpirationDate' },
154
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
155
- { path: 'file.media.video.posters.urlExpirationDate' },
156
- { path: 'file.media.audio.assets.urlExpirationDate' },
157
- { path: 'file.media.document.urlExpirationDate' },
158
- { path: 'file.media.vector.image.urlExpirationDate' },
159
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
160
- { path: 'file.media.archive.urlExpirationDate' },
161
- { path: 'file.media.model3d.urlExpirationDate' },
162
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
163
- ],
164
- },
165
- {
166
- transformFn: transformRESTFloatToSDKFloat,
167
- paths: [
168
- { path: 'file.media.image.faces.confidence' },
169
- { path: 'file.media.vector.faces.confidence' },
170
- ],
171
- },
172
- ]),
173
- };
174
- return metadata;
175
- }
176
- return __getFileDescriptor;
177
- }
178
- /**
179
- * Gets information about the specified files in the Media Manager.
180
- *
181
- *
182
- * The `getFileDescriptors()` function returns a Promise that resolves to an array containing the specified files' descriptors.
183
- *
184
- * Use `getFileDescriptor()` to get a single file descriptor.
185
- */
186
- export function getFileDescriptors(payload) {
187
- function __getFileDescriptors({ host }) {
188
- const metadata = {
189
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
190
- method: 'POST',
191
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GetFileDescriptors',
192
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
193
- protoPath: '/v1/files/get-files',
194
- data: payload,
195
- host,
196
- }),
197
- data: payload,
198
- transformResponse: (payload) => transformPaths(payload, [
199
- {
200
- transformFn: transformRESTTimestampToSDKTimestamp,
201
- paths: [
202
- { path: 'files.createdDate' },
203
- { path: 'files.updatedDate' },
204
- { path: 'files.media.image.image.urlExpirationDate' },
205
- { path: 'files.media.image.previewImage.urlExpirationDate' },
206
- { path: 'files.media.video.urlExpirationDate' },
207
- { path: 'files.media.video.resolutions.urlExpirationDate' },
208
- {
209
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
210
- },
211
- { path: 'files.media.video.posters.urlExpirationDate' },
212
- { path: 'files.media.audio.assets.urlExpirationDate' },
213
- { path: 'files.media.document.urlExpirationDate' },
214
- { path: 'files.media.vector.image.urlExpirationDate' },
215
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
216
- { path: 'files.media.archive.urlExpirationDate' },
217
- { path: 'files.media.model3d.urlExpirationDate' },
218
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
219
- ],
220
- },
221
- {
222
- transformFn: transformRESTFloatToSDKFloat,
223
- paths: [
224
- { path: 'files.media.image.faces.confidence' },
225
- { path: 'files.media.vector.faces.confidence' },
226
- ],
227
- },
228
- ]),
229
- };
230
- return metadata;
231
- }
232
- return __getFileDescriptors;
233
- }
234
- /**
235
- * Updates a file.
236
- *
237
- *
238
- * The `updateFileDescriptor()` function returns a Promise that resolves to the updated file's descriptor.
239
- *
240
- * You can use the `parentFolderId` parameter to move a file from its current folder to a different folder.
241
- */
242
- export function updateFileDescriptor(payload) {
243
- function __updateFileDescriptor({ host }) {
244
- const serializedData = transformPaths(payload, [
245
- {
246
- transformFn: transformSDKFieldMaskToRESTFieldMask,
247
- paths: [{ path: 'fieldMask' }],
248
- },
249
- {
250
- transformFn: transformSDKTimestampToRESTTimestamp,
251
- paths: [
252
- { path: 'file.createdDate' },
253
- { path: 'file.updatedDate' },
254
- { path: 'file.media.image.image.urlExpirationDate' },
255
- { path: 'file.media.image.previewImage.urlExpirationDate' },
256
- { path: 'file.media.video.urlExpirationDate' },
257
- { path: 'file.media.video.resolutions.urlExpirationDate' },
258
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
259
- { path: 'file.media.video.posters.urlExpirationDate' },
260
- { path: 'file.media.audio.assets.urlExpirationDate' },
261
- { path: 'file.media.document.urlExpirationDate' },
262
- { path: 'file.media.vector.image.urlExpirationDate' },
263
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
264
- { path: 'file.media.archive.urlExpirationDate' },
265
- { path: 'file.media.model3d.urlExpirationDate' },
266
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
267
- ],
268
- },
269
- {
270
- transformFn: transformSDKFloatToRESTFloat,
271
- paths: [
272
- { path: 'file.media.image.faces.confidence' },
273
- { path: 'file.media.vector.faces.confidence' },
274
- ],
275
- },
276
- ]);
277
- const metadata = {
278
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
279
- method: 'PATCH',
280
- methodFqn: 'com.wix.media.site_media.v1.FilesService.UpdateFileDescriptor',
281
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
282
- protoPath: '/v1/files/{file.id}/update',
283
- data: serializedData,
284
- host,
285
- }),
286
- data: serializedData,
287
- transformResponse: (payload) => transformPaths(payload, [
288
- {
289
- transformFn: transformRESTTimestampToSDKTimestamp,
290
- paths: [
291
- { path: 'file.createdDate' },
292
- { path: 'file.updatedDate' },
293
- { path: 'file.media.image.image.urlExpirationDate' },
294
- { path: 'file.media.image.previewImage.urlExpirationDate' },
295
- { path: 'file.media.video.urlExpirationDate' },
296
- { path: 'file.media.video.resolutions.urlExpirationDate' },
297
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
298
- { path: 'file.media.video.posters.urlExpirationDate' },
299
- { path: 'file.media.audio.assets.urlExpirationDate' },
300
- { path: 'file.media.document.urlExpirationDate' },
301
- { path: 'file.media.vector.image.urlExpirationDate' },
302
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
303
- { path: 'file.media.archive.urlExpirationDate' },
304
- { path: 'file.media.model3d.urlExpirationDate' },
305
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
306
- ],
307
- },
308
- {
309
- transformFn: transformRESTFloatToSDKFloat,
310
- paths: [
311
- { path: 'file.media.image.faces.confidence' },
312
- { path: 'file.media.vector.faces.confidence' },
313
- ],
314
- },
315
- ]),
316
- };
317
- return metadata;
318
- }
319
- return __updateFileDescriptor;
320
- }
321
- /**
322
- * Generates an upload URL to allow external clients to upload a file to the Media Manager.
323
- *
324
- * The `generateFileUploadUrl()` function returns a Promise that resolves to an upload URL.
325
- *
326
- * To learn how external clients can use the generated upload URL in the response to upload a file to the Media Manager, see the Upload API article.
327
- *
328
- * > **Note:** Any interruption in the upload process stops the file upload. For files larger than 10MB, or when network connection is poor, use `generateFileResumableUploadUrl()` instead. With the resumable upload URL, any interruption in the upload process pauses the file upload, and resumes the file upload process after the interruption.
329
- */
330
- export function generateFileUploadUrl(payload) {
331
- function __generateFileUploadUrl({ host }) {
332
- const metadata = {
333
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
334
- method: 'POST',
335
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileUploadUrl',
336
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
337
- protoPath: '/v1/files/generate-upload-url',
338
- data: payload,
339
- host,
340
- }),
341
- data: payload,
342
- };
343
- return metadata;
344
- }
345
- return __generateFileUploadUrl;
346
- }
347
- /**
348
- * Generates a resumable upload URL to allow external clients to upload large files over 10MB to the Media Manager.
349
- *
350
- * The `generateFileResumableUploadUrl()` function returns a Promise that resolves to an upload URL, token, and protocol.
351
- *
352
- * When using the resumable upload URL, any interruptions will pause the file upload process, which automatically resumes once the interruption is resolved. The resumable upload URL is also helpful when network connection is poor.
353
- *
354
- * To learn how external clients can use the generated upload URL in the response to upload large files to the Media Manager, see the Resumable Upload API article.
355
- */
356
- export function generateFileResumableUploadUrl(payload) {
357
- function __generateFileResumableUploadUrl({ host }) {
358
- const metadata = {
359
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
360
- method: 'POST',
361
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateFileResumableUploadUrl',
362
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
363
- protoPath: '/v1/files/generate-resumable-upload-url',
364
- data: payload,
365
- host,
366
- }),
367
- data: payload,
368
- };
369
- return metadata;
370
- }
371
- return __generateFileResumableUploadUrl;
372
- }
373
- /**
374
- * Imports a file to the Media Manager using an external URL.
375
- *
376
- * The `importFile()` function returns a Promise that resolves to the imported file's descriptor.
377
- *
378
- * This function returns information about the imported file. Importing a file is the method through which you can add files to the Media Manager.
379
- * Use the `parentFolderId` parameter to specify which folder you want the file to be imported to.
380
- * If no folder is specified, the file is imported to the `media-root` folder.
381
- *
382
- * To import a file, you need to do one of the following:
383
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
384
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
385
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
386
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
387
- */
388
- export function importFile(payload) {
389
- function __importFile({ host }) {
390
- const metadata = {
391
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
392
- method: 'POST',
393
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ImportFile',
394
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
395
- protoPath: '/v1/files/import',
396
- data: payload,
397
- host,
398
- }),
399
- data: payload,
400
- transformResponse: (payload) => transformPaths(payload, [
401
- {
402
- transformFn: transformRESTTimestampToSDKTimestamp,
403
- paths: [
404
- { path: 'file.createdDate' },
405
- { path: 'file.updatedDate' },
406
- { path: 'file.media.image.image.urlExpirationDate' },
407
- { path: 'file.media.image.previewImage.urlExpirationDate' },
408
- { path: 'file.media.video.urlExpirationDate' },
409
- { path: 'file.media.video.resolutions.urlExpirationDate' },
410
- { path: 'file.media.video.resolutions.poster.urlExpirationDate' },
411
- { path: 'file.media.video.posters.urlExpirationDate' },
412
- { path: 'file.media.audio.assets.urlExpirationDate' },
413
- { path: 'file.media.document.urlExpirationDate' },
414
- { path: 'file.media.vector.image.urlExpirationDate' },
415
- { path: 'file.media.vector.previewImage.urlExpirationDate' },
416
- { path: 'file.media.archive.urlExpirationDate' },
417
- { path: 'file.media.model3d.urlExpirationDate' },
418
- { path: 'file.media.model3d.thumbnail.urlExpirationDate' },
419
- ],
420
- },
421
- {
422
- transformFn: transformRESTFloatToSDKFloat,
423
- paths: [
424
- { path: 'file.media.image.faces.confidence' },
425
- { path: 'file.media.vector.faces.confidence' },
426
- ],
427
- },
428
- ]),
429
- };
430
- return metadata;
431
- }
432
- return __importFile;
433
- }
434
- /**
435
- * > **Deprecated.**
436
- * > This function has been replaced with `bulkImportFile()`, and will be removed on March 31, 2024.
437
- *
438
- *
439
- * The `bulkImportFiles()` function returns a Promise that resolves to an array of the imported files' descriptors.
440
- *
441
- * Imports a bulk of files to the Media Manager using external urls.
442
- *
443
- * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
444
- * If no folder is specified, the file is imported to the `media-root` folder.
445
- *
446
- * >**Note:** The `media` property isn't returned in the `files` response object.
447
- *
448
- * To import files, you need to do one of the following for each file:
449
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
450
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
451
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
452
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
453
- */
454
- export function bulkImportFiles(payload) {
455
- function __bulkImportFiles({ host }) {
456
- const metadata = {
457
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
458
- method: 'POST',
459
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFiles',
460
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
461
- protoPath: '/v1/bulk/files/import',
462
- data: payload,
463
- host,
464
- }),
465
- data: payload,
466
- transformResponse: (payload) => transformPaths(payload, [
467
- {
468
- transformFn: transformRESTTimestampToSDKTimestamp,
469
- paths: [
470
- { path: 'files.createdDate' },
471
- { path: 'files.updatedDate' },
472
- { path: 'files.media.image.image.urlExpirationDate' },
473
- { path: 'files.media.image.previewImage.urlExpirationDate' },
474
- { path: 'files.media.video.urlExpirationDate' },
475
- { path: 'files.media.video.resolutions.urlExpirationDate' },
476
- {
477
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
478
- },
479
- { path: 'files.media.video.posters.urlExpirationDate' },
480
- { path: 'files.media.audio.assets.urlExpirationDate' },
481
- { path: 'files.media.document.urlExpirationDate' },
482
- { path: 'files.media.vector.image.urlExpirationDate' },
483
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
484
- { path: 'files.media.archive.urlExpirationDate' },
485
- { path: 'files.media.model3d.urlExpirationDate' },
486
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
487
- ],
488
- },
489
- {
490
- transformFn: transformRESTFloatToSDKFloat,
491
- paths: [
492
- { path: 'files.media.image.faces.confidence' },
493
- { path: 'files.media.vector.faces.confidence' },
494
- ],
495
- },
496
- ]),
497
- };
498
- return metadata;
499
- }
500
- return __bulkImportFiles;
501
- }
502
- /**
503
- * Imports a bulk of files to the Media Manager using external urls.
504
- *
505
- * The `bulkImportFile()` function returns a Promise that resolves to an object containing bulk import metadata and an array of imported files' descriptors and metadata.
506
- *
507
- * Returns information about the imported files. Use the `parentFolderId` parameter to specify in which folder you want each file to be imported.
508
- * If no folder is specified, the file is imported to the `media-root` folder.
509
- *
510
- * To import files, you need to do one of the following for each file:
511
- * - Pass its [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) in the `mimeType` field of the request. For example, `mimeType: 'image/jpeg'`.
512
- * - Include its extension in either the `displayName` or `url` field of the request. For example, `displayName: 'Example Image.jpeg` or `url: https://www.example.com/image.jpeg`.
513
- * - Ensure the server hosting the file supports HEAD requests. In these cases the Wix servers can retrieve the MIME type from the hosting server.
514
- * > **Note:** If you want to validate the media type, pass the file's expected media type in the optional `mediaType` field of the request. For example, `mediaType: 'IMAGE'`.
515
- */
516
- export function bulkImportFile(payload) {
517
- function __bulkImportFile({ host }) {
518
- const metadata = {
519
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
520
- method: 'POST',
521
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkImportFile',
522
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
523
- protoPath: '/v1/bulk/files/import-v2',
524
- data: payload,
525
- host,
526
- }),
527
- data: payload,
528
- transformResponse: (payload) => transformPaths(payload, [
529
- {
530
- transformFn: transformRESTTimestampToSDKTimestamp,
531
- paths: [
532
- { path: 'results.item.createdDate' },
533
- { path: 'results.item.updatedDate' },
534
- { path: 'results.item.media.image.image.urlExpirationDate' },
535
- {
536
- path: 'results.item.media.image.previewImage.urlExpirationDate',
537
- },
538
- { path: 'results.item.media.video.urlExpirationDate' },
539
- {
540
- path: 'results.item.media.video.resolutions.urlExpirationDate',
541
- },
542
- {
543
- path: 'results.item.media.video.resolutions.poster.urlExpirationDate',
544
- },
545
- { path: 'results.item.media.video.posters.urlExpirationDate' },
546
- { path: 'results.item.media.audio.assets.urlExpirationDate' },
547
- { path: 'results.item.media.document.urlExpirationDate' },
548
- { path: 'results.item.media.vector.image.urlExpirationDate' },
549
- {
550
- path: 'results.item.media.vector.previewImage.urlExpirationDate',
551
- },
552
- { path: 'results.item.media.archive.urlExpirationDate' },
553
- { path: 'results.item.media.model3d.urlExpirationDate' },
554
- {
555
- path: 'results.item.media.model3d.thumbnail.urlExpirationDate',
556
- },
557
- ],
558
- },
559
- {
560
- transformFn: transformRESTFloatToSDKFloat,
561
- paths: [
562
- { path: 'results.item.media.image.faces.confidence' },
563
- { path: 'results.item.media.vector.faces.confidence' },
564
- ],
565
- },
566
- ]),
567
- };
568
- return metadata;
569
- }
570
- return __bulkImportFile;
571
- }
572
- /**
573
- * Retrieves a list of files in the Media Manager.
574
- *
575
- * The `listFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
576
- *
577
- * To retrieve a list of files within a specific folder in the Media Manager, pass the folder's ID in the `parentFolderId` parameter. If no folder is specified, the function retrieves only the list of files in the root folder of the Media Manager.
578
- *
579
- * To retrieve a list of (non-permanently) deleted files, use the `listDeletedFiles()` function.
580
- */
581
- export function listFiles(payload) {
582
- function __listFiles({ host }) {
583
- const metadata = {
584
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
585
- method: 'GET',
586
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ListFiles',
587
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
588
- protoPath: '/v1/files',
589
- data: payload,
590
- host,
591
- }),
592
- params: toURLSearchParams(payload),
593
- transformResponse: (payload) => transformPaths(payload, [
594
- {
595
- transformFn: transformRESTTimestampToSDKTimestamp,
596
- paths: [
597
- { path: 'files.createdDate' },
598
- { path: 'files.updatedDate' },
599
- { path: 'files.media.image.image.urlExpirationDate' },
600
- { path: 'files.media.image.previewImage.urlExpirationDate' },
601
- { path: 'files.media.video.urlExpirationDate' },
602
- { path: 'files.media.video.resolutions.urlExpirationDate' },
603
- {
604
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
605
- },
606
- { path: 'files.media.video.posters.urlExpirationDate' },
607
- { path: 'files.media.audio.assets.urlExpirationDate' },
608
- { path: 'files.media.document.urlExpirationDate' },
609
- { path: 'files.media.vector.image.urlExpirationDate' },
610
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
611
- { path: 'files.media.archive.urlExpirationDate' },
612
- { path: 'files.media.model3d.urlExpirationDate' },
613
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
614
- ],
615
- },
616
- {
617
- transformFn: transformRESTFloatToSDKFloat,
618
- paths: [
619
- { path: 'files.media.image.faces.confidence' },
620
- { path: 'files.media.vector.faces.confidence' },
621
- ],
622
- },
623
- ]),
624
- };
625
- return metadata;
626
- }
627
- return __listFiles;
628
- }
629
- /**
630
- * Searches all folders in the Media Manager and returns a list of files that match the terms specified in the optional parameters.
631
- *
632
- * The `searchFiles()` function returns a Promise that resolves to an array of the specified files' descriptors and cursor information.
633
- *
634
- * If no parameters are specified, the function returns all files in the `MEDIA_ROOT` folder.
635
- */
636
- export function searchFiles(payload) {
637
- function __searchFiles({ host }) {
638
- const metadata = {
639
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
640
- method: 'POST',
641
- methodFqn: 'com.wix.media.site_media.v1.FilesService.SearchFiles',
642
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
643
- protoPath: '/v1/files/search',
644
- data: payload,
645
- host,
646
- }),
647
- data: payload,
648
- transformResponse: (payload) => transformPaths(payload, [
649
- {
650
- transformFn: transformRESTTimestampToSDKTimestamp,
651
- paths: [
652
- { path: 'files.createdDate' },
653
- { path: 'files.updatedDate' },
654
- { path: 'files.media.image.image.urlExpirationDate' },
655
- { path: 'files.media.image.previewImage.urlExpirationDate' },
656
- { path: 'files.media.video.urlExpirationDate' },
657
- { path: 'files.media.video.resolutions.urlExpirationDate' },
658
- {
659
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
660
- },
661
- { path: 'files.media.video.posters.urlExpirationDate' },
662
- { path: 'files.media.audio.assets.urlExpirationDate' },
663
- { path: 'files.media.document.urlExpirationDate' },
664
- { path: 'files.media.vector.image.urlExpirationDate' },
665
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
666
- { path: 'files.media.archive.urlExpirationDate' },
667
- { path: 'files.media.model3d.urlExpirationDate' },
668
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
669
- ],
670
- },
671
- {
672
- transformFn: transformRESTFloatToSDKFloat,
673
- paths: [
674
- { path: 'files.media.image.faces.confidence' },
675
- { path: 'files.media.vector.faces.confidence' },
676
- ],
677
- },
678
- ]),
679
- };
680
- return metadata;
681
- }
682
- return __searchFiles;
683
- }
684
- /**
685
- * Generates a URL for streaming a specific video file in the Media Manager.
686
- *
687
- *
688
- * The `generateVideoStreamingUrl()` function returns a Promise that resolves to a download URL and its asset key.
689
- *
690
- * To stream different assets of the file, use the `assetKeys` parameter which generates a video streaming URL for each asset. If no asset key is specified, it defaults to `src`, which generates one video streaming URL in the original file's format and quality.
691
- */
692
- export function generateVideoStreamingUrl(payload) {
693
- function __generateVideoStreamingUrl({ host }) {
694
- const metadata = {
695
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
696
- method: 'POST',
697
- methodFqn: 'com.wix.media.site_media.v1.FilesService.GenerateVideoStreamingUrl',
698
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
699
- protoPath: '/v1/files/video/{fileId}/generate-stream-url',
700
- data: payload,
701
- host,
702
- }),
703
- data: payload,
704
- };
705
- return metadata;
706
- }
707
- return __generateVideoStreamingUrl;
708
- }
709
- /**
710
- * Deletes the specified files from the Media Manager.
711
- *
712
- *
713
- * The `bulkDeleteFiles()` function returns a Promise that resolves when the files are deleted.
714
- *
715
- * The deleted files are moved to the Media Manager's trash bin (`TRASH_ROOT` folder) unless permanently deleted. To permanently delete files, pass the `permanent` parameter with the value `true`. Permanently deleting files isn't reversible, so make sure that these files aren't being used in a site or in any other way as the files will no longer be accessible.
716
- *
717
- * >**Notes:**
718
- * > - The specified files can be from different folders.
719
- * > - Moving multiple files at once is an asynchronous action, and may take time for the changes to appear in the Media Manager.
720
- * > - Attempting to delete files that are already in the trash bin doesn't result in an error.
721
- * > - If your site contains deleted media files, the deleted media files still appear on your site as the files are still in the Media Manager (in the trash bin).
722
- * > - You can use `bulkRestoreFilesFromTrashBin()` to restore files from the Media Manager's trash bin.
723
- */
724
- export function bulkDeleteFiles(payload) {
725
- function __bulkDeleteFiles({ host }) {
726
- const metadata = {
727
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
728
- method: 'POST',
729
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkDeleteFiles',
730
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
731
- protoPath: '/v1/bulk/files/delete',
732
- data: payload,
733
- host,
734
- }),
735
- data: payload,
736
- };
737
- return metadata;
738
- }
739
- return __bulkDeleteFiles;
740
- }
741
- /**
742
- * Restores the specified files from the Media Manager's trash bin, and moves them to their original locations in the Media Manager.
743
- *
744
- * The `bulkRestoreFilesFromTrashBin()` function returns a Promise that resolves when the files have been restored.
745
- */
746
- export function bulkRestoreFilesFromTrashBin(payload) {
747
- function __bulkRestoreFilesFromTrashBin({ host }) {
748
- const metadata = {
749
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
750
- method: 'POST',
751
- methodFqn: 'com.wix.media.site_media.v1.FilesService.BulkRestoreFilesFromTrashBin',
752
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
753
- protoPath: '/v1/bulk/trash-bin/files/restore',
754
- data: payload,
755
- host,
756
- }),
757
- data: payload,
758
- };
759
- return metadata;
760
- }
761
- return __bulkRestoreFilesFromTrashBin;
762
- }
763
- /**
764
- * Retrieves a list of files in the Media Manager's trash bin.
765
- *
766
- * The `listDeletedFiles()` function returns a Promise that resolves to an array of the specified deleted files' descriptors and cursor information.
767
- *
768
- * >**Note:** The Media Manager's trash bin (`TRASH_ROOT` folder) only contains temporarily deleted files, not permanently deleted files.
769
- *
770
- * To retrieve a list of non-deleted files, use the `listFiles()` function.
771
- */
772
- export function listDeletedFiles(payload) {
773
- function __listDeletedFiles({ host }) {
774
- const metadata = {
775
- entityFqdn: 'wix.media.site_media.v1.file_descriptor',
776
- method: 'GET',
777
- methodFqn: 'com.wix.media.site_media.v1.FilesService.ListDeletedFiles',
778
- url: resolveComWixMediaSiteMediaV1FilesServiceUrl({
779
- protoPath: '/v1/trash-bin/files',
780
- data: payload,
781
- host,
782
- }),
783
- params: toURLSearchParams(payload),
784
- transformResponse: (payload) => transformPaths(payload, [
785
- {
786
- transformFn: transformRESTTimestampToSDKTimestamp,
787
- paths: [
788
- { path: 'files.createdDate' },
789
- { path: 'files.updatedDate' },
790
- { path: 'files.media.image.image.urlExpirationDate' },
791
- { path: 'files.media.image.previewImage.urlExpirationDate' },
792
- { path: 'files.media.video.urlExpirationDate' },
793
- { path: 'files.media.video.resolutions.urlExpirationDate' },
794
- {
795
- path: 'files.media.video.resolutions.poster.urlExpirationDate',
796
- },
797
- { path: 'files.media.video.posters.urlExpirationDate' },
798
- { path: 'files.media.audio.assets.urlExpirationDate' },
799
- { path: 'files.media.document.urlExpirationDate' },
800
- { path: 'files.media.vector.image.urlExpirationDate' },
801
- { path: 'files.media.vector.previewImage.urlExpirationDate' },
802
- { path: 'files.media.archive.urlExpirationDate' },
803
- { path: 'files.media.model3d.urlExpirationDate' },
804
- { path: 'files.media.model3d.thumbnail.urlExpirationDate' },
805
- ],
806
- },
807
- {
808
- transformFn: transformRESTFloatToSDKFloat,
809
- paths: [
810
- { path: 'files.media.image.faces.confidence' },
811
- { path: 'files.media.vector.faces.confidence' },
812
- ],
813
- },
814
- ]),
815
- };
816
- return metadata;
817
- }
818
- return __listDeletedFiles;
819
- }
820
- //# sourceMappingURL=media-site-media-v1-file-descriptor.http.js.map