@wix/auto_sdk_seo_redirects 1.0.1 → 1.0.2

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.
@@ -66,7 +66,7 @@ interface GetRedirectSignature {
66
66
  declare function bulkCreateRedirects$1(httpClient: HttpClient): BulkCreateRedirectsSignature;
67
67
  interface BulkCreateRedirectsSignature {
68
68
  /**
69
- * Creates up to 500 redirects.
69
+ * Creates up to 100 redirects.
70
70
  *
71
71
  * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails
72
72
  * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/promote-seo-v1-redirect-redirects.public.ts","../../src/promote-seo-v1-redirect-redirects.universal.ts","../../src/promote-seo-v1-redirect-redirects.http.ts","../../src/promote-seo-v1-redirect-redirects.context.ts"],"sourcesContent":["export * from './src/promote-seo-v1-redirect-redirects.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n BulkCreateRedirectsOptionsForRequest,\n BulkCreateRedirectsResponse,\n BulkDeleteRedirectsResponse,\n CreateRedirectApplicationErrors,\n CreateRedirectOptionsForRequest,\n DeleteRedirectApplicationErrors,\n GetRedirectApplicationErrors,\n ListRedirectsResponse,\n Redirect,\n RedirectCreatedEnvelope,\n bulkCreateRedirects as universalBulkCreateRedirects,\n bulkDeleteRedirects as universalBulkDeleteRedirects,\n createRedirect as universalCreateRedirect,\n deleteRedirect as universalDeleteRedirect,\n getRedirect as universalGetRedirect,\n listRedirects as universalListRedirects,\n} from './promote-seo-v1-redirect-redirects.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function bulkDeleteRedirects(\n httpClient: HttpClient\n): BulkDeleteRedirectsSignature {\n return (redirectIds: string[]) =>\n universalBulkDeleteRedirects(\n redirectIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkDeleteRedirectsSignature {\n /**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n * @param - IDs of the redirects to delete.\n * @returns The response for deleting redirects in bulk.\n */\n (redirectIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function listRedirects(httpClient: HttpClient): ListRedirectsSignature {\n return () =>\n universalListRedirects(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListRedirectsSignature {\n /**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n * @returns The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n */\n (): Promise<\n NonNullablePaths<\n ListRedirectsResponse,\n | `redirects`\n | `redirects.${number}.from`\n | `redirects.${number}.to`\n | `redirects.${number}.options.groupRedirect`,\n 5\n >\n >;\n}\n\nexport function getRedirect(httpClient: HttpClient): GetRedirectSignature {\n return (redirectId: string) =>\n universalGetRedirect(\n redirectId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRedirectSignature {\n /**\n * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n * @param - ID of the redirect to retrieve.\n * @returns Retrieved redirect.\n */\n (redirectId: string): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: GetRedirectApplicationErrors;\n }\n >;\n}\n\nexport function bulkCreateRedirects(\n httpClient: HttpClient\n): BulkCreateRedirectsSignature {\n return (\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n ) =>\n universalBulkCreateRedirects(\n redirects,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCreateRedirectsSignature {\n /**\n * Creates up to 500 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n * @param - Redirects to create.\n * @returns The response for creating redirects in bulk\n */\n (\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n ): Promise<\n NonNullablePaths<\n BulkCreateRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function createRedirect(\n httpClient: HttpClient\n): CreateRedirectSignature {\n return (redirect: Redirect, options?: CreateRedirectOptionsForRequest) =>\n universalCreateRedirect(\n redirect,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateRedirectSignature {\n /**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n * @param - Redirect to create.\n * @returns Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n */\n (redirect: Redirect, options?: CreateRedirectOptionsForRequest): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: CreateRedirectApplicationErrors;\n }\n >;\n}\n\nexport function deleteRedirect(\n httpClient: HttpClient\n): DeleteRedirectSignature {\n return (redirectId: string) =>\n universalDeleteRedirect(\n redirectId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteRedirectSignature {\n /**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n * @param - ID of the redirect to delete.\n * @returns The response for deleting a single redirect\n */\n (redirectId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteRedirectApplicationErrors;\n }\n >;\n}\n\nexport const onRedirectCreated = /*#__PURE__*/ EventDefinition(\n 'wix.promote.seo.v1.redirect_created',\n true,\n (event: RedirectCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<RedirectCreatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n AddGroupRedirectsOptions,\n AddGroupRedirectsRequest,\n AddGroupRedirectsResponse,\n AddRedirectsOptions,\n AddRedirectsRequest,\n AddRedirectsResponse,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateRedirectsOptions,\n BulkCreateRedirectsOptionsForRequest,\n BulkCreateRedirectsRequest,\n BulkCreateRedirectsResponse,\n BulkDeleteRedirectsRequest,\n BulkDeleteRedirectsResponse,\n BulkRedirectResult,\n CleanupLanguageRedirectsRequest,\n CleanupLanguageRedirectsResponse,\n CreateRedirectOptions,\n CreateRedirectOptionsForRequest,\n CreateRedirectRequest,\n CreateRedirectResponse,\n DeleteRedirectRequest,\n DeleteRedirectResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetHttpStatusRequest,\n GetHttpStatusResponse,\n GetRedirectRequest,\n GetRedirectResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n ListRedirectsRequest,\n ListRedirectsResponse,\n MessageEnvelope,\n Redirect,\n RedirectCreatedEnvelope,\n RedirectOptions,\n RemoveGeneralRedirectRequest,\n RemoveGeneralRedirectResponse,\n RemoveGeneralRedirectsOptions,\n RestoreInfo,\n Source,\n WebhookIdentityType,\n} from './promote-seo-v1-redirect-redirects.universal.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 ambassadorWixPromoteSeoV1Redirect from './promote-seo-v1-redirect-redirects.http.js';\n\n/**\n * A redirect sends a visitor who requests one path on a site to another path or URL.\n *\n * Redirects keep old links working after a page is renamed or removed, consolidate duplicate URLs,\n * and point a whole section of a site somewhere else. A redirect returns a 301 permanent redirect,\n * takes effect on the live site immediately with no site publish, and takes precedence over a page\n * that exists at the same path.\n *\n * A redirect either matches its `from` path exactly, or matches everything under it when\n * `options.groupRedirect` is `true`. A redirect scoped to a `language` applies to that language\n * version of a multilingual site, and one with no `language` applies to every language.\n */\nexport interface Redirect {\n /**\n * Path on the site that the redirect starts from, URL-encoded. For example, `/old-page`.\n *\n * Can't be the site root. A path that differs from another redirect's `from` path only by a\n * trailing slash counts as the same path.\n *\n * For a redirect scoped to a `language`, specify the path with or without the language prefix:\n * the prefix is stripped, so a `fr` redirect from `/fr/about` is stored and returned as `/about`.\n * @maxLength 950\n */\n from?: string;\n /**\n * Where the redirect sends the visitor, URL-encoded. Either a path on the site, such as\n * `/new-page`, or a full URL, such as `https://example.com/page`.\n * @maxLength 4096\n */\n to?: string;\n /** How the redirect matches the paths a visitor requests. */\n options?: RedirectOptions;\n /**\n * Redirect source.\n *\n * Held internal: the enum is defined in the Redirector's own proto\n * (com/wixpress/redirector/api/v1/redirects.proto), so its values describe how *Wix* created the\n * route - REDIRECTOR (a user in the SEO tab), REDIRECTOR_NON_USER_FACING (an offline process),\n * PAGE_SLUG_RENAME (the editor renaming a page). That vocabulary means nothing to a third-party\n * caller, it leaks our internal write paths, the field is settable so a public caller could forge a\n * provenance it did not have, and we cannot version an enum another team owns.\n *\n * Internal callers keep it: advanced-seo-client writes PAGE_SLUG_RENAME when the editor\n * auto-creates a redirect, and the redirects BM component reads it to separate auto redirects from\n * user ones. A public caller's redirect therefore lands as REDIRECTOR, the default applied in\n * redirect-entity.ts, and is indistinguishable in the BM table from one a user typed. Surfacing\n * app-created redirects would need a new public-safe provenance field, not this one.\n *\n * Permanent - there is no feature waiting to ship behind this marker.\n * @internal\n */\n source?: SourceWithLiterals;\n /**\n * Language version of a multilingual site that the redirect applies to, as a 2-letter language\n * code or a language tag. For example, `fr` or `en-US`.\n *\n * When omitted, the redirect applies to every language on the site. A redirect scoped to a\n * language conflicts only with redirects in the same language and with redirects that apply to\n * every language.\n *\n * Deleting a redirect scoped to a language stops it taking effect, but it can still appear in\n * [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * @minLength 2\n * @maxLength 5\n */\n language?: string | null;\n /**\n * Redirect ID.\n *\n * You can specify your own ID when creating a redirect. When omitted, an ID is generated.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Date and time the redirect was created.\n *\n * Not returned by [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect). Call [Get Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/get-redirect) or [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) to retrieve it.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\n/** How a redirect matches the paths a visitor requests. */\nexport interface RedirectOptions {\n /**\n * Whether the redirect matches every path under its `from` path, carrying the rest of the URL\n * over to the target. For example, a group redirect from `/forum/questions/` to `/forum/faqs/`\n * sends `/forum/questions/my-post` to `/forum/faqs/my-post`. When `false`, only the exact `from`\n * path matches.\n *\n * A group redirect and an exact redirect that share a `from` path are two different redirects.\n *\n * Default: `false`\n */\n groupRedirect?: boolean;\n}\n\nexport enum Source {\n /** Unknown. */\n UNKNOWN_SOURCE = 'UNKNOWN_SOURCE',\n /** A route is created by user in SEO tab. */\n REDIRECTOR = 'REDIRECTOR',\n /** A route is created via offline process (e.g., blogs migration). */\n REDIRECTOR_NON_USER_FACING = 'REDIRECTOR_NON_USER_FACING',\n /** A route is created on page slug rename. */\n PAGE_SLUG_RENAME = 'PAGE_SLUG_RENAME',\n}\n\n/** @enumType */\nexport type SourceWithLiterals =\n | Source\n | 'UNKNOWN_SOURCE'\n | 'REDIRECTOR'\n | 'REDIRECTOR_NON_USER_FACING'\n | 'PAGE_SLUG_RENAME';\n\n/** The request for adding bulk redirects */\nexport interface AddRedirectsRequest {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n /** Extra options for adding bulk redirects */\n options?: AddRedirectsOptions;\n}\n\n/** Add bulk extra options and configurations */\nexport interface AddRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for adding bulk redirects */\nexport interface AddRedirectsResponse {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n}\n\n/** The request for adding group redirects */\nexport interface AddGroupRedirectsRequest {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n /** Extra options for adding group redirects */\n options?: AddGroupRedirectsOptions;\n}\n\n/** Add group extra options and configurations */\nexport interface AddGroupRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for adding group redirects */\nexport interface AddGroupRedirectsResponse {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n}\n\n/** The request for deleting redirects in bulk. */\nexport interface BulkDeleteRedirectsRequest {\n /**\n * IDs of the redirects to delete.\n * @minSize 1\n * @maxSize 500\n * @format GUID\n */\n redirectIds: string[];\n}\n\n/** The response for deleting redirects in bulk. */\nexport interface BulkDeleteRedirectsResponse {\n /**\n * Outcome of each ID, in request order. `originalIndex` is the ID's position in `redirectIds`.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. An ID that matches no redirect on the site fails with `REDIRECT_NOT_FOUND`, and\n * every other ID in the request is still deleted.\n * @maxSize 500\n */\n results?: BulkRedirectResult[];\n /** Number of redirects deleted and number that failed. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\n/** The result of creating a single redirect within a bulk request */\nexport interface BulkRedirectResult {\n /**\n * Whether this redirect succeeded, its position in the request as `originalIndex`, and the error\n * if it failed.\n *\n * A redirect that already exists on the site is reported as a success with no `id`, and nothing is\n * written for it.\n */\n itemMetadata?: ItemMetadata;\n /**\n * Created redirect.\n *\n * Returned only when `returnFullEntity` is `true` in the request. Never returned by Bulk Delete\n * Redirects.\n */\n item?: Redirect;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @maxLength 100\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\n/** The request for listing the site's redirects */\nexport interface ListRedirectsRequest {}\n\n/**\n * The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n */\nexport interface ListRedirectsResponse {\n /**\n * Retrieved redirects.\n *\n * Includes redirects that Wix created on the site owner's behalf, such as when a page's URL slug\n * is renamed in the editor. Empty when the site has no redirects.\n */\n redirects?: Redirect[];\n}\n\n/** The request for retrieving a single redirect by id */\nexport interface GetRedirectRequest {\n /**\n * ID of the redirect to retrieve.\n * @format GUID\n */\n redirectId: string;\n}\n\n/** The response for retrieving a single redirect */\nexport interface GetRedirectResponse {\n /** Retrieved redirect. */\n redirect?: Redirect;\n}\n\n/** The request for creating redirects in bulk. */\nexport interface BulkCreateRedirectsRequest {\n /**\n * Redirects to create.\n * @minSize 1\n * @maxSize 500\n */\n redirects: Redirect[];\n /**\n * Whether to return the created redirects in `results[].item`, and not only their metadata.\n *\n * Default: `false`\n */\n returnFullEntity?: boolean;\n /** Extra options for creating the redirects. */\n options?: BulkCreateRedirectsOptions;\n}\n\n/** Extra options for creating redirects in bulk. */\nexport interface BulkCreateRedirectsOptions {\n /**\n * Whether to delete a redirect on the site that already starts from the same `from` path and\n * create the new one in its place. When `false`, a redirect whose `from` path is taken fails with\n * `FROM_URL_EXISTS` while the rest of the request goes ahead.\n *\n * Applies only to redirects already on the site. A redirect that clashes with an earlier redirect\n * in the same request always fails. The replaced redirect is deleted for good, so retrieve it\n * first if you might need to restore it.\n *\n * Default: `false`\n */\n forceReplace?: boolean;\n}\n\n/** The response for creating redirects in bulk */\nexport interface BulkCreateRedirectsResponse {\n /**\n * Outcome of each redirect, in request order.\n * @maxSize 500\n */\n results?: BulkRedirectResult[];\n /**\n * Number of redirects created and number that failed.\n *\n * `undetailedFailures` counts redirects whose outcome is unknown. They may or may not have been\n * created, and they carry no error, so call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) to check them.\n */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\n/** The request for creating a redirect */\nexport interface CreateRedirectRequest {\n /** Redirect to create. */\n redirect: Redirect;\n /** Extra options for creating the redirect. */\n options?: CreateRedirectOptions;\n}\n\n/** Extra options for creating a redirect. */\nexport interface CreateRedirectOptions {\n /**\n * Whether to delete the redirect that already starts from the same `from` path and create the new\n * one in its place. When `false`, a taken `from` path fails the call with `FROM_URL_EXISTS`.\n *\n * The replaced redirect is deleted for good, so retrieve it first if you might need to restore it.\n *\n * Default: `false`\n */\n forceReplace?: boolean;\n}\n\n/** The response for creating a redirect */\nexport interface CreateRedirectResponse {\n /**\n * Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n */\n redirect?: Redirect;\n}\n\n/** The request for deleting a single redirect by id */\nexport interface DeleteRedirectRequest {\n /**\n * ID of the redirect to delete.\n * @format GUID\n */\n redirectId: string;\n}\n\n/** The response for deleting a single redirect */\nexport interface DeleteRedirectResponse {}\n\n/** The request for removing a general (all languages) redirect */\nexport interface RemoveGeneralRedirectRequest {\n /** general redirect to be removed. its language property should be empty */\n redirect?: Redirect;\n /**\n * language for which this general redirect should be removed\n * @minLength 2\n * @maxLength 5\n */\n applicableLanguage?: string | null;\n /** Extra options for removing general redirect */\n options?: RemoveGeneralRedirectsOptions;\n}\n\n/** remove general (all languages) redirect options and configurations */\nexport interface RemoveGeneralRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for removing a general (all languages) redirect */\nexport interface RemoveGeneralRedirectResponse {\n /** added redirects */\n redirects?: Redirect[];\n}\n\n/** The request for getting http status */\nexport interface GetHttpStatusRequest {\n /**\n * url\n * @maxLength 1000\n */\n url?: string | null;\n}\n\n/** The response for getting http status */\nexport interface GetHttpStatusResponse {\n /** http status code */\n status?: number | null;\n /**\n * http status text\n * @maxLength 100\n */\n statusText?: string | null;\n}\n\n/** Request to delete all redirects scoped to a specific language code. */\nexport interface CleanupLanguageRedirectsRequest {\n /**\n * Language code of redirects to remove (e.g. \"fr\", \"en-US\").\n * @minLength 2\n * @maxLength 5\n */\n languageCode?: string;\n}\n\n/**\n * Response with counts describing the cleanup outcome.\n * found_count vs removed_count lets callers detect partial failures\n * (a future per-batch failure-handling change may diverge the two).\n */\nexport interface CleanupLanguageRedirectsResponse {\n /** Number of redirects found for the given language before cleanup. */\n foundCount?: number;\n /** Number of redirects successfully removed for the given language. */\n removedCount?: number;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type GetRedirectApplicationErrors = {\n code?: 'REDIRECT_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type CreateRedirectApplicationErrors = {\n code?: 'FROM_URL_EXISTS';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteRedirectApplicationErrors = {\n code?: 'REDIRECT_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface RedirectCreatedEnvelope {\n entity: Redirect;\n metadata: EventMetadata;\n}\n\n/** @webhook\n * @eventType wix.promote.seo.v1.redirect_created\n * @serviceIdentifier com.wixpress.promote.seo.redirects.api.RedirectsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onRedirectCreated(\n handler: (event: RedirectCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n * @param redirectIds - IDs of the redirects to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectIds\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for deleting redirects in bulk.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkDeleteRedirects\n */\nexport async function bulkDeleteRedirects(\n redirectIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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({\n redirectIds: redirectIds,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1Redirect.bulkDeleteRedirects(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: { redirectIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.ListRedirects\n */\nexport async function listRedirects(): Promise<\n NonNullablePaths<\n ListRedirectsResponse,\n | `redirects`\n | `redirects.${number}.from`\n | `redirects.${number}.to`\n | `redirects.${number}.options.groupRedirect`,\n 5\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 = ambassadorWixPromoteSeoV1Redirect.listRedirects(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 * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n * @param redirectId - ID of the redirect to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectId\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Retrieved redirect.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.GetRedirect\n */\nexport async function getRedirect(redirectId: string): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: GetRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirectId: redirectId,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.getRedirect(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.redirect!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { redirectId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates up to 500 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n * @param redirects - Redirects to create.\n * @public\n * @documentationMaturity preview\n * @requiredField redirects\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for creating redirects in bulk\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkCreateRedirects\n */\nexport async function bulkCreateRedirects(\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n): Promise<\n NonNullablePaths<\n BulkCreateRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirects: redirects,\n returnFullEntity: options?.returnFullEntity,\n options: options?.options,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1Redirect.bulkCreateRedirects(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 redirects: '$[0]',\n returnFullEntity: '$[1].returnFullEntity',\n options: '$[1].options',\n },\n singleArgumentUnchanged: false,\n },\n ['redirects', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateRedirectsOptionsForRequest {\n /**\n * Whether to return the created redirects in `results[].item`, and not only their metadata.\n *\n * Default: `false`\n */\n returnFullEntity?: boolean;\n /** Extra options for creating the redirects. */\n options?: BulkCreateRedirectsOptions;\n}\n\n/**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n * @param redirect - Redirect to create.\n * @public\n * @documentationMaturity preview\n * @requiredField redirect\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.CreateRedirect\n */\nexport async function createRedirect(\n redirect: Redirect,\n options?: CreateRedirectOptionsForRequest\n): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: CreateRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirect: redirect,\n options: options?.options,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.createRedirect(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.redirect!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { redirect: '$[0]', options: '$[1].options' },\n singleArgumentUnchanged: false,\n },\n ['redirect', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateRedirectOptionsForRequest {\n /** Extra options for creating the redirect. */\n options?: CreateRedirectOptions;\n}\n\n/**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n * @param redirectId - ID of the redirect to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectId\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for deleting a single redirect\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.DeleteRedirect\n */\nexport async function deleteRedirect(redirectId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirectId: redirectId,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.deleteRedirect(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: { redirectId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/seo-redirects-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-redirects-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/seo-redirects-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_redirects';\n\n/**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n */\nexport function bulkDeleteRedirects(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteRedirects({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.BulkDeleteRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/bulk/redirects/delete',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.item.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkDeleteRedirects;\n}\n\n/**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n */\nexport function listRedirects(payload: object): RequestOptionsFactory<any> {\n function __listRedirects({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.ListRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirects.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listRedirects;\n}\n\n/**\n * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n */\nexport function getRedirect(payload: object): RequestOptionsFactory<any> {\n function __getRedirect({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.GetRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects/{redirectId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getRedirect;\n}\n\n/**\n * Creates up to 500 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n */\nexport function bulkCreateRedirects(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCreateRedirects({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'redirects.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.BulkCreateRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/bulk/redirects/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.item.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateRedirects;\n}\n\n/**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n */\nexport function createRedirect(payload: object): RequestOptionsFactory<any> {\n function __createRedirect({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.CreateRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/create-redirect',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createRedirect;\n}\n\n/**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n */\nexport function deleteRedirect(payload: object): RequestOptionsFactory<any> {\n function __deleteRedirect({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.DeleteRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects/{redirectId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteRedirect;\n}\n","import {\n bulkDeleteRedirects as publicBulkDeleteRedirects,\n listRedirects as publicListRedirects,\n getRedirect as publicGetRedirect,\n bulkCreateRedirects as publicBulkCreateRedirects,\n createRedirect as publicCreateRedirect,\n deleteRedirect as publicDeleteRedirect,\n} from './promote-seo-v1-redirect-redirects.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onRedirectCreated as publicOnRedirectCreated } from './promote-seo-v1-redirect-redirects.public.js';\n\nexport const bulkDeleteRedirects: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteRedirects> &\n typeof publicBulkDeleteRedirects\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteRedirects);\nexport const listRedirects: MaybeContext<\n BuildRESTFunction<typeof publicListRedirects> & typeof publicListRedirects\n> = /*#__PURE__*/ createRESTModule(publicListRedirects);\nexport const getRedirect: MaybeContext<\n BuildRESTFunction<typeof publicGetRedirect> & typeof publicGetRedirect\n> = /*#__PURE__*/ createRESTModule(publicGetRedirect);\nexport const bulkCreateRedirects: MaybeContext<\n BuildRESTFunction<typeof publicBulkCreateRedirects> &\n typeof publicBulkCreateRedirects\n> = /*#__PURE__*/ createRESTModule(publicBulkCreateRedirects);\nexport const createRedirect: MaybeContext<\n BuildRESTFunction<typeof publicCreateRedirect> & typeof publicCreateRedirect\n> = /*#__PURE__*/ createRESTModule(publicCreateRedirect);\nexport const deleteRedirect: MaybeContext<\n BuildRESTFunction<typeof publicDeleteRedirect> & typeof publicDeleteRedirect\n> = /*#__PURE__*/ createRESTModule(publicDeleteRedirect);\n/** */\nexport const onRedirectCreated: BuildEventDefinition<\n typeof publicOnRedirectCreated\n> &\n typeof publicOnRedirectCreated = /*#__PURE__*/ createEventModule(\n publicOnRedirectCreated\n);\n\nexport {\n Source,\n WebhookIdentityType,\n} from './promote-seo-v1-redirect-redirects.universal.js';\nexport {\n Redirect,\n RedirectOptions,\n AddRedirectsRequest,\n AddRedirectsOptions,\n AddRedirectsResponse,\n AddGroupRedirectsRequest,\n AddGroupRedirectsOptions,\n AddGroupRedirectsResponse,\n BulkDeleteRedirectsRequest,\n BulkDeleteRedirectsResponse,\n BulkRedirectResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n ListRedirectsRequest,\n ListRedirectsResponse,\n GetRedirectRequest,\n GetRedirectResponse,\n BulkCreateRedirectsRequest,\n BulkCreateRedirectsOptions,\n BulkCreateRedirectsResponse,\n CreateRedirectRequest,\n CreateRedirectOptions,\n CreateRedirectResponse,\n DeleteRedirectRequest,\n DeleteRedirectResponse,\n RemoveGeneralRedirectRequest,\n RemoveGeneralRedirectsOptions,\n RemoveGeneralRedirectResponse,\n GetHttpStatusRequest,\n GetHttpStatusResponse,\n CleanupLanguageRedirectsRequest,\n CleanupLanguageRedirectsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n RedirectCreatedEnvelope,\n BulkCreateRedirectsOptionsForRequest,\n CreateRedirectOptionsForRequest,\n} from './promote-seo-v1-redirect-redirects.universal.js';\nexport {\n SourceWithLiterals,\n WebhookIdentityTypeWithLiterals,\n GetRedirectApplicationErrors,\n CreateRedirectApplicationErrors,\n DeleteRedirectApplicationErrors,\n} from './promote-seo-v1-redirect-redirects.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,mBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,yBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,4DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MAC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CAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA2B;;;AG5R3B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAEhD,IAAMC,qBAGoC;AAAA,EAC/C;AACF;","names":["bulkCreateRedirects","bulkDeleteRedirects","createRedirect","deleteRedirect","getRedirect","listRedirects","onRedirectCreated","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","Source","WebhookIdentityType","bulkDeleteRedirects","sdkTransformError","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","bulkDeleteRedirects","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","import_rest_modules","bulkDeleteRedirects","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","onRedirectCreated"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/promote-seo-v1-redirect-redirects.public.ts","../../src/promote-seo-v1-redirect-redirects.universal.ts","../../src/promote-seo-v1-redirect-redirects.http.ts","../../src/promote-seo-v1-redirect-redirects.context.ts"],"sourcesContent":["export * from './src/promote-seo-v1-redirect-redirects.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n BulkCreateRedirectsOptionsForRequest,\n BulkCreateRedirectsResponse,\n BulkDeleteRedirectsResponse,\n CreateRedirectApplicationErrors,\n CreateRedirectOptionsForRequest,\n DeleteRedirectApplicationErrors,\n GetRedirectApplicationErrors,\n ListRedirectsResponse,\n Redirect,\n RedirectCreatedEnvelope,\n bulkCreateRedirects as universalBulkCreateRedirects,\n bulkDeleteRedirects as universalBulkDeleteRedirects,\n createRedirect as universalCreateRedirect,\n deleteRedirect as universalDeleteRedirect,\n getRedirect as universalGetRedirect,\n listRedirects as universalListRedirects,\n} from './promote-seo-v1-redirect-redirects.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function bulkDeleteRedirects(\n httpClient: HttpClient\n): BulkDeleteRedirectsSignature {\n return (redirectIds: string[]) =>\n universalBulkDeleteRedirects(\n redirectIds,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkDeleteRedirectsSignature {\n /**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n * @param - IDs of the redirects to delete.\n * @returns The response for deleting redirects in bulk.\n */\n (redirectIds: string[]): Promise<\n NonNullablePaths<\n BulkDeleteRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function listRedirects(httpClient: HttpClient): ListRedirectsSignature {\n return () =>\n universalListRedirects(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListRedirectsSignature {\n /**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n * @returns The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n */\n (): Promise<\n NonNullablePaths<\n ListRedirectsResponse,\n | `redirects`\n | `redirects.${number}.from`\n | `redirects.${number}.to`\n | `redirects.${number}.options.groupRedirect`,\n 5\n >\n >;\n}\n\nexport function getRedirect(httpClient: HttpClient): GetRedirectSignature {\n return (redirectId: string) =>\n universalGetRedirect(\n redirectId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRedirectSignature {\n /**\n * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n * @param - ID of the redirect to retrieve.\n * @returns Retrieved redirect.\n */\n (redirectId: string): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: GetRedirectApplicationErrors;\n }\n >;\n}\n\nexport function bulkCreateRedirects(\n httpClient: HttpClient\n): BulkCreateRedirectsSignature {\n return (\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n ) =>\n universalBulkCreateRedirects(\n redirects,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface BulkCreateRedirectsSignature {\n /**\n * Creates up to 100 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n * @param - Redirects to create.\n * @returns The response for creating redirects in bulk\n */\n (\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n ): Promise<\n NonNullablePaths<\n BulkCreateRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n >;\n}\n\nexport function createRedirect(\n httpClient: HttpClient\n): CreateRedirectSignature {\n return (redirect: Redirect, options?: CreateRedirectOptionsForRequest) =>\n universalCreateRedirect(\n redirect,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateRedirectSignature {\n /**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n * @param - Redirect to create.\n * @returns Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n */\n (redirect: Redirect, options?: CreateRedirectOptionsForRequest): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: CreateRedirectApplicationErrors;\n }\n >;\n}\n\nexport function deleteRedirect(\n httpClient: HttpClient\n): DeleteRedirectSignature {\n return (redirectId: string) =>\n universalDeleteRedirect(\n redirectId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteRedirectSignature {\n /**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n * @param - ID of the redirect to delete.\n * @returns The response for deleting a single redirect\n */\n (redirectId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteRedirectApplicationErrors;\n }\n >;\n}\n\nexport const onRedirectCreated = /*#__PURE__*/ EventDefinition(\n 'wix.promote.seo.v1.redirect_created',\n true,\n (event: RedirectCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<RedirectCreatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n AddGroupRedirectsOptions,\n AddGroupRedirectsRequest,\n AddGroupRedirectsResponse,\n AddRedirectsOptions,\n AddRedirectsRequest,\n AddRedirectsResponse,\n ApplicationError,\n BaseEventMetadata,\n BulkActionMetadata,\n BulkCreateRedirectsOptions,\n BulkCreateRedirectsOptionsForRequest,\n BulkCreateRedirectsRequest,\n BulkCreateRedirectsResponse,\n BulkDeleteRedirectsRequest,\n BulkDeleteRedirectsResponse,\n BulkRedirectResult,\n CleanupLanguageRedirectsRequest,\n CleanupLanguageRedirectsResponse,\n CreateRedirectOptions,\n CreateRedirectOptionsForRequest,\n CreateRedirectRequest,\n CreateRedirectResponse,\n DeleteRedirectRequest,\n DeleteRedirectResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetHttpStatusRequest,\n GetHttpStatusResponse,\n GetRedirectRequest,\n GetRedirectResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ItemMetadata,\n ListRedirectsRequest,\n ListRedirectsResponse,\n MessageEnvelope,\n Redirect,\n RedirectCreatedEnvelope,\n RedirectOptions,\n RemoveGeneralRedirectRequest,\n RemoveGeneralRedirectResponse,\n RemoveGeneralRedirectsOptions,\n RestoreInfo,\n Source,\n WebhookIdentityType,\n} from './promote-seo-v1-redirect-redirects.universal.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 ambassadorWixPromoteSeoV1Redirect from './promote-seo-v1-redirect-redirects.http.js';\n\n/**\n * A redirect sends a visitor who requests one path on a site to another path or URL.\n *\n * Redirects keep old links working after a page is renamed or removed, consolidate duplicate URLs,\n * and point a whole section of a site somewhere else. A redirect returns a 301 permanent redirect,\n * takes effect on the live site immediately with no site publish, and takes precedence over a page\n * that exists at the same path.\n *\n * A redirect either matches its `from` path exactly, or matches everything under it when\n * `options.groupRedirect` is `true`. A redirect scoped to a `language` applies to that language\n * version of a multilingual site, and one with no `language` applies to every language.\n */\nexport interface Redirect {\n /**\n * Path on the site that the redirect starts from, URL-encoded. For example, `/old-page`.\n *\n * Can't be the site root. A path that differs from another redirect's `from` path only by a\n * trailing slash counts as the same path.\n *\n * For a redirect scoped to a `language`, specify the path with or without the language prefix:\n * the prefix is stripped, so a `fr` redirect from `/fr/about` is stored and returned as `/about`.\n * @maxLength 950\n */\n from?: string;\n /**\n * Where the redirect sends the visitor, URL-encoded. Either a path on the site, such as\n * `/new-page`, or a full URL, such as `https://example.com/page`.\n * @maxLength 4096\n */\n to?: string;\n /** How the redirect matches the paths a visitor requests. */\n options?: RedirectOptions;\n /**\n * Redirect source.\n *\n * Held internal: the enum is defined in the Redirector's own proto\n * (com/wixpress/redirector/api/v1/redirects.proto), so its values describe how *Wix* created the\n * route - REDIRECTOR (a user in the SEO tab), REDIRECTOR_NON_USER_FACING (an offline process),\n * PAGE_SLUG_RENAME (the editor renaming a page). That vocabulary means nothing to a third-party\n * caller, it leaks our internal write paths, the field is settable so a public caller could forge a\n * provenance it did not have, and we cannot version an enum another team owns.\n *\n * Internal callers keep it: advanced-seo-client writes PAGE_SLUG_RENAME when the editor\n * auto-creates a redirect, and the redirects BM component reads it to separate auto redirects from\n * user ones. A public caller's redirect therefore lands as REDIRECTOR, the default applied in\n * redirect-entity.ts, and is indistinguishable in the BM table from one a user typed. Surfacing\n * app-created redirects would need a new public-safe provenance field, not this one.\n *\n * Permanent - there is no feature waiting to ship behind this marker.\n * @internal\n */\n source?: SourceWithLiterals;\n /**\n * Language version of a multilingual site that the redirect applies to, as a 2-letter language\n * code or a language tag. For example, `fr` or `en-US`.\n *\n * When omitted, the redirect applies to every language on the site. A redirect scoped to a\n * language conflicts only with redirects in the same language and with redirects that apply to\n * every language.\n *\n * Deleting a redirect scoped to a language stops it taking effect, but it can still appear in\n * [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * @minLength 2\n * @maxLength 5\n */\n language?: string | null;\n /**\n * Redirect ID.\n *\n * You can specify your own ID when creating a redirect. When omitted, an ID is generated.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Date and time the redirect was created.\n *\n * Not returned by [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect). Call [Get Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/get-redirect) or [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) to retrieve it.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\n/** How a redirect matches the paths a visitor requests. */\nexport interface RedirectOptions {\n /**\n * Whether the redirect matches every path under its `from` path, carrying the rest of the URL\n * over to the target. For example, a group redirect from `/forum/questions/` to `/forum/faqs/`\n * sends `/forum/questions/my-post` to `/forum/faqs/my-post`. When `false`, only the exact `from`\n * path matches.\n *\n * A group redirect and an exact redirect that share a `from` path are two different redirects.\n *\n * Default: `false`\n */\n groupRedirect?: boolean;\n}\n\nexport enum Source {\n /** Unknown. */\n UNKNOWN_SOURCE = 'UNKNOWN_SOURCE',\n /** A route is created by user in SEO tab. */\n REDIRECTOR = 'REDIRECTOR',\n /** A route is created via offline process (e.g., blogs migration). */\n REDIRECTOR_NON_USER_FACING = 'REDIRECTOR_NON_USER_FACING',\n /** A route is created on page slug rename. */\n PAGE_SLUG_RENAME = 'PAGE_SLUG_RENAME',\n}\n\n/** @enumType */\nexport type SourceWithLiterals =\n | Source\n | 'UNKNOWN_SOURCE'\n | 'REDIRECTOR'\n | 'REDIRECTOR_NON_USER_FACING'\n | 'PAGE_SLUG_RENAME';\n\n/** The request for adding bulk redirects */\nexport interface AddRedirectsRequest {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n /** Extra options for adding bulk redirects */\n options?: AddRedirectsOptions;\n}\n\n/** Add bulk extra options and configurations */\nexport interface AddRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for adding bulk redirects */\nexport interface AddRedirectsResponse {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n}\n\n/** The request for adding group redirects */\nexport interface AddGroupRedirectsRequest {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n /** Extra options for adding group redirects */\n options?: AddGroupRedirectsOptions;\n}\n\n/** Add group extra options and configurations */\nexport interface AddGroupRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for adding group redirects */\nexport interface AddGroupRedirectsResponse {\n /**\n * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The\n * service chunks larger batches, but an unbounded request array is a memory risk with no caller\n * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.\n *\n * No `minSize`: the service already rejects an empty array with its own message, and adding one\n * here would add a second field violation to this deprecated endpoint's error payload.\n * @maxSize 500\n */\n redirects?: Redirect[];\n}\n\n/** The request for deleting redirects in bulk. */\nexport interface BulkDeleteRedirectsRequest {\n /**\n * IDs of the redirects to delete.\n * @minSize 1\n * @maxSize 500\n * @format GUID\n */\n redirectIds: string[];\n}\n\n/** The response for deleting redirects in bulk. */\nexport interface BulkDeleteRedirectsResponse {\n /**\n * Outcome of each ID, in request order. `originalIndex` is the ID's position in `redirectIds`.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. An ID that matches no redirect on the site fails with `REDIRECT_NOT_FOUND`, and\n * every other ID in the request is still deleted.\n * @maxSize 500\n */\n results?: BulkRedirectResult[];\n /** Number of redirects deleted and number that failed. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\n/** The result of creating a single redirect within a bulk request */\nexport interface BulkRedirectResult {\n /**\n * Whether this redirect succeeded, its position in the request as `originalIndex`, and the error\n * if it failed.\n *\n * A redirect that already exists on the site is reported as a success with no `id`, and nothing is\n * written for it.\n */\n itemMetadata?: ItemMetadata;\n /**\n * Created redirect.\n *\n * Returned only when `returnFullEntity` is `true` in the request. Never returned by Bulk Delete\n * Redirects.\n */\n item?: Redirect;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @maxLength 100\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\n/** The request for listing the site's redirects */\nexport interface ListRedirectsRequest {}\n\n/**\n * The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n */\nexport interface ListRedirectsResponse {\n /**\n * Retrieved redirects.\n *\n * Includes redirects that Wix created on the site owner's behalf, such as when a page's URL slug\n * is renamed in the editor. Empty when the site has no redirects.\n */\n redirects?: Redirect[];\n}\n\n/** The request for retrieving a single redirect by id */\nexport interface GetRedirectRequest {\n /**\n * ID of the redirect to retrieve.\n * @format GUID\n */\n redirectId: string;\n}\n\n/** The response for retrieving a single redirect */\nexport interface GetRedirectResponse {\n /** Retrieved redirect. */\n redirect?: Redirect;\n}\n\n/** The request for creating redirects in bulk. */\nexport interface BulkCreateRedirectsRequest {\n /**\n * Redirects to create.\n * @minSize 1\n * @maxSize 100\n */\n redirects: Redirect[];\n /**\n * Whether to return the created redirects in `results[].item`, and not only their metadata.\n *\n * Default: `false`\n */\n returnFullEntity?: boolean;\n /** Extra options for creating the redirects. */\n options?: BulkCreateRedirectsOptions;\n}\n\n/** Extra options for creating redirects in bulk. */\nexport interface BulkCreateRedirectsOptions {\n /**\n * Whether to delete a redirect on the site that already starts from the same `from` path and\n * create the new one in its place. When `false`, a redirect whose `from` path is taken fails with\n * `FROM_URL_EXISTS` while the rest of the request goes ahead.\n *\n * Applies only to redirects already on the site. A redirect that clashes with an earlier redirect\n * in the same request always fails. The replaced redirect is deleted for good, so retrieve it\n * first if you might need to restore it.\n *\n * Default: `false`\n */\n forceReplace?: boolean;\n}\n\n/** The response for creating redirects in bulk */\nexport interface BulkCreateRedirectsResponse {\n /**\n * Outcome of each redirect, in request order.\n * @maxSize 100\n */\n results?: BulkRedirectResult[];\n /**\n * Number of redirects created and number that failed.\n *\n * `undetailedFailures` counts redirects whose outcome is unknown. They may or may not have been\n * created, and they carry no error, so call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) to check them.\n */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\n/** The request for creating a redirect */\nexport interface CreateRedirectRequest {\n /** Redirect to create. */\n redirect: Redirect;\n /** Extra options for creating the redirect. */\n options?: CreateRedirectOptions;\n}\n\n/** Extra options for creating a redirect. */\nexport interface CreateRedirectOptions {\n /**\n * Whether to delete the redirect that already starts from the same `from` path and create the new\n * one in its place. When `false`, a taken `from` path fails the call with `FROM_URL_EXISTS`.\n *\n * The replaced redirect is deleted for good, so retrieve it first if you might need to restore it.\n *\n * Default: `false`\n */\n forceReplace?: boolean;\n}\n\n/** The response for creating a redirect */\nexport interface CreateRedirectResponse {\n /**\n * Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n */\n redirect?: Redirect;\n}\n\n/** The request for deleting a single redirect by id */\nexport interface DeleteRedirectRequest {\n /**\n * ID of the redirect to delete.\n * @format GUID\n */\n redirectId: string;\n}\n\n/** The response for deleting a single redirect */\nexport interface DeleteRedirectResponse {}\n\n/** The request for removing a general (all languages) redirect */\nexport interface RemoveGeneralRedirectRequest {\n /** general redirect to be removed. its language property should be empty */\n redirect?: Redirect;\n /**\n * language for which this general redirect should be removed\n * @minLength 2\n * @maxLength 5\n */\n applicableLanguage?: string | null;\n /** Extra options for removing general redirect */\n options?: RemoveGeneralRedirectsOptions;\n}\n\n/** remove general (all languages) redirect options and configurations */\nexport interface RemoveGeneralRedirectsOptions {\n /** Should be true if the domain will be included to the redirect */\n requireDomain?: boolean;\n}\n\n/** The response for removing a general (all languages) redirect */\nexport interface RemoveGeneralRedirectResponse {\n /** added redirects */\n redirects?: Redirect[];\n}\n\n/** The request for getting http status */\nexport interface GetHttpStatusRequest {\n /**\n * url\n * @maxLength 1000\n */\n url?: string | null;\n}\n\n/** The response for getting http status */\nexport interface GetHttpStatusResponse {\n /** http status code */\n status?: number | null;\n /**\n * http status text\n * @maxLength 100\n */\n statusText?: string | null;\n}\n\n/** Request to delete all redirects scoped to a specific language code. */\nexport interface CleanupLanguageRedirectsRequest {\n /**\n * Language code of redirects to remove (e.g. \"fr\", \"en-US\").\n * @minLength 2\n * @maxLength 5\n */\n languageCode?: string;\n}\n\n/**\n * Response with counts describing the cleanup outcome.\n * found_count vs removed_count lets callers detect partial failures\n * (a future per-batch failure-handling change may diverge the two).\n */\nexport interface CleanupLanguageRedirectsResponse {\n /** Number of redirects found for the given language before cleanup. */\n foundCount?: number;\n /** Number of redirects successfully removed for the given language. */\n removedCount?: number;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type GetRedirectApplicationErrors = {\n code?: 'REDIRECT_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type CreateRedirectApplicationErrors = {\n code?: 'FROM_URL_EXISTS';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type DeleteRedirectApplicationErrors = {\n code?: 'REDIRECT_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface RedirectCreatedEnvelope {\n entity: Redirect;\n metadata: EventMetadata;\n}\n\n/** @webhook\n * @eventType wix.promote.seo.v1.redirect_created\n * @serviceIdentifier com.wixpress.promote.seo.redirects.api.RedirectsService\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onRedirectCreated(\n handler: (event: RedirectCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n * @param redirectIds - IDs of the redirects to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectIds\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for deleting redirects in bulk.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkDeleteRedirects\n */\nexport async function bulkDeleteRedirects(\n redirectIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\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({\n redirectIds: redirectIds,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1Redirect.bulkDeleteRedirects(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: { redirectIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response for listing the site's redirects.\n *\n * Unpaged, so there is no paging_metadata: the Redirector's Get returns every redirect for the\n * site in a single response and offers no paging or filtering of its own. Paging here would mean\n * reading the whole set and then slicing it, which costs the same and buys the caller nothing.\n * Revisit if the Redirector ever gains real paging.\n *\n * Unbounded for the same reason, mirroring the Redirector's own GetResponse.redirects, which\n * declares no maxSize. The 500 in the Redirector's protos bounds its bulk *write* requests\n * (Upsert, Remove, Validate); it is not a ceiling on how many redirects a site can hold.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.ListRedirects\n */\nexport async function listRedirects(): Promise<\n NonNullablePaths<\n ListRedirectsResponse,\n | `redirects`\n | `redirects.${number}.from`\n | `redirects.${number}.to`\n | `redirects.${number}.options.groupRedirect`,\n 5\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 = ambassadorWixPromoteSeoV1Redirect.listRedirects(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 * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n * @param redirectId - ID of the redirect to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectId\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Retrieved redirect.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.GetRedirect\n */\nexport async function getRedirect(redirectId: string): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: GetRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirectId: redirectId,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.getRedirect(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.redirect!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { redirectId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates up to 100 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n * @param redirects - Redirects to create.\n * @public\n * @documentationMaturity preview\n * @requiredField redirects\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for creating redirects in bulk\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.BulkCreateRedirects\n */\nexport async function bulkCreateRedirects(\n redirects: Redirect[],\n options?: BulkCreateRedirectsOptionsForRequest\n): Promise<\n NonNullablePaths<\n BulkCreateRedirectsResponse,\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 | `results.${number}.item.from`\n | `results.${number}.item.to`\n | `results.${number}.item.options.groupRedirect`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirects: redirects,\n returnFullEntity: options?.returnFullEntity,\n options: options?.options,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1Redirect.bulkCreateRedirects(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 redirects: '$[0]',\n returnFullEntity: '$[1].returnFullEntity',\n options: '$[1].options',\n },\n singleArgumentUnchanged: false,\n },\n ['redirects', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateRedirectsOptionsForRequest {\n /**\n * Whether to return the created redirects in `results[].item`, and not only their metadata.\n *\n * Default: `false`\n */\n returnFullEntity?: boolean;\n /** Extra options for creating the redirects. */\n options?: BulkCreateRedirectsOptions;\n}\n\n/**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n * @param redirect - Redirect to create.\n * @public\n * @documentationMaturity preview\n * @requiredField redirect\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns Created redirect.\n *\n * `createdDate` isn't returned. When the site already has an identical redirect, the redirect from\n * the request is returned as is, without an `id`.\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.CreateRedirect\n */\nexport async function createRedirect(\n redirect: Redirect,\n options?: CreateRedirectOptionsForRequest\n): Promise<\n NonNullablePaths<Redirect, `from` | `to` | `options.groupRedirect`, 3> & {\n __applicationErrorsType?: CreateRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirect: redirect,\n options: options?.options,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.createRedirect(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.redirect!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { redirect: '$[0]', options: '$[1].options' },\n singleArgumentUnchanged: false,\n },\n ['redirect', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CreateRedirectOptionsForRequest {\n /** Extra options for creating the redirect. */\n options?: CreateRedirectOptions;\n}\n\n/**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n * @param redirectId - ID of the redirect to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField redirectId\n * @permissionId wix-seo.edit\n * @applicableIdentity APP\n * @returns The response for deleting a single redirect\n * @fqn com.wixpress.promote.seo.redirects.api.RedirectsService.DeleteRedirect\n */\nexport async function deleteRedirect(redirectId: string): Promise<\n void & {\n __applicationErrorsType?: DeleteRedirectApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n redirectId: redirectId,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV1Redirect.deleteRedirect(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: { redirectId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['redirectId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_serverless/seo-redirects-service',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/seo-redirects-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-redirects-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/seo-redirects-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_redirects';\n\n/**\n * Deletes up to 500 redirects by ID.\n *\n * Each ID succeeds or fails on its own. An ID that matches no redirect on the site fails with\n * `REDIRECT_NOT_FOUND` while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirectIds`\n * list, is rejected as a whole and returns no results.\n *\n * A successful item means the redirect was found and its deletion was sent, not that the deletion\n * is confirmed. Call [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects) if you need to confirm the outcome.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n * [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) behaves the same way.\n *\n * To delete a single redirect, call [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect).\n */\nexport function bulkDeleteRedirects(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteRedirects({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.BulkDeleteRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/bulk/redirects/delete',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.item.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkDeleteRedirects;\n}\n\n/**\n * Retrieves every redirect on the site.\n *\n * The response isn't paged and the method takes no filter or sort, so filter the returned list on\n * your side. A site with no redirects returns an empty list.\n *\n * A redirect that Wix created on the site owner's behalf, such as when a page's URL slug is\n * renamed in the editor, is returned alongside the ones created through this API.\n */\nexport function listRedirects(payload: object): RequestOptionsFactory<any> {\n function __listRedirects({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.ListRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirects.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listRedirects;\n}\n\n/**\n * Retrieves a redirect by ID.\n *\n * Call this method before [Delete Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/delete-redirect) and [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect) when changing an existing redirect,\n * and keep the response: the create fills any field you omit with its default rather than with the\n * redirect's previous value.\n */\nexport function getRedirect(payload: object): RequestOptionsFactory<any> {\n function __getRedirect({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.GetRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects/{redirectId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getRedirect;\n}\n\n/**\n * Creates up to 100 redirects.\n *\n * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails\n * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request\n * fails with `REDIRECT_LOOP`, while the rest of the request goes ahead. Read those failures from\n * `results[].itemMetadata.error` in a successful response, matched to the request by\n * `results[].itemMetadata.originalIndex`. A malformed request, such as an empty `redirects` list,\n * is rejected as a whole and returns no results.\n *\n * A redirect that already exists with the same `from`, `to`, and `options.groupRedirect` is\n * reported as a success with no `id`, and nothing is written for it.\n *\n * A redirect that closes a loop with a redirect already on the site is created, and the\n * loop-closing redirect is deleted. `options.forceReplace` does the same for a `from` path that's\n * already taken by a redirect on the site, instead of failing that redirect. Neither deletion can\n * be undone, so retrieve those redirects first if you need to restore them.\n *\n * To create a single redirect, call [Create Redirect](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/create-redirect).\n */\nexport function bulkCreateRedirects(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkCreateRedirects({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'redirects.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.BulkCreateRedirects',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/bulk/redirects/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'results.item.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateRedirects;\n}\n\n/**\n * Creates a redirect.\n *\n * The `from` path can't be the site root, and can't already belong to another redirect unless\n * `options.forceReplace` is `true`. With `options.forceReplace`, the redirect that holds the path\n * is deleted and the new one is created in its place.\n *\n * If the redirect would close a loop, meaning an existing redirect starts at the path this one\n * points to, the redirect that closes the loop is deleted and the create proceeds. Both a\n * conflicting redirect replaced this way and a loop-closing redirect are gone for good, so\n * retrieve them first if you need to restore them.\n *\n * Creating a redirect that already exists with the same `from`, `to`, and `options.groupRedirect`\n * changes nothing and returns the redirect from the request, without an `id` or a `createdDate`.\n *\n * To create multiple redirects in a single API call, call [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects). Note the\n * difference in how the two handle problems: this method resolves loops and, with\n * `options.forceReplace`, conflicts, while [Bulk Create Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-create-redirects) fails the individual redirect\n * instead.\n */\nexport function createRedirect(payload: object): RequestOptionsFactory<any> {\n function __createRedirect({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.CreateRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/create-redirect',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'redirect.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createRedirect;\n}\n\n/**\n * Deletes a redirect by ID.\n *\n * The response is empty. Deleting a redirect can't be undone, so retrieve it first if you might\n * need to recreate it.\n *\n * A redirect scoped to a language stops taking effect but can still appear in [List Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/list-redirects).\n *\n * To delete multiple redirects in a single API call, call [Bulk Delete Redirects](https://dev.wix.com/docs/api-reference/business-management/seo/redirects/redirect-v1/bulk-delete-redirects).\n */\nexport function deleteRedirect(payload: object): RequestOptionsFactory<any> {\n function __deleteRedirect({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.redirect',\n method: 'DELETE' as any,\n methodFqn:\n 'com.wixpress.promote.seo.redirects.api.RedirectsService.DeleteRedirect',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressPromoteSeoRedirectsApiRedirectsServiceUrl({\n protoPath: '/v1/redirects/{redirectId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteRedirect;\n}\n","import {\n bulkDeleteRedirects as publicBulkDeleteRedirects,\n listRedirects as publicListRedirects,\n getRedirect as publicGetRedirect,\n bulkCreateRedirects as publicBulkCreateRedirects,\n createRedirect as publicCreateRedirect,\n deleteRedirect as publicDeleteRedirect,\n} from './promote-seo-v1-redirect-redirects.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onRedirectCreated as publicOnRedirectCreated } from './promote-seo-v1-redirect-redirects.public.js';\n\nexport const bulkDeleteRedirects: MaybeContext<\n BuildRESTFunction<typeof publicBulkDeleteRedirects> &\n typeof publicBulkDeleteRedirects\n> = /*#__PURE__*/ createRESTModule(publicBulkDeleteRedirects);\nexport const listRedirects: MaybeContext<\n BuildRESTFunction<typeof publicListRedirects> & typeof publicListRedirects\n> = /*#__PURE__*/ createRESTModule(publicListRedirects);\nexport const getRedirect: MaybeContext<\n BuildRESTFunction<typeof publicGetRedirect> & typeof publicGetRedirect\n> = /*#__PURE__*/ createRESTModule(publicGetRedirect);\nexport const bulkCreateRedirects: MaybeContext<\n BuildRESTFunction<typeof publicBulkCreateRedirects> &\n typeof publicBulkCreateRedirects\n> = /*#__PURE__*/ createRESTModule(publicBulkCreateRedirects);\nexport const createRedirect: MaybeContext<\n BuildRESTFunction<typeof publicCreateRedirect> & typeof publicCreateRedirect\n> = /*#__PURE__*/ createRESTModule(publicCreateRedirect);\nexport const deleteRedirect: MaybeContext<\n BuildRESTFunction<typeof publicDeleteRedirect> & typeof publicDeleteRedirect\n> = /*#__PURE__*/ createRESTModule(publicDeleteRedirect);\n/** */\nexport const onRedirectCreated: BuildEventDefinition<\n typeof publicOnRedirectCreated\n> &\n typeof publicOnRedirectCreated = /*#__PURE__*/ createEventModule(\n publicOnRedirectCreated\n);\n\nexport {\n Source,\n WebhookIdentityType,\n} from './promote-seo-v1-redirect-redirects.universal.js';\nexport {\n Redirect,\n RedirectOptions,\n AddRedirectsRequest,\n AddRedirectsOptions,\n AddRedirectsResponse,\n AddGroupRedirectsRequest,\n AddGroupRedirectsOptions,\n AddGroupRedirectsResponse,\n BulkDeleteRedirectsRequest,\n BulkDeleteRedirectsResponse,\n BulkRedirectResult,\n ItemMetadata,\n ApplicationError,\n BulkActionMetadata,\n ListRedirectsRequest,\n ListRedirectsResponse,\n GetRedirectRequest,\n GetRedirectResponse,\n BulkCreateRedirectsRequest,\n BulkCreateRedirectsOptions,\n BulkCreateRedirectsResponse,\n CreateRedirectRequest,\n CreateRedirectOptions,\n CreateRedirectResponse,\n DeleteRedirectRequest,\n DeleteRedirectResponse,\n RemoveGeneralRedirectRequest,\n RemoveGeneralRedirectsOptions,\n RemoveGeneralRedirectResponse,\n GetHttpStatusRequest,\n GetHttpStatusResponse,\n CleanupLanguageRedirectsRequest,\n CleanupLanguageRedirectsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n RedirectCreatedEnvelope,\n BulkCreateRedirectsOptionsForRequest,\n CreateRedirectOptionsForRequest,\n} from './promote-seo-v1-redirect-redirects.universal.js';\nexport {\n SourceWithLiterals,\n WebhookIdentityTypeWithLiterals,\n GetRedirectApplicationErrors,\n CreateRedirectApplicationErrors,\n DeleteRedirectApplicationErrors,\n} from './promote-seo-v1-redirect-redirects.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA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AAW;AAAA,EACf;AACJ;AAmBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CACL,WACA,YAEAA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AA+CO,SAASC,gBACd,YACyB;AACzB,SAAO,CAAC,UAAoB,YAC1BA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAmCO,SAASC,gBACd,YACyB;AACzB,SAAO,CAAC,eACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,IAAM,oBAAkC;AAAA,EAC7C;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA2B;;;AG5R3B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,iBAEK,2DAAiBA,cAAmB;AAC/C,IAAMC,eAEK,2DAAiBA,YAAiB;AAC7C,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,kBAEK,2DAAiBA,eAAoB;AAEhD,IAAMC,qBAGoC;AAAA,EAC/C;AACF;","names":["bulkCreateRedirects","bulkDeleteRedirects","createRedirect","deleteRedirect","getRedirect","listRedirects","onRedirectCreated","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","Source","WebhookIdentityType","bulkDeleteRedirects","sdkTransformError","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","bulkDeleteRedirects","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","import_rest_modules","bulkDeleteRedirects","listRedirects","getRedirect","bulkCreateRedirects","createRedirect","deleteRedirect","onRedirectCreated"]}
@@ -92,7 +92,7 @@ interface AddRedirectsRequest {
92
92
  /**
93
93
  * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
94
94
  * service chunks larger batches, but an unbounded request array is a memory risk with no caller
95
- * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
95
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.
96
96
  *
97
97
  * No `minSize`: the service already rejects an empty array with its own message, and adding one
98
98
  * here would add a second field violation to this deprecated endpoint's error payload.
@@ -112,7 +112,7 @@ interface AddRedirectsResponse {
112
112
  /**
113
113
  * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
114
114
  * service chunks larger batches, but an unbounded request array is a memory risk with no caller
115
- * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
115
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.
116
116
  *
117
117
  * No `minSize`: the service already rejects an empty array with its own message, and adding one
118
118
  * here would add a second field violation to this deprecated endpoint's error payload.
@@ -125,7 +125,7 @@ interface AddGroupRedirectsRequest {
125
125
  /**
126
126
  * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
127
127
  * service chunks larger batches, but an unbounded request array is a memory risk with no caller
128
- * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
128
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.
129
129
  *
130
130
  * No `minSize`: the service already rejects an empty array with its own message, and adding one
131
131
  * here would add a second field violation to this deprecated endpoint's error payload.
@@ -145,7 +145,7 @@ interface AddGroupRedirectsResponse {
145
145
  /**
146
146
  * Capped at the Redirector's own bulk limit of 500, which is what this ends up calling. The
147
147
  * service chunks larger batches, but an unbounded request array is a memory risk with no caller
148
- * asking for it - and BulkCreateRedirects, which replaces this endpoint, already declares 500.
148
+ * asking for it - and BulkCreateRedirects, which replaces this endpoint, is bounded too, at 100.
149
149
  *
150
150
  * No `minSize`: the service already rejects an empty array with its own message, and adding one
151
151
  * here would add a second field violation to this deprecated endpoint's error payload.
@@ -266,7 +266,7 @@ interface BulkCreateRedirectsRequest {
266
266
  /**
267
267
  * Redirects to create.
268
268
  * @minSize 1
269
- * @maxSize 500
269
+ * @maxSize 100
270
270
  */
271
271
  redirects: Redirect[];
272
272
  /**
@@ -297,7 +297,7 @@ interface BulkCreateRedirectsOptions {
297
297
  interface BulkCreateRedirectsResponse {
298
298
  /**
299
299
  * Outcome of each redirect, in request order.
300
- * @maxSize 500
300
+ * @maxSize 100
301
301
  */
302
302
  results?: BulkRedirectResult[];
303
303
  /**
@@ -718,7 +718,7 @@ declare function getRedirect(redirectId: string): Promise<NonNullablePaths<Redir
718
718
  __applicationErrorsType?: GetRedirectApplicationErrors;
719
719
  }>;
720
720
  /**
721
- * Creates up to 500 redirects.
721
+ * Creates up to 100 redirects.
722
722
  *
723
723
  * Each redirect succeeds or fails on its own. A redirect whose `from` path is already taken fails
724
724
  * with `FROM_URL_EXISTS`, and one that closes a loop with an earlier redirect in the same request