@wix/auto_sdk_sites_site-actions 1.0.22 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +13 -5
- package/build/cjs/index.js +84 -12
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +14 -1
- package/build/cjs/index.typings.js +76 -4
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +14 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +13 -5
- package/build/es/index.mjs +74 -12
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +14 -1
- package/build/es/index.typings.mjs +66 -4
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +14 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +13 -5
- package/build/internal/cjs/index.js +84 -12
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +14 -1
- package/build/internal/cjs/index.typings.js +76 -4
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +14 -1
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +13 -5
- package/build/internal/es/index.mjs +74 -12
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +14 -1
- package/build/internal/es/index.typings.mjs +66 -4
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +14 -1
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
2
|
import { PublishSiteApplicationErrors, DeployStandalonePagesApplicationErrors, DuplicateSiteOptions, DuplicateSiteResponse, BulkDeleteSiteResponse } from './index.typings.js';
|
|
3
|
-
export { ApplicationError, BulkActionMetadata, BulkDeleteSiteRequest, BulkSiteResult, DeleteSiteFromTrashRequest, DeleteSiteFromTrashResponse, DeployStandalonePagesRequest, DeployStandalonePagesResponse, DuplicateSiteRequest, EmptyEntity, ItemMetadata, MoveSiteToTrashRequest, MoveSiteToTrashResponse, PublishSiteRequest, PublishSiteResponse, RenameSiteRequest, RenameSiteResponse, RestoreSiteFromTrashRequest, RestoreSiteFromTrashResponse, UnpublishSiteRequest, UnpublishSiteResponse, ValidateSiteNameRequest, ValidateSiteNameResponse } from './index.typings.js';
|
|
3
|
+
export { ApplicationError, BulkActionMetadata, BulkDeleteSiteRequest, BulkSiteResult, CreateAndAttachChildRequest, CreateAndAttachChildResponse, DeleteSiteFromTrashRequest, DeleteSiteFromTrashResponse, DeployStandalonePagesRequest, DeployStandalonePagesResponse, DuplicateSiteRequest, EmptyEntity, ItemMetadata, MoveSiteToTrashRequest, MoveSiteToTrashResponse, PublishSiteRequest, PublishSiteResponse, RenameSiteRequest, RenameSiteResponse, RestoreSiteFromTrashRequest, RestoreSiteFromTrashResponse, UnpublishSiteRequest, UnpublishSiteResponse, ValidateSiteNameRequest, ValidateSiteNameResponse } from './index.typings.js';
|
|
4
4
|
|
|
5
|
-
declare function publishSite$1(httpClient: HttpClient
|
|
5
|
+
declare function publishSite$1(httpClient: HttpClient, __options?: {
|
|
6
|
+
validateRequestSchema?: boolean;
|
|
7
|
+
}): PublishSiteSignature;
|
|
6
8
|
interface PublishSiteSignature {
|
|
7
9
|
/**
|
|
8
10
|
* Publishes a site.
|
|
@@ -16,7 +18,9 @@ interface PublishSiteSignature {
|
|
|
16
18
|
__applicationErrorsType?: PublishSiteApplicationErrors;
|
|
17
19
|
}>;
|
|
18
20
|
}
|
|
19
|
-
declare function deployStandalonePages$1(httpClient: HttpClient
|
|
21
|
+
declare function deployStandalonePages$1(httpClient: HttpClient, __options?: {
|
|
22
|
+
validateRequestSchema?: boolean;
|
|
23
|
+
}): DeployStandalonePagesSignature;
|
|
20
24
|
interface DeployStandalonePagesSignature {
|
|
21
25
|
/**
|
|
22
26
|
* Publishes a headless site.
|
|
@@ -29,7 +33,9 @@ interface DeployStandalonePagesSignature {
|
|
|
29
33
|
__applicationErrorsType?: DeployStandalonePagesApplicationErrors;
|
|
30
34
|
}>;
|
|
31
35
|
}
|
|
32
|
-
declare function duplicateSite$1(httpClient: HttpClient
|
|
36
|
+
declare function duplicateSite$1(httpClient: HttpClient, __options?: {
|
|
37
|
+
validateRequestSchema?: boolean;
|
|
38
|
+
}): DuplicateSiteSignature;
|
|
33
39
|
interface DuplicateSiteSignature {
|
|
34
40
|
/**
|
|
35
41
|
* Duplicates a site with a new site name.
|
|
@@ -45,7 +51,9 @@ interface DuplicateSiteSignature {
|
|
|
45
51
|
*/
|
|
46
52
|
(sourceSiteId: string, options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>): Promise<NonNullablePaths<DuplicateSiteResponse, `newSiteId`, 2>>;
|
|
47
53
|
}
|
|
48
|
-
declare function bulkDeleteSite$1(httpClient: HttpClient
|
|
54
|
+
declare function bulkDeleteSite$1(httpClient: HttpClient, __options?: {
|
|
55
|
+
validateRequestSchema?: boolean;
|
|
56
|
+
}): BulkDeleteSiteSignature;
|
|
49
57
|
interface BulkDeleteSiteSignature {
|
|
50
58
|
/**
|
|
51
59
|
* This endpoint enables you to delete multiple sites.
|
package/build/cjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// index.ts
|
|
@@ -171,9 +181,62 @@ function bulkDeleteSite(payload) {
|
|
|
171
181
|
return __bulkDeleteSite;
|
|
172
182
|
}
|
|
173
183
|
|
|
184
|
+
// src/site-actions-v1-site-actions-site-actions.schemas.ts
|
|
185
|
+
var z = __toESM(require("zod"));
|
|
186
|
+
var PublishSiteRequest = z.object({});
|
|
187
|
+
var PublishSiteResponse = z.object({});
|
|
188
|
+
var DeployStandalonePagesRequest = z.object({});
|
|
189
|
+
var DeployStandalonePagesResponse = z.object({});
|
|
190
|
+
var DuplicateSiteRequest = z.object({
|
|
191
|
+
sourceSiteId: z.string().describe("ID of the site to duplicated.").regex(
|
|
192
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
193
|
+
"Must be a valid GUID"
|
|
194
|
+
),
|
|
195
|
+
options: z.object({
|
|
196
|
+
siteDisplayName: z.string().describe("Display name for the new site.").min(1).max(40)
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
var DuplicateSiteResponse = z.object({
|
|
200
|
+
newSiteId: z.string().describe("ID of the new site.").regex(
|
|
201
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
202
|
+
"Must be a valid GUID"
|
|
203
|
+
).optional()
|
|
204
|
+
});
|
|
205
|
+
var BulkDeleteSiteRequest = z.object({
|
|
206
|
+
ids: z.array(z.string()).min(1).max(20)
|
|
207
|
+
});
|
|
208
|
+
var BulkDeleteSiteResponse = z.object({
|
|
209
|
+
results: z.array(
|
|
210
|
+
z.object({
|
|
211
|
+
itemMetadata: z.object({
|
|
212
|
+
_id: z.string().describe("Site ID.").optional().nullable(),
|
|
213
|
+
originalIndex: z.number().int().describe(
|
|
214
|
+
"Index of the site in the request array. Allows for correlation between request and response."
|
|
215
|
+
).optional(),
|
|
216
|
+
success: z.boolean().describe(
|
|
217
|
+
"Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated."
|
|
218
|
+
).optional(),
|
|
219
|
+
error: z.object({
|
|
220
|
+
code: z.string().describe("Error code.").optional(),
|
|
221
|
+
description: z.string().describe("Description of error.").optional()
|
|
222
|
+
}).describe("Details about the error.").optional()
|
|
223
|
+
}).describe(
|
|
224
|
+
"Result of deletion request per site describing the success or failure of each deletion."
|
|
225
|
+
).optional()
|
|
226
|
+
})
|
|
227
|
+
).optional(),
|
|
228
|
+
bulkActionMetadata: z.object({
|
|
229
|
+
totalSuccesses: z.number().int().describe("Number of sites that were deleted successfully.").optional(),
|
|
230
|
+
totalFailures: z.number().int().describe("Number of sites that were not deleted successfully.").optional()
|
|
231
|
+
}).describe("Summary of deletion data.").optional()
|
|
232
|
+
});
|
|
233
|
+
|
|
174
234
|
// src/site-actions-v1-site-actions-site-actions.universal.ts
|
|
175
235
|
async function publishSite2() {
|
|
176
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
236
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[0];
|
|
237
|
+
if (validateRequestSchema) {
|
|
238
|
+
PublishSiteRequest.parse({});
|
|
239
|
+
}
|
|
177
240
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
178
241
|
const reqOpts = publishSite(payload);
|
|
179
242
|
sideEffects?.onSiteCall?.();
|
|
@@ -196,7 +259,10 @@ async function publishSite2() {
|
|
|
196
259
|
}
|
|
197
260
|
}
|
|
198
261
|
async function deployStandalonePages2() {
|
|
199
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
262
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[0];
|
|
263
|
+
if (validateRequestSchema) {
|
|
264
|
+
DeployStandalonePagesRequest.parse({});
|
|
265
|
+
}
|
|
200
266
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
201
267
|
const reqOpts = deployStandalonePages(payload);
|
|
202
268
|
sideEffects?.onSiteCall?.();
|
|
@@ -219,7 +285,10 @@ async function deployStandalonePages2() {
|
|
|
219
285
|
}
|
|
220
286
|
}
|
|
221
287
|
async function duplicateSite2(sourceSiteId, options) {
|
|
222
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
288
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
289
|
+
if (validateRequestSchema) {
|
|
290
|
+
DuplicateSiteRequest.parse({ sourceSiteId, options });
|
|
291
|
+
}
|
|
223
292
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
224
293
|
sourceSiteId,
|
|
225
294
|
siteDisplayName: options?.siteDisplayName
|
|
@@ -248,7 +317,10 @@ async function duplicateSite2(sourceSiteId, options) {
|
|
|
248
317
|
}
|
|
249
318
|
}
|
|
250
319
|
async function bulkDeleteSite2(ids) {
|
|
251
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
320
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
321
|
+
if (validateRequestSchema) {
|
|
322
|
+
BulkDeleteSiteRequest.parse({ ids });
|
|
323
|
+
}
|
|
252
324
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
|
|
253
325
|
const reqOpts = bulkDeleteSite(payload);
|
|
254
326
|
sideEffects?.onSiteCall?.();
|
|
@@ -272,31 +344,31 @@ async function bulkDeleteSite2(ids) {
|
|
|
272
344
|
}
|
|
273
345
|
|
|
274
346
|
// src/site-actions-v1-site-actions-site-actions.public.ts
|
|
275
|
-
function publishSite3(httpClient) {
|
|
347
|
+
function publishSite3(httpClient, __options) {
|
|
276
348
|
return () => publishSite2(
|
|
277
349
|
// @ts-ignore
|
|
278
|
-
{ httpClient }
|
|
350
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
279
351
|
);
|
|
280
352
|
}
|
|
281
|
-
function deployStandalonePages3(httpClient) {
|
|
353
|
+
function deployStandalonePages3(httpClient, __options) {
|
|
282
354
|
return () => deployStandalonePages2(
|
|
283
355
|
// @ts-ignore
|
|
284
|
-
{ httpClient }
|
|
356
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
285
357
|
);
|
|
286
358
|
}
|
|
287
|
-
function duplicateSite3(httpClient) {
|
|
359
|
+
function duplicateSite3(httpClient, __options) {
|
|
288
360
|
return (sourceSiteId, options) => duplicateSite2(
|
|
289
361
|
sourceSiteId,
|
|
290
362
|
options,
|
|
291
363
|
// @ts-ignore
|
|
292
|
-
{ httpClient }
|
|
364
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
293
365
|
);
|
|
294
366
|
}
|
|
295
|
-
function bulkDeleteSite3(httpClient) {
|
|
367
|
+
function bulkDeleteSite3(httpClient, __options) {
|
|
296
368
|
return (ids) => bulkDeleteSite2(
|
|
297
369
|
ids,
|
|
298
370
|
// @ts-ignore
|
|
299
|
-
{ httpClient }
|
|
371
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
300
372
|
);
|
|
301
373
|
}
|
|
302
374
|
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/site-actions-v1-site-actions-site-actions.universal.ts","../../src/site-actions-v1-site-actions-site-actions.http.ts","../../src/site-actions-v1-site-actions-site-actions.public.ts","../../src/site-actions-v1-site-actions-site-actions.context.ts"],"sourcesContent":["export * from './src/site-actions-v1-site-actions-site-actions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixSiteActionsV1SiteActions from './site-actions-v1-site-actions-site-actions.http.js';\n\n/**\n * A package is group of instances of Wix services that a reseller offers to a\n * customer as part of a single transaction.\n */\nexport interface EmptyEntity {}\n\nexport interface PublishSiteRequest {}\n\nexport interface PublishSiteResponse {}\n\nexport interface DeployStandalonePagesRequest {}\n\nexport interface DeployStandalonePagesResponse {}\n\nexport interface DuplicateSiteRequest {\n /**\n * ID of the site to duplicated.\n * @format GUID\n */\n sourceSiteId: string;\n /**\n * Display name for the new site.\n * @minLength 1\n * @maxLength 40\n */\n siteDisplayName: string;\n}\n\nexport interface DuplicateSiteResponse {\n /**\n * ID of the new site.\n * @format GUID\n */\n newSiteId?: string;\n}\n\nexport interface BulkDeleteSiteRequest {\n /**\n * Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n * @format GUID\n * @minSize 1\n * @maxSize 20\n */\n ids: string[];\n}\n\nexport interface BulkDeleteSiteResponse {\n /** List of deletion results. */\n results?: BulkSiteResult[];\n /** Summary of deletion data. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkSiteResult {\n /** Result of deletion request per site describing the success or failure of each deletion. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface ItemMetadata {\n /** Site ID. */\n _id?: string | null;\n /** Index of the site in the request array. Allows for correlation between request and response. */\n originalIndex?: number;\n /** Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated. */\n success?: boolean;\n /** Details about the error. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of error. */\n description?: string;\n}\n\nexport interface BulkActionMetadata {\n /** Number of sites that were deleted successfully. */\n totalSuccesses?: number;\n /** Number of sites that were not deleted successfully. */\n totalFailures?: number;\n}\n\nexport interface RenameSiteRequest {\n /**\n * @minLength 1\n * @maxLength 40\n */\n siteNewName?: string;\n}\n\nexport interface RenameSiteResponse {}\n\nexport interface ValidateSiteNameRequest {\n /**\n * @minLength 1\n * @maxLength 40\n */\n siteName?: string;\n}\n\nexport interface ValidateSiteNameResponse {\n /** Indicates whether the site name is valid. */\n valid?: boolean;\n}\n\nexport interface UnpublishSiteRequest {}\n\nexport interface UnpublishSiteResponse {}\n\nexport interface MoveSiteToTrashRequest {}\n\nexport interface MoveSiteToTrashResponse {}\n\nexport interface RestoreSiteFromTrashRequest {\n /** @format GUID */\n siteId?: string;\n}\n\nexport interface RestoreSiteFromTrashResponse {}\n\nexport interface DeleteSiteFromTrashRequest {\n /** @format GUID */\n siteId?: string;\n}\n\nexport interface DeleteSiteFromTrashResponse {}\n\n/** @docsIgnore */\nexport type PublishSiteApplicationErrors = {\n code?: 'SITE_IS_NOT_DEFINED_AS_PUBLISHABLE';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeployStandalonePagesApplicationErrors = {\n code?: 'SITE_IS_NOT_HEADLESS';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n * @public\n * @permissionId METASITE.UPDATE\n * @applicableIdentity APP\n * @fqn wix.site.v1.SitePublisher.PublishSite\n */\nexport async function publishSite(): Promise<\n void & {\n __applicationErrorsType?: PublishSiteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.publishSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n * @public\n * @permissionId METASITE.UPDATE\n * @applicableIdentity APP\n * @fqn wix.site.v1.SitePublisher.DeployStandalonePages\n */\nexport async function deployStandalonePages(): Promise<\n void & {\n __applicationErrorsType?: DeployStandalonePagesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixSiteActionsV1SiteActions.deployStandalonePages(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n * @param sourceSiteId - ID of the site to duplicated.\n * @public\n * @requiredField options\n * @requiredField options.siteDisplayName\n * @requiredField sourceSiteId\n * @permissionId my-account.duplicate-site\n * @fqn com.wix.site.actions.SiteActionsService.DuplicateSite\n */\nexport async function duplicateSite(\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n): Promise<NonNullablePaths<DuplicateSiteResponse, `newSiteId`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n sourceSiteId: sourceSiteId,\n siteDisplayName: options?.siteDisplayName,\n });\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.duplicateSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n sourceSiteId: '$[0]',\n siteDisplayName: '$[1].siteDisplayName',\n },\n singleArgumentUnchanged: false,\n },\n ['sourceSiteId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DuplicateSiteOptions {\n /**\n * Display name for the new site.\n * @minLength 1\n * @maxLength 40\n */\n siteDisplayName: string;\n}\n\n/**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n * @param ids - Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n * @public\n * @requiredField ids\n * @permissionId my-account.delete-site\n * @fqn com.wix.site.actions.SiteActionsService.BulkDeleteSite\n */\nexport async function bulkDeleteSite(\n ids: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteSiteResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ ids: ids });\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.bulkDeleteSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { ids: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['ids']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixSiteActionsSiteActionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/site-actions',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/site-actions',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/site-actions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nfunction resolveWixSiteV1SitePublisherUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/site-publisher',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_sites_site-actions';\n\n/**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\nexport function publishSite(payload: object): RequestOptionsFactory<any> {\n function __publishSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'wix.site.v1.SitePublisher.PublishSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSiteV1SitePublisherUrl({\n protoPath: '/v1/site/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publishSite;\n}\n\n/**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\nexport function deployStandalonePages(\n payload: object\n): RequestOptionsFactory<any> {\n function __deployStandalonePages({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'wix.site.v1.SitePublisher.DeployStandalonePages',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSiteV1SitePublisherUrl({\n protoPath: '/v1/site/deploy-standalone-pages',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __deployStandalonePages;\n}\n\n/**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n */\nexport function duplicateSite(payload: object): RequestOptionsFactory<any> {\n function __duplicateSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'com.wix.site.actions.SiteActionsService.DuplicateSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixSiteActionsSiteActionsServiceUrl({\n protoPath: '/v1/sites/duplicate',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __duplicateSite;\n}\n\n/**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n */\nexport function bulkDeleteSite(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'com.wix.site.actions.SiteActionsService.BulkDeleteSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixSiteActionsSiteActionsServiceUrl({\n protoPath: '/v1/bulk/sites/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteSite;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n BulkDeleteSiteResponse,\n DeployStandalonePagesApplicationErrors,\n DuplicateSiteOptions,\n DuplicateSiteResponse,\n PublishSiteApplicationErrors,\n bulkDeleteSite as universalBulkDeleteSite,\n deployStandalonePages as universalDeployStandalonePages,\n duplicateSite as universalDuplicateSite,\n publishSite as universalPublishSite,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/sites' };\n\nexport function publishSite(httpClient: HttpClient): PublishSiteSignature {\n return () =>\n universalPublishSite(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface PublishSiteSignature {\n /**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\n (): Promise<\n void & {\n __applicationErrorsType?: PublishSiteApplicationErrors;\n }\n >;\n}\n\nexport function deployStandalonePages(\n httpClient: HttpClient\n): DeployStandalonePagesSignature {\n return () =>\n universalDeployStandalonePages(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeployStandalonePagesSignature {\n /**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\n (): Promise<\n void & {\n __applicationErrorsType?: DeployStandalonePagesApplicationErrors;\n }\n >;\n}\n\nexport function duplicateSite(httpClient: HttpClient): DuplicateSiteSignature {\n return (\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n ) =>\n universalDuplicateSite(\n sourceSiteId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DuplicateSiteSignature {\n /**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n * @param - ID of the site to duplicated.\n */\n (\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n ): Promise<NonNullablePaths<DuplicateSiteResponse, `newSiteId`, 2>>;\n}\n\nexport function bulkDeleteSite(\n httpClient: HttpClient\n): BulkDeleteSiteSignature {\n return (ids: string[]) =>\n universalBulkDeleteSite(\n ids,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkDeleteSiteSignature {\n /**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n * @param - Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n */\n (ids: string[]): Promise<\n NonNullablePaths<\n BulkDeleteSiteResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`,\n 6\n >\n >;\n}\n\nexport {\n ApplicationError,\n BulkActionMetadata,\n BulkDeleteSiteRequest,\n BulkDeleteSiteResponse,\n BulkSiteResult,\n DeleteSiteFromTrashRequest,\n DeleteSiteFromTrashResponse,\n DeployStandalonePagesRequest,\n DeployStandalonePagesResponse,\n DuplicateSiteOptions,\n DuplicateSiteRequest,\n DuplicateSiteResponse,\n EmptyEntity,\n ItemMetadata,\n MoveSiteToTrashRequest,\n MoveSiteToTrashResponse,\n PublishSiteRequest,\n PublishSiteResponse,\n RenameSiteRequest,\n RenameSiteResponse,\n RestoreSiteFromTrashRequest,\n RestoreSiteFromTrashResponse,\n UnpublishSiteRequest,\n UnpublishSiteResponse,\n ValidateSiteNameRequest,\n ValidateSiteNameResponse,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n","import {\n publishSite as publicPublishSite,\n deployStandalonePages as publicDeployStandalonePages,\n duplicateSite as publicDuplicateSite,\n bulkDeleteSite as publicBulkDeleteSite,\n} from './site-actions-v1-site-actions-site-actions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publishSite: MaybeContext<\n BuildRESTFunction<typeof publicPublishSite> & typeof publicPublishSite\n> = /*#__PURE__*/ createRESTModule(publicPublishSite);\nexport const deployStandalonePages: MaybeContext<\n BuildRESTFunction<typeof publicDeployStandalonePages> &\n typeof publicDeployStandalonePages\n> = /*#__PURE__*/ createRESTModule(publicDeployStandalonePages);\nexport const duplicateSite: MaybeContext<\n BuildRESTFunction<typeof publicDuplicateSite> & typeof publicDuplicateSite\n> = /*#__PURE__*/ createRESTModule(publicDuplicateSite);\nexport const bulkDeleteSite: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteSite> & typeof publicBulkDeleteSite\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteSite);\n\nexport {\n EmptyEntity,\n PublishSiteRequest,\n PublishSiteResponse,\n DeployStandalonePagesRequest,\n DeployStandalonePagesResponse,\n DuplicateSiteRequest,\n DuplicateSiteResponse,\n BulkDeleteSiteRequest,\n BulkDeleteSiteResponse,\n BulkSiteResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n RenameSiteRequest,\n RenameSiteResponse,\n ValidateSiteNameRequest,\n ValidateSiteNameResponse,\n UnpublishSiteRequest,\n UnpublishSiteResponse,\n MoveSiteToTrashRequest,\n MoveSiteToTrashResponse,\n RestoreSiteFromTrashRequest,\n RestoreSiteFromTrashResponse,\n DeleteSiteFromTrashRequest,\n DeleteSiteFromTrashResponse,\n DuplicateSiteOptions,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\nexport {\n PublishSiteApplicationErrors,\n DeployStandalonePagesApplicationErrors,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,6BAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,mBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,8CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,SAAS,iCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,YAAY,SAA6C;AACvE,WAAS,cAAc,EAAE,KAAK,GAAQ;AACpC,UAAM,WAAW;AAAA,MACf,YAAY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C,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAiBO,SAASC,eAAc,YAAgD;AAC5E,SAAO,CACL,cACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,SAASC,gBACd,YACyB;AACzB,SAAO,CAAC,QACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnGA,IAAAC,uBAAiC;AAG1B,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,yBAGK,2DAAiBA,sBAA2B;AACvD,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,kBAEK,2DAAiBA,eAAoB;","names":["bulkDeleteSite","deployStandalonePages","duplicateSite","publishSite","publishSite","sdkTransformError","deployStandalonePages","duplicateSite","bulkDeleteSite","publishSite","deployStandalonePages","duplicateSite","bulkDeleteSite","import_rest_modules","publishSite","deployStandalonePages","duplicateSite","bulkDeleteSite"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/site-actions-v1-site-actions-site-actions.universal.ts","../../src/site-actions-v1-site-actions-site-actions.http.ts","../../src/site-actions-v1-site-actions-site-actions.schemas.ts","../../src/site-actions-v1-site-actions-site-actions.public.ts","../../src/site-actions-v1-site-actions-site-actions.context.ts"],"sourcesContent":["export * from './src/site-actions-v1-site-actions-site-actions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixSiteActionsV1SiteActions from './site-actions-v1-site-actions-site-actions.http.js';\nimport {\n PublishSiteRequest as PublishSiteRequestSchema,\n DeployStandalonePagesRequest as DeployStandalonePagesRequestSchema,\n DuplicateSiteRequest as DuplicateSiteRequestSchema,\n BulkDeleteSiteRequest as BulkDeleteSiteRequestSchema,\n} from './site-actions-v1-site-actions-site-actions.schemas.js';\n\n/**\n * A package is group of instances of Wix services that a reseller offers to a\n * customer as part of a single transaction.\n */\nexport interface EmptyEntity {}\n\nexport interface PublishSiteRequest {}\n\nexport interface PublishSiteResponse {}\n\nexport interface DeployStandalonePagesRequest {}\n\nexport interface DeployStandalonePagesResponse {}\n\nexport interface DuplicateSiteRequest {\n /**\n * ID of the site to duplicated.\n * @format GUID\n */\n sourceSiteId: string;\n /**\n * Display name for the new site.\n * @minLength 1\n * @maxLength 40\n */\n siteDisplayName: string;\n}\n\nexport interface DuplicateSiteResponse {\n /**\n * ID of the new site.\n * @format GUID\n */\n newSiteId?: string;\n}\n\nexport interface BulkDeleteSiteRequest {\n /**\n * Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n * @format GUID\n * @minSize 1\n * @maxSize 20\n */\n ids: string[];\n}\n\nexport interface BulkDeleteSiteResponse {\n /** List of deletion results. */\n results?: BulkSiteResult[];\n /** Summary of deletion data. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkSiteResult {\n /** Result of deletion request per site describing the success or failure of each deletion. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface ItemMetadata {\n /** Site ID. */\n _id?: string | null;\n /** Index of the site in the request array. Allows for correlation between request and response. */\n originalIndex?: number;\n /** Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated. */\n success?: boolean;\n /** Details about the error. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of error. */\n description?: string;\n}\n\nexport interface BulkActionMetadata {\n /** Number of sites that were deleted successfully. */\n totalSuccesses?: number;\n /** Number of sites that were not deleted successfully. */\n totalFailures?: number;\n}\n\nexport interface RenameSiteRequest {\n /**\n * @minLength 1\n * @maxLength 40\n */\n siteNewName?: string;\n}\n\nexport interface RenameSiteResponse {}\n\nexport interface ValidateSiteNameRequest {\n /**\n * @minLength 1\n * @maxLength 40\n */\n siteName?: string;\n}\n\nexport interface ValidateSiteNameResponse {\n /** Indicates whether the site name is valid. */\n valid?: boolean;\n}\n\nexport interface UnpublishSiteRequest {}\n\nexport interface UnpublishSiteResponse {}\n\nexport interface MoveSiteToTrashRequest {}\n\nexport interface MoveSiteToTrashResponse {}\n\nexport interface RestoreSiteFromTrashRequest {\n /** @format GUID */\n siteId?: string;\n}\n\nexport interface RestoreSiteFromTrashResponse {}\n\nexport interface DeleteSiteFromTrashRequest {\n /** @format GUID */\n siteId?: string;\n}\n\nexport interface DeleteSiteFromTrashResponse {}\n\nexport interface CreateAndAttachChildRequest {\n /** @format GUID */\n templateId?: string;\n /**\n * @minLength 1\n * @maxLength 40\n */\n name?: string;\n}\n\nexport interface CreateAndAttachChildResponse {\n /** @format GUID */\n childMetaSiteId?: string;\n}\n\n/** @docsIgnore */\nexport type PublishSiteApplicationErrors = {\n code?: 'SITE_IS_NOT_DEFINED_AS_PUBLISHABLE';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeployStandalonePagesApplicationErrors = {\n code?: 'SITE_IS_NOT_HEADLESS';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n * @public\n * @permissionId METASITE.UPDATE\n * @applicableIdentity APP\n * @fqn wix.site.v1.SitePublisher.PublishSite\n */\nexport async function publishSite(): Promise<\n void & {\n __applicationErrorsType?: PublishSiteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n PublishSiteRequestSchema.parse({});\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.publishSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n * @public\n * @permissionId METASITE.UPDATE\n * @applicableIdentity APP\n * @fqn wix.site.v1.SitePublisher.DeployStandalonePages\n */\nexport async function deployStandalonePages(): Promise<\n void & {\n __applicationErrorsType?: DeployStandalonePagesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n DeployStandalonePagesRequestSchema.parse({});\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixSiteActionsV1SiteActions.deployStandalonePages(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n * @param sourceSiteId - ID of the site to duplicated.\n * @public\n * @requiredField options\n * @requiredField options.siteDisplayName\n * @requiredField sourceSiteId\n * @permissionId my-account.duplicate-site\n * @fqn com.wix.site.actions.SiteActionsService.DuplicateSite\n */\nexport async function duplicateSite(\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n): Promise<NonNullablePaths<DuplicateSiteResponse, `newSiteId`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n DuplicateSiteRequestSchema.parse({ sourceSiteId, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n sourceSiteId: sourceSiteId,\n siteDisplayName: options?.siteDisplayName,\n });\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.duplicateSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n sourceSiteId: '$[0]',\n siteDisplayName: '$[1].siteDisplayName',\n },\n singleArgumentUnchanged: false,\n },\n ['sourceSiteId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DuplicateSiteOptions {\n /**\n * Display name for the new site.\n * @minLength 1\n * @maxLength 40\n */\n siteDisplayName: string;\n}\n\n/**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n * @param ids - Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n * @public\n * @requiredField ids\n * @permissionId my-account.delete-site\n * @fqn com.wix.site.actions.SiteActionsService.BulkDeleteSite\n */\nexport async function bulkDeleteSite(\n ids: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteSiteResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n BulkDeleteSiteRequestSchema.parse({ ids });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ ids: ids });\n\n const reqOpts = ambassadorWixSiteActionsV1SiteActions.bulkDeleteSite(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { ids: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['ids']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixSiteActionsSiteActionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/site-actions',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/site-actions',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/site-actions',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nfunction resolveWixSiteV1SitePublisherUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/site-publisher',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/site-publisher',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_sites_site-actions';\n\n/**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\nexport function publishSite(payload: object): RequestOptionsFactory<any> {\n function __publishSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'wix.site.v1.SitePublisher.PublishSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSiteV1SitePublisherUrl({\n protoPath: '/v1/site/publish',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __publishSite;\n}\n\n/**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\nexport function deployStandalonePages(\n payload: object\n): RequestOptionsFactory<any> {\n function __deployStandalonePages({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'wix.site.v1.SitePublisher.DeployStandalonePages',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSiteV1SitePublisherUrl({\n protoPath: '/v1/site/deploy-standalone-pages',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __deployStandalonePages;\n}\n\n/**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n */\nexport function duplicateSite(payload: object): RequestOptionsFactory<any> {\n function __duplicateSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'com.wix.site.actions.SiteActionsService.DuplicateSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixSiteActionsSiteActionsServiceUrl({\n protoPath: '/v1/sites/duplicate',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __duplicateSite;\n}\n\n/**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n */\nexport function bulkDeleteSite(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteSite({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.site_actions.v1.site_actions',\n method: 'POST' as any,\n methodFqn: 'com.wix.site.actions.SiteActionsService.BulkDeleteSite',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixSiteActionsSiteActionsServiceUrl({\n protoPath: '/v1/bulk/sites/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteSite;\n}\n","import * as z from 'zod';\n\nexport const PublishSiteRequest = z.object({});\nexport const PublishSiteResponse = z.object({});\nexport const DeployStandalonePagesRequest = z.object({});\nexport const DeployStandalonePagesResponse = z.object({});\nexport const DuplicateSiteRequest = z.object({\n sourceSiteId: z\n .string()\n .describe('ID of the site to duplicated.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n options: z.object({\n siteDisplayName: z\n .string()\n .describe('Display name for the new site.')\n .min(1)\n .max(40),\n }),\n});\nexport const DuplicateSiteResponse = z.object({\n newSiteId: z\n .string()\n .describe('ID of the new site.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n});\nexport const BulkDeleteSiteRequest = z.object({\n ids: z.array(z.string()).min(1).max(20),\n});\nexport const BulkDeleteSiteResponse = z.object({\n results: z\n .array(\n z.object({\n itemMetadata: z\n .object({\n _id: z.string().describe('Site ID.').optional().nullable(),\n originalIndex: z\n .number()\n .int()\n .describe(\n 'Index of the site in the request array. Allows for correlation between request and response.'\n )\n .optional(),\n success: z\n .boolean()\n .describe(\n 'Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated.'\n )\n .optional(),\n error: z\n .object({\n code: z.string().describe('Error code.').optional(),\n description: z\n .string()\n .describe('Description of error.')\n .optional(),\n })\n .describe('Details about the error.')\n .optional(),\n })\n .describe(\n 'Result of deletion request per site describing the success or failure of each deletion.'\n )\n .optional(),\n })\n )\n .optional(),\n bulkActionMetadata: z\n .object({\n totalSuccesses: z\n .number()\n .int()\n .describe('Number of sites that were deleted successfully.')\n .optional(),\n totalFailures: z\n .number()\n .int()\n .describe('Number of sites that were not deleted successfully.')\n .optional(),\n })\n .describe('Summary of deletion data.')\n .optional(),\n});\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n BulkDeleteSiteResponse,\n DeployStandalonePagesApplicationErrors,\n DuplicateSiteOptions,\n DuplicateSiteResponse,\n PublishSiteApplicationErrors,\n bulkDeleteSite as universalBulkDeleteSite,\n deployStandalonePages as universalDeployStandalonePages,\n duplicateSite as universalDuplicateSite,\n publishSite as universalPublishSite,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/sites' };\n\nexport function publishSite(\n httpClient: HttpClient,\n __options?: { validateRequestSchema?: boolean }\n): PublishSiteSignature {\n return () =>\n universalPublishSite(\n // @ts-ignore\n { httpClient, validateRequestSchema: __options?.validateRequestSchema }\n );\n}\n\ninterface PublishSiteSignature {\n /**\n * Publishes a site.\n *\n * Publishing a site makes any changes previously saved on the site available on the internet.\n * After publishing, changes to your site appear in the [site's history](https://support.wix.com/en/article/viewing-and-managing-your-site-history).\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\n (): Promise<\n void & {\n __applicationErrorsType?: PublishSiteApplicationErrors;\n }\n >;\n}\n\nexport function deployStandalonePages(\n httpClient: HttpClient,\n __options?: { validateRequestSchema?: boolean }\n): DeployStandalonePagesSignature {\n return () =>\n universalDeployStandalonePages(\n // @ts-ignore\n { httpClient, validateRequestSchema: __options?.validateRequestSchema }\n );\n}\n\ninterface DeployStandalonePagesSignature {\n /**\n * Publishes a headless site.\n *\n * Publishing only the headless pages of the site.\n *\n * When using an API key for authentication, include a `wix-site-id` header with the ID of the site you want to publish.\n */\n (): Promise<\n void & {\n __applicationErrorsType?: DeployStandalonePagesApplicationErrors;\n }\n >;\n}\n\nexport function duplicateSite(\n httpClient: HttpClient,\n __options?: { validateRequestSchema?: boolean }\n): DuplicateSiteSignature {\n return (\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n ) =>\n universalDuplicateSite(\n sourceSiteId,\n options,\n // @ts-ignore\n { httpClient, validateRequestSchema: __options?.validateRequestSchema }\n );\n}\n\ninterface DuplicateSiteSignature {\n /**\n * Duplicates a site with a new site name.\n *\n * > **Note:** When you duplicate a site, some business-related content such as store orders, contacts, invoices, and 3rd-party app settings are not be included.\n * > The duplicated site won’t have a domain or any Premium capabilities.\n *\n * Any installed apps that can be used only on sites with a Premium Plan, will be copied to the duplicated site and\n * will appear unactivated. Once the site is upgraded, the app will be available for use.\n *\n * > **Important:** This call requires an account level API key.\n * @param - ID of the site to duplicated.\n */\n (\n sourceSiteId: string,\n options: NonNullablePaths<DuplicateSiteOptions, `siteDisplayName`, 2>\n ): Promise<NonNullablePaths<DuplicateSiteResponse, `newSiteId`, 2>>;\n}\n\nexport function bulkDeleteSite(\n httpClient: HttpClient,\n __options?: { validateRequestSchema?: boolean }\n): BulkDeleteSiteSignature {\n return (ids: string[]) =>\n universalBulkDeleteSite(\n ids,\n // @ts-ignore\n { httpClient, validateRequestSchema: __options?.validateRequestSchema }\n );\n}\n\ninterface BulkDeleteSiteSignature {\n /**\n * This endpoint enables you to delete multiple sites.\n *\n * This is not a permanent delete. Sites are moved to the trash bin and can be restored through site collaborators.\n *\n * Learn more about [deleting multiple sites](https://support.wix.com/en/article/moving-a-site-to-trash).\n *\n * > **Important:** This call requires an account level API key.\n * @param - Site IDs.\n *\n * Min: 1 site ID <br>\n * Max: 20 site IDs\n */\n (ids: string[]): Promise<\n NonNullablePaths<\n BulkDeleteSiteResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`,\n 6\n >\n >;\n}\n\nexport {\n ApplicationError,\n BulkActionMetadata,\n BulkDeleteSiteRequest,\n BulkDeleteSiteResponse,\n BulkSiteResult,\n CreateAndAttachChildRequest,\n CreateAndAttachChildResponse,\n DeleteSiteFromTrashRequest,\n DeleteSiteFromTrashResponse,\n DeployStandalonePagesRequest,\n DeployStandalonePagesResponse,\n DuplicateSiteOptions,\n DuplicateSiteRequest,\n DuplicateSiteResponse,\n EmptyEntity,\n ItemMetadata,\n MoveSiteToTrashRequest,\n MoveSiteToTrashResponse,\n PublishSiteRequest,\n PublishSiteResponse,\n RenameSiteRequest,\n RenameSiteResponse,\n RestoreSiteFromTrashRequest,\n RestoreSiteFromTrashResponse,\n UnpublishSiteRequest,\n UnpublishSiteResponse,\n ValidateSiteNameRequest,\n ValidateSiteNameResponse,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n","import {\n publishSite as publicPublishSite,\n deployStandalonePages as publicDeployStandalonePages,\n duplicateSite as publicDuplicateSite,\n bulkDeleteSite as publicBulkDeleteSite,\n} from './site-actions-v1-site-actions-site-actions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const publishSite: MaybeContext<\n BuildRESTFunction<typeof publicPublishSite> & typeof publicPublishSite\n> = /*#__PURE__*/ createRESTModule(publicPublishSite);\nexport const deployStandalonePages: MaybeContext<\n BuildRESTFunction<typeof publicDeployStandalonePages> &\n typeof publicDeployStandalonePages\n> = /*#__PURE__*/ createRESTModule(publicDeployStandalonePages);\nexport const duplicateSite: MaybeContext<\n BuildRESTFunction<typeof publicDuplicateSite> & typeof publicDuplicateSite\n> = /*#__PURE__*/ createRESTModule(publicDuplicateSite);\nexport const bulkDeleteSite: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteSite> & typeof publicBulkDeleteSite\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteSite);\n\nexport {\n EmptyEntity,\n PublishSiteRequest,\n PublishSiteResponse,\n DeployStandalonePagesRequest,\n DeployStandalonePagesResponse,\n DuplicateSiteRequest,\n DuplicateSiteResponse,\n BulkDeleteSiteRequest,\n BulkDeleteSiteResponse,\n BulkSiteResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n RenameSiteRequest,\n RenameSiteResponse,\n ValidateSiteNameRequest,\n ValidateSiteNameResponse,\n UnpublishSiteRequest,\n UnpublishSiteResponse,\n MoveSiteToTrashRequest,\n MoveSiteToTrashResponse,\n RestoreSiteFromTrashRequest,\n RestoreSiteFromTrashResponse,\n DeleteSiteFromTrashRequest,\n DeleteSiteFromTrashResponse,\n CreateAndAttachChildRequest,\n CreateAndAttachChildResponse,\n DuplicateSiteOptions,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\nexport {\n PublishSiteApplicationErrors,\n DeployStandalonePagesApplicationErrors,\n} from './site-actions-v1-site-actions-site-actions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAAA;AAAA,EAAA,6BAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,mBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAA2B;AAI3B,SAAS,8CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,gCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,SAAS,iCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QAC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O,CAAC,QACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,YAAY,uBAAuB,WAAW,sBAAsB;AAAA,EACxE;AACJ;;;AC3GA,IAAAC,uBAAiC;AAG1B,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,yBAGK,2DAAiBA,sBAA2B;AACvD,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,kBAEK,2DAAiBA,eAAoB;","names":["bulkDeleteSite","deployStandalonePages","duplicateSite","publishSite","publishSite","sdkTransformError","deployStandalonePages","duplicateSite","bulkDeleteSite","publishSite","deployStandalonePages","duplicateSite","bulkDeleteSite","import_rest_modules","publishSite","deployStandalonePages","duplicateSite","bulkDeleteSite"]}
|
|
@@ -118,6 +118,19 @@ interface DeleteSiteFromTrashRequest {
|
|
|
118
118
|
}
|
|
119
119
|
interface DeleteSiteFromTrashResponse {
|
|
120
120
|
}
|
|
121
|
+
interface CreateAndAttachChildRequest {
|
|
122
|
+
/** @format GUID */
|
|
123
|
+
templateId?: string;
|
|
124
|
+
/**
|
|
125
|
+
* @minLength 1
|
|
126
|
+
* @maxLength 40
|
|
127
|
+
*/
|
|
128
|
+
name?: string;
|
|
129
|
+
}
|
|
130
|
+
interface CreateAndAttachChildResponse {
|
|
131
|
+
/** @format GUID */
|
|
132
|
+
childMetaSiteId?: string;
|
|
133
|
+
}
|
|
121
134
|
/** @docsIgnore */
|
|
122
135
|
type PublishSiteApplicationErrors = {
|
|
123
136
|
code?: 'SITE_IS_NOT_DEFINED_AS_PUBLISHABLE';
|
|
@@ -205,4 +218,4 @@ interface DuplicateSiteOptions {
|
|
|
205
218
|
*/
|
|
206
219
|
declare function bulkDeleteSite(ids: string[]): Promise<NonNullablePaths<BulkDeleteSiteResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures`, 6>>;
|
|
207
220
|
|
|
208
|
-
export { type ApplicationError, type BulkActionMetadata, type BulkDeleteSiteRequest, type BulkDeleteSiteResponse, type BulkSiteResult, type DeleteSiteFromTrashRequest, type DeleteSiteFromTrashResponse, type DeployStandalonePagesApplicationErrors, type DeployStandalonePagesRequest, type DeployStandalonePagesResponse, type DuplicateSiteOptions, type DuplicateSiteRequest, type DuplicateSiteResponse, type EmptyEntity, type ItemMetadata, type MoveSiteToTrashRequest, type MoveSiteToTrashResponse, type PublishSiteApplicationErrors, type PublishSiteRequest, type PublishSiteResponse, type RenameSiteRequest, type RenameSiteResponse, type RestoreSiteFromTrashRequest, type RestoreSiteFromTrashResponse, type UnpublishSiteRequest, type UnpublishSiteResponse, type ValidateSiteNameRequest, type ValidateSiteNameResponse, bulkDeleteSite, deployStandalonePages, duplicateSite, publishSite };
|
|
221
|
+
export { type ApplicationError, type BulkActionMetadata, type BulkDeleteSiteRequest, type BulkDeleteSiteResponse, type BulkSiteResult, type CreateAndAttachChildRequest, type CreateAndAttachChildResponse, type DeleteSiteFromTrashRequest, type DeleteSiteFromTrashResponse, type DeployStandalonePagesApplicationErrors, type DeployStandalonePagesRequest, type DeployStandalonePagesResponse, type DuplicateSiteOptions, type DuplicateSiteRequest, type DuplicateSiteResponse, type EmptyEntity, type ItemMetadata, type MoveSiteToTrashRequest, type MoveSiteToTrashResponse, type PublishSiteApplicationErrors, type PublishSiteRequest, type PublishSiteResponse, type RenameSiteRequest, type RenameSiteResponse, type RestoreSiteFromTrashRequest, type RestoreSiteFromTrashResponse, type UnpublishSiteRequest, type UnpublishSiteResponse, type ValidateSiteNameRequest, type ValidateSiteNameResponse, bulkDeleteSite, deployStandalonePages, duplicateSite, publishSite };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// index.typings.ts
|
|
@@ -171,9 +181,62 @@ function bulkDeleteSite(payload) {
|
|
|
171
181
|
return __bulkDeleteSite;
|
|
172
182
|
}
|
|
173
183
|
|
|
184
|
+
// src/site-actions-v1-site-actions-site-actions.schemas.ts
|
|
185
|
+
var z = __toESM(require("zod"));
|
|
186
|
+
var PublishSiteRequest = z.object({});
|
|
187
|
+
var PublishSiteResponse = z.object({});
|
|
188
|
+
var DeployStandalonePagesRequest = z.object({});
|
|
189
|
+
var DeployStandalonePagesResponse = z.object({});
|
|
190
|
+
var DuplicateSiteRequest = z.object({
|
|
191
|
+
sourceSiteId: z.string().describe("ID of the site to duplicated.").regex(
|
|
192
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
193
|
+
"Must be a valid GUID"
|
|
194
|
+
),
|
|
195
|
+
options: z.object({
|
|
196
|
+
siteDisplayName: z.string().describe("Display name for the new site.").min(1).max(40)
|
|
197
|
+
})
|
|
198
|
+
});
|
|
199
|
+
var DuplicateSiteResponse = z.object({
|
|
200
|
+
newSiteId: z.string().describe("ID of the new site.").regex(
|
|
201
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
202
|
+
"Must be a valid GUID"
|
|
203
|
+
).optional()
|
|
204
|
+
});
|
|
205
|
+
var BulkDeleteSiteRequest = z.object({
|
|
206
|
+
ids: z.array(z.string()).min(1).max(20)
|
|
207
|
+
});
|
|
208
|
+
var BulkDeleteSiteResponse = z.object({
|
|
209
|
+
results: z.array(
|
|
210
|
+
z.object({
|
|
211
|
+
itemMetadata: z.object({
|
|
212
|
+
_id: z.string().describe("Site ID.").optional().nullable(),
|
|
213
|
+
originalIndex: z.number().int().describe(
|
|
214
|
+
"Index of the site in the request array. Allows for correlation between request and response."
|
|
215
|
+
).optional(),
|
|
216
|
+
success: z.boolean().describe(
|
|
217
|
+
"Whether the requested action was successful for the site. When `false`, the action failed and an `error` object is populated."
|
|
218
|
+
).optional(),
|
|
219
|
+
error: z.object({
|
|
220
|
+
code: z.string().describe("Error code.").optional(),
|
|
221
|
+
description: z.string().describe("Description of error.").optional()
|
|
222
|
+
}).describe("Details about the error.").optional()
|
|
223
|
+
}).describe(
|
|
224
|
+
"Result of deletion request per site describing the success or failure of each deletion."
|
|
225
|
+
).optional()
|
|
226
|
+
})
|
|
227
|
+
).optional(),
|
|
228
|
+
bulkActionMetadata: z.object({
|
|
229
|
+
totalSuccesses: z.number().int().describe("Number of sites that were deleted successfully.").optional(),
|
|
230
|
+
totalFailures: z.number().int().describe("Number of sites that were not deleted successfully.").optional()
|
|
231
|
+
}).describe("Summary of deletion data.").optional()
|
|
232
|
+
});
|
|
233
|
+
|
|
174
234
|
// src/site-actions-v1-site-actions-site-actions.universal.ts
|
|
175
235
|
async function publishSite2() {
|
|
176
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
236
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[0];
|
|
237
|
+
if (validateRequestSchema) {
|
|
238
|
+
PublishSiteRequest.parse({});
|
|
239
|
+
}
|
|
177
240
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
178
241
|
const reqOpts = publishSite(payload);
|
|
179
242
|
sideEffects?.onSiteCall?.();
|
|
@@ -196,7 +259,10 @@ async function publishSite2() {
|
|
|
196
259
|
}
|
|
197
260
|
}
|
|
198
261
|
async function deployStandalonePages2() {
|
|
199
|
-
const { httpClient, sideEffects } = arguments[0];
|
|
262
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[0];
|
|
263
|
+
if (validateRequestSchema) {
|
|
264
|
+
DeployStandalonePagesRequest.parse({});
|
|
265
|
+
}
|
|
200
266
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
|
|
201
267
|
const reqOpts = deployStandalonePages(payload);
|
|
202
268
|
sideEffects?.onSiteCall?.();
|
|
@@ -219,7 +285,10 @@ async function deployStandalonePages2() {
|
|
|
219
285
|
}
|
|
220
286
|
}
|
|
221
287
|
async function duplicateSite2(sourceSiteId, options) {
|
|
222
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
288
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
289
|
+
if (validateRequestSchema) {
|
|
290
|
+
DuplicateSiteRequest.parse({ sourceSiteId, options });
|
|
291
|
+
}
|
|
223
292
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
224
293
|
sourceSiteId,
|
|
225
294
|
siteDisplayName: options?.siteDisplayName
|
|
@@ -248,7 +317,10 @@ async function duplicateSite2(sourceSiteId, options) {
|
|
|
248
317
|
}
|
|
249
318
|
}
|
|
250
319
|
async function bulkDeleteSite2(ids) {
|
|
251
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
320
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
321
|
+
if (validateRequestSchema) {
|
|
322
|
+
BulkDeleteSiteRequest.parse({ ids });
|
|
323
|
+
}
|
|
252
324
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ ids });
|
|
253
325
|
const reqOpts = bulkDeleteSite(payload);
|
|
254
326
|
sideEffects?.onSiteCall?.();
|