@wix/auto_sdk_seo_robots-txt 1.0.0 → 1.0.1
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 +8 -3
- package/build/cjs/index.js.map +1 -1
- package/build/es/index.d.mts +8 -3
- package/build/es/index.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -3
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/es/index.d.mts +8 -3
- package/build/internal/es/index.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { GetRobotsTxtOptions, GetRobotsTxtResponse, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, RobotsTxtUpdatedEnvelope } from './index.typings.js';
|
|
3
3
|
export { ActionEvent, BaseEventMetadata, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetRobotsTxtRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, RobotsTxt, UpdateRobotsTxtRequest, WebhookIdentityType } from './index.typings.js';
|
|
4
4
|
|
|
5
|
+
type RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;
|
|
5
6
|
declare function getRobotsTxt$1(httpClient: HttpClient): GetRobotsTxtSignature;
|
|
6
7
|
interface GetRobotsTxtSignature {
|
|
7
8
|
/**
|
|
@@ -9,7 +10,9 @@ interface GetRobotsTxtSignature {
|
|
|
9
10
|
* Returns the content and whether it's the default.
|
|
10
11
|
* @returns The response of the Robots.txt file request
|
|
11
12
|
*/
|
|
12
|
-
(options?: GetRobotsTxtOptions
|
|
13
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, {
|
|
14
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
15
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
13
16
|
}
|
|
14
17
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
15
18
|
interface UpdateRobotsTxtSignature {
|
|
@@ -18,7 +21,9 @@ interface UpdateRobotsTxtSignature {
|
|
|
18
21
|
* You may set an empty string as the file content.
|
|
19
22
|
* In order to reset the content to Wix's default, send `default: true`.
|
|
20
23
|
*/
|
|
21
|
-
(options?: UpdateRobotsTxtOptions
|
|
24
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, {
|
|
25
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
26
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
22
27
|
}
|
|
23
28
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
24
29
|
|
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 } 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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions | undefined): Promise<GetRobotsTxtResponse>;\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (\n options?: UpdateRobotsTxtOptions | undefined\n ): Promise<UpdateRobotsTxtResponse>;\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EA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A,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAWO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAaO,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;;;AGhE5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\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,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;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yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;ADvWO,SAASE,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,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;;;AG9E5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,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"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { GetRobotsTxtOptions, GetRobotsTxtResponse, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, RobotsTxtUpdatedEnvelope } from './index.typings.mjs';
|
|
3
3
|
export { ActionEvent, BaseEventMetadata, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetRobotsTxtRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, RobotsTxt, UpdateRobotsTxtRequest, WebhookIdentityType } from './index.typings.mjs';
|
|
4
4
|
|
|
5
|
+
type RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;
|
|
5
6
|
declare function getRobotsTxt$1(httpClient: HttpClient): GetRobotsTxtSignature;
|
|
6
7
|
interface GetRobotsTxtSignature {
|
|
7
8
|
/**
|
|
@@ -9,7 +10,9 @@ interface GetRobotsTxtSignature {
|
|
|
9
10
|
* Returns the content and whether it's the default.
|
|
10
11
|
* @returns The response of the Robots.txt file request
|
|
11
12
|
*/
|
|
12
|
-
(options?: GetRobotsTxtOptions
|
|
13
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, {
|
|
14
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
15
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
13
16
|
}
|
|
14
17
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
15
18
|
interface UpdateRobotsTxtSignature {
|
|
@@ -18,7 +21,9 @@ interface UpdateRobotsTxtSignature {
|
|
|
18
21
|
* You may set an empty string as the file content.
|
|
19
22
|
* In order to reset the content to Wix's default, send `default: true`.
|
|
20
23
|
*/
|
|
21
|
-
(options?: UpdateRobotsTxtOptions
|
|
24
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, {
|
|
25
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
26
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
22
27
|
}
|
|
23
28
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
24
29
|
|
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 } 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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions | undefined): Promise<GetRobotsTxtResponse>;\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (\n options?: UpdateRobotsTxtOptions | undefined\n ): Promise<UpdateRobotsTxtResponse>;\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,uBAAmC;;;ACH5C,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;AA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a;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;;;ADzWO,SAASC,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAWO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAaO,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;;;AGhE5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAEjD,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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\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,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;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AED,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;;;ADvWO,SAASC,cAAa,YAA+C;AAC1E,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,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;;;AG9E5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAEjD,IAAMC,sBAET,kBAAkB,kBAAwB;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","getRobotsTxt","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","renameKeysFromRESTResponseToSDKResponse","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { GetRobotsTxtOptions, GetRobotsTxtResponse, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, RobotsTxtUpdatedEnvelope } from './index.typings.js';
|
|
3
3
|
export { ActionEvent, BaseEventMetadata, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetRobotsTxtRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, RobotsTxt, UpdateRobotsTxtRequest, WebhookIdentityType } from './index.typings.js';
|
|
4
4
|
|
|
5
|
+
type RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;
|
|
5
6
|
declare function getRobotsTxt$1(httpClient: HttpClient): GetRobotsTxtSignature;
|
|
6
7
|
interface GetRobotsTxtSignature {
|
|
7
8
|
/**
|
|
@@ -9,7 +10,9 @@ interface GetRobotsTxtSignature {
|
|
|
9
10
|
* Returns the content and whether it's the default.
|
|
10
11
|
* @returns The response of the Robots.txt file request
|
|
11
12
|
*/
|
|
12
|
-
(options?: GetRobotsTxtOptions
|
|
13
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, {
|
|
14
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
15
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
13
16
|
}
|
|
14
17
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
15
18
|
interface UpdateRobotsTxtSignature {
|
|
@@ -18,7 +21,9 @@ interface UpdateRobotsTxtSignature {
|
|
|
18
21
|
* You may set an empty string as the file content.
|
|
19
22
|
* In order to reset the content to Wix's default, send `default: true`.
|
|
20
23
|
*/
|
|
21
|
-
(options?: UpdateRobotsTxtOptions
|
|
24
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, {
|
|
25
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
26
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
22
27
|
}
|
|
23
28
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
24
29
|
|
|
@@ -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 } 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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions | undefined): Promise<GetRobotsTxtResponse>;\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (\n options?: UpdateRobotsTxtOptions | undefined\n ): Promise<UpdateRobotsTxtResponse>;\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\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,uBAA4C;;;ACH5C,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,Q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BA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\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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pB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA4B;;;AG9E5B,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;AAEjD,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,7 +1,8 @@
|
|
|
1
|
-
import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { GetRobotsTxtOptions, GetRobotsTxtResponse, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, RobotsTxtUpdatedEnvelope } from './index.typings.mjs';
|
|
3
3
|
export { ActionEvent, BaseEventMetadata, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetRobotsTxtRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, RobotsTxt, UpdateRobotsTxtRequest, WebhookIdentityType } from './index.typings.mjs';
|
|
4
4
|
|
|
5
|
+
type RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;
|
|
5
6
|
declare function getRobotsTxt$1(httpClient: HttpClient): GetRobotsTxtSignature;
|
|
6
7
|
interface GetRobotsTxtSignature {
|
|
7
8
|
/**
|
|
@@ -9,7 +10,9 @@ interface GetRobotsTxtSignature {
|
|
|
9
10
|
* Returns the content and whether it's the default.
|
|
10
11
|
* @returns The response of the Robots.txt file request
|
|
11
12
|
*/
|
|
12
|
-
(options?: GetRobotsTxtOptions
|
|
13
|
+
(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, {
|
|
14
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
15
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
13
16
|
}
|
|
14
17
|
declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
|
|
15
18
|
interface UpdateRobotsTxtSignature {
|
|
@@ -18,7 +21,9 @@ interface UpdateRobotsTxtSignature {
|
|
|
18
21
|
* You may set an empty string as the file content.
|
|
19
22
|
* In order to reset the content to Wix's default, send `default: true`.
|
|
20
23
|
*/
|
|
21
|
-
(options?: UpdateRobotsTxtOptions
|
|
24
|
+
(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, {
|
|
25
|
+
[P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
|
|
26
|
+
}[RobotsTxtNonNullablePaths]>>;
|
|
22
27
|
}
|
|
23
28
|
declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
|
|
24
29
|
|
|
@@ -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 } 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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions | undefined): Promise<GetRobotsTxtResponse>;\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (\n options?: UpdateRobotsTxtOptions | undefined\n ): Promise<UpdateRobotsTxtResponse>;\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C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AA,EACf;AACJ;AAWO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAaO,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;;;AGhE5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAEjD,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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\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 * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n * @returns The response of the Robots.txt file request\n */\n (options?: GetRobotsTxtOptions): Promise<\n NonNullablePaths<\n GetRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\n */\n (options?: UpdateRobotsTxtOptions): Promise<\n NonNullablePaths<\n UpdateRobotsTxtResponse,\n {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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\nexport interface RobotsTxt {\n /**\n * The robots.txt file content\n * @maxLength 720000\n */\n content?: string;\n /** The Wix default robots.txt file content */\n default?: boolean;\n /**\n * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.\n * @maxLength 63\n */\n subdomain?: string;\n}\n\n/** The request to get the Robots.txt file content */\nexport interface GetRobotsTxtRequest {\n /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/** The response of the Robots.txt file request */\nexport interface GetRobotsTxtResponse {\n robotsTxt?: RobotsTxt;\n}\n\n/** The request to update the content of the Robots.txt file */\nexport interface UpdateRobotsTxtRequest {\n /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/** @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\ntype RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;\n\n/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */\n subdomain?: string;\n}\n\n/**\n * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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 {\n [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;\n }[RobotsTxtNonNullablePaths]\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 /**\n * Provided content will override existing content.\n * Use `default:true` to reset the content to default, no `content` is required in that case\n */\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/**\n * Get the Robots.txt file content.\n * Returns the content and whether it's the default.\n */\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 * Update the Robots.txt file content.\n * You may set an empty string as the file content.\n * In order to reset the content to Wix's default, send `default: true`.\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/** */\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-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AC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,YACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,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;;;AG9E5B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;AAEjD,IAAMC,sBAET,kBAAkB,kBAAwB;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","getRobotsTxt","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","renameKeysFromRESTResponseToSDKResponse","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/auto_sdk_seo_robots-txt",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"fqdn": "wix.promote.seo.v2.robots_txt"
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
|
-
"falconPackageHash": "
|
|
52
|
+
"falconPackageHash": "216753b691d4503ffaab16d79eff2917bf395fd745eedac9390f0772"
|
|
53
53
|
}
|