@wix/auto_sdk_seo_robots-txt 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +3 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +4 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +3 -3
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +4 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -3
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +4 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +3 -3
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +4 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ interface GetRobotsTxtSignature {
|
|
|
8
8
|
* Retrieves the `robots.txt` file entity.
|
|
9
9
|
* @returns The response of the Robots.txt file request
|
|
10
10
|
*/
|
|
11
|
-
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
11
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
12
12
|
}
|
|
13
13
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
14
14
|
interface UpdateRobotsTxtSignature {
|
|
@@ -19,7 +19,7 @@ interface UpdateRobotsTxtSignature {
|
|
|
19
19
|
*
|
|
20
20
|
* To restore Wix's default content, set the `default` field to `true` and omit the `content` field.
|
|
21
21
|
*/
|
|
22
|
-
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
22
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
23
23
|
}
|
|
24
24
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
25
25
|
|
|
@@ -28,6 +28,6 @@ declare const updateRobotsTxt: MaybeContext<BuildRESTFunction<typeof updateRobot
|
|
|
28
28
|
/**
|
|
29
29
|
* Triggered when the `robots.txt` file entity is updated.
|
|
30
30
|
*/
|
|
31
|
-
declare const onRobotsTxtUpdated: BuildEventDefinition<typeof onRobotsTxtUpdated$1
|
|
31
|
+
declare const onRobotsTxtUpdated: BuildEventDefinition<typeof onRobotsTxtUpdated$1> & typeof onRobotsTxtUpdated$1;
|
|
32
32
|
|
|
33
33
|
export { GetRobotsTxtOptions, GetRobotsTxtResponse, RobotsTxtUpdatedEnvelope, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, getRobotsTxt, onRobotsTxtUpdated, updateRobotsTxt };
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/promote-seo-v2-robots-txt-robots-txt.public.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts","../../src/promote-seo-v2-robots-txt-robots-txt.context.ts"],"sourcesContent":["export * from './src/promote-seo-v2-robots-txt-robots-txt.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 GetRobotsTxtOptions,\n GetRobotsTxtResponse,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtResponse,\n getRobotsTxt as universalGetRobotsTxt,\n updateRobotsTxt as universalUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getRobotsTxt(httpClient: HttpClient): GetRobotsTxtSignature {\n return (options?: GetRobotsTxtOptions) =>\n universalGetRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRobotsTxtSignature {\n /**\n * Retrieves the `robots.txt` file entity.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\n >\n >;\n}\n\nexport function updateRobotsTxt(\n httpClient: HttpClient\n): UpdateRobotsTxtSignature {\n return (options?: UpdateRobotsTxtOptions) =>\n universalUpdateRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateRobotsTxtSignature {\n /**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\n >\n >;\n}\n\nexport const onRobotsTxtUpdated = EventDefinition(\n 'wix.promote.seo.robots_txt_updated',\n true,\n (event: RobotsTxtUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RobotsTxtUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetRobotsTxtOptions,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n RobotsTxt,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n WebhookIdentityType,\n} from './promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n","import {\n getRobotsTxt as publicGetRobotsTxt,\n updateRobotsTxt as publicUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.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 { onRobotsTxtUpdated as publicOnRobotsTxtUpdated } from './promote-seo-v2-robots-txt-robots-txt.public.js';\n\nexport const getRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicGetRobotsTxt> & typeof publicGetRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicGetRobotsTxt);\nexport const updateRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicUpdateRobotsTxt> & typeof publicUpdateRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicUpdateRobotsTxt);\n/**\n * Triggered when the `robots.txt` file entity is updated.\n */\nexport const onRobotsTxtUpdated: BuildEventDefinition<\n typeof publicOnRobotsTxtUpdated\n> = createEventModule(publicOnRobotsTxtUpdated);\n\nexport { WebhookIdentityType } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport {\n RobotsTxt,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n RobotsTxtUpdatedEnvelope,\n GetRobotsTxtOptions,\n UpdateRobotsTxtOptions,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAAqD;AACrD,6BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QAC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,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;ADrWO,SAASE,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAeO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,IAAM,yBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,uCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AGzE5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAIjD,IAAMC,0BAET,mDAAkB,kBAAwB;","names":["getRobotsTxt","onRobotsTxtUpdated","updateRobotsTxt","import_rename_all_nested_keys","import_rest_modules","WebhookIdentityType","getRobotsTxt","sdkTransformError","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","import_rest_modules","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/promote-seo-v2-robots-txt-robots-txt.public.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts","../../src/promote-seo-v2-robots-txt-robots-txt.context.ts"],"sourcesContent":["export * from './src/promote-seo-v2-robots-txt-robots-txt.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 GetRobotsTxtOptions,\n GetRobotsTxtResponse,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtResponse,\n getRobotsTxt as universalGetRobotsTxt,\n updateRobotsTxt as universalUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getRobotsTxt(httpClient: HttpClient): GetRobotsTxtSignature {\n return (options?: GetRobotsTxtOptions) =>\n universalGetRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRobotsTxtSignature {\n /**\n * Retrieves the `robots.txt` file entity.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\n >\n >;\n}\n\nexport function updateRobotsTxt(\n httpClient: HttpClient\n): UpdateRobotsTxtSignature {\n return (options?: UpdateRobotsTxtOptions) =>\n universalUpdateRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateRobotsTxtSignature {\n /**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\n >\n >;\n}\n\nexport const onRobotsTxtUpdated = EventDefinition(\n 'wix.promote.seo.robots_txt_updated',\n true,\n (event: RobotsTxtUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RobotsTxtUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetRobotsTxtOptions,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n RobotsTxt,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n WebhookIdentityType,\n} from './promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n","import {\n getRobotsTxt as publicGetRobotsTxt,\n updateRobotsTxt as publicUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.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 { onRobotsTxtUpdated as publicOnRobotsTxtUpdated } from './promote-seo-v2-robots-txt-robots-txt.public.js';\n\nexport const getRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicGetRobotsTxt> & typeof publicGetRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicGetRobotsTxt);\nexport const updateRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicUpdateRobotsTxt> & typeof publicUpdateRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicUpdateRobotsTxt);\n/**\n * Triggered when the `robots.txt` file entity is updated.\n */\nexport const onRobotsTxtUpdated: BuildEventDefinition<\n typeof publicOnRobotsTxtUpdated\n> &\n typeof publicOnRobotsTxtUpdated = createEventModule(publicOnRobotsTxtUpdated);\n\nexport { WebhookIdentityType } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport {\n RobotsTxt,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n RobotsTxtUpdatedEnvelope,\n GetRobotsTxtOptions,\n UpdateRobotsTxtOptions,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAAqD;AACrD,6BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;A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AA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AG3E5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAIjD,IAAMC,0BAGuB,mDAAkB,kBAAwB;","names":["getRobotsTxt","onRobotsTxtUpdated","updateRobotsTxt","import_rename_all_nested_keys","import_rest_modules","WebhookIdentityType","getRobotsTxt","sdkTransformError","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","import_rest_modules","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
|
@@ -220,6 +220,8 @@ interface RobotsTxtUpdatedEnvelope {
|
|
|
220
220
|
* Triggered when the `robots.txt` file entity is updated.
|
|
221
221
|
* @permissionScope Manage Stores
|
|
222
222
|
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
223
|
+
* @permissionScope View SEO Settings
|
|
224
|
+
* @permissionScopeId SCOPE.PROMOTE.VIEW-SEO
|
|
223
225
|
* @permissionId wix-seo.read
|
|
224
226
|
* @webhook
|
|
225
227
|
* @eventType wix.promote.seo.robots_txt_updated
|
|
@@ -238,7 +240,7 @@ declare function onRobotsTxtUpdated(handler: (event: RobotsTxtUpdatedEnvelope) =
|
|
|
238
240
|
* @returns The response of the Robots.txt file request
|
|
239
241
|
* @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt
|
|
240
242
|
*/
|
|
241
|
-
declare function getRobotsTxt(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
243
|
+
declare function getRobotsTxt(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
242
244
|
interface GetRobotsTxtOptions {
|
|
243
245
|
/** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */
|
|
244
246
|
subdomain?: string;
|
|
@@ -254,7 +256,7 @@ interface GetRobotsTxtOptions {
|
|
|
254
256
|
* @permissionId wix-seo.edit
|
|
255
257
|
* @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt
|
|
256
258
|
*/
|
|
257
|
-
declare function updateRobotsTxt(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
259
|
+
declare function updateRobotsTxt(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
258
260
|
interface UpdateRobotsTxtOptions {
|
|
259
261
|
/** `robots.txt` file to update. */
|
|
260
262
|
robotsTxt?: RobotsTxt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts"],"sourcesContent":["export * from './src/promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SA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MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAkBA,eAAsBC,iBACpB,SAMA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,WAAW,SAAS;AAAA,EACtB,CAAC;AAED,QAAM,UAA6C,gBAAgB,OAAO;AAE1E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getRobotsTxt","updateRobotsTxt","import_rest_modules","WebhookIdentityType","getRobotsTxt","sdkTransformError","updateRobotsTxt"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts"],"sourcesContent":["export * from './src/promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;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AAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,WAAW,SAAS;AAAA,EACtB,CAAC;AAED,QAAM,UAA6C,aAAa,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAkBA,eAAsBC,iBACpB,SAOA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD,WAAW,SAAS;AAAA,EACtB,CAAC;AAED,QAAM,UAA6C,gBAAgB,OAAO;AAE1E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getRobotsTxt","updateRobotsTxt","import_rest_modules","WebhookIdentityType","getRobotsTxt","sdkTransformError","updateRobotsTxt"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -8,7 +8,7 @@ interface GetRobotsTxtSignature {
|
|
|
8
8
|
* Retrieves the `robots.txt` file entity.
|
|
9
9
|
* @returns The response of the Robots.txt file request
|
|
10
10
|
*/
|
|
11
|
-
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
11
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
12
12
|
}
|
|
13
13
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
14
14
|
interface UpdateRobotsTxtSignature {
|
|
@@ -19,7 +19,7 @@ interface UpdateRobotsTxtSignature {
|
|
|
19
19
|
*
|
|
20
20
|
* To restore Wix's default content, set the `default` field to `true` and omit the `content` field.
|
|
21
21
|
*/
|
|
22
|
-
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
22
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
23
23
|
}
|
|
24
24
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
25
25
|
|
|
@@ -28,6 +28,6 @@ declare const updateRobotsTxt: MaybeContext<BuildRESTFunction<typeof updateRobot
|
|
|
28
28
|
/**
|
|
29
29
|
* Triggered when the `robots.txt` file entity is updated.
|
|
30
30
|
*/
|
|
31
|
-
declare const onRobotsTxtUpdated: BuildEventDefinition<typeof onRobotsTxtUpdated$1
|
|
31
|
+
declare const onRobotsTxtUpdated: BuildEventDefinition<typeof onRobotsTxtUpdated$1> & typeof onRobotsTxtUpdated$1;
|
|
32
32
|
|
|
33
33
|
export { GetRobotsTxtOptions, GetRobotsTxtResponse, RobotsTxtUpdatedEnvelope, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, getRobotsTxt, onRobotsTxtUpdated, updateRobotsTxt };
|
package/build/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/promote-seo-v2-robots-txt-robots-txt.public.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts","../../src/promote-seo-v2-robots-txt-robots-txt.context.ts"],"sourcesContent":["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 GetRobotsTxtOptions,\n GetRobotsTxtResponse,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtResponse,\n getRobotsTxt as universalGetRobotsTxt,\n updateRobotsTxt as universalUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getRobotsTxt(httpClient: HttpClient): GetRobotsTxtSignature {\n return (options?: GetRobotsTxtOptions) =>\n universalGetRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRobotsTxtSignature {\n /**\n * Retrieves the `robots.txt` file entity.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\n >\n >;\n}\n\nexport function updateRobotsTxt(\n httpClient: HttpClient\n): UpdateRobotsTxtSignature {\n return (options?: UpdateRobotsTxtOptions) =>\n universalUpdateRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateRobotsTxtSignature {\n /**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\n >\n >;\n}\n\nexport const onRobotsTxtUpdated = EventDefinition(\n 'wix.promote.seo.robots_txt_updated',\n true,\n (event: RobotsTxtUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RobotsTxtUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetRobotsTxtOptions,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n RobotsTxt,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n WebhookIdentityType,\n} from './promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n","import {\n getRobotsTxt as publicGetRobotsTxt,\n updateRobotsTxt as publicUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.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 { onRobotsTxtUpdated as publicOnRobotsTxtUpdated } from './promote-seo-v2-robots-txt-robots-txt.public.js';\n\nexport const getRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicGetRobotsTxt> & typeof publicGetRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicGetRobotsTxt);\nexport const updateRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicUpdateRobotsTxt> & typeof publicUpdateRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicUpdateRobotsTxt);\n/**\n * Triggered when the `robots.txt` file entity is updated.\n */\nexport const onRobotsTxtUpdated: BuildEventDefinition<\n typeof publicOnRobotsTxtUpdated\n> = createEventModule(publicOnRobotsTxtUpdated);\n\nexport { WebhookIdentityType } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport {\n RobotsTxt,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n RobotsTxtUpdatedEnvelope,\n GetRobotsTxtOptions,\n UpdateRobotsTxtOptions,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QAC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,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AGzE5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAIjD,IAAMC,sBAET,kBAAkB,kBAAwB;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","getRobotsTxt","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","renameKeysFromRESTResponseToSDKResponse","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../src/promote-seo-v2-robots-txt-robots-txt.public.ts","../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts","../../src/promote-seo-v2-robots-txt-robots-txt.context.ts"],"sourcesContent":["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 GetRobotsTxtOptions,\n GetRobotsTxtResponse,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtResponse,\n getRobotsTxt as universalGetRobotsTxt,\n updateRobotsTxt as universalUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getRobotsTxt(httpClient: HttpClient): GetRobotsTxtSignature {\n return (options?: GetRobotsTxtOptions) =>\n universalGetRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetRobotsTxtSignature {\n /**\n * Retrieves the `robots.txt` file entity.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\n >\n >;\n}\n\nexport function updateRobotsTxt(\n httpClient: HttpClient\n): UpdateRobotsTxtSignature {\n return (options?: UpdateRobotsTxtOptions) =>\n universalUpdateRobotsTxt(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateRobotsTxtSignature {\n /**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\n >\n >;\n}\n\nexport const onRobotsTxtUpdated = EventDefinition(\n 'wix.promote.seo.robots_txt_updated',\n true,\n (event: RobotsTxtUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<RobotsTxtUpdatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetRobotsTxtOptions,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n RobotsTxt,\n RobotsTxtUpdatedEnvelope,\n UpdateRobotsTxtOptions,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n WebhookIdentityType,\n} from './promote-seo-v2-robots-txt-robots-txt.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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n","import {\n getRobotsTxt as publicGetRobotsTxt,\n updateRobotsTxt as publicUpdateRobotsTxt,\n} from './promote-seo-v2-robots-txt-robots-txt.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 { onRobotsTxtUpdated as publicOnRobotsTxtUpdated } from './promote-seo-v2-robots-txt-robots-txt.public.js';\n\nexport const getRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicGetRobotsTxt> & typeof publicGetRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicGetRobotsTxt);\nexport const updateRobotsTxt: MaybeContext<\n BuildRESTFunction<typeof publicUpdateRobotsTxt> & typeof publicUpdateRobotsTxt\n> = /*#__PURE__*/ createRESTModule(publicUpdateRobotsTxt);\n/**\n * Triggered when the `robots.txt` file entity is updated.\n */\nexport const onRobotsTxtUpdated: BuildEventDefinition<\n typeof publicOnRobotsTxtUpdated\n> &\n typeof publicOnRobotsTxtUpdated = createEventModule(publicOnRobotsTxtUpdated);\n\nexport { WebhookIdentityType } from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport {\n RobotsTxt,\n GetRobotsTxtRequest,\n GetRobotsTxtResponse,\n UpdateRobotsTxtRequest,\n UpdateRobotsTxtResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n RobotsTxtUpdatedEnvelope,\n GetRobotsTxtOptions,\n UpdateRobotsTxtOptions,\n} from './promote-seo-v2-robots-txt-robots-txt.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './promote-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C1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAgBO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAmBO,IAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA,CAAC,UACCC;AAAA,IACE,eAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AG3E5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAIjD,IAAMC,sBAGuB,kBAAkB,kBAAwB;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","getRobotsTxt","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","renameKeysFromRESTResponseToSDKResponse","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
|
@@ -220,6 +220,8 @@ interface RobotsTxtUpdatedEnvelope {
|
|
|
220
220
|
* Triggered when the `robots.txt` file entity is updated.
|
|
221
221
|
* @permissionScope Manage Stores
|
|
222
222
|
* @permissionScopeId SCOPE.STORES.MANAGE-STORES
|
|
223
|
+
* @permissionScope View SEO Settings
|
|
224
|
+
* @permissionScopeId SCOPE.PROMOTE.VIEW-SEO
|
|
223
225
|
* @permissionId wix-seo.read
|
|
224
226
|
* @webhook
|
|
225
227
|
* @eventType wix.promote.seo.robots_txt_updated
|
|
@@ -238,7 +240,7 @@ declare function onRobotsTxtUpdated(handler: (event: RobotsTxtUpdatedEnvelope) =
|
|
|
238
240
|
* @returns The response of the Robots.txt file request
|
|
239
241
|
* @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt
|
|
240
242
|
*/
|
|
241
|
-
declare function getRobotsTxt(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
243
|
+
declare function getRobotsTxt(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
242
244
|
interface GetRobotsTxtOptions {
|
|
243
245
|
/** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */
|
|
244
246
|
subdomain?: string;
|
|
@@ -254,7 +256,7 @@ interface GetRobotsTxtOptions {
|
|
|
254
256
|
* @permissionId wix-seo.edit
|
|
255
257
|
* @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt
|
|
256
258
|
*/
|
|
257
|
-
declare function updateRobotsTxt(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain
|
|
259
|
+
declare function updateRobotsTxt(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`, 3>>;
|
|
258
260
|
interface UpdateRobotsTxtOptions {
|
|
259
261
|
/** `robots.txt` file to update. */
|
|
260
262
|
robotsTxt?: RobotsTxt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts"],"sourcesContent":["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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAA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QAAM,UAA6C,aAAa,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAkBA,eAAsBC,iBACpB,SAMA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD,WAAW,SAAS;AAAA,EACtB,CAAC;AAED,QAAM,UAA6C,gBAAgB,OAAO;AAE1E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,iBAAiB;AAAA,QACxD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["WebhookIdentityType","getRobotsTxt","updateRobotsTxt"]}
|
|
1
|
+
{"version":3,"sources":["../../src/promote-seo-v2-robots-txt-robots-txt.universal.ts","../../src/promote-seo-v2-robots-txt-robots-txt.http.ts"],"sourcesContent":["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 ambassadorWixPromoteSeoV2RobotsTxt from './promote-seo-v2-robots-txt-robots-txt.http.js';\n\n/** Represents a `robots.txt` file entity that controls web crawler access to a website or subdomain. It defines crawling rules and directives for search engines and other automated agents, ensuring proper indexing behavior and preventing unauthorized access to specific site areas. */\nexport interface RobotsTxt {\n /**\n * Full text content of the `robots.txt` file.\n * @maxLength 720000\n */\n content?: string;\n /** Whether this `robots.txt` file uses Wix's [default content](https://support.wix.com/en/article/editing-your-sites-robotstxt-file). */\n default?: boolean;\n /**\n * If applicable, target subdomain for the `robots.txt` file. For example, a site can have multiple subdomains like `www.example.com`, `es.example.com`, `fr.example.com`. Each subdomain can have its own `robots.txt` file with different rules. Default: 'www'\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n /** Retrieved `robots.txt` file entity. */\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n\nexport interface UpdateRobotsTxtResponse {\n /** Updated `robots.txt` file. */\n robotsTxt?: RobotsTxt;\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}\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 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}\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}\n\nexport interface RobotsTxtUpdatedEnvelope {\n entity: RobotsTxt;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when the `robots.txt` file entity is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope View SEO Settings\n * @permissionScopeId SCOPE.PROMOTE.VIEW-SEO\n * @permissionId wix-seo.read\n * @webhook\n * @eventType wix.promote.seo.robots_txt_updated\n * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2\n * @slug updated\n * @documentationMaturity preview\n */\nexport declare function onRobotsTxtUpdated(\n handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieves the `robots.txt` file entity.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.read\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns The response of the Robots.txt file request\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt\n */\nexport async function getRobotsTxt(\n options?: GetRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 subdomain: options?.subdomain,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.getRobotsTxt(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: { subdomain: '$[0].subdomain' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetRobotsTxtOptions {\n /** Subdomain of the requested `robots.txt file`. For example, `www`, `es`, `fr`. Default: `www`. */\n subdomain?: string;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n * @public\n * @documentationMaturity preview\n * @permissionId wix-seo.edit\n * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt\n */\nexport async function updateRobotsTxt(\n options?: UpdateRobotsTxtOptions\n): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n `robotsTxt.content` | `robotsTxt.default` | `robotsTxt.subdomain`,\n 3\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 robotsTxt: options?.robotsTxt,\n });\n\n const reqOpts = ambassadorWixPromoteSeoV2RobotsTxt.updateRobotsTxt(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: { robotsTxt: '$[0].robotsTxt' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateRobotsTxtOptions {\n /** `robots.txt` file to update. */\n robotsTxt?: RobotsTxt;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/promote-seo-robots-server',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/promote-seo-robots-server',\n destPath: '/api',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/_api/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/promote-seo-robots-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote-seo-txt-file-server/v2/robots',\n destPath: '/v2/robots',\n },\n {\n srcPath: '/promote-seo-robots-server/v2/llms',\n destPath: '/v2/llms',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n _: [\n {\n srcPath: '/promote/marketing/v2/ads',\n destPath: '/v2/ads',\n },\n {\n srcPath: '/promote/seo/v2/llms',\n destPath: '/v2/llms',\n },\n {\n srcPath: '/promote/seo/v2/robots',\n destPath: '/v2/robots',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_robots-txt';\n\n/** Retrieves the `robots.txt` file entity. */\nexport function getRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __getRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getRobotsTxt;\n}\n\n/**\n * Updates the `robots.txt` file entity.\n *\n * The content can be set to an empty string to create a blank file.\n *\n * To restore Wix's default content, set the `default` field to `true` and omit the `content` field.\n */\nexport function updateRobotsTxt(payload: object): RequestOptionsFactory<any> {\n function __updateRobotsTxt({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v2.robots_txt',\n method: 'PUT' as any,\n methodFqn:\n 'com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({\n protoPath: '/v2/robots',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateRobotsTxt;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA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