@wix/auto_sdk_pro-gallery_pro-gallery 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.d.mts +213 -0
- package/build/index.d.ts +213 -0
- package/build/index.js +1847 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +1796 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/index.d.mts +213 -0
- package/build/internal/index.d.ts +213 -0
- package/build/internal/index.js +1847 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +1796 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +498 -0
- package/build/internal/meta.d.ts +498 -0
- package/build/internal/meta.js +1054 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +1016 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/{es/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts → internal/pro-gallery-v2-gallery-pro-gallery.universal-CExTgtbV.d.mts} +399 -208
- package/build/{cjs/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts → internal/pro-gallery-v2-gallery-pro-gallery.universal-CExTgtbV.d.ts} +399 -208
- package/build/meta.d.mts +498 -0
- package/build/meta.d.ts +498 -0
- package/build/meta.js +1054 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +1016 -0
- package/build/meta.mjs.map +1 -0
- package/build/{internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts → pro-gallery-v2-gallery-pro-gallery.universal-CExTgtbV.d.mts} +399 -208
- package/build/{internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.d.ts → pro-gallery-v2-gallery-pro-gallery.universal-CExTgtbV.d.ts} +399 -208
- package/package.json +13 -12
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +0 -56
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js +0 -69
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +0 -90
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js +0 -875
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +0 -47
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js +0 -256
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +0 -167
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js +0 -309
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js +0 -103
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +0 -1
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +0 -1830
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js +0 -850
- package/build/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +0 -56
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.js +0 -56
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +0 -1
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +0 -90
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.js +0 -860
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +0 -1
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +0 -47
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js +0 -218
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +0 -1
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +0 -167
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.js +0 -284
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +0 -1
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.types.js +0 -100
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +0 -1
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +0 -1830
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js +0 -812
- package/build/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +0 -56
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js +0 -69
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +0 -90
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js +0 -875
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +0 -47
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js +0 -256
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +0 -167
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js +0 -309
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js +0 -103
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +0 -1
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +0 -1830
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js +0 -850
- package/build/internal/cjs/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.d.ts +0 -56
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.js +0 -56
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.context.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.d.ts +0 -90
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.js +0 -860
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.http.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.d.ts +0 -47
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js +0 -218
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.meta.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.d.ts +0 -167
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.js +0 -284
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.public.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.js +0 -100
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.types.js.map +0 -1
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.d.ts +0 -1830
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js +0 -812
- package/build/internal/es/src/pro-gallery-v2-gallery-pro-gallery.universal.js.map +0 -1
@@ -1,812 +0,0 @@
|
|
1
|
-
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
|
2
|
-
import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';
|
3
|
-
import * as ambassadorWixProGalleryV2Gallery from './pro-gallery-v2-gallery-pro-gallery.http.js';
|
4
|
-
import { transformSDKImageToRESTImage } from '@wix/sdk-runtime/transformations/image';
|
5
|
-
import { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';
|
6
|
-
import { transformSDKVideoV2ToRESTVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
|
7
|
-
import { transformRESTVideoV2ToSDKVideoV2 } from '@wix/sdk-runtime/transformations/video-v2';
|
8
|
-
import { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';
|
9
|
-
export var LinkType;
|
10
|
-
(function (LinkType) {
|
11
|
-
LinkType["UNDEFINED"] = "UNDEFINED";
|
12
|
-
/** External link. */
|
13
|
-
LinkType["EXTERNAL"] = "EXTERNAL";
|
14
|
-
/** For internal usage using wixLinkData. */
|
15
|
-
LinkType["INTERNAL"] = "INTERNAL";
|
16
|
-
})(LinkType || (LinkType = {}));
|
17
|
-
/**
|
18
|
-
* The 'rel' attribute of the link. The rel attribute defines the relationship between a linked resource and the current document.
|
19
|
-
* Further reading (also about different possible rel types): https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel
|
20
|
-
* Following are the accepted 'rel' types by Wix applications.
|
21
|
-
*/
|
22
|
-
export var LinkRel;
|
23
|
-
(function (LinkRel) {
|
24
|
-
/** default (not implemented) */
|
25
|
-
LinkRel["unknown_link_rel"] = "unknown_link_rel";
|
26
|
-
/** Indicates that the current document's original author or publisher does not endorse the referenced document. */
|
27
|
-
LinkRel["nofollow"] = "nofollow";
|
28
|
-
/** Instructs the browser to navigate to the target resource without granting the new browsing context access to the document that opened it. */
|
29
|
-
LinkRel["noopener"] = "noopener";
|
30
|
-
/** No Referer header will be included. Additionally, has the same effect as noopener. */
|
31
|
-
LinkRel["noreferrer"] = "noreferrer";
|
32
|
-
/** Indicates a link that resulted from advertisements or paid placements. */
|
33
|
-
LinkRel["sponsored"] = "sponsored";
|
34
|
-
})(LinkRel || (LinkRel = {}));
|
35
|
-
export var Type;
|
36
|
-
(function (Type) {
|
37
|
-
Type["UNDEFINED"] = "UNDEFINED";
|
38
|
-
Type["IMAGE"] = "IMAGE";
|
39
|
-
Type["VIDEO"] = "VIDEO";
|
40
|
-
Type["TEXT"] = "TEXT";
|
41
|
-
})(Type || (Type = {}));
|
42
|
-
export var ImageType;
|
43
|
-
(function (ImageType) {
|
44
|
-
ImageType["UNDEFINED"] = "UNDEFINED";
|
45
|
-
ImageType["WIX_MEDIA"] = "WIX_MEDIA";
|
46
|
-
ImageType["EXTERNAL"] = "EXTERNAL";
|
47
|
-
})(ImageType || (ImageType = {}));
|
48
|
-
export var VideoType;
|
49
|
-
(function (VideoType) {
|
50
|
-
VideoType["UNDEFINED"] = "UNDEFINED";
|
51
|
-
VideoType["WIX_MEDIA"] = "WIX_MEDIA";
|
52
|
-
VideoType["YOUTUBE"] = "YOUTUBE";
|
53
|
-
VideoType["VIMEO"] = "VIMEO";
|
54
|
-
})(VideoType || (VideoType = {}));
|
55
|
-
export var RCLabel;
|
56
|
-
(function (RCLabel) {
|
57
|
-
/** Illegal default value, exception will be thrown if used */
|
58
|
-
RCLabel["UNKNOWN"] = "UNKNOWN";
|
59
|
-
RCLabel["RELEASE_MANAGER"] = "RELEASE_MANAGER";
|
60
|
-
RCLabel["BLOCKS"] = "BLOCKS";
|
61
|
-
RCLabel["WIX_CLI"] = "WIX_CLI";
|
62
|
-
RCLabel["MOBILE_APP_BUILDER"] = "MOBILE_APP_BUILDER";
|
63
|
-
RCLabel["SEO"] = "SEO";
|
64
|
-
RCLabel["FEEDBACK"] = "FEEDBACK";
|
65
|
-
RCLabel["ACCESSIBILITY"] = "ACCESSIBILITY";
|
66
|
-
})(RCLabel || (RCLabel = {}));
|
67
|
-
export var WebhookIdentityType;
|
68
|
-
(function (WebhookIdentityType) {
|
69
|
-
WebhookIdentityType["UNKNOWN"] = "UNKNOWN";
|
70
|
-
WebhookIdentityType["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
71
|
-
WebhookIdentityType["MEMBER"] = "MEMBER";
|
72
|
-
WebhookIdentityType["WIX_USER"] = "WIX_USER";
|
73
|
-
WebhookIdentityType["APP"] = "APP";
|
74
|
-
})(WebhookIdentityType || (WebhookIdentityType = {}));
|
75
|
-
export var State;
|
76
|
-
(function (State) {
|
77
|
-
/** Undefined state. */
|
78
|
-
State["UNDEFINED"] = "UNDEFINED";
|
79
|
-
/** The gallery in the Editor. */
|
80
|
-
State["SAVED"] = "SAVED";
|
81
|
-
/** The gallery in the LiveSite. */
|
82
|
-
State["PUBLISHED"] = "PUBLISHED";
|
83
|
-
})(State || (State = {}));
|
84
|
-
export var Enum;
|
85
|
-
(function (Enum) {
|
86
|
-
/** Default value. Means that permission not set */
|
87
|
-
Enum["UNKNOWN"] = "UNKNOWN";
|
88
|
-
/** Protected exposure. Exposed to members and owners */
|
89
|
-
Enum["PROTECTED"] = "PROTECTED";
|
90
|
-
/** Private exposure. Exposed to owners */
|
91
|
-
Enum["PRIVATE"] = "PRIVATE";
|
92
|
-
/** Public exposure. Visible to everyone */
|
93
|
-
Enum["PUBLIC"] = "PUBLIC";
|
94
|
-
/** Used for partial updates, to state that exposure is not changing */
|
95
|
-
Enum["UNCHANGED"] = "UNCHANGED";
|
96
|
-
/** Protected to members of permitted groups and owners */
|
97
|
-
Enum["GROUP_PROTECTED"] = "GROUP_PROTECTED";
|
98
|
-
})(Enum || (Enum = {}));
|
99
|
-
export var SearchIndexingNotificationState;
|
100
|
-
(function (SearchIndexingNotificationState) {
|
101
|
-
/** default state */
|
102
|
-
SearchIndexingNotificationState["Unknown"] = "Unknown";
|
103
|
-
/** metasite does not require site search indexing */
|
104
|
-
SearchIndexingNotificationState["Off"] = "Off";
|
105
|
-
/** metasite requires site search indexing */
|
106
|
-
SearchIndexingNotificationState["On"] = "On";
|
107
|
-
})(SearchIndexingNotificationState || (SearchIndexingNotificationState = {}));
|
108
|
-
/**
|
109
|
-
* Retrieves a list of galleries.
|
110
|
-
*
|
111
|
-
* 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.
|
112
|
-
* @public
|
113
|
-
* @documentationMaturity preview
|
114
|
-
* @param options - Options to use when getting the list of galleries.
|
115
|
-
* @permissionId PRO_GALLERY.READ
|
116
|
-
* @permissionScope Manage Galleries
|
117
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
118
|
-
* @permissionScope Read Galleries
|
119
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
|
120
|
-
* @applicableIdentity APP
|
121
|
-
* @applicableIdentity VISITOR
|
122
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.ListGalleries
|
123
|
-
*/
|
124
|
-
export async function listGalleries(options) {
|
125
|
-
// @ts-ignore
|
126
|
-
const { httpClient, sideEffects } = arguments[1];
|
127
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
128
|
-
itemLimit: options?.itemLimit,
|
129
|
-
offset: options?.offset,
|
130
|
-
limit: options?.limit,
|
131
|
-
});
|
132
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleries(payload);
|
133
|
-
sideEffects?.onSiteCall?.();
|
134
|
-
try {
|
135
|
-
const result = await httpClient.request(reqOpts);
|
136
|
-
sideEffects?.onSuccess?.(result);
|
137
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
138
|
-
{
|
139
|
-
transformFn: transformRESTImageToSDKImage,
|
140
|
-
paths: [
|
141
|
-
{ path: 'galleries.items.image.imageInfo' },
|
142
|
-
{ path: 'galleries.items.secondaryMedia.image.imageInfo' },
|
143
|
-
],
|
144
|
-
},
|
145
|
-
{
|
146
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
147
|
-
paths: [{ path: 'galleries.items.video.videoInfo' }],
|
148
|
-
},
|
149
|
-
]));
|
150
|
-
}
|
151
|
-
catch (err) {
|
152
|
-
const transformedError = sdkTransformError(err, {
|
153
|
-
spreadPathsToArguments: {},
|
154
|
-
explicitPathsToArguments: {
|
155
|
-
itemLimit: '$[0].itemLimit',
|
156
|
-
offset: '$[0].offset',
|
157
|
-
limit: '$[0].limit',
|
158
|
-
},
|
159
|
-
singleArgumentUnchanged: false,
|
160
|
-
}, ['options']);
|
161
|
-
sideEffects?.onError?.(err);
|
162
|
-
throw transformedError;
|
163
|
-
}
|
164
|
-
}
|
165
|
-
/**
|
166
|
-
* Retrieves a gallery by ID.
|
167
|
-
* @param galleryId - Gallery ID.
|
168
|
-
* @public
|
169
|
-
* @documentationMaturity preview
|
170
|
-
* @requiredField galleryId
|
171
|
-
* @param options - Options to use when getting the gallery.
|
172
|
-
* @permissionId PRO_GALLERY.READ
|
173
|
-
* @permissionScope Manage Galleries
|
174
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
175
|
-
* @permissionScope Read Galleries
|
176
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
|
177
|
-
* @applicableIdentity APP
|
178
|
-
* @applicableIdentity VISITOR
|
179
|
-
* @returns Returned gallery.
|
180
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.GetGallery
|
181
|
-
*/
|
182
|
-
export async function getGallery(galleryId, options) {
|
183
|
-
// @ts-ignore
|
184
|
-
const { httpClient, sideEffects } = arguments[2];
|
185
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
186
|
-
galleryId: galleryId,
|
187
|
-
itemOffset: options?.itemOffset,
|
188
|
-
itemLimit: options?.itemLimit,
|
189
|
-
});
|
190
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.getGallery(payload);
|
191
|
-
sideEffects?.onSiteCall?.();
|
192
|
-
try {
|
193
|
-
const result = await httpClient.request(reqOpts);
|
194
|
-
sideEffects?.onSuccess?.(result);
|
195
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
196
|
-
{
|
197
|
-
transformFn: transformRESTImageToSDKImage,
|
198
|
-
paths: [
|
199
|
-
{ path: 'gallery.items.image.imageInfo' },
|
200
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
201
|
-
],
|
202
|
-
},
|
203
|
-
{
|
204
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
205
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
206
|
-
},
|
207
|
-
]))?.gallery;
|
208
|
-
}
|
209
|
-
catch (err) {
|
210
|
-
const transformedError = sdkTransformError(err, {
|
211
|
-
spreadPathsToArguments: {},
|
212
|
-
explicitPathsToArguments: {
|
213
|
-
galleryId: '$[0]',
|
214
|
-
itemOffset: '$[1].itemOffset',
|
215
|
-
itemLimit: '$[1].itemLimit',
|
216
|
-
},
|
217
|
-
singleArgumentUnchanged: false,
|
218
|
-
}, ['galleryId', 'options']);
|
219
|
-
sideEffects?.onError?.(err);
|
220
|
-
throw transformedError;
|
221
|
-
}
|
222
|
-
}
|
223
|
-
/**
|
224
|
-
* Retrieves a list of media items in a specified gallery.
|
225
|
-
*
|
226
|
-
* This function retrieves a list of up to 100 gallery items. The gallery items are listed by `sortOrder` in descending order.
|
227
|
-
* @param galleryId - Gallery ID.
|
228
|
-
* @public
|
229
|
-
* @documentationMaturity preview
|
230
|
-
* @requiredField galleryId
|
231
|
-
* @param options - Options to use when getting the list of gallery items.
|
232
|
-
* @permissionId PRO_GALLERY.READ
|
233
|
-
* @permissionScope Manage Galleries
|
234
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
235
|
-
* @permissionScope Read Galleries
|
236
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
|
237
|
-
* @applicableIdentity APP
|
238
|
-
* @applicableIdentity VISITOR
|
239
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.ListGalleryItems
|
240
|
-
*/
|
241
|
-
export async function listGalleryItems(galleryId, options) {
|
242
|
-
// @ts-ignore
|
243
|
-
const { httpClient, sideEffects } = arguments[2];
|
244
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
245
|
-
galleryId: galleryId,
|
246
|
-
itemOffset: options?.itemOffset,
|
247
|
-
itemLimit: options?.itemLimit,
|
248
|
-
});
|
249
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleryItems(payload);
|
250
|
-
sideEffects?.onSiteCall?.();
|
251
|
-
try {
|
252
|
-
const result = await httpClient.request(reqOpts);
|
253
|
-
sideEffects?.onSuccess?.(result);
|
254
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
255
|
-
{
|
256
|
-
transformFn: transformRESTImageToSDKImage,
|
257
|
-
paths: [
|
258
|
-
{ path: 'items.image.imageInfo' },
|
259
|
-
{ path: 'items.secondaryMedia.image.imageInfo' },
|
260
|
-
],
|
261
|
-
},
|
262
|
-
{
|
263
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
264
|
-
paths: [{ path: 'items.video.videoInfo' }],
|
265
|
-
},
|
266
|
-
]));
|
267
|
-
}
|
268
|
-
catch (err) {
|
269
|
-
const transformedError = sdkTransformError(err, {
|
270
|
-
spreadPathsToArguments: {},
|
271
|
-
explicitPathsToArguments: {
|
272
|
-
galleryId: '$[0]',
|
273
|
-
itemOffset: '$[1].itemOffset',
|
274
|
-
itemLimit: '$[1].itemLimit',
|
275
|
-
},
|
276
|
-
singleArgumentUnchanged: false,
|
277
|
-
}, ['galleryId', 'options']);
|
278
|
-
sideEffects?.onError?.(err);
|
279
|
-
throw transformedError;
|
280
|
-
}
|
281
|
-
}
|
282
|
-
/**
|
283
|
-
* Retrieves a gallery item by ID.
|
284
|
-
* @public
|
285
|
-
* @documentationMaturity preview
|
286
|
-
* @requiredField identifiers
|
287
|
-
* @requiredField identifiers.galleryId
|
288
|
-
* @requiredField identifiers.itemId
|
289
|
-
* @param identifiers - Gallery ID and Item ID.
|
290
|
-
* @permissionId PRO_GALLERY.READ
|
291
|
-
* @permissionScope Manage Galleries
|
292
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
293
|
-
* @permissionScope Read Galleries
|
294
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
|
295
|
-
* @applicableIdentity APP
|
296
|
-
* @applicableIdentity VISITOR
|
297
|
-
* @returns Returned media item.
|
298
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.GetGalleryItem
|
299
|
-
*/
|
300
|
-
export async function getGalleryItem(identifiers) {
|
301
|
-
// @ts-ignore
|
302
|
-
const { httpClient, sideEffects } = arguments[1];
|
303
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
304
|
-
galleryId: identifiers?.galleryId,
|
305
|
-
itemId: identifiers?.itemId,
|
306
|
-
});
|
307
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.getGalleryItem(payload);
|
308
|
-
sideEffects?.onSiteCall?.();
|
309
|
-
try {
|
310
|
-
const result = await httpClient.request(reqOpts);
|
311
|
-
sideEffects?.onSuccess?.(result);
|
312
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
313
|
-
{
|
314
|
-
transformFn: transformRESTImageToSDKImage,
|
315
|
-
paths: [
|
316
|
-
{ path: 'item.image.imageInfo' },
|
317
|
-
{ path: 'item.secondaryMedia.image.imageInfo' },
|
318
|
-
],
|
319
|
-
},
|
320
|
-
{
|
321
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
322
|
-
paths: [{ path: 'item.video.videoInfo' }],
|
323
|
-
},
|
324
|
-
]))?.item;
|
325
|
-
}
|
326
|
-
catch (err) {
|
327
|
-
const transformedError = sdkTransformError(err, {
|
328
|
-
spreadPathsToArguments: {},
|
329
|
-
explicitPathsToArguments: {
|
330
|
-
galleryId: '$[0].galleryId',
|
331
|
-
itemId: '$[0].itemId',
|
332
|
-
},
|
333
|
-
singleArgumentUnchanged: false,
|
334
|
-
}, ['identifiers']);
|
335
|
-
sideEffects?.onError?.(err);
|
336
|
-
throw transformedError;
|
337
|
-
}
|
338
|
-
}
|
339
|
-
/**
|
340
|
-
* Creates a new gallery.
|
341
|
-
*
|
342
|
-
* 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.
|
343
|
-
*
|
344
|
-
* 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).
|
345
|
-
*
|
346
|
-
* <blockquote class="important">
|
347
|
-
*
|
348
|
-
* __Important:__
|
349
|
-
* 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.
|
350
|
-
*
|
351
|
-
* </blockquote>
|
352
|
-
* @public
|
353
|
-
* @documentationMaturity preview
|
354
|
-
* @requiredField options.gallery.items.metadata.image.imageInfo
|
355
|
-
* @requiredField options.gallery.items.metadata.text.html
|
356
|
-
* @requiredField options.gallery.items.metadata.video.videoInfo
|
357
|
-
* @param options - Options to use when creating the gallery.
|
358
|
-
* @permissionId PRO_GALLERY.MANAGE
|
359
|
-
* @permissionScope Manage Galleries
|
360
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
361
|
-
* @applicableIdentity APP
|
362
|
-
* @returns Created gallery.
|
363
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.CreateGallery
|
364
|
-
*/
|
365
|
-
export async function createGallery(options) {
|
366
|
-
// @ts-ignore
|
367
|
-
const { httpClient, sideEffects } = arguments[1];
|
368
|
-
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
369
|
-
gallery: options?.gallery,
|
370
|
-
cloneFromGalleryId: options?.cloneFromGalleryId,
|
371
|
-
}), [
|
372
|
-
{
|
373
|
-
transformFn: transformSDKImageToRESTImage,
|
374
|
-
paths: [
|
375
|
-
{ path: 'gallery.items.image.imageInfo' },
|
376
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
377
|
-
],
|
378
|
-
},
|
379
|
-
{
|
380
|
-
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
381
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
382
|
-
},
|
383
|
-
]);
|
384
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.createGallery(payload);
|
385
|
-
sideEffects?.onSiteCall?.();
|
386
|
-
try {
|
387
|
-
const result = await httpClient.request(reqOpts);
|
388
|
-
sideEffects?.onSuccess?.(result);
|
389
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
390
|
-
{
|
391
|
-
transformFn: transformRESTImageToSDKImage,
|
392
|
-
paths: [
|
393
|
-
{ path: 'gallery.items.image.imageInfo' },
|
394
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
395
|
-
],
|
396
|
-
},
|
397
|
-
{
|
398
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
399
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
400
|
-
},
|
401
|
-
]))?.gallery;
|
402
|
-
}
|
403
|
-
catch (err) {
|
404
|
-
const transformedError = sdkTransformError(err, {
|
405
|
-
spreadPathsToArguments: {},
|
406
|
-
explicitPathsToArguments: {
|
407
|
-
gallery: '$[0].gallery',
|
408
|
-
cloneFromGalleryId: '$[0].cloneFromGalleryId',
|
409
|
-
},
|
410
|
-
singleArgumentUnchanged: false,
|
411
|
-
}, ['options']);
|
412
|
-
sideEffects?.onError?.(err);
|
413
|
-
throw transformedError;
|
414
|
-
}
|
415
|
-
}
|
416
|
-
/**
|
417
|
-
* Updates a gallery.
|
418
|
-
*
|
419
|
-
* Only the fields in the `gallery` object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
|
420
|
-
*
|
421
|
-
* <blockquote class="important">
|
422
|
-
*
|
423
|
-
* __Important:__
|
424
|
-
* 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.
|
425
|
-
*
|
426
|
-
* </blockquote>
|
427
|
-
* @public
|
428
|
-
* @documentationMaturity preview
|
429
|
-
* @requiredField _id
|
430
|
-
* @requiredField gallery
|
431
|
-
* @requiredField gallery.items.metadata.image.imageInfo
|
432
|
-
* @requiredField gallery.items.metadata.text.html
|
433
|
-
* @requiredField gallery.items.metadata.video.videoInfo
|
434
|
-
* @param _id - ID of the gallery to update.
|
435
|
-
* @param gallery - The information for the gallery being updated.
|
436
|
-
* @permissionId PRO_GALLERY.MANAGE
|
437
|
-
* @permissionScope Manage Galleries
|
438
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
439
|
-
* @applicableIdentity APP
|
440
|
-
* @returns Updated gallery.
|
441
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.UpdateGallery
|
442
|
-
*/
|
443
|
-
export async function updateGallery(_id, gallery) {
|
444
|
-
// @ts-ignore
|
445
|
-
const { httpClient, sideEffects } = arguments[2];
|
446
|
-
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ gallery: { ...gallery, id: _id } }), [
|
447
|
-
{
|
448
|
-
transformFn: transformSDKImageToRESTImage,
|
449
|
-
paths: [
|
450
|
-
{ path: 'gallery.items.image.imageInfo' },
|
451
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
452
|
-
],
|
453
|
-
},
|
454
|
-
{
|
455
|
-
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
456
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
457
|
-
},
|
458
|
-
]);
|
459
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGallery(payload);
|
460
|
-
sideEffects?.onSiteCall?.();
|
461
|
-
try {
|
462
|
-
const result = await httpClient.request(reqOpts);
|
463
|
-
sideEffects?.onSuccess?.(result);
|
464
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
465
|
-
{
|
466
|
-
transformFn: transformRESTImageToSDKImage,
|
467
|
-
paths: [
|
468
|
-
{ path: 'gallery.items.image.imageInfo' },
|
469
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
470
|
-
],
|
471
|
-
},
|
472
|
-
{
|
473
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
474
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
475
|
-
},
|
476
|
-
]))?.gallery;
|
477
|
-
}
|
478
|
-
catch (err) {
|
479
|
-
const transformedError = sdkTransformError(err, {
|
480
|
-
spreadPathsToArguments: { gallery: '$[1]' },
|
481
|
-
explicitPathsToArguments: { 'gallery.id': '$[0]' },
|
482
|
-
singleArgumentUnchanged: false,
|
483
|
-
}, ['_id', 'gallery']);
|
484
|
-
sideEffects?.onError?.(err);
|
485
|
-
throw transformedError;
|
486
|
-
}
|
487
|
-
}
|
488
|
-
/**
|
489
|
-
* Deletes a gallery.
|
490
|
-
*
|
491
|
-
* When a gallery is deleted, the deleted gallery is no longer returned when calling the [`listGalleries()`](/pro-gallery/list-galleries) function.
|
492
|
-
* @param galleryId - ID of the gallery to delete.
|
493
|
-
* @public
|
494
|
-
* @documentationMaturity preview
|
495
|
-
* @requiredField galleryId
|
496
|
-
* @permissionId PRO_GALLERY.MANAGE
|
497
|
-
* @permissionScope Manage Galleries
|
498
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
499
|
-
* @applicableIdentity APP
|
500
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.DeleteGallery
|
501
|
-
*/
|
502
|
-
export async function deleteGallery(galleryId) {
|
503
|
-
// @ts-ignore
|
504
|
-
const { httpClient, sideEffects } = arguments[1];
|
505
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
506
|
-
galleryId: galleryId,
|
507
|
-
});
|
508
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGallery(payload);
|
509
|
-
sideEffects?.onSiteCall?.();
|
510
|
-
try {
|
511
|
-
const result = await httpClient.request(reqOpts);
|
512
|
-
sideEffects?.onSuccess?.(result);
|
513
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
514
|
-
}
|
515
|
-
catch (err) {
|
516
|
-
const transformedError = sdkTransformError(err, {
|
517
|
-
spreadPathsToArguments: {},
|
518
|
-
explicitPathsToArguments: { galleryId: '$[0]' },
|
519
|
-
singleArgumentUnchanged: false,
|
520
|
-
}, ['galleryId']);
|
521
|
-
sideEffects?.onError?.(err);
|
522
|
-
throw transformedError;
|
523
|
-
}
|
524
|
-
}
|
525
|
-
/**
|
526
|
-
* Deletes multiple media items from a gallery.
|
527
|
-
* @param galleryId - Gallery ID.
|
528
|
-
* @public
|
529
|
-
* @documentationMaturity preview
|
530
|
-
* @requiredField galleryId
|
531
|
-
* @permissionId PRO_GALLERY.MANAGE
|
532
|
-
* @permissionScope Manage Galleries
|
533
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
534
|
-
* @applicableIdentity APP
|
535
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.DeleteGalleryItems
|
536
|
-
* @deprecated
|
537
|
-
* @replacedBy wix.pro_gallery.v2.gallery.BulkDeleteGalleryItems
|
538
|
-
* @targetRemovalDate 2024-08-15
|
539
|
-
*/
|
540
|
-
export async function deleteGalleryItems(galleryId, options) {
|
541
|
-
// @ts-ignore
|
542
|
-
const { httpClient, sideEffects } = arguments[2];
|
543
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
544
|
-
galleryId: galleryId,
|
545
|
-
itemsIds: options?.itemsIds,
|
546
|
-
});
|
547
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItems(payload);
|
548
|
-
sideEffects?.onSiteCall?.();
|
549
|
-
try {
|
550
|
-
const result = await httpClient.request(reqOpts);
|
551
|
-
sideEffects?.onSuccess?.(result);
|
552
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
553
|
-
{
|
554
|
-
transformFn: transformRESTImageToSDKImage,
|
555
|
-
paths: [
|
556
|
-
{ path: 'gallery.items.image.imageInfo' },
|
557
|
-
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
|
558
|
-
],
|
559
|
-
},
|
560
|
-
{
|
561
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
562
|
-
paths: [{ path: 'gallery.items.video.videoInfo' }],
|
563
|
-
},
|
564
|
-
]));
|
565
|
-
}
|
566
|
-
catch (err) {
|
567
|
-
const transformedError = sdkTransformError(err, {
|
568
|
-
spreadPathsToArguments: {},
|
569
|
-
explicitPathsToArguments: {
|
570
|
-
galleryId: '$[0]',
|
571
|
-
itemsIds: '$[1].itemsIds',
|
572
|
-
},
|
573
|
-
singleArgumentUnchanged: false,
|
574
|
-
}, ['galleryId', 'options']);
|
575
|
-
sideEffects?.onError?.(err);
|
576
|
-
throw transformedError;
|
577
|
-
}
|
578
|
-
}
|
579
|
-
/**
|
580
|
-
* Deletes multiple media items from a gallery.
|
581
|
-
* @param galleryId - Gallery ID.
|
582
|
-
* @param itemIds - IDs of the media items to delete.
|
583
|
-
* @public
|
584
|
-
* @documentationMaturity preview
|
585
|
-
* @requiredField galleryId
|
586
|
-
* @requiredField itemIds
|
587
|
-
* @permissionId PRO_GALLERY.MANAGE
|
588
|
-
* @permissionScope Manage Galleries
|
589
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
590
|
-
* @applicableIdentity APP
|
591
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.BulkDeleteGalleryItems
|
592
|
-
*/
|
593
|
-
export async function bulkDeleteGalleryItems(galleryId, itemIds) {
|
594
|
-
// @ts-ignore
|
595
|
-
const { httpClient, sideEffects } = arguments[2];
|
596
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
597
|
-
galleryId: galleryId,
|
598
|
-
itemIds: itemIds,
|
599
|
-
});
|
600
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.bulkDeleteGalleryItems(payload);
|
601
|
-
sideEffects?.onSiteCall?.();
|
602
|
-
try {
|
603
|
-
const result = await httpClient.request(reqOpts);
|
604
|
-
sideEffects?.onSuccess?.(result);
|
605
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
606
|
-
}
|
607
|
-
catch (err) {
|
608
|
-
const transformedError = sdkTransformError(err, {
|
609
|
-
spreadPathsToArguments: {},
|
610
|
-
explicitPathsToArguments: { galleryId: '$[0]', itemIds: '$[1]' },
|
611
|
-
singleArgumentUnchanged: false,
|
612
|
-
}, ['galleryId', 'itemIds']);
|
613
|
-
sideEffects?.onError?.(err);
|
614
|
-
throw transformedError;
|
615
|
-
}
|
616
|
-
}
|
617
|
-
/**
|
618
|
-
* Creates a media item in a specified gallery.
|
619
|
-
*
|
620
|
-
* The `createGalleryItem()` function returns a Promise that resolves to a newly-created gallery item after it has successfully been created.
|
621
|
-
*
|
622
|
-
* <blockquote class="important">
|
623
|
-
*
|
624
|
-
* __Important:__
|
625
|
-
* 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.
|
626
|
-
*
|
627
|
-
* </blockquote>
|
628
|
-
* @param galleryId - Gallery ID.
|
629
|
-
* @param item - Media item to create.
|
630
|
-
* @public
|
631
|
-
* @documentationMaturity preview
|
632
|
-
* @requiredField galleryId
|
633
|
-
* @requiredField item
|
634
|
-
* @requiredField item.metadata.image.imageInfo
|
635
|
-
* @requiredField item.metadata.text.html
|
636
|
-
* @requiredField item.metadata.video.videoInfo
|
637
|
-
* @permissionId PRO_GALLERY.MANAGE
|
638
|
-
* @permissionScope Manage Galleries
|
639
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
640
|
-
* @applicableIdentity APP
|
641
|
-
* @returns Created media item.
|
642
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.CreateGalleryItem
|
643
|
-
*/
|
644
|
-
export async function createGalleryItem(galleryId, item) {
|
645
|
-
// @ts-ignore
|
646
|
-
const { httpClient, sideEffects } = arguments[2];
|
647
|
-
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ galleryId: galleryId, item: item }), [
|
648
|
-
{
|
649
|
-
transformFn: transformSDKImageToRESTImage,
|
650
|
-
paths: [
|
651
|
-
{ path: 'item.image.imageInfo' },
|
652
|
-
{ path: 'item.secondaryMedia.image.imageInfo' },
|
653
|
-
],
|
654
|
-
},
|
655
|
-
{
|
656
|
-
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
657
|
-
paths: [{ path: 'item.video.videoInfo' }],
|
658
|
-
},
|
659
|
-
]);
|
660
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.createGalleryItem(payload);
|
661
|
-
sideEffects?.onSiteCall?.();
|
662
|
-
try {
|
663
|
-
const result = await httpClient.request(reqOpts);
|
664
|
-
sideEffects?.onSuccess?.(result);
|
665
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
666
|
-
{
|
667
|
-
transformFn: transformRESTImageToSDKImage,
|
668
|
-
paths: [
|
669
|
-
{ path: 'item.image.imageInfo' },
|
670
|
-
{ path: 'item.secondaryMedia.image.imageInfo' },
|
671
|
-
],
|
672
|
-
},
|
673
|
-
{
|
674
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
675
|
-
paths: [{ path: 'item.video.videoInfo' }],
|
676
|
-
},
|
677
|
-
]))?.item;
|
678
|
-
}
|
679
|
-
catch (err) {
|
680
|
-
const transformedError = sdkTransformError(err, {
|
681
|
-
spreadPathsToArguments: {},
|
682
|
-
explicitPathsToArguments: { galleryId: '$[0]', item: '$[1]' },
|
683
|
-
singleArgumentUnchanged: false,
|
684
|
-
}, ['galleryId', 'item']);
|
685
|
-
sideEffects?.onError?.(err);
|
686
|
-
throw transformedError;
|
687
|
-
}
|
688
|
-
}
|
689
|
-
/**
|
690
|
-
* Updates a media item in a specified gallery.
|
691
|
-
*
|
692
|
-
* Only the fields in the `item` object parameter can be updated. Specify which fields to update. Unspecified fields remain the same.
|
693
|
-
*
|
694
|
-
* <blockquote class="important">
|
695
|
-
*
|
696
|
-
* __Important:__
|
697
|
-
* 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.
|
698
|
-
*
|
699
|
-
* </blockquote>
|
700
|
-
* @public
|
701
|
-
* @documentationMaturity preview
|
702
|
-
* @requiredField identifiers
|
703
|
-
* @requiredField identifiers.galleryId
|
704
|
-
* @requiredField identifiers.itemId
|
705
|
-
* @requiredField item
|
706
|
-
* @requiredField item.metadata.image.imageInfo
|
707
|
-
* @requiredField item.metadata.text.html
|
708
|
-
* @requiredField item.metadata.video.videoInfo
|
709
|
-
* @param item - The information for the gallery item being updated.
|
710
|
-
* @param identifiers - Gallery ID and Item ID.
|
711
|
-
* @permissionId PRO_GALLERY.MANAGE
|
712
|
-
* @permissionScope Manage Galleries
|
713
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
714
|
-
* @applicableIdentity APP
|
715
|
-
* @returns Updated media item.
|
716
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.UpdateGalleryItem
|
717
|
-
*/
|
718
|
-
export async function updateGalleryItem(identifiers, item) {
|
719
|
-
// @ts-ignore
|
720
|
-
const { httpClient, sideEffects } = arguments[2];
|
721
|
-
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
|
722
|
-
galleryId: identifiers?.galleryId,
|
723
|
-
item: { ...item, id: identifiers?.itemId },
|
724
|
-
}), [
|
725
|
-
{
|
726
|
-
transformFn: transformSDKImageToRESTImage,
|
727
|
-
paths: [
|
728
|
-
{ path: 'item.image.imageInfo' },
|
729
|
-
{ path: 'item.secondaryMedia.image.imageInfo' },
|
730
|
-
],
|
731
|
-
},
|
732
|
-
{
|
733
|
-
transformFn: transformSDKVideoV2ToRESTVideoV2,
|
734
|
-
paths: [{ path: 'item.video.videoInfo' }],
|
735
|
-
},
|
736
|
-
]);
|
737
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGalleryItem(payload);
|
738
|
-
sideEffects?.onSiteCall?.();
|
739
|
-
try {
|
740
|
-
const result = await httpClient.request(reqOpts);
|
741
|
-
sideEffects?.onSuccess?.(result);
|
742
|
-
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
|
743
|
-
{
|
744
|
-
transformFn: transformRESTImageToSDKImage,
|
745
|
-
paths: [
|
746
|
-
{ path: 'item.image.imageInfo' },
|
747
|
-
{ path: 'item.secondaryMedia.image.imageInfo' },
|
748
|
-
],
|
749
|
-
},
|
750
|
-
{
|
751
|
-
transformFn: transformRESTVideoV2ToSDKVideoV2,
|
752
|
-
paths: [{ path: 'item.video.videoInfo' }],
|
753
|
-
},
|
754
|
-
]))?.item;
|
755
|
-
}
|
756
|
-
catch (err) {
|
757
|
-
const transformedError = sdkTransformError(err, {
|
758
|
-
spreadPathsToArguments: { item: '$[1]' },
|
759
|
-
explicitPathsToArguments: {
|
760
|
-
galleryId: '$[0].galleryId',
|
761
|
-
'item.id': '$[0].itemId',
|
762
|
-
},
|
763
|
-
singleArgumentUnchanged: false,
|
764
|
-
}, ['identifiers', 'item']);
|
765
|
-
sideEffects?.onError?.(err);
|
766
|
-
throw transformedError;
|
767
|
-
}
|
768
|
-
}
|
769
|
-
/**
|
770
|
-
* Deletes a media item from a gallery.
|
771
|
-
*
|
772
|
-
* When a gallery item is deleted, the deleted gallery item is no longer returned when calling the [`listGalleryItems()`](/pro-gallery/list-gallery-items) function.
|
773
|
-
* @public
|
774
|
-
* @documentationMaturity preview
|
775
|
-
* @requiredField identifiers
|
776
|
-
* @requiredField identifiers.galleryId
|
777
|
-
* @requiredField identifiers.itemId
|
778
|
-
* @param identifiers - Gallery ID and Item ID.
|
779
|
-
* @permissionId PRO_GALLERY.MANAGE
|
780
|
-
* @permissionScope Manage Galleries
|
781
|
-
* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
|
782
|
-
* @applicableIdentity APP
|
783
|
-
* @fqn com.wixpress.exposure.progallery.ProGallery.DeleteGalleryItem
|
784
|
-
*/
|
785
|
-
export async function deleteGalleryItem(identifiers) {
|
786
|
-
// @ts-ignore
|
787
|
-
const { httpClient, sideEffects } = arguments[1];
|
788
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
789
|
-
galleryId: identifiers?.galleryId,
|
790
|
-
itemId: identifiers?.itemId,
|
791
|
-
});
|
792
|
-
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItem(payload);
|
793
|
-
sideEffects?.onSiteCall?.();
|
794
|
-
try {
|
795
|
-
const result = await httpClient.request(reqOpts);
|
796
|
-
sideEffects?.onSuccess?.(result);
|
797
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
798
|
-
}
|
799
|
-
catch (err) {
|
800
|
-
const transformedError = sdkTransformError(err, {
|
801
|
-
spreadPathsToArguments: {},
|
802
|
-
explicitPathsToArguments: {
|
803
|
-
galleryId: '$[0].galleryId',
|
804
|
-
itemId: '$[0].itemId',
|
805
|
-
},
|
806
|
-
singleArgumentUnchanged: false,
|
807
|
-
}, ['identifiers']);
|
808
|
-
sideEffects?.onError?.(err);
|
809
|
-
throw transformedError;
|
810
|
-
}
|
811
|
-
}
|
812
|
-
//# sourceMappingURL=pro-gallery-v2-gallery-pro-gallery.universal.js.map
|