@wix/auto_sdk_pro-gallery_pro-gallery 1.0.0
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/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +56 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js +69 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +90 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js +821 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +47 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js +256 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +167 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js +309 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts +1138 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js +102 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +1 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +1606 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js +849 -0
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +56 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.js +56 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +1 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +90 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.js +806 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +1 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +47 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js +218 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +1 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +167 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.js +284 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +1 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts +1138 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.types.js +99 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +1 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +1606 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js +811 -0
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +56 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js +69 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +90 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js +821 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +47 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js +256 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +167 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js +309 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts +1138 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js +102 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +1 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +1606 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js +849 -0
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +56 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.js +56 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +90 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.js +806 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +47 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js +218 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +167 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.js +284 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts +1138 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.js +99 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +1 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +1606 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js +811 -0
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
@@ -0,0 +1,806 @@
|
|
1
|
+
import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';
|
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/sdk-runtime/rest-modules';
|
9
|
+
function resolveComWixpressExposureProgalleryProGalleryUrl(opts) {
|
10
|
+
const domainToMappings = {
|
11
|
+
'api._api_base_domain_': [
|
12
|
+
{
|
13
|
+
srcPath: '/pro-gallery-server',
|
14
|
+
destPath: '',
|
15
|
+
},
|
16
|
+
],
|
17
|
+
};
|
18
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
19
|
+
}
|
20
|
+
const PACKAGE_NAME = '@wix/auto_sdk_pro-gallery_pro-gallery';
|
21
|
+
/**
|
22
|
+
* Retrieves a list of galleries.
|
23
|
+
*
|
24
|
+
* This function retrieves a list of up to 10 galleries at a given time. To list the next 10 galleries in your site's backend, use the `offset` parameter.
|
25
|
+
*/
|
26
|
+
export function listGalleries(payload) {
|
27
|
+
function __listGalleries({ host }) {
|
28
|
+
const serializedData = transformPaths(payload, [
|
29
|
+
{
|
30
|
+
transformFn: transformSDKFieldMaskToRESTFieldMask,
|
31
|
+
paths: [{ path: 'fields' }],
|
32
|
+
},
|
33
|
+
]);
|
34
|
+
const metadata = {
|
35
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
36
|
+
method: 'GET',
|
37
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.ListGalleries',
|
38
|
+
packageName: PACKAGE_NAME,
|
39
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
40
|
+
protoPath: '/v2/galleries',
|
41
|
+
data: serializedData,
|
42
|
+
host,
|
43
|
+
}),
|
44
|
+
params: toURLSearchParams(serializedData),
|
45
|
+
transformResponse: (payload) => transformPaths(payload, [
|
46
|
+
{
|
47
|
+
transformFn: transformRESTFloatToSDKFloat,
|
48
|
+
paths: [
|
49
|
+
{ path: 'galleries.sortOrder' },
|
50
|
+
{ path: 'galleries.items.sortOrder' },
|
51
|
+
{ path: 'galleries.items.image.focalPoint.x' },
|
52
|
+
{ path: 'galleries.items.image.focalPoint.y' },
|
53
|
+
{ path: 'galleries.items.secondaryMedia.image.focalPoint.x' },
|
54
|
+
{ path: 'galleries.items.secondaryMedia.image.focalPoint.y' },
|
55
|
+
{ path: 'galleries.items.image.unsharpMasking.amount' },
|
56
|
+
{ path: 'galleries.items.image.unsharpMasking.radius' },
|
57
|
+
{ path: 'galleries.items.image.unsharpMasking.threshold' },
|
58
|
+
{
|
59
|
+
path: 'galleries.items.secondaryMedia.image.unsharpMasking.amount',
|
60
|
+
},
|
61
|
+
{
|
62
|
+
path: 'galleries.items.secondaryMedia.image.unsharpMasking.radius',
|
63
|
+
},
|
64
|
+
{
|
65
|
+
path: 'galleries.items.secondaryMedia.image.unsharpMasking.threshold',
|
66
|
+
},
|
67
|
+
],
|
68
|
+
},
|
69
|
+
{
|
70
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
71
|
+
paths: [
|
72
|
+
{ path: 'galleries.createdDate' },
|
73
|
+
{ path: 'galleries.items.createdDate' },
|
74
|
+
{ path: 'galleries.items.updatedDate' },
|
75
|
+
{ path: 'galleries.items.image.imageInfo.urlExpirationDate' },
|
76
|
+
{ path: 'galleries.items.video.videoInfo.urlExpirationDate' },
|
77
|
+
{
|
78
|
+
path: 'galleries.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
79
|
+
},
|
80
|
+
{
|
81
|
+
path: 'galleries.items.video.videoInfo.posters.urlExpirationDate',
|
82
|
+
},
|
83
|
+
{
|
84
|
+
path: 'galleries.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
85
|
+
},
|
86
|
+
],
|
87
|
+
},
|
88
|
+
]),
|
89
|
+
};
|
90
|
+
return metadata;
|
91
|
+
}
|
92
|
+
return __listGalleries;
|
93
|
+
}
|
94
|
+
/** Retrieves a gallery by ID. */
|
95
|
+
export function getGallery(payload) {
|
96
|
+
function __getGallery({ host }) {
|
97
|
+
const metadata = {
|
98
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
99
|
+
method: 'GET',
|
100
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.GetGallery',
|
101
|
+
packageName: PACKAGE_NAME,
|
102
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
103
|
+
protoPath: '/v2/galleries/{galleryId}',
|
104
|
+
data: payload,
|
105
|
+
host,
|
106
|
+
}),
|
107
|
+
params: toURLSearchParams(payload),
|
108
|
+
transformResponse: (payload) => transformPaths(payload, [
|
109
|
+
{
|
110
|
+
transformFn: transformRESTFloatToSDKFloat,
|
111
|
+
paths: [
|
112
|
+
{ path: 'gallery.sortOrder' },
|
113
|
+
{ path: 'gallery.items.sortOrder' },
|
114
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
115
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
116
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
117
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
118
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
119
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
120
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
121
|
+
{
|
122
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount',
|
123
|
+
},
|
124
|
+
{
|
125
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius',
|
126
|
+
},
|
127
|
+
{
|
128
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
129
|
+
},
|
130
|
+
],
|
131
|
+
},
|
132
|
+
{
|
133
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
134
|
+
paths: [
|
135
|
+
{ path: 'gallery.createdDate' },
|
136
|
+
{ path: 'gallery.items.createdDate' },
|
137
|
+
{ path: 'gallery.items.updatedDate' },
|
138
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
139
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
140
|
+
{
|
141
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
142
|
+
},
|
143
|
+
{
|
144
|
+
path: 'gallery.items.video.videoInfo.posters.urlExpirationDate',
|
145
|
+
},
|
146
|
+
{
|
147
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
148
|
+
},
|
149
|
+
],
|
150
|
+
},
|
151
|
+
]),
|
152
|
+
};
|
153
|
+
return metadata;
|
154
|
+
}
|
155
|
+
return __getGallery;
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Retrieves a list of media items in a specified gallery.
|
159
|
+
*
|
160
|
+
* This function retrieves a list of up to 100 gallery items. The gallery items are listed by `sortOrder` in descending order.
|
161
|
+
*/
|
162
|
+
export function listGalleryItems(payload) {
|
163
|
+
function __listGalleryItems({ host }) {
|
164
|
+
const metadata = {
|
165
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
166
|
+
method: 'GET',
|
167
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.ListGalleryItems',
|
168
|
+
packageName: PACKAGE_NAME,
|
169
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
170
|
+
protoPath: '/v2/galleries/{galleryId}/items',
|
171
|
+
data: payload,
|
172
|
+
host,
|
173
|
+
}),
|
174
|
+
params: toURLSearchParams(payload),
|
175
|
+
transformResponse: (payload) => transformPaths(payload, [
|
176
|
+
{
|
177
|
+
transformFn: transformRESTFloatToSDKFloat,
|
178
|
+
paths: [
|
179
|
+
{ path: 'items.sortOrder' },
|
180
|
+
{ path: 'items.image.focalPoint.x' },
|
181
|
+
{ path: 'items.image.focalPoint.y' },
|
182
|
+
{ path: 'items.secondaryMedia.image.focalPoint.x' },
|
183
|
+
{ path: 'items.secondaryMedia.image.focalPoint.y' },
|
184
|
+
{ path: 'items.image.unsharpMasking.amount' },
|
185
|
+
{ path: 'items.image.unsharpMasking.radius' },
|
186
|
+
{ path: 'items.image.unsharpMasking.threshold' },
|
187
|
+
{ path: 'items.secondaryMedia.image.unsharpMasking.amount' },
|
188
|
+
{ path: 'items.secondaryMedia.image.unsharpMasking.radius' },
|
189
|
+
{ path: 'items.secondaryMedia.image.unsharpMasking.threshold' },
|
190
|
+
],
|
191
|
+
},
|
192
|
+
{
|
193
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
194
|
+
paths: [
|
195
|
+
{ path: 'items.createdDate' },
|
196
|
+
{ path: 'items.updatedDate' },
|
197
|
+
{ path: 'items.image.imageInfo.urlExpirationDate' },
|
198
|
+
{ path: 'items.video.videoInfo.urlExpirationDate' },
|
199
|
+
{
|
200
|
+
path: 'items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
201
|
+
},
|
202
|
+
{ path: 'items.video.videoInfo.posters.urlExpirationDate' },
|
203
|
+
{
|
204
|
+
path: 'items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
205
|
+
},
|
206
|
+
],
|
207
|
+
},
|
208
|
+
]),
|
209
|
+
};
|
210
|
+
return metadata;
|
211
|
+
}
|
212
|
+
return __listGalleryItems;
|
213
|
+
}
|
214
|
+
/** Retrieves a gallery item by ID. */
|
215
|
+
export function getGalleryItem(payload) {
|
216
|
+
function __getGalleryItem({ host }) {
|
217
|
+
const metadata = {
|
218
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
219
|
+
method: 'GET',
|
220
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.GetGalleryItem',
|
221
|
+
packageName: PACKAGE_NAME,
|
222
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
223
|
+
protoPath: '/v2/galleries/{galleryId}/items/{itemId}',
|
224
|
+
data: payload,
|
225
|
+
host,
|
226
|
+
}),
|
227
|
+
params: toURLSearchParams(payload),
|
228
|
+
transformResponse: (payload) => transformPaths(payload, [
|
229
|
+
{
|
230
|
+
transformFn: transformRESTFloatToSDKFloat,
|
231
|
+
paths: [
|
232
|
+
{ path: 'item.sortOrder' },
|
233
|
+
{ path: 'item.image.focalPoint.x' },
|
234
|
+
{ path: 'item.image.focalPoint.y' },
|
235
|
+
{ path: 'item.secondaryMedia.image.focalPoint.x' },
|
236
|
+
{ path: 'item.secondaryMedia.image.focalPoint.y' },
|
237
|
+
{ path: 'item.image.unsharpMasking.amount' },
|
238
|
+
{ path: 'item.image.unsharpMasking.radius' },
|
239
|
+
{ path: 'item.image.unsharpMasking.threshold' },
|
240
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.amount' },
|
241
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.radius' },
|
242
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.threshold' },
|
243
|
+
],
|
244
|
+
},
|
245
|
+
{
|
246
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
247
|
+
paths: [
|
248
|
+
{ path: 'item.createdDate' },
|
249
|
+
{ path: 'item.updatedDate' },
|
250
|
+
{ path: 'item.image.imageInfo.urlExpirationDate' },
|
251
|
+
{ path: 'item.video.videoInfo.urlExpirationDate' },
|
252
|
+
{
|
253
|
+
path: 'item.video.videoInfo.resolutions.poster.urlExpirationDate',
|
254
|
+
},
|
255
|
+
{ path: 'item.video.videoInfo.posters.urlExpirationDate' },
|
256
|
+
{ path: 'item.secondaryMedia.image.imageInfo.urlExpirationDate' },
|
257
|
+
],
|
258
|
+
},
|
259
|
+
]),
|
260
|
+
};
|
261
|
+
return metadata;
|
262
|
+
}
|
263
|
+
return __getGalleryItem;
|
264
|
+
}
|
265
|
+
/**
|
266
|
+
* Creates a new gallery.
|
267
|
+
*
|
268
|
+
* You can create your own gallery by providing the gallery information, or clone an existing gallery using the ID of that existing gallery. When a gallery is cloned, the newly-created gallery includes the same properties as the existing gallery except for the gallery and item IDs, sort order, and created and updated dates.
|
269
|
+
*
|
270
|
+
* The newly-created gallery is only available on your backend, and doesn't appear on your live site. To display your backend gallery on your live site, you need to connect it to a gallery component on your live site. To do this, import the `createGallery()` function to your page code, and write code to convert the backend gallery object to the frontend gallery component object. Once converted, the newly created backend gallery is visible on your live site. For reference, check out the code example, "Create a gallery and display it on your live site". To learn more, see [Displaying a Pro Gallery on Your Site Using the Pro Gallery Backend API](https://support.wix.com/en/article/velo-tutorial-displaying-a-pro-gallery-on-your-site-using-the-pro-gallery-backend-api).
|
271
|
+
*
|
272
|
+
* <blockquote class="important">
|
273
|
+
*
|
274
|
+
* __Important:__
|
275
|
+
* When creating `image` items in your gallery, the images must be uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager) first as the `imageInfo` parameter currently only supports the Wix media URL.
|
276
|
+
*
|
277
|
+
* </blockquote>
|
278
|
+
*/
|
279
|
+
export function createGallery(payload) {
|
280
|
+
function __createGallery({ host }) {
|
281
|
+
const serializedData = transformPaths(payload, [
|
282
|
+
{
|
283
|
+
transformFn: transformSDKFloatToRESTFloat,
|
284
|
+
paths: [
|
285
|
+
{ path: 'gallery.sortOrder' },
|
286
|
+
{ path: 'gallery.items.sortOrder' },
|
287
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
288
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
289
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
290
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
291
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
292
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
293
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
294
|
+
{ path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount' },
|
295
|
+
{ path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius' },
|
296
|
+
{
|
297
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
298
|
+
},
|
299
|
+
],
|
300
|
+
},
|
301
|
+
{
|
302
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
303
|
+
paths: [
|
304
|
+
{ path: 'gallery.createdDate' },
|
305
|
+
{ path: 'gallery.items.createdDate' },
|
306
|
+
{ path: 'gallery.items.updatedDate' },
|
307
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
308
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
309
|
+
{
|
310
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
311
|
+
},
|
312
|
+
{ path: 'gallery.items.video.videoInfo.posters.urlExpirationDate' },
|
313
|
+
{
|
314
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
315
|
+
},
|
316
|
+
],
|
317
|
+
},
|
318
|
+
]);
|
319
|
+
const metadata = {
|
320
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
321
|
+
method: 'POST',
|
322
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.CreateGallery',
|
323
|
+
packageName: PACKAGE_NAME,
|
324
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
325
|
+
protoPath: '/v2/galleries',
|
326
|
+
data: serializedData,
|
327
|
+
host,
|
328
|
+
}),
|
329
|
+
data: serializedData,
|
330
|
+
transformResponse: (payload) => transformPaths(payload, [
|
331
|
+
{
|
332
|
+
transformFn: transformRESTFloatToSDKFloat,
|
333
|
+
paths: [
|
334
|
+
{ path: 'gallery.sortOrder' },
|
335
|
+
{ path: 'gallery.items.sortOrder' },
|
336
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
337
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
338
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
339
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
340
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
341
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
342
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
343
|
+
{
|
344
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount',
|
345
|
+
},
|
346
|
+
{
|
347
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius',
|
348
|
+
},
|
349
|
+
{
|
350
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
351
|
+
},
|
352
|
+
],
|
353
|
+
},
|
354
|
+
{
|
355
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
356
|
+
paths: [
|
357
|
+
{ path: 'gallery.createdDate' },
|
358
|
+
{ path: 'gallery.items.createdDate' },
|
359
|
+
{ path: 'gallery.items.updatedDate' },
|
360
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
361
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
362
|
+
{
|
363
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
364
|
+
},
|
365
|
+
{
|
366
|
+
path: 'gallery.items.video.videoInfo.posters.urlExpirationDate',
|
367
|
+
},
|
368
|
+
{
|
369
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
370
|
+
},
|
371
|
+
],
|
372
|
+
},
|
373
|
+
]),
|
374
|
+
};
|
375
|
+
return metadata;
|
376
|
+
}
|
377
|
+
return __createGallery;
|
378
|
+
}
|
379
|
+
/**
|
380
|
+
* Updates a gallery.
|
381
|
+
*
|
382
|
+
* Only the fields in the `gallery` object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
|
383
|
+
*
|
384
|
+
* <blockquote class="important">
|
385
|
+
*
|
386
|
+
* __Important:__
|
387
|
+
* When updating `image` items in your gallery, the images must be uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager) first as the `imageInfo` parameter currently only supports the Wix media URL.
|
388
|
+
*
|
389
|
+
* </blockquote>
|
390
|
+
*/
|
391
|
+
export function updateGallery(payload) {
|
392
|
+
function __updateGallery({ host }) {
|
393
|
+
const serializedData = transformPaths(payload, [
|
394
|
+
{
|
395
|
+
transformFn: transformSDKFloatToRESTFloat,
|
396
|
+
paths: [
|
397
|
+
{ path: 'gallery.sortOrder' },
|
398
|
+
{ path: 'gallery.items.sortOrder' },
|
399
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
400
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
401
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
402
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
403
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
404
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
405
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
406
|
+
{ path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount' },
|
407
|
+
{ path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius' },
|
408
|
+
{
|
409
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
410
|
+
},
|
411
|
+
],
|
412
|
+
},
|
413
|
+
{
|
414
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
415
|
+
paths: [
|
416
|
+
{ path: 'gallery.createdDate' },
|
417
|
+
{ path: 'gallery.items.createdDate' },
|
418
|
+
{ path: 'gallery.items.updatedDate' },
|
419
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
420
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
421
|
+
{
|
422
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
423
|
+
},
|
424
|
+
{ path: 'gallery.items.video.videoInfo.posters.urlExpirationDate' },
|
425
|
+
{
|
426
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
427
|
+
},
|
428
|
+
],
|
429
|
+
},
|
430
|
+
]);
|
431
|
+
const metadata = {
|
432
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
433
|
+
method: 'PATCH',
|
434
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.UpdateGallery',
|
435
|
+
packageName: PACKAGE_NAME,
|
436
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
437
|
+
protoPath: '/v2/galleries/{gallery.id}',
|
438
|
+
data: serializedData,
|
439
|
+
host,
|
440
|
+
}),
|
441
|
+
data: serializedData,
|
442
|
+
transformResponse: (payload) => transformPaths(payload, [
|
443
|
+
{
|
444
|
+
transformFn: transformRESTFloatToSDKFloat,
|
445
|
+
paths: [
|
446
|
+
{ path: 'gallery.sortOrder' },
|
447
|
+
{ path: 'gallery.items.sortOrder' },
|
448
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
449
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
450
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
451
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
452
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
453
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
454
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
455
|
+
{
|
456
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount',
|
457
|
+
},
|
458
|
+
{
|
459
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius',
|
460
|
+
},
|
461
|
+
{
|
462
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
463
|
+
},
|
464
|
+
],
|
465
|
+
},
|
466
|
+
{
|
467
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
468
|
+
paths: [
|
469
|
+
{ path: 'gallery.createdDate' },
|
470
|
+
{ path: 'gallery.items.createdDate' },
|
471
|
+
{ path: 'gallery.items.updatedDate' },
|
472
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
473
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
474
|
+
{
|
475
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
476
|
+
},
|
477
|
+
{
|
478
|
+
path: 'gallery.items.video.videoInfo.posters.urlExpirationDate',
|
479
|
+
},
|
480
|
+
{
|
481
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
482
|
+
},
|
483
|
+
],
|
484
|
+
},
|
485
|
+
]),
|
486
|
+
};
|
487
|
+
return metadata;
|
488
|
+
}
|
489
|
+
return __updateGallery;
|
490
|
+
}
|
491
|
+
/**
|
492
|
+
* Deletes a gallery.
|
493
|
+
*
|
494
|
+
* When a gallery is deleted, the deleted gallery is no longer returned when calling the [`listGalleries()`](/pro-gallery/list-galleries) function.
|
495
|
+
*/
|
496
|
+
export function deleteGallery(payload) {
|
497
|
+
function __deleteGallery({ host }) {
|
498
|
+
const metadata = {
|
499
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
500
|
+
method: 'DELETE',
|
501
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.DeleteGallery',
|
502
|
+
packageName: PACKAGE_NAME,
|
503
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
504
|
+
protoPath: '/v2/galleries/{galleryId}',
|
505
|
+
data: payload,
|
506
|
+
host,
|
507
|
+
}),
|
508
|
+
params: toURLSearchParams(payload),
|
509
|
+
};
|
510
|
+
return metadata;
|
511
|
+
}
|
512
|
+
return __deleteGallery;
|
513
|
+
}
|
514
|
+
/**
|
515
|
+
* Deletes multiple media items from a gallery.
|
516
|
+
* @deprecated It has been replaced with com.wixpress.exposure.progallery.BulkDeleteGalleryItems(), and will be removed on 2024-08-15.
|
517
|
+
*/
|
518
|
+
export function deleteGalleryItems(payload) {
|
519
|
+
function __deleteGalleryItems({ host }) {
|
520
|
+
const metadata = {
|
521
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
522
|
+
method: 'DELETE',
|
523
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.DeleteGalleryItems',
|
524
|
+
packageName: PACKAGE_NAME,
|
525
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
526
|
+
protoPath: '/v2/galleries/{galleryId}/items',
|
527
|
+
data: payload,
|
528
|
+
host,
|
529
|
+
}),
|
530
|
+
params: toURLSearchParams(payload),
|
531
|
+
transformResponse: (payload) => transformPaths(payload, [
|
532
|
+
{
|
533
|
+
transformFn: transformRESTFloatToSDKFloat,
|
534
|
+
paths: [
|
535
|
+
{ path: 'gallery.sortOrder' },
|
536
|
+
{ path: 'gallery.items.sortOrder' },
|
537
|
+
{ path: 'gallery.items.image.focalPoint.x' },
|
538
|
+
{ path: 'gallery.items.image.focalPoint.y' },
|
539
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.x' },
|
540
|
+
{ path: 'gallery.items.secondaryMedia.image.focalPoint.y' },
|
541
|
+
{ path: 'gallery.items.image.unsharpMasking.amount' },
|
542
|
+
{ path: 'gallery.items.image.unsharpMasking.radius' },
|
543
|
+
{ path: 'gallery.items.image.unsharpMasking.threshold' },
|
544
|
+
{
|
545
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.amount',
|
546
|
+
},
|
547
|
+
{
|
548
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.radius',
|
549
|
+
},
|
550
|
+
{
|
551
|
+
path: 'gallery.items.secondaryMedia.image.unsharpMasking.threshold',
|
552
|
+
},
|
553
|
+
],
|
554
|
+
},
|
555
|
+
{
|
556
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
557
|
+
paths: [
|
558
|
+
{ path: 'gallery.createdDate' },
|
559
|
+
{ path: 'gallery.items.createdDate' },
|
560
|
+
{ path: 'gallery.items.updatedDate' },
|
561
|
+
{ path: 'gallery.items.image.imageInfo.urlExpirationDate' },
|
562
|
+
{ path: 'gallery.items.video.videoInfo.urlExpirationDate' },
|
563
|
+
{
|
564
|
+
path: 'gallery.items.video.videoInfo.resolutions.poster.urlExpirationDate',
|
565
|
+
},
|
566
|
+
{
|
567
|
+
path: 'gallery.items.video.videoInfo.posters.urlExpirationDate',
|
568
|
+
},
|
569
|
+
{
|
570
|
+
path: 'gallery.items.secondaryMedia.image.imageInfo.urlExpirationDate',
|
571
|
+
},
|
572
|
+
],
|
573
|
+
},
|
574
|
+
]),
|
575
|
+
};
|
576
|
+
return metadata;
|
577
|
+
}
|
578
|
+
return __deleteGalleryItems;
|
579
|
+
}
|
580
|
+
/** Deletes multiple media items from a gallery. */
|
581
|
+
export function bulkDeleteGalleryItems(payload) {
|
582
|
+
function __bulkDeleteGalleryItems({ host }) {
|
583
|
+
const metadata = {
|
584
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
585
|
+
method: 'POST',
|
586
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.BulkDeleteGalleryItems',
|
587
|
+
packageName: PACKAGE_NAME,
|
588
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
589
|
+
protoPath: '/v2/galleries/{galleryId}/items/delete',
|
590
|
+
data: payload,
|
591
|
+
host,
|
592
|
+
}),
|
593
|
+
data: payload,
|
594
|
+
};
|
595
|
+
return metadata;
|
596
|
+
}
|
597
|
+
return __bulkDeleteGalleryItems;
|
598
|
+
}
|
599
|
+
/**
|
600
|
+
* Creates a media item in a specified gallery.
|
601
|
+
*
|
602
|
+
* The `createGalleryItem()` function returns a Promise that resolves to a newly-created gallery item after it has successfully been created.
|
603
|
+
*
|
604
|
+
* <blockquote class="important">
|
605
|
+
*
|
606
|
+
* __Important:__
|
607
|
+
* When creating `image` items in your gallery, the images must be uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager) first as the `imageInfo` parameter currently only supports the Wix media URL.
|
608
|
+
*
|
609
|
+
* </blockquote>
|
610
|
+
*/
|
611
|
+
export function createGalleryItem(payload) {
|
612
|
+
function __createGalleryItem({ host }) {
|
613
|
+
const serializedData = transformPaths(payload, [
|
614
|
+
{
|
615
|
+
transformFn: transformSDKFloatToRESTFloat,
|
616
|
+
paths: [
|
617
|
+
{ path: 'item.sortOrder' },
|
618
|
+
{ path: 'item.image.focalPoint.x' },
|
619
|
+
{ path: 'item.image.focalPoint.y' },
|
620
|
+
{ path: 'item.secondaryMedia.image.focalPoint.x' },
|
621
|
+
{ path: 'item.secondaryMedia.image.focalPoint.y' },
|
622
|
+
{ path: 'item.image.unsharpMasking.amount' },
|
623
|
+
{ path: 'item.image.unsharpMasking.radius' },
|
624
|
+
{ path: 'item.image.unsharpMasking.threshold' },
|
625
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.amount' },
|
626
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.radius' },
|
627
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.threshold' },
|
628
|
+
],
|
629
|
+
},
|
630
|
+
{
|
631
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
632
|
+
paths: [
|
633
|
+
{ path: 'item.createdDate' },
|
634
|
+
{ path: 'item.updatedDate' },
|
635
|
+
{ path: 'item.image.imageInfo.urlExpirationDate' },
|
636
|
+
{ path: 'item.video.videoInfo.urlExpirationDate' },
|
637
|
+
{ path: 'item.video.videoInfo.resolutions.poster.urlExpirationDate' },
|
638
|
+
{ path: 'item.video.videoInfo.posters.urlExpirationDate' },
|
639
|
+
{ path: 'item.secondaryMedia.image.imageInfo.urlExpirationDate' },
|
640
|
+
],
|
641
|
+
},
|
642
|
+
]);
|
643
|
+
const metadata = {
|
644
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
645
|
+
method: 'POST',
|
646
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.CreateGalleryItem',
|
647
|
+
packageName: PACKAGE_NAME,
|
648
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
649
|
+
protoPath: '/v2/galleries/{galleryId}/items',
|
650
|
+
data: serializedData,
|
651
|
+
host,
|
652
|
+
}),
|
653
|
+
data: serializedData,
|
654
|
+
transformResponse: (payload) => transformPaths(payload, [
|
655
|
+
{
|
656
|
+
transformFn: transformRESTFloatToSDKFloat,
|
657
|
+
paths: [
|
658
|
+
{ path: 'item.sortOrder' },
|
659
|
+
{ path: 'item.image.focalPoint.x' },
|
660
|
+
{ path: 'item.image.focalPoint.y' },
|
661
|
+
{ path: 'item.secondaryMedia.image.focalPoint.x' },
|
662
|
+
{ path: 'item.secondaryMedia.image.focalPoint.y' },
|
663
|
+
{ path: 'item.image.unsharpMasking.amount' },
|
664
|
+
{ path: 'item.image.unsharpMasking.radius' },
|
665
|
+
{ path: 'item.image.unsharpMasking.threshold' },
|
666
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.amount' },
|
667
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.radius' },
|
668
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.threshold' },
|
669
|
+
],
|
670
|
+
},
|
671
|
+
{
|
672
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
673
|
+
paths: [
|
674
|
+
{ path: 'item.createdDate' },
|
675
|
+
{ path: 'item.updatedDate' },
|
676
|
+
{ path: 'item.image.imageInfo.urlExpirationDate' },
|
677
|
+
{ path: 'item.video.videoInfo.urlExpirationDate' },
|
678
|
+
{
|
679
|
+
path: 'item.video.videoInfo.resolutions.poster.urlExpirationDate',
|
680
|
+
},
|
681
|
+
{ path: 'item.video.videoInfo.posters.urlExpirationDate' },
|
682
|
+
{ path: 'item.secondaryMedia.image.imageInfo.urlExpirationDate' },
|
683
|
+
],
|
684
|
+
},
|
685
|
+
]),
|
686
|
+
};
|
687
|
+
return metadata;
|
688
|
+
}
|
689
|
+
return __createGalleryItem;
|
690
|
+
}
|
691
|
+
/**
|
692
|
+
* Updates a media item in a specified gallery.
|
693
|
+
*
|
694
|
+
* Only the fields in the `item` object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
|
695
|
+
*
|
696
|
+
* <blockquote class="important">
|
697
|
+
*
|
698
|
+
* __Important:__
|
699
|
+
* When updating `image` items in your gallery, the images must be uploaded to the [Wix Media Manager](https://support.wix.com/en/article/wix-media-uploading-media-to-the-media-manager) first as the `imageInfo` parameter currently only supports the Wix media URL.
|
700
|
+
*
|
701
|
+
* </blockquote>
|
702
|
+
*/
|
703
|
+
export function updateGalleryItem(payload) {
|
704
|
+
function __updateGalleryItem({ host }) {
|
705
|
+
const serializedData = transformPaths(payload, [
|
706
|
+
{
|
707
|
+
transformFn: transformSDKFloatToRESTFloat,
|
708
|
+
paths: [
|
709
|
+
{ path: 'item.sortOrder' },
|
710
|
+
{ path: 'item.image.focalPoint.x' },
|
711
|
+
{ path: 'item.image.focalPoint.y' },
|
712
|
+
{ path: 'item.secondaryMedia.image.focalPoint.x' },
|
713
|
+
{ path: 'item.secondaryMedia.image.focalPoint.y' },
|
714
|
+
{ path: 'item.image.unsharpMasking.amount' },
|
715
|
+
{ path: 'item.image.unsharpMasking.radius' },
|
716
|
+
{ path: 'item.image.unsharpMasking.threshold' },
|
717
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.amount' },
|
718
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.radius' },
|
719
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.threshold' },
|
720
|
+
],
|
721
|
+
},
|
722
|
+
{
|
723
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
724
|
+
paths: [
|
725
|
+
{ path: 'item.createdDate' },
|
726
|
+
{ path: 'item.updatedDate' },
|
727
|
+
{ path: 'item.image.imageInfo.urlExpirationDate' },
|
728
|
+
{ path: 'item.video.videoInfo.urlExpirationDate' },
|
729
|
+
{ path: 'item.video.videoInfo.resolutions.poster.urlExpirationDate' },
|
730
|
+
{ path: 'item.video.videoInfo.posters.urlExpirationDate' },
|
731
|
+
{ path: 'item.secondaryMedia.image.imageInfo.urlExpirationDate' },
|
732
|
+
],
|
733
|
+
},
|
734
|
+
]);
|
735
|
+
const metadata = {
|
736
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
737
|
+
method: 'PATCH',
|
738
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.UpdateGalleryItem',
|
739
|
+
packageName: PACKAGE_NAME,
|
740
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
741
|
+
protoPath: '/v2/galleries/{galleryId}/items/{item.id}',
|
742
|
+
data: serializedData,
|
743
|
+
host,
|
744
|
+
}),
|
745
|
+
data: serializedData,
|
746
|
+
transformResponse: (payload) => transformPaths(payload, [
|
747
|
+
{
|
748
|
+
transformFn: transformRESTFloatToSDKFloat,
|
749
|
+
paths: [
|
750
|
+
{ path: 'item.sortOrder' },
|
751
|
+
{ path: 'item.image.focalPoint.x' },
|
752
|
+
{ path: 'item.image.focalPoint.y' },
|
753
|
+
{ path: 'item.secondaryMedia.image.focalPoint.x' },
|
754
|
+
{ path: 'item.secondaryMedia.image.focalPoint.y' },
|
755
|
+
{ path: 'item.image.unsharpMasking.amount' },
|
756
|
+
{ path: 'item.image.unsharpMasking.radius' },
|
757
|
+
{ path: 'item.image.unsharpMasking.threshold' },
|
758
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.amount' },
|
759
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.radius' },
|
760
|
+
{ path: 'item.secondaryMedia.image.unsharpMasking.threshold' },
|
761
|
+
],
|
762
|
+
},
|
763
|
+
{
|
764
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
765
|
+
paths: [
|
766
|
+
{ path: 'item.createdDate' },
|
767
|
+
{ path: 'item.updatedDate' },
|
768
|
+
{ path: 'item.image.imageInfo.urlExpirationDate' },
|
769
|
+
{ path: 'item.video.videoInfo.urlExpirationDate' },
|
770
|
+
{
|
771
|
+
path: 'item.video.videoInfo.resolutions.poster.urlExpirationDate',
|
772
|
+
},
|
773
|
+
{ path: 'item.video.videoInfo.posters.urlExpirationDate' },
|
774
|
+
{ path: 'item.secondaryMedia.image.imageInfo.urlExpirationDate' },
|
775
|
+
],
|
776
|
+
},
|
777
|
+
]),
|
778
|
+
};
|
779
|
+
return metadata;
|
780
|
+
}
|
781
|
+
return __updateGalleryItem;
|
782
|
+
}
|
783
|
+
/**
|
784
|
+
* Deletes a media item from a gallery.
|
785
|
+
*
|
786
|
+
* When a gallery item is deleted, the deleted gallery item is no longer returned when calling the [`listGalleryItems()`](/pro-gallery/list-gallery-items) function.
|
787
|
+
*/
|
788
|
+
export function deleteGalleryItem(payload) {
|
789
|
+
function __deleteGalleryItem({ host }) {
|
790
|
+
const metadata = {
|
791
|
+
entityFqdn: 'wix.pro_gallery.v2.gallery',
|
792
|
+
method: 'DELETE',
|
793
|
+
methodFqn: 'com.wixpress.exposure.progallery.ProGallery.DeleteGalleryItem',
|
794
|
+
packageName: PACKAGE_NAME,
|
795
|
+
url: resolveComWixpressExposureProgalleryProGalleryUrl({
|
796
|
+
protoPath: '/v2/galleries/{galleryId}/items/{itemId}',
|
797
|
+
data: payload,
|
798
|
+
host,
|
799
|
+
}),
|
800
|
+
params: toURLSearchParams(payload),
|
801
|
+
};
|
802
|
+
return metadata;
|
803
|
+
}
|
804
|
+
return __deleteGalleryItem;
|
805
|
+
}
|
806
|
+
//# sourceMappingURL=pro-gallery-v2-gallery-pro-gallery.http.js.map
|