Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wix/pro-gallery_pro-gallery

Package Overview
Dependencies
Maintainers
26
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wix/pro-gallery_pro-gallery - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

30

build/cjs/src/pro-gallery-v2-gallery-pro-gallery.context.js

@@ -6,3 +6,2 @@ "use strict";

const listGalleries = (...args) => {
var _a;
const context =

@@ -19,3 +18,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.listGalleries, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.listGalleries, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -25,3 +24,2 @@ };

const getGallery = (...args) => {
var _a;
const context =

@@ -38,3 +36,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.getGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.getGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -44,3 +42,2 @@ };

const listGalleryItems = (...args) => {
var _a;
const context =

@@ -57,3 +54,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.listGalleryItems, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.listGalleryItems, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -63,3 +60,2 @@ };

const getGalleryItem = (...args) => {
var _a;
const context =

@@ -76,3 +72,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.getGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.getGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -82,3 +78,2 @@ };

const createGallery = (...args) => {
var _a;
const context =

@@ -95,3 +90,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.createGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.createGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -101,3 +96,2 @@ };

const updateGallery = (...args) => {
var _a;
const context =

@@ -114,3 +108,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.updateGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.updateGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -120,3 +114,2 @@ };

const deleteGallery = (...args) => {
var _a;
const context =

@@ -133,3 +126,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.deleteGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.deleteGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -139,3 +132,2 @@ };

const createGalleryItem = (...args) => {
var _a;
const context =

@@ -152,3 +144,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.createGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.createGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -158,3 +150,2 @@ };

const updateGalleryItem = (...args) => {
var _a;
const context =

@@ -171,3 +162,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.updateGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.updateGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -177,3 +168,2 @@ };

const deleteGalleryItem = (...args) => {
var _a;
const context =

@@ -190,3 +180,3 @@ // @ts-expect-error

return context
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.deleteGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(pro_gallery_v2_gallery_pro_gallery_public_1.deleteGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);

@@ -193,0 +183,0 @@ };

@@ -1039,2 +1039,5 @@ import { EventDefinition } from '@wix/sdk-types';

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/

@@ -1063,2 +1066,5 @@ export declare function listGalleries(options?: ListGalleriesOptions): Promise<ListGalleriesResponse & ListGalleriesResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned gallery.

@@ -1092,2 +1098,5 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/

@@ -1121,2 +1130,5 @@ export declare function listGalleryItems(galleryId: string, options?: ListGalleryItemsOptions): Promise<ListGalleryItemsResponse & ListGalleryItemsResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned media item.

@@ -1160,2 +1172,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created gallery.

@@ -1198,2 +1211,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated gallery.

@@ -1245,2 +1259,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/

@@ -1276,2 +1291,3 @@ export declare function deleteGallery(galleryId: string): Promise<DeleteGalleryResponse & DeleteGalleryResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created media item.

@@ -1310,2 +1326,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated media item.

@@ -1382,2 +1399,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/

@@ -1384,0 +1402,0 @@ export declare function deleteGalleryItem(identifiers: DeleteGalleryItemIdentifiers): Promise<DeleteGalleryItemResponse & DeleteGalleryItemResponseNonNullableFields>;

@@ -25,11 +25,2 @@ "use strict";

};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -212,47 +203,46 @@ exports.deleteGalleryItem = exports.updateGalleryItem = exports.createGalleryItem = exports.deleteGallery = exports.updateGallery = exports.createGallery = exports.getGalleryItem = exports.listGalleryItems = exports.getGallery = exports.listGalleries = exports.onGalleryItemDeleted = exports.onGalleryItemUpdated = exports.onGalleryItemCreated = exports.onGalleryDeleted = exports.onGalleryUpdated = exports.onGalleryCreated = exports.State = exports.SearchIndexingNotificationState = exports.Enum = exports.VideoType = exports.ImageType = exports.Type = exports.LinkRel = exports.LinkType = void 0;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/
function listGalleries(options) {
var arguments_1 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_1[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
offset: options === null || options === void 0 ? void 0 : options.offset,
limit: options === null || options === void 0 ? void 0 : options.limit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleries(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'galleries.items.image.imageInfo' },
{ path: 'galleries.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'galleries.items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
itemLimit: '$[0].itemLimit',
offset: '$[0].offset',
limit: '$[0].limit',
},
singleArgumentUnchanged: false,
}, ['options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
async function listGalleries(options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
itemLimit: options?.itemLimit,
offset: options?.offset,
limit: options?.limit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleries(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'galleries.items.image.imageInfo' },
{ path: 'galleries.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'galleries.items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
itemLimit: '$[0].itemLimit',
offset: '$[0].offset',
limit: '$[0].limit',
},
singleArgumentUnchanged: false,
}, ['options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -273,48 +263,47 @@ exports.listGalleries = listGalleries;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned gallery.
*/
function getGallery(galleryId, options) {
var arguments_2 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_2[2];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
itemOffset: options === null || options === void 0 ? void 0 : options.itemOffset,
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
async function getGallery(galleryId, options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
itemOffset: options?.itemOffset,
itemLimit: options?.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))?.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -335,47 +324,46 @@ exports.getGallery = getGallery;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/
function listGalleryItems(galleryId, options) {
var arguments_3 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_3[2];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
itemOffset: options === null || options === void 0 ? void 0 : options.itemOffset,
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleryItems(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'items.image.imageInfo' },
{ path: 'items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
async function listGalleryItems(galleryId, options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
itemOffset: options?.itemOffset,
itemLimit: options?.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleryItems(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'items.image.imageInfo' },
{ path: 'items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -397,46 +385,45 @@ exports.listGalleryItems = listGalleryItems;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned media item.
*/
function getGalleryItem(identifiers) {
var arguments_4 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_4[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
itemId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
async function getGalleryItem(identifiers) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers?.galleryId,
itemId: identifiers?.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))?.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -473,16 +460,32 @@ exports.getGalleryItem = getGalleryItem;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created gallery.
*/
function createGallery(options) {
var arguments_5 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_5[1];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
gallery: options === null || options === void 0 ? void 0 : options.gallery,
cloneFromGalleryId: options === null || options === void 0 ? void 0 : options.cloneFromGalleryId,
}), [
async function createGallery(options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
gallery: options?.gallery,
cloneFromGalleryId: options?.cloneFromGalleryId,
}), [
{
transformFn: image_1.transformSDKImageToRESTImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_1.transformSDKImageToRESTImage,
transformFn: image_2.transformRESTImageToSDKImage,
paths: [

@@ -494,38 +497,19 @@ { path: 'gallery.items.image.imageInfo' },

{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
gallery: '$[0].gallery',
cloneFromGalleryId: '$[0].cloneFromGalleryId',
},
singleArgumentUnchanged: false,
}, ['options']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
gallery: '$[0].gallery',
cloneFromGalleryId: '$[0].cloneFromGalleryId',
},
singleArgumentUnchanged: false,
}, ['options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -561,13 +545,29 @@ exports.createGallery = createGallery;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated gallery.
*/
function updateGallery(_id, gallery) {
var arguments_6 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_6[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ gallery: Object.assign(Object.assign({}, gallery), { id: _id }) }), [
async function updateGallery(_id, gallery) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ gallery: { ...gallery, id: _id } }), [
{
transformFn: image_1.transformSDKImageToRESTImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_1.transformSDKImageToRESTImage,
transformFn: image_2.transformRESTImageToSDKImage,
paths: [

@@ -579,35 +579,16 @@ { path: 'gallery.items.image.imageInfo' },

{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: { gallery: '$[1]' },
explicitPathsToArguments: { 'gallery.id': '$[0]' },
singleArgumentUnchanged: false,
}, ['_id', 'gallery']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.gallery;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: { gallery: '$[1]' },
explicitPathsToArguments: { 'gallery.id': '$[0]' },
singleArgumentUnchanged: false,
}, ['_id', 'gallery']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -631,29 +612,26 @@ exports.updateGallery = updateGallery;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/
function deleteGallery(galleryId) {
var arguments_7 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_7[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]' },
singleArgumentUnchanged: false,
}, ['galleryId']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
async function deleteGallery(galleryId) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: galleryId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]' },
singleArgumentUnchanged: false,
}, ['galleryId']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -689,13 +667,29 @@ exports.deleteGallery = deleteGallery;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created media item.
*/
function createGalleryItem(galleryId, item) {
var arguments_8 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_8[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ galleryId: galleryId, item: item }), [
async function createGalleryItem(galleryId, item) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({ galleryId: galleryId, item: item }), [
{
transformFn: image_1.transformSDKImageToRESTImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_1.transformSDKImageToRESTImage,
transformFn: image_2.transformRESTImageToSDKImage,
paths: [

@@ -707,35 +701,16 @@ { path: 'item.image.imageInfo' },

{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]', item: '$[1]' },
singleArgumentUnchanged: false,
}, ['galleryId', 'item']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]', item: '$[1]' },
singleArgumentUnchanged: false,
}, ['galleryId', 'item']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -773,16 +748,32 @@ exports.createGalleryItem = createGalleryItem;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated media item.
*/
function updateGalleryItem(identifiers, item) {
var arguments_9 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_9[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
item: Object.assign(Object.assign({}, item), { id: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId }),
}), [
async function updateGalleryItem(identifiers, item) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = (0, transform_paths_1.transformPaths)((0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers?.galleryId,
item: { ...item, id: identifiers?.itemId },
}), [
{
transformFn: image_1.transformSDKImageToRESTImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_1.transformSDKImageToRESTImage,
transformFn: image_2.transformRESTImageToSDKImage,
paths: [

@@ -794,38 +785,19 @@ { path: 'item.image.imageInfo' },

{
transformFn: video_v2_1.transformSDKVideoV2ToRESTVideoV2,
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)((0, transform_paths_1.transformPaths)(result.data, [
{
transformFn: image_2.transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: video_v2_2.transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: { item: '$[1]' },
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
'item.id': '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers', 'item']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.item;
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: { item: '$[1]' },
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
'item.id': '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers', 'item']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -851,35 +823,32 @@ exports.updateGalleryItem = updateGalleryItem;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/
function deleteGalleryItem(identifiers) {
var arguments_10 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_10[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
itemId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
async function deleteGalleryItem(identifiers) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
galleryId: identifiers?.galleryId,
itemId: identifiers?.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
}
catch (err) {
const transformedError = (0, transform_error_1.transformError)(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
sideEffects?.onError?.(err);
throw transformedError;
}
}
exports.deleteGalleryItem = deleteGalleryItem;
//# sourceMappingURL=pro-gallery-v2-gallery-pro-gallery.universal.js.map
import { listGalleries as publicListGalleries, getGallery as publicGetGallery, listGalleryItems as publicListGalleryItems, getGalleryItem as publicGetGalleryItem, createGallery as publicCreateGallery, updateGallery as publicUpdateGallery, deleteGallery as publicDeleteGallery, createGalleryItem as publicCreateGalleryItem, updateGalleryItem as publicUpdateGalleryItem, deleteGalleryItem as publicDeleteGalleryItem, } from './pro-gallery-v2-gallery-pro-gallery.public';
export const listGalleries = (...args) => {
var _a;
const context =

@@ -15,7 +14,6 @@ // @ts-expect-error

return context
.initWixModules(publicListGalleries, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicListGalleries, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const getGallery = (...args) => {
var _a;
const context =

@@ -32,7 +30,6 @@ // @ts-expect-error

return context
.initWixModules(publicGetGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicGetGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const listGalleryItems = (...args) => {
var _a;
const context =

@@ -49,7 +46,6 @@ // @ts-expect-error

return context
.initWixModules(publicListGalleryItems, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicListGalleryItems, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const getGalleryItem = (...args) => {
var _a;
const context =

@@ -66,7 +62,6 @@ // @ts-expect-error

return context
.initWixModules(publicGetGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicGetGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const createGallery = (...args) => {
var _a;
const context =

@@ -83,7 +78,6 @@ // @ts-expect-error

return context
.initWixModules(publicCreateGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicCreateGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const updateGallery = (...args) => {
var _a;
const context =

@@ -100,7 +94,6 @@ // @ts-expect-error

return context
.initWixModules(publicUpdateGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicUpdateGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const deleteGallery = (...args) => {
var _a;
const context =

@@ -117,7 +110,6 @@ // @ts-expect-error

return context
.initWixModules(publicDeleteGallery, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicDeleteGallery, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const createGalleryItem = (...args) => {
var _a;
const context =

@@ -134,7 +126,6 @@ // @ts-expect-error

return context
.initWixModules(publicCreateGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicCreateGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const updateGalleryItem = (...args) => {
var _a;
const context =

@@ -151,7 +142,6 @@ // @ts-expect-error

return context
.initWixModules(publicUpdateGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicUpdateGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
export const deleteGalleryItem = (...args) => {
var _a;
const context =

@@ -168,5 +158,5 @@ // @ts-expect-error

return context
.initWixModules(publicDeleteGalleryItem, ((_a = args[1]) === null || _a === void 0 ? void 0 : _a.supressAuth) ? true : false)
.initWixModules(publicDeleteGalleryItem, args[1]?.supressAuth ? true : false)
.apply(undefined, args);
};
//# sourceMappingURL=pro-gallery-v2-gallery-pro-gallery.context.js.map

@@ -1039,2 +1039,5 @@ import { EventDefinition } from '@wix/sdk-types';

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/

@@ -1063,2 +1066,5 @@ export declare function listGalleries(options?: ListGalleriesOptions): Promise<ListGalleriesResponse & ListGalleriesResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned gallery.

@@ -1092,2 +1098,5 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/

@@ -1121,2 +1130,5 @@ export declare function listGalleryItems(galleryId: string, options?: ListGalleryItemsOptions): Promise<ListGalleryItemsResponse & ListGalleryItemsResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned media item.

@@ -1160,2 +1172,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created gallery.

@@ -1198,2 +1211,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated gallery.

@@ -1245,2 +1259,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/

@@ -1276,2 +1291,3 @@ export declare function deleteGallery(galleryId: string): Promise<DeleteGalleryResponse & DeleteGalleryResponseNonNullableFields>;

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created media item.

@@ -1310,2 +1326,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated media item.

@@ -1382,2 +1399,3 @@ */

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/

@@ -1384,0 +1402,0 @@ export declare function deleteGalleryItem(identifiers: DeleteGalleryItemIdentifiers): Promise<DeleteGalleryItemResponse & DeleteGalleryItemResponseNonNullableFields>;

@@ -1,10 +0,1 @@

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';

@@ -185,47 +176,46 @@ import { renameKeysFromSDKRequestToRESTRequest, renameKeysFromRESTResponseToSDKResponse, } from '@wix/sdk-runtime/rename-all-nested-keys';

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/
export function listGalleries(options) {
var arguments_1 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_1[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
offset: options === null || options === void 0 ? void 0 : options.offset,
limit: options === null || options === void 0 ? void 0 : options.limit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleries(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'galleries.items.image.imageInfo' },
{ path: 'galleries.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'galleries.items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
itemLimit: '$[0].itemLimit',
offset: '$[0].offset',
limit: '$[0].limit',
},
singleArgumentUnchanged: false,
}, ['options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
export async function listGalleries(options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
itemLimit: options?.itemLimit,
offset: options?.offset,
limit: options?.limit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleries(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'galleries.items.image.imageInfo' },
{ path: 'galleries.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'galleries.items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
itemLimit: '$[0].itemLimit',
offset: '$[0].offset',
limit: '$[0].limit',
},
singleArgumentUnchanged: false,
}, ['options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -245,48 +235,47 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned gallery.
*/
export function getGallery(galleryId, options) {
var arguments_2 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_2[2];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
itemOffset: options === null || options === void 0 ? void 0 : options.itemOffset,
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
export async function getGallery(galleryId, options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
itemOffset: options?.itemOffset,
itemLimit: options?.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))?.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -306,47 +295,46 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
*/
export function listGalleryItems(galleryId, options) {
var arguments_3 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_3[2];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
itemOffset: options === null || options === void 0 ? void 0 : options.itemOffset,
itemLimit: options === null || options === void 0 ? void 0 : options.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleryItems(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'items.image.imageInfo' },
{ path: 'items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
export async function listGalleryItems(galleryId, options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
itemOffset: options?.itemOffset,
itemLimit: options?.itemLimit,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.listGalleryItems(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'items.image.imageInfo' },
{ path: 'items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'items.video.videoInfo' }],
},
]));
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0]',
itemOffset: '$[1].itemOffset',
itemLimit: '$[1].itemLimit',
},
singleArgumentUnchanged: false,
}, ['galleryId', 'options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -367,46 +355,45 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.READ-GALLERIES
* @applicableIdentity APP
* @applicableIdentity MEMBER
* @applicableIdentity VISITOR
* @returns Returned media item.
*/
export function getGalleryItem(identifiers) {
var arguments_4 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_4[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
itemId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
export async function getGalleryItem(identifiers) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers?.galleryId,
itemId: identifiers?.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.getGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))?.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -442,16 +429,32 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created gallery.
*/
export function createGallery(options) {
var arguments_5 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_5[1];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
gallery: options === null || options === void 0 ? void 0 : options.gallery,
cloneFromGalleryId: options === null || options === void 0 ? void 0 : options.cloneFromGalleryId,
}), [
export async function createGallery(options) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
gallery: options?.gallery,
cloneFromGalleryId: options?.cloneFromGalleryId,
}), [
{
transformFn: transformSDKImageToRESTImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformSDKImageToRESTImage,
transformFn: transformRESTImageToSDKImage,
paths: [

@@ -463,38 +466,19 @@ { path: 'gallery.items.image.imageInfo' },

{
transformFn: transformSDKVideoV2ToRESTVideoV2,
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
gallery: '$[0].gallery',
cloneFromGalleryId: '$[0].cloneFromGalleryId',
},
singleArgumentUnchanged: false,
}, ['options']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
gallery: '$[0].gallery',
cloneFromGalleryId: '$[0].cloneFromGalleryId',
},
singleArgumentUnchanged: false,
}, ['options']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -529,13 +513,29 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated gallery.
*/
export function updateGallery(_id, gallery) {
var arguments_6 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_6[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ gallery: Object.assign(Object.assign({}, gallery), { id: _id }) }), [
export async function updateGallery(_id, gallery) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ gallery: { ...gallery, id: _id } }), [
{
transformFn: transformSDKImageToRESTImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformSDKImageToRESTImage,
transformFn: transformRESTImageToSDKImage,
paths: [

@@ -547,35 +547,16 @@ { path: 'gallery.items.image.imageInfo' },

{
transformFn: transformSDKVideoV2ToRESTVideoV2,
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'gallery.items.image.imageInfo' },
{ path: 'gallery.items.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'gallery.items.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: { gallery: '$[1]' },
explicitPathsToArguments: { 'gallery.id': '$[0]' },
singleArgumentUnchanged: false,
}, ['_id', 'gallery']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.gallery;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: { gallery: '$[1]' },
explicitPathsToArguments: { 'gallery.id': '$[0]' },
singleArgumentUnchanged: false,
}, ['_id', 'gallery']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -598,29 +579,26 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/
export function deleteGallery(galleryId) {
var arguments_7 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_7[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGallery(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return renameKeysFromRESTResponseToSDKResponse(result.data);
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]' },
singleArgumentUnchanged: false,
}, ['galleryId']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
export async function deleteGallery(galleryId) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: galleryId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGallery(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(result.data);
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]' },
singleArgumentUnchanged: false,
}, ['galleryId']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -655,13 +633,29 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Created media item.
*/
export function createGalleryItem(galleryId, item) {
var arguments_8 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_8[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ galleryId: galleryId, item: item }), [
export async function createGalleryItem(galleryId, item) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({ galleryId: galleryId, item: item }), [
{
transformFn: transformSDKImageToRESTImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformSDKImageToRESTImage,
transformFn: transformRESTImageToSDKImage,
paths: [

@@ -673,35 +667,16 @@ { path: 'item.image.imageInfo' },

{
transformFn: transformSDKVideoV2ToRESTVideoV2,
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.createGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]', item: '$[1]' },
singleArgumentUnchanged: false,
}, ['galleryId', 'item']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: { galleryId: '$[0]', item: '$[1]' },
singleArgumentUnchanged: false,
}, ['galleryId', 'item']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -738,16 +713,32 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
* @returns Updated media item.
*/
export function updateGalleryItem(identifiers, item) {
var arguments_9 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c, _d;
// @ts-ignore
const { httpClient, sideEffects } = arguments_9[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
item: Object.assign(Object.assign({}, item), { id: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId }),
}), [
export async function updateGalleryItem(identifiers, item) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[2];
const payload = transformPaths(renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers?.galleryId,
item: { ...item, id: identifiers?.itemId },
}), [
{
transformFn: transformSDKImageToRESTImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformSDKVideoV2ToRESTVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformSDKImageToRESTImage,
transformFn: transformRESTImageToSDKImage,
paths: [

@@ -759,38 +750,19 @@ { path: 'item.image.imageInfo' },

{
transformFn: transformSDKVideoV2ToRESTVideoV2,
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]);
const reqOpts = ambassadorWixProGalleryV2Gallery.updateGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return (_c = renameKeysFromRESTResponseToSDKResponse(transformPaths(result.data, [
{
transformFn: transformRESTImageToSDKImage,
paths: [
{ path: 'item.image.imageInfo' },
{ path: 'item.secondaryMedia.image.imageInfo' },
],
},
{
transformFn: transformRESTVideoV2ToSDKVideoV2,
paths: [{ path: 'item.video.videoInfo' }],
},
]))) === null || _c === void 0 ? void 0 : _c.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: { item: '$[1]' },
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
'item.id': '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers', 'item']);
(_d = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _d === void 0 ? void 0 : _d.call(sideEffects, err);
throw transformedError;
}
});
]))?.item;
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: { item: '$[1]' },
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
'item.id': '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers', 'item']);
sideEffects?.onError?.(err);
throw transformedError;
}
}

@@ -815,34 +787,31 @@ /**

* @permissionScopeId SCOPE.DC-PROGALLERY.MANAGE-GALLERIES
* @applicableIdentity APP
*/
export function deleteGalleryItem(identifiers) {
var arguments_10 = arguments;
return __awaiter(this, void 0, void 0, function* () {
var _a, _b, _c;
// @ts-ignore
const { httpClient, sideEffects } = arguments_10[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.galleryId,
itemId: identifiers === null || identifiers === void 0 ? void 0 : identifiers.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItem(payload);
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
try {
const result = yield httpClient.request(reqOpts);
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
return renameKeysFromRESTResponseToSDKResponse(result.data);
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
throw transformedError;
}
export async function deleteGalleryItem(identifiers) {
// @ts-ignore
const { httpClient, sideEffects } = arguments[1];
const payload = renameKeysFromSDKRequestToRESTRequest({
galleryId: identifiers?.galleryId,
itemId: identifiers?.itemId,
});
const reqOpts = ambassadorWixProGalleryV2Gallery.deleteGalleryItem(payload);
sideEffects?.onSiteCall?.();
try {
const result = await httpClient.request(reqOpts);
sideEffects?.onSuccess?.(result);
return renameKeysFromRESTResponseToSDKResponse(result.data);
}
catch (err) {
const transformedError = sdkTransformError(err, {
spreadPathsToArguments: {},
explicitPathsToArguments: {
galleryId: '$[0].galleryId',
itemId: '$[0].itemId',
},
singleArgumentUnchanged: false,
}, ['identifiers']);
sideEffects?.onError?.(err);
throw transformedError;
}
}
//# sourceMappingURL=pro-gallery-v2-gallery-pro-gallery.universal.js.map
{
"name": "@wix/pro-gallery_pro-gallery",
"version": "1.0.9",
"version": "1.0.10",
"publishConfig": {

@@ -42,3 +42,3 @@ "registry": "https://registry.npmjs.org/",

},
"falconPackageHash": "92b7da1132182a88f164e401db56406efc190fe972b6ab31a51b5cec"
"falconPackageHash": "aa9591e77d1e8cb40236a86010d1506134e3274c138a3403e6edbaca"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc