@wix/auto_sdk_seo_robots-txt 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/build/cjs/index.d.ts +30 -0
  2. package/build/cjs/index.js +279 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +269 -0
  5. package/build/cjs/index.typings.js +236 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +53 -0
  8. package/build/cjs/meta.js +208 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/es/index.d.mts +30 -0
  11. package/build/es/index.mjs +252 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/index.typings.d.mts +269 -0
  14. package/build/es/index.typings.mjs +210 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +53 -0
  17. package/build/es/meta.mjs +180 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/es/package.json +3 -0
  20. package/build/internal/cjs/index.d.ts +30 -0
  21. package/build/internal/cjs/index.js +279 -0
  22. package/build/internal/cjs/index.js.map +1 -0
  23. package/build/internal/cjs/index.typings.d.ts +269 -0
  24. package/build/internal/cjs/index.typings.js +236 -0
  25. package/build/internal/cjs/index.typings.js.map +1 -0
  26. package/build/internal/cjs/meta.d.ts +53 -0
  27. package/build/internal/cjs/meta.js +208 -0
  28. package/build/internal/cjs/meta.js.map +1 -0
  29. package/build/internal/es/index.d.mts +30 -0
  30. package/build/internal/es/index.mjs +252 -0
  31. package/build/internal/es/index.mjs.map +1 -0
  32. package/build/internal/es/index.typings.d.mts +269 -0
  33. package/build/internal/es/index.typings.mjs +210 -0
  34. package/build/internal/es/index.typings.mjs.map +1 -0
  35. package/build/internal/es/meta.d.mts +53 -0
  36. package/build/internal/es/meta.mjs +180 -0
  37. package/build/internal/es/meta.mjs.map +1 -0
  38. package/meta/package.json +3 -0
  39. package/package.json +53 -0
@@ -0,0 +1,30 @@
1
+ import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { GetRobotsTxtOptions, GetRobotsTxtResponse, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, RobotsTxtUpdatedEnvelope } from './index.typings.js';
3
+ export { ActionEvent, BaseEventMetadata, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetRobotsTxtRequest, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, RestoreInfo, RobotsTxt, UpdateRobotsTxtRequest, WebhookIdentityType } from './index.typings.js';
4
+
5
+ declare function getRobotsTxt$1(httpClient: HttpClient): GetRobotsTxtSignature;
6
+ interface GetRobotsTxtSignature {
7
+ /**
8
+ * Get the Robots.txt file content.
9
+ * Returns the content and whether it's the default.
10
+ * @returns The response of the Robots.txt file request
11
+ */
12
+ (options?: GetRobotsTxtOptions | undefined): Promise<GetRobotsTxtResponse>;
13
+ }
14
+ declare function updateRobotsTxt$1(httpClient: HttpClient): UpdateRobotsTxtSignature;
15
+ interface UpdateRobotsTxtSignature {
16
+ /**
17
+ * Update the Robots.txt file content.
18
+ * You may set an empty string as the file content.
19
+ * In order to reset the content to Wix's default, send `default: true`.
20
+ */
21
+ (options?: UpdateRobotsTxtOptions | undefined): Promise<UpdateRobotsTxtResponse>;
22
+ }
23
+ declare const onRobotsTxtUpdated$1: EventDefinition<RobotsTxtUpdatedEnvelope, "wix.promote.seo.robots_txt_updated">;
24
+
25
+ declare const getRobotsTxt: MaybeContext<BuildRESTFunction<typeof getRobotsTxt$1> & typeof getRobotsTxt$1>;
26
+ declare const updateRobotsTxt: MaybeContext<BuildRESTFunction<typeof updateRobotsTxt$1> & typeof updateRobotsTxt$1>;
27
+ /** */
28
+ declare const onRobotsTxtUpdated: BuildEventDefinition<typeof onRobotsTxtUpdated$1>;
29
+
30
+ export { GetRobotsTxtOptions, GetRobotsTxtResponse, RobotsTxtUpdatedEnvelope, UpdateRobotsTxtOptions, UpdateRobotsTxtResponse, getRobotsTxt, onRobotsTxtUpdated, updateRobotsTxt };
@@ -0,0 +1,279 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ WebhookIdentityType: () => WebhookIdentityType,
24
+ getRobotsTxt: () => getRobotsTxt4,
25
+ onRobotsTxtUpdated: () => onRobotsTxtUpdated2,
26
+ updateRobotsTxt: () => updateRobotsTxt4
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+
30
+ // src/promote-seo-v2-robots-txt-robots-txt.public.ts
31
+ var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
32
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
33
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
34
+ var import_sdk_types = require("@wix/sdk-types");
35
+
36
+ // src/promote-seo-v2-robots-txt-robots-txt.universal.ts
37
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
38
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
39
+
40
+ // src/promote-seo-v2-robots-txt-robots-txt.http.ts
41
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
42
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
43
+ function resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url(opts) {
44
+ const domainToMappings = {
45
+ "www._base_domain_": [
46
+ {
47
+ srcPath: "/_api/promote-seo-robots-server",
48
+ destPath: "/api"
49
+ },
50
+ {
51
+ srcPath: "/_api/promote-seo-robots-server/v2/robots",
52
+ destPath: "/v2/robots"
53
+ },
54
+ {
55
+ srcPath: "/_api/promote-seo-robots-server/v2/ads",
56
+ destPath: "/v2/ads"
57
+ },
58
+ {
59
+ srcPath: "/_api/promote-seo-robots-server/v2/llms",
60
+ destPath: "/v2/llms"
61
+ }
62
+ ],
63
+ "api._api_base_domain_": [
64
+ {
65
+ srcPath: "/promote-seo-robots-server",
66
+ destPath: ""
67
+ }
68
+ ],
69
+ "manage._base_domain_": [
70
+ {
71
+ srcPath: "/_api/promote-seo-robots-server",
72
+ destPath: "/api"
73
+ },
74
+ {
75
+ srcPath: "/_api/promote-seo-robots-server/v2/robots",
76
+ destPath: "/v2/robots"
77
+ },
78
+ {
79
+ srcPath: "/_api/promote-seo-robots-server/v2/ads",
80
+ destPath: "/v2/ads"
81
+ },
82
+ {
83
+ srcPath: "/_api/promote-seo-robots-server/v2/llms",
84
+ destPath: "/v2/llms"
85
+ }
86
+ ],
87
+ "www.wixapis.com": [
88
+ {
89
+ srcPath: "/promote-seo-robots-server/v2/robots",
90
+ destPath: "/v2/robots"
91
+ },
92
+ {
93
+ srcPath: "/promote-seo-robots-server/v2/ads",
94
+ destPath: "/v2/ads"
95
+ },
96
+ {
97
+ srcPath: "/promote-seo-txt-file-server/v2/ads",
98
+ destPath: "/v2/ads"
99
+ },
100
+ {
101
+ srcPath: "/promote-seo-txt-file-server/v2/robots",
102
+ destPath: "/v2/robots"
103
+ },
104
+ {
105
+ srcPath: "/promote-seo-robots-server/v2/llms",
106
+ destPath: "/v2/llms"
107
+ }
108
+ ],
109
+ "*.dev.wix-code.com": [
110
+ {
111
+ srcPath: "/promote/marketing/v2/ads",
112
+ destPath: "/v2/ads"
113
+ },
114
+ {
115
+ srcPath: "/promote/seo/v2/llms",
116
+ destPath: "/v2/llms"
117
+ },
118
+ {
119
+ srcPath: "/promote/seo/v2/robots",
120
+ destPath: "/v2/robots"
121
+ }
122
+ ],
123
+ _: [
124
+ {
125
+ srcPath: "/promote/marketing/v2/ads",
126
+ destPath: "/v2/ads"
127
+ },
128
+ {
129
+ srcPath: "/promote/seo/v2/llms",
130
+ destPath: "/v2/llms"
131
+ },
132
+ {
133
+ srcPath: "/promote/seo/v2/robots",
134
+ destPath: "/v2/robots"
135
+ }
136
+ ]
137
+ };
138
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
139
+ }
140
+ var PACKAGE_NAME = "@wix/auto_sdk_seo_robots-txt";
141
+ function getRobotsTxt(payload) {
142
+ function __getRobotsTxt({ host }) {
143
+ const metadata = {
144
+ entityFqdn: "wix.promote.seo.v2.robots_txt",
145
+ method: "GET",
146
+ methodFqn: "com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt",
147
+ packageName: PACKAGE_NAME,
148
+ url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({
149
+ protoPath: "/v2/robots",
150
+ data: payload,
151
+ host
152
+ }),
153
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
154
+ };
155
+ return metadata;
156
+ }
157
+ return __getRobotsTxt;
158
+ }
159
+ function updateRobotsTxt(payload) {
160
+ function __updateRobotsTxt({ host }) {
161
+ const metadata = {
162
+ entityFqdn: "wix.promote.seo.v2.robots_txt",
163
+ method: "PUT",
164
+ methodFqn: "com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt",
165
+ packageName: PACKAGE_NAME,
166
+ url: resolveComWixpressPromoteSeoRobotsServerV2RobotsServiceV2Url({
167
+ protoPath: "/v2/robots",
168
+ data: payload,
169
+ host
170
+ }),
171
+ data: payload
172
+ };
173
+ return metadata;
174
+ }
175
+ return __updateRobotsTxt;
176
+ }
177
+
178
+ // src/promote-seo-v2-robots-txt-robots-txt.universal.ts
179
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
180
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
181
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
182
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
183
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
184
+ WebhookIdentityType2["APP"] = "APP";
185
+ return WebhookIdentityType2;
186
+ })(WebhookIdentityType || {});
187
+ async function getRobotsTxt2(options) {
188
+ const { httpClient, sideEffects } = arguments[1];
189
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
190
+ subdomain: options?.subdomain
191
+ });
192
+ const reqOpts = getRobotsTxt(payload);
193
+ sideEffects?.onSiteCall?.();
194
+ try {
195
+ const result = await httpClient.request(reqOpts);
196
+ sideEffects?.onSuccess?.(result);
197
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
198
+ } catch (err) {
199
+ const transformedError = (0, import_transform_error.transformError)(
200
+ err,
201
+ {
202
+ spreadPathsToArguments: {},
203
+ explicitPathsToArguments: { subdomain: "$[0].subdomain" },
204
+ singleArgumentUnchanged: false
205
+ },
206
+ ["options"]
207
+ );
208
+ sideEffects?.onError?.(err);
209
+ throw transformedError;
210
+ }
211
+ }
212
+ async function updateRobotsTxt2(options) {
213
+ const { httpClient, sideEffects } = arguments[1];
214
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
215
+ robotsTxt: options?.robotsTxt
216
+ });
217
+ const reqOpts = updateRobotsTxt(payload);
218
+ sideEffects?.onSiteCall?.();
219
+ try {
220
+ const result = await httpClient.request(reqOpts);
221
+ sideEffects?.onSuccess?.(result);
222
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
223
+ } catch (err) {
224
+ const transformedError = (0, import_transform_error.transformError)(
225
+ err,
226
+ {
227
+ spreadPathsToArguments: {},
228
+ explicitPathsToArguments: { robotsTxt: "$[0].robotsTxt" },
229
+ singleArgumentUnchanged: false
230
+ },
231
+ ["options"]
232
+ );
233
+ sideEffects?.onError?.(err);
234
+ throw transformedError;
235
+ }
236
+ }
237
+
238
+ // src/promote-seo-v2-robots-txt-robots-txt.public.ts
239
+ function getRobotsTxt3(httpClient) {
240
+ return (options) => getRobotsTxt2(
241
+ options,
242
+ // @ts-ignore
243
+ { httpClient }
244
+ );
245
+ }
246
+ function updateRobotsTxt3(httpClient) {
247
+ return (options) => updateRobotsTxt2(
248
+ options,
249
+ // @ts-ignore
250
+ { httpClient }
251
+ );
252
+ }
253
+ var onRobotsTxtUpdated = (0, import_sdk_types.EventDefinition)(
254
+ "wix.promote.seo.robots_txt_updated",
255
+ true,
256
+ (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
257
+ (0, import_transform_paths.transformPaths)(event, [
258
+ {
259
+ transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
260
+ paths: [{ path: "metadata.eventTime" }]
261
+ }
262
+ ])
263
+ )
264
+ )();
265
+
266
+ // src/promote-seo-v2-robots-txt-robots-txt.context.ts
267
+ var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
268
+ var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
269
+ var getRobotsTxt4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getRobotsTxt3);
270
+ var updateRobotsTxt4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(updateRobotsTxt3);
271
+ var onRobotsTxtUpdated2 = (0, import_event_definition_modules.createEventModule)(onRobotsTxtUpdated);
272
+ // Annotate the CommonJS export names for ESM import in node:
273
+ 0 && (module.exports = {
274
+ WebhookIdentityType,
275
+ getRobotsTxt,
276
+ onRobotsTxtUpdated,
277
+ updateRobotsTxt
278
+ });
279
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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":"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","names":["getRobotsTxt","onRobotsTxtUpdated","updateRobotsTxt","import_rename_all_nested_keys","import_rest_modules","WebhookIdentityType","getRobotsTxt","sdkTransformError","updateRobotsTxt","getRobotsTxt","updateRobotsTxt","import_rest_modules","getRobotsTxt","updateRobotsTxt","onRobotsTxtUpdated"]}
@@ -0,0 +1,269 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ interface RobotsTxt {
4
+ /**
5
+ * The robots.txt file content
6
+ * @maxLength 720000
7
+ */
8
+ content?: string;
9
+ /** The Wix default robots.txt file content */
10
+ default?: boolean;
11
+ /**
12
+ * The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www.
13
+ * @maxLength 63
14
+ */
15
+ subdomain?: string;
16
+ }
17
+ /** The request to get the Robots.txt file content */
18
+ interface GetRobotsTxtRequest {
19
+ /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */
20
+ subdomain?: string;
21
+ }
22
+ /** The response of the Robots.txt file request */
23
+ interface GetRobotsTxtResponse {
24
+ robotsTxt?: RobotsTxt;
25
+ }
26
+ /** The request to update the content of the Robots.txt file */
27
+ interface UpdateRobotsTxtRequest {
28
+ /**
29
+ * Provided content will override existing content.
30
+ * Use `default:true` to reset the content to default, no `content` is required in that case
31
+ */
32
+ robotsTxt?: RobotsTxt;
33
+ }
34
+ interface UpdateRobotsTxtResponse {
35
+ /** updated robots.txt file */
36
+ robotsTxt?: RobotsTxt;
37
+ }
38
+ interface DomainEvent extends DomainEventBodyOneOf {
39
+ createdEvent?: EntityCreatedEvent;
40
+ updatedEvent?: EntityUpdatedEvent;
41
+ deletedEvent?: EntityDeletedEvent;
42
+ actionEvent?: ActionEvent;
43
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
44
+ _id?: string;
45
+ /**
46
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
47
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
48
+ */
49
+ entityFqdn?: string;
50
+ /**
51
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
52
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
53
+ */
54
+ slug?: string;
55
+ /** ID of the entity associated with the event. */
56
+ entityId?: string;
57
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
58
+ eventTime?: Date | null;
59
+ /**
60
+ * Whether the event was triggered as a result of a privacy regulation application
61
+ * (for example, GDPR).
62
+ */
63
+ triggeredByAnonymizeRequest?: boolean | null;
64
+ /** If present, indicates the action that triggered the event. */
65
+ originatedFrom?: string | null;
66
+ /**
67
+ * 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.
68
+ * 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.
69
+ */
70
+ entityEventSequence?: string | null;
71
+ }
72
+ /** @oneof */
73
+ interface DomainEventBodyOneOf {
74
+ createdEvent?: EntityCreatedEvent;
75
+ updatedEvent?: EntityUpdatedEvent;
76
+ deletedEvent?: EntityDeletedEvent;
77
+ actionEvent?: ActionEvent;
78
+ }
79
+ interface EntityCreatedEvent {
80
+ entity?: string;
81
+ }
82
+ interface RestoreInfo {
83
+ deletedDate?: Date | null;
84
+ }
85
+ interface EntityUpdatedEvent {
86
+ /**
87
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
88
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
89
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
90
+ */
91
+ currentEntity?: string;
92
+ }
93
+ interface EntityDeletedEvent {
94
+ /** Entity that was deleted. */
95
+ deletedEntity?: string | null;
96
+ }
97
+ interface ActionEvent {
98
+ body?: string;
99
+ }
100
+ interface MessageEnvelope {
101
+ /**
102
+ * App instance ID.
103
+ * @format GUID
104
+ */
105
+ instanceId?: string | null;
106
+ /**
107
+ * Event type.
108
+ * @maxLength 150
109
+ */
110
+ eventType?: string;
111
+ /** The identification type and identity data. */
112
+ identity?: IdentificationData;
113
+ /** Stringify payload. */
114
+ data?: string;
115
+ }
116
+ interface IdentificationData extends IdentificationDataIdOneOf {
117
+ /**
118
+ * ID of a site visitor that has not logged in to the site.
119
+ * @format GUID
120
+ */
121
+ anonymousVisitorId?: string;
122
+ /**
123
+ * ID of a site visitor that has logged in to the site.
124
+ * @format GUID
125
+ */
126
+ memberId?: string;
127
+ /**
128
+ * ID of a Wix user (site owner, contributor, etc.).
129
+ * @format GUID
130
+ */
131
+ wixUserId?: string;
132
+ /**
133
+ * ID of an app.
134
+ * @format GUID
135
+ */
136
+ appId?: string;
137
+ /** @readonly */
138
+ identityType?: WebhookIdentityTypeWithLiterals;
139
+ }
140
+ /** @oneof */
141
+ interface IdentificationDataIdOneOf {
142
+ /**
143
+ * ID of a site visitor that has not logged in to the site.
144
+ * @format GUID
145
+ */
146
+ anonymousVisitorId?: string;
147
+ /**
148
+ * ID of a site visitor that has logged in to the site.
149
+ * @format GUID
150
+ */
151
+ memberId?: string;
152
+ /**
153
+ * ID of a Wix user (site owner, contributor, etc.).
154
+ * @format GUID
155
+ */
156
+ wixUserId?: string;
157
+ /**
158
+ * ID of an app.
159
+ * @format GUID
160
+ */
161
+ appId?: string;
162
+ }
163
+ declare enum WebhookIdentityType {
164
+ UNKNOWN = "UNKNOWN",
165
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
166
+ MEMBER = "MEMBER",
167
+ WIX_USER = "WIX_USER",
168
+ APP = "APP"
169
+ }
170
+ /** @enumType */
171
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
172
+ interface BaseEventMetadata {
173
+ /**
174
+ * App instance ID.
175
+ * @format GUID
176
+ */
177
+ instanceId?: string | null;
178
+ /**
179
+ * Event type.
180
+ * @maxLength 150
181
+ */
182
+ eventType?: string;
183
+ /** The identification type and identity data. */
184
+ identity?: IdentificationData;
185
+ }
186
+ interface EventMetadata extends BaseEventMetadata {
187
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
188
+ _id?: string;
189
+ /**
190
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
191
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
192
+ */
193
+ entityFqdn?: string;
194
+ /**
195
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
196
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
197
+ */
198
+ slug?: string;
199
+ /** ID of the entity associated with the event. */
200
+ entityId?: string;
201
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
202
+ eventTime?: Date | null;
203
+ /**
204
+ * Whether the event was triggered as a result of a privacy regulation application
205
+ * (for example, GDPR).
206
+ */
207
+ triggeredByAnonymizeRequest?: boolean | null;
208
+ /** If present, indicates the action that triggered the event. */
209
+ originatedFrom?: string | null;
210
+ /**
211
+ * 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.
212
+ * 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.
213
+ */
214
+ entityEventSequence?: string | null;
215
+ }
216
+ interface RobotsTxtUpdatedEnvelope {
217
+ entity: RobotsTxt;
218
+ metadata: EventMetadata;
219
+ }
220
+ /** @permissionScope Manage Stores
221
+ * @permissionScopeId SCOPE.STORES.MANAGE-STORES
222
+ * @permissionId wix-seo.read
223
+ * @webhook
224
+ * @eventType wix.promote.seo.robots_txt_updated
225
+ * @serviceIdentifier com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2
226
+ * @slug updated
227
+ * @documentationMaturity preview
228
+ */
229
+ declare function onRobotsTxtUpdated(handler: (event: RobotsTxtUpdatedEnvelope) => void | Promise<void>): void;
230
+ type RobotsTxtNonNullablePaths = `content` | `default` | `subdomain`;
231
+ /**
232
+ * Get the Robots.txt file content.
233
+ * Returns the content and whether it's the default.
234
+ * @public
235
+ * @documentationMaturity preview
236
+ * @permissionId wix-seo.read
237
+ * @applicableIdentity APP
238
+ * @applicableIdentity MEMBER
239
+ * @returns The response of the Robots.txt file request
240
+ * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.GetRobotsTxt
241
+ */
242
+ declare function getRobotsTxt(options?: GetRobotsTxtOptions): Promise<NonNullablePaths<GetRobotsTxtResponse, {
243
+ [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
244
+ }[RobotsTxtNonNullablePaths]>>;
245
+ interface GetRobotsTxtOptions {
246
+ /** The subdomain of the requested robots.txt file ,e.g. www, es, fr. default is www. */
247
+ subdomain?: string;
248
+ }
249
+ /**
250
+ * Update the Robots.txt file content.
251
+ * You may set an empty string as the file content.
252
+ * In order to reset the content to Wix's default, send `default: true`.
253
+ * @public
254
+ * @documentationMaturity preview
255
+ * @permissionId wix-seo.edit
256
+ * @fqn com.wixpress.promote.seo.robots.server.v2.RobotsServiceV2.UpdateRobotsTxt
257
+ */
258
+ declare function updateRobotsTxt(options?: UpdateRobotsTxtOptions): Promise<NonNullablePaths<UpdateRobotsTxtResponse, {
259
+ [P in RobotsTxtNonNullablePaths]: `robotsTxt.${P}`;
260
+ }[RobotsTxtNonNullablePaths]>>;
261
+ interface UpdateRobotsTxtOptions {
262
+ /**
263
+ * Provided content will override existing content.
264
+ * Use `default:true` to reset the content to default, no `content` is required in that case
265
+ */
266
+ robotsTxt?: RobotsTxt;
267
+ }
268
+
269
+ export { type ActionEvent, type BaseEventMetadata, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetRobotsTxtOptions, type GetRobotsTxtRequest, type GetRobotsTxtResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type RestoreInfo, type RobotsTxt, type RobotsTxtUpdatedEnvelope, type UpdateRobotsTxtOptions, type UpdateRobotsTxtRequest, type UpdateRobotsTxtResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getRobotsTxt, onRobotsTxtUpdated, updateRobotsTxt };