@wix/auto_sdk_pro-gallery_pro-gallery 1.0.0

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