@wix/auto_sdk_seo_page-optimization 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.
@@ -0,0 +1,306 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * A whole-page set of SEO optimization suggestions, generated for one page
5
+ * and focus keyword.
6
+ *
7
+ * Each suggestion is a before/after pair: `before` is the page's current
8
+ * text (empty when the page has none, such as a missing meta description),
9
+ * and `after` is the suggested replacement. Locate the element to change by
10
+ * its `before` text.
11
+ */
12
+ interface PageOptimization {
13
+ /**
14
+ * ID of this suggestion set.
15
+ * @format GUID
16
+ * @readonly
17
+ */
18
+ _id?: string | null;
19
+ /**
20
+ * Suggested title tag.
21
+ * @readonly
22
+ */
23
+ metaTitle?: TextSuggestion;
24
+ /**
25
+ * Suggested description tag.
26
+ * @readonly
27
+ */
28
+ metaDescription?: TextSuggestion;
29
+ /**
30
+ * Suggested H1 heading.
31
+ * @readonly
32
+ */
33
+ h1?: TextSuggestion;
34
+ /**
35
+ * Suggested H2 or H3 heading.
36
+ * @readonly
37
+ */
38
+ h2OrH3?: TextSuggestion;
39
+ /**
40
+ * Suggested body text rewrites.
41
+ * @readonly
42
+ * @maxSize 100
43
+ */
44
+ content?: TextSuggestion[];
45
+ }
46
+ /** One suggested text change. */
47
+ interface TextSuggestion {
48
+ /**
49
+ * The page's current text. Empty when the page has no text in this slot —
50
+ * for example, a missing meta description.
51
+ * @readonly
52
+ * @maxLength 1000
53
+ */
54
+ before?: string | null;
55
+ /**
56
+ * The suggested text.
57
+ * @readonly
58
+ * @maxLength 1000
59
+ */
60
+ after?: string;
61
+ }
62
+ interface TriggerPageOptimizationRequest {
63
+ /**
64
+ * ID of the site page to optimize.
65
+ * @maxLength 1000
66
+ * @minLength 1
67
+ */
68
+ pageId: string;
69
+ /**
70
+ * URL path of the page, relative to the site's domain. For example,
71
+ * `/about`.
72
+ * @maxLength 1000
73
+ * @minLength 1
74
+ */
75
+ pagePath: string;
76
+ }
77
+ interface TriggerPageOptimizationResponse {
78
+ /**
79
+ * ID of the generation job. Pass to Get Page Optimization Results.
80
+ * @readonly
81
+ * @maxLength 200
82
+ */
83
+ predictionId?: string;
84
+ }
85
+ interface TriggerHomePageOptimizationRequest {
86
+ /**
87
+ * ID of the site's homepage.
88
+ * @maxLength 1000
89
+ * @minLength 1
90
+ */
91
+ pageId: string;
92
+ /**
93
+ * URL path of the homepage. Usually `/`.
94
+ * @maxLength 1000
95
+ * @minLength 1
96
+ */
97
+ pagePath: string;
98
+ }
99
+ interface TriggerHomePageOptimizationResponse {
100
+ /**
101
+ * ID of the generation job. Pass to Get Page Optimization Results.
102
+ * @readonly
103
+ * @maxLength 200
104
+ */
105
+ predictionId?: string;
106
+ }
107
+ interface GetPageOptimizationResultsRequest {
108
+ /**
109
+ * ID of the generation job, from the trigger call.
110
+ * @maxLength 200
111
+ */
112
+ predictionId?: string | null;
113
+ /**
114
+ * ID of the page to retrieve suggestions for. An alternative to
115
+ * `predictionId` — returns the page's latest generation.
116
+ * @maxLength 1000
117
+ */
118
+ pageId?: string | null;
119
+ }
120
+ interface GetPageOptimizationResultsResponse {
121
+ /** The generated suggestions. Returned only when `status` is `COMPLETED`. */
122
+ pageOptimization?: PageOptimization;
123
+ /**
124
+ * Status of the generation job the lookup matched.
125
+ * @readonly
126
+ */
127
+ status?: OptimizationStatusWithLiterals;
128
+ }
129
+ /** Status of a page optimization generation job. */
130
+ declare enum OptimizationStatus {
131
+ UNKNOWN_OPTIMIZATION_STATUS = "UNKNOWN_OPTIMIZATION_STATUS",
132
+ /**
133
+ * No generation job matches the lookup — it never existed, or a later
134
+ * trigger for the same page replaced it.
135
+ */
136
+ NOT_FOUND = "NOT_FOUND",
137
+ /** Generation is still running. Poll again. */
138
+ IN_PROGRESS = "IN_PROGRESS",
139
+ /** Generation finished; the response carries the suggestions. */
140
+ COMPLETED = "COMPLETED",
141
+ /** Generation failed. Trigger again to retry. */
142
+ FAILED = "FAILED"
143
+ }
144
+ /** @enumType */
145
+ type OptimizationStatusWithLiterals = OptimizationStatus | 'UNKNOWN_OPTIMIZATION_STATUS' | 'NOT_FOUND' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
146
+ /** @docsIgnore */
147
+ type TriggerPageOptimizationApplicationErrors = {
148
+ code?: 'SITE_NOT_SUPPORTED';
149
+ description?: string;
150
+ data?: Record<string, any>;
151
+ } | {
152
+ code?: 'FOCUS_KEYWORD_NOT_SET';
153
+ description?: string;
154
+ data?: Record<string, any>;
155
+ } | {
156
+ code?: 'CONTENT_TOO_SHORT';
157
+ description?: string;
158
+ data?: Record<string, any>;
159
+ } | {
160
+ code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';
161
+ description?: string;
162
+ data?: Record<string, any>;
163
+ } | {
164
+ code?: 'GENERATION_FAILED';
165
+ description?: string;
166
+ data?: Record<string, any>;
167
+ } | {
168
+ code?: 'QUOTA_LIMIT_REACHED';
169
+ description?: string;
170
+ data?: Record<string, any>;
171
+ };
172
+ /** @docsIgnore */
173
+ type TriggerHomePageOptimizationApplicationErrors = {
174
+ code?: 'SITE_NOT_SUPPORTED';
175
+ description?: string;
176
+ data?: Record<string, any>;
177
+ } | {
178
+ code?: 'FOCUS_KEYWORD_NOT_SET';
179
+ description?: string;
180
+ data?: Record<string, any>;
181
+ } | {
182
+ code?: 'CONTENT_TOO_SHORT';
183
+ description?: string;
184
+ data?: Record<string, any>;
185
+ } | {
186
+ code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';
187
+ description?: string;
188
+ data?: Record<string, any>;
189
+ } | {
190
+ code?: 'GENERATION_FAILED';
191
+ description?: string;
192
+ data?: Record<string, any>;
193
+ } | {
194
+ code?: 'QUOTA_LIMIT_REACHED';
195
+ description?: string;
196
+ data?: Record<string, any>;
197
+ };
198
+ /** @docsIgnore */
199
+ type GetPageOptimizationResultsApplicationErrors = {
200
+ code?: 'GENERATION_FAILED';
201
+ description?: string;
202
+ data?: Record<string, any>;
203
+ } | {
204
+ code?: 'QUOTA_LIMIT_REACHED';
205
+ description?: string;
206
+ data?: Record<string, any>;
207
+ };
208
+ /**
209
+ * Starts generating optimization suggestions for a site page.
210
+ *
211
+ * The suggestions target the page's focus keyword, so set it first: run
212
+ * keyword research, set the chosen keyword as the page's focus keyword,
213
+ * then trigger. Returns a `predictionId` to poll Get Page Optimization
214
+ * Results with.
215
+ *
216
+ * Triggering is idempotent per page: while a generation for the page is in
217
+ * progress, calling again returns the same `predictionId` instead of
218
+ * starting a new job — unless the page's focus keyword changed since the
219
+ * job started, which returns a `SUGGESTIONS_ALREADY_IN_PROGRESS` error.
220
+ * @param pageId - ID of the site page to optimize.
221
+ * @public
222
+ * @documentationMaturity preview
223
+ * @requiredField options
224
+ * @requiredField options.pagePath
225
+ * @requiredField pageId
226
+ * @permissionId seo:suggestions:v1:page_optimization:trigger_page_optimization
227
+ * @applicableIdentity APP
228
+ * @fqn wix.seo.suggestions.v1.PageOptimizationService.TriggerPageOptimization
229
+ */
230
+ declare function triggerPageOptimization(pageId: string, options: NonNullablePaths<TriggerPageOptimizationOptions, `pagePath`, 2>): Promise<NonNullablePaths<TriggerPageOptimizationResponse, `predictionId`, 2> & {
231
+ __applicationErrorsType?: TriggerPageOptimizationApplicationErrors;
232
+ }>;
233
+ interface TriggerPageOptimizationOptions {
234
+ /**
235
+ * URL path of the page, relative to the site's domain. For example,
236
+ * `/about`.
237
+ * @maxLength 1000
238
+ * @minLength 1
239
+ */
240
+ pagePath: string;
241
+ }
242
+ /**
243
+ * Starts generating optimization suggestions for the site's homepage.
244
+ *
245
+ * The homepage gets its own method because its suggestions are generated
246
+ * with homepage-specific guidance — representing the whole site, not one
247
+ * topic. Same contract as Trigger Page Optimization: the homepage's focus
248
+ * keyword must be set first, the call returns a `predictionId` to poll,
249
+ * and triggering is idempotent per page while a job is in progress.
250
+ * @param pageId - ID of the site's homepage.
251
+ * @public
252
+ * @documentationMaturity preview
253
+ * @requiredField options
254
+ * @requiredField options.pagePath
255
+ * @requiredField pageId
256
+ * @permissionId seo:suggestions:v1:page_optimization:trigger_home_page_optimization
257
+ * @applicableIdentity APP
258
+ * @fqn wix.seo.suggestions.v1.PageOptimizationService.TriggerHomePageOptimization
259
+ */
260
+ declare function triggerHomePageOptimization(pageId: string, options: NonNullablePaths<TriggerHomePageOptimizationOptions, `pagePath`, 2>): Promise<NonNullablePaths<TriggerHomePageOptimizationResponse, `predictionId`, 2> & {
261
+ __applicationErrorsType?: TriggerHomePageOptimizationApplicationErrors;
262
+ }>;
263
+ interface TriggerHomePageOptimizationOptions {
264
+ /**
265
+ * URL path of the homepage. Usually `/`.
266
+ * @maxLength 1000
267
+ * @minLength 1
268
+ */
269
+ pagePath: string;
270
+ }
271
+ /**
272
+ * Retrieves the optimization suggestions generated for a page.
273
+ *
274
+ * Poll this method after a trigger call. The response's `status` reports
275
+ * where the job stands: while generation is still in progress the
276
+ * suggestions are empty and `status` is `IN_PROGRESS`; when it completes,
277
+ * the response carries the full suggestion set with `status` `COMPLETED`.
278
+ * A job that failed reports `FAILED` — trigger again to retry. Suggestions
279
+ * are stored per page — a later trigger for the same page replaces them,
280
+ * and a replaced job's lookup reports `NOT_FOUND`.
281
+ *
282
+ * Look up by `predictionId` (from the trigger call), or by `pageId`.
283
+ * @public
284
+ * @documentationMaturity preview
285
+ * @permissionId seo:suggestions:v1:page_optimization:get_page_optimization_results
286
+ * @applicableIdentity APP
287
+ * @fqn wix.seo.suggestions.v1.PageOptimizationService.GetPageOptimizationResults
288
+ */
289
+ declare function getPageOptimizationResults(options?: GetPageOptimizationResultsOptions): Promise<NonNullablePaths<GetPageOptimizationResultsResponse, `pageOptimization.metaTitle.after` | `pageOptimization.content` | `status`, 4> & {
290
+ __applicationErrorsType?: GetPageOptimizationResultsApplicationErrors;
291
+ }>;
292
+ interface GetPageOptimizationResultsOptions {
293
+ /**
294
+ * ID of the generation job, from the trigger call.
295
+ * @maxLength 200
296
+ */
297
+ predictionId?: string | null;
298
+ /**
299
+ * ID of the page to retrieve suggestions for. An alternative to
300
+ * `predictionId` — returns the page's latest generation.
301
+ * @maxLength 1000
302
+ */
303
+ pageId?: string | null;
304
+ }
305
+
306
+ export { type GetPageOptimizationResultsApplicationErrors, type GetPageOptimizationResultsOptions, type GetPageOptimizationResultsRequest, type GetPageOptimizationResultsResponse, OptimizationStatus, type OptimizationStatusWithLiterals, type PageOptimization, type TextSuggestion, type TriggerHomePageOptimizationApplicationErrors, type TriggerHomePageOptimizationOptions, type TriggerHomePageOptimizationRequest, type TriggerHomePageOptimizationResponse, type TriggerPageOptimizationApplicationErrors, type TriggerPageOptimizationOptions, type TriggerPageOptimizationRequest, type TriggerPageOptimizationResponse, getPageOptimizationResults, triggerHomePageOptimization, triggerPageOptimization };
@@ -0,0 +1,258 @@
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.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ OptimizationStatus: () => OptimizationStatus,
24
+ getPageOptimizationResults: () => getPageOptimizationResults2,
25
+ triggerHomePageOptimization: () => triggerHomePageOptimization2,
26
+ triggerPageOptimization: () => triggerPageOptimization2
27
+ });
28
+ module.exports = __toCommonJS(index_typings_exports);
29
+
30
+ // src/seo-suggestions-v1-page-optimization-page-optimization.universal.ts
31
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
32
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
33
+
34
+ // src/seo-suggestions-v1-page-optimization-page-optimization.http.ts
35
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
36
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
37
+ function resolveWixSeoSuggestionsV1PageOptimizationServiceUrl(opts) {
38
+ const domainToMappings = {
39
+ "bo._base_domain_": [
40
+ {
41
+ srcPath: "/_serverless/seo-tags-suggestions-service",
42
+ destPath: ""
43
+ }
44
+ ],
45
+ "wixbo.ai": [
46
+ {
47
+ srcPath: "/_serverless/seo-tags-suggestions-service",
48
+ destPath: ""
49
+ }
50
+ ],
51
+ "wix-bo.com": [
52
+ {
53
+ srcPath: "/_serverless/seo-tags-suggestions-service",
54
+ destPath: ""
55
+ }
56
+ ],
57
+ "manage._base_domain_": [
58
+ {
59
+ srcPath: "/_serverless/seo-tags-suggestions-service",
60
+ destPath: ""
61
+ }
62
+ ],
63
+ "editor._base_domain_": [
64
+ {
65
+ srcPath: "/_api/seo-tags-suggestions-service",
66
+ destPath: ""
67
+ }
68
+ ],
69
+ "blocks._base_domain_": [
70
+ {
71
+ srcPath: "/_api/seo-tags-suggestions-service",
72
+ destPath: ""
73
+ }
74
+ ],
75
+ "create.editorx": [
76
+ {
77
+ srcPath: "/_api/seo-tags-suggestions-service",
78
+ destPath: ""
79
+ }
80
+ ],
81
+ "www.wixapis.com": [
82
+ {
83
+ srcPath: "/seo-suggestions/v1",
84
+ destPath: "/v1"
85
+ }
86
+ ]
87
+ };
88
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
89
+ }
90
+ var PACKAGE_NAME = "@wix/auto_sdk_seo_page-optimization";
91
+ function triggerPageOptimization(payload) {
92
+ function __triggerPageOptimization({ host }) {
93
+ const metadata = {
94
+ entityFqdn: "wix.seo.suggestions.v1.page_optimization",
95
+ method: "POST",
96
+ methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.TriggerPageOptimization",
97
+ packageName: PACKAGE_NAME,
98
+ migrationOptions: {
99
+ optInTransformResponse: true
100
+ },
101
+ url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
102
+ protoPath: "/v1/page-optimization/trigger",
103
+ data: payload,
104
+ host
105
+ }),
106
+ data: payload
107
+ };
108
+ return metadata;
109
+ }
110
+ return __triggerPageOptimization;
111
+ }
112
+ function triggerHomePageOptimization(payload) {
113
+ function __triggerHomePageOptimization({ host }) {
114
+ const metadata = {
115
+ entityFqdn: "wix.seo.suggestions.v1.page_optimization",
116
+ method: "POST",
117
+ methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.TriggerHomePageOptimization",
118
+ packageName: PACKAGE_NAME,
119
+ migrationOptions: {
120
+ optInTransformResponse: true
121
+ },
122
+ url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
123
+ protoPath: "/v1/page-optimization/trigger-home",
124
+ data: payload,
125
+ host
126
+ }),
127
+ data: payload
128
+ };
129
+ return metadata;
130
+ }
131
+ return __triggerHomePageOptimization;
132
+ }
133
+ function getPageOptimizationResults(payload) {
134
+ function __getPageOptimizationResults({ host }) {
135
+ const metadata = {
136
+ entityFqdn: "wix.seo.suggestions.v1.page_optimization",
137
+ method: "GET",
138
+ methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.GetPageOptimizationResults",
139
+ packageName: PACKAGE_NAME,
140
+ migrationOptions: {
141
+ optInTransformResponse: true
142
+ },
143
+ url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
144
+ protoPath: "/v1/page-optimization/results",
145
+ data: payload,
146
+ host
147
+ }),
148
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
149
+ };
150
+ return metadata;
151
+ }
152
+ return __getPageOptimizationResults;
153
+ }
154
+
155
+ // src/seo-suggestions-v1-page-optimization-page-optimization.universal.ts
156
+ var OptimizationStatus = /* @__PURE__ */ ((OptimizationStatus2) => {
157
+ OptimizationStatus2["UNKNOWN_OPTIMIZATION_STATUS"] = "UNKNOWN_OPTIMIZATION_STATUS";
158
+ OptimizationStatus2["NOT_FOUND"] = "NOT_FOUND";
159
+ OptimizationStatus2["IN_PROGRESS"] = "IN_PROGRESS";
160
+ OptimizationStatus2["COMPLETED"] = "COMPLETED";
161
+ OptimizationStatus2["FAILED"] = "FAILED";
162
+ return OptimizationStatus2;
163
+ })(OptimizationStatus || {});
164
+ async function triggerPageOptimization2(pageId, options) {
165
+ const { httpClient, sideEffects } = arguments[2];
166
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
167
+ pageId,
168
+ pagePath: options?.pagePath
169
+ });
170
+ const reqOpts = triggerPageOptimization(
171
+ payload
172
+ );
173
+ sideEffects?.onSiteCall?.();
174
+ try {
175
+ const result = await httpClient.request(reqOpts);
176
+ sideEffects?.onSuccess?.(result);
177
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
178
+ } catch (err) {
179
+ const transformedError = (0, import_transform_error.transformError)(
180
+ err,
181
+ {
182
+ spreadPathsToArguments: {},
183
+ explicitPathsToArguments: { pageId: "$[0]", pagePath: "$[1].pagePath" },
184
+ singleArgumentUnchanged: false
185
+ },
186
+ ["pageId", "options"]
187
+ );
188
+ sideEffects?.onError?.(err);
189
+ throw transformedError;
190
+ }
191
+ }
192
+ async function triggerHomePageOptimization2(pageId, options) {
193
+ const { httpClient, sideEffects } = arguments[2];
194
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
195
+ pageId,
196
+ pagePath: options?.pagePath
197
+ });
198
+ const reqOpts = triggerHomePageOptimization(
199
+ payload
200
+ );
201
+ sideEffects?.onSiteCall?.();
202
+ try {
203
+ const result = await httpClient.request(reqOpts);
204
+ sideEffects?.onSuccess?.(result);
205
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
206
+ } catch (err) {
207
+ const transformedError = (0, import_transform_error.transformError)(
208
+ err,
209
+ {
210
+ spreadPathsToArguments: {},
211
+ explicitPathsToArguments: { pageId: "$[0]", pagePath: "$[1].pagePath" },
212
+ singleArgumentUnchanged: false
213
+ },
214
+ ["pageId", "options"]
215
+ );
216
+ sideEffects?.onError?.(err);
217
+ throw transformedError;
218
+ }
219
+ }
220
+ async function getPageOptimizationResults2(options) {
221
+ const { httpClient, sideEffects } = arguments[1];
222
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
223
+ predictionId: options?.predictionId,
224
+ pageId: options?.pageId
225
+ });
226
+ const reqOpts = getPageOptimizationResults(
227
+ payload
228
+ );
229
+ sideEffects?.onSiteCall?.();
230
+ try {
231
+ const result = await httpClient.request(reqOpts);
232
+ sideEffects?.onSuccess?.(result);
233
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
234
+ } catch (err) {
235
+ const transformedError = (0, import_transform_error.transformError)(
236
+ err,
237
+ {
238
+ spreadPathsToArguments: {},
239
+ explicitPathsToArguments: {
240
+ predictionId: "$[0].predictionId",
241
+ pageId: "$[0].pageId"
242
+ },
243
+ singleArgumentUnchanged: false
244
+ },
245
+ ["options"]
246
+ );
247
+ sideEffects?.onError?.(err);
248
+ throw transformedError;
249
+ }
250
+ }
251
+ // Annotate the CommonJS export names for ESM import in node:
252
+ 0 && (module.exports = {
253
+ OptimizationStatus,
254
+ getPageOptimizationResults,
255
+ triggerHomePageOptimization,
256
+ triggerPageOptimization
257
+ });
258
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/seo-suggestions-v1-page-optimization-page-optimization.universal.ts","../../src/seo-suggestions-v1-page-optimization-page-optimization.http.ts"],"sourcesContent":["export * from './src/seo-suggestions-v1-page-optimization-page-optimization.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 ambassadorWixSeoSuggestionsV1PageOptimization from './seo-suggestions-v1-page-optimization-page-optimization.http.js';\n\n/**\n * A whole-page set of SEO optimization suggestions, generated for one page\n * and focus keyword.\n *\n * Each suggestion is a before/after pair: `before` is the page's current\n * text (empty when the page has none, such as a missing meta description),\n * and `after` is the suggested replacement. Locate the element to change by\n * its `before` text.\n */\nexport interface PageOptimization {\n /**\n * ID of this suggestion set.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Suggested title tag.\n * @readonly\n */\n metaTitle?: TextSuggestion;\n /**\n * Suggested description tag.\n * @readonly\n */\n metaDescription?: TextSuggestion;\n /**\n * Suggested H1 heading.\n * @readonly\n */\n h1?: TextSuggestion;\n /**\n * Suggested H2 or H3 heading.\n * @readonly\n */\n h2OrH3?: TextSuggestion;\n /**\n * Suggested body text rewrites.\n * @readonly\n * @maxSize 100\n */\n content?: TextSuggestion[];\n}\n\n/** One suggested text change. */\nexport interface TextSuggestion {\n /**\n * The page's current text. Empty when the page has no text in this slot —\n * for example, a missing meta description.\n * @readonly\n * @maxLength 1000\n */\n before?: string | null;\n /**\n * The suggested text.\n * @readonly\n * @maxLength 1000\n */\n after?: string;\n}\n\nexport interface TriggerPageOptimizationRequest {\n /**\n * ID of the site page to optimize.\n * @maxLength 1000\n * @minLength 1\n */\n pageId: string;\n /**\n * URL path of the page, relative to the site's domain. For example,\n * `/about`.\n * @maxLength 1000\n * @minLength 1\n */\n pagePath: string;\n}\n\nexport interface TriggerPageOptimizationResponse {\n /**\n * ID of the generation job. Pass to Get Page Optimization Results.\n * @readonly\n * @maxLength 200\n */\n predictionId?: string;\n}\n\nexport interface TriggerHomePageOptimizationRequest {\n /**\n * ID of the site's homepage.\n * @maxLength 1000\n * @minLength 1\n */\n pageId: string;\n /**\n * URL path of the homepage. Usually `/`.\n * @maxLength 1000\n * @minLength 1\n */\n pagePath: string;\n}\n\nexport interface TriggerHomePageOptimizationResponse {\n /**\n * ID of the generation job. Pass to Get Page Optimization Results.\n * @readonly\n * @maxLength 200\n */\n predictionId?: string;\n}\n\nexport interface GetPageOptimizationResultsRequest {\n /**\n * ID of the generation job, from the trigger call.\n * @maxLength 200\n */\n predictionId?: string | null;\n /**\n * ID of the page to retrieve suggestions for. An alternative to\n * `predictionId` — returns the page's latest generation.\n * @maxLength 1000\n */\n pageId?: string | null;\n}\n\nexport interface GetPageOptimizationResultsResponse {\n /** The generated suggestions. Returned only when `status` is `COMPLETED`. */\n pageOptimization?: PageOptimization;\n /**\n * Status of the generation job the lookup matched.\n * @readonly\n */\n status?: OptimizationStatusWithLiterals;\n}\n\n/** Status of a page optimization generation job. */\nexport enum OptimizationStatus {\n UNKNOWN_OPTIMIZATION_STATUS = 'UNKNOWN_OPTIMIZATION_STATUS',\n /**\n * No generation job matches the lookup — it never existed, or a later\n * trigger for the same page replaced it.\n */\n NOT_FOUND = 'NOT_FOUND',\n /** Generation is still running. Poll again. */\n IN_PROGRESS = 'IN_PROGRESS',\n /** Generation finished; the response carries the suggestions. */\n COMPLETED = 'COMPLETED',\n /** Generation failed. Trigger again to retry. */\n FAILED = 'FAILED',\n}\n\n/** @enumType */\nexport type OptimizationStatusWithLiterals =\n | OptimizationStatus\n | 'UNKNOWN_OPTIMIZATION_STATUS'\n | 'NOT_FOUND'\n | 'IN_PROGRESS'\n | 'COMPLETED'\n | 'FAILED';\n/** @docsIgnore */\nexport type TriggerPageOptimizationApplicationErrors =\n | {\n code?: 'SITE_NOT_SUPPORTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'FOCUS_KEYWORD_NOT_SET';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'CONTENT_TOO_SHORT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'GENERATION_FAILED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUOTA_LIMIT_REACHED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type TriggerHomePageOptimizationApplicationErrors =\n | {\n code?: 'SITE_NOT_SUPPORTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'FOCUS_KEYWORD_NOT_SET';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'CONTENT_TOO_SHORT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'GENERATION_FAILED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUOTA_LIMIT_REACHED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type GetPageOptimizationResultsApplicationErrors =\n | {\n code?: 'GENERATION_FAILED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'QUOTA_LIMIT_REACHED';\n description?: string;\n data?: Record<string, any>;\n };\n\n/**\n * Starts generating optimization suggestions for a site page.\n *\n * The suggestions target the page's focus keyword, so set it first: run\n * keyword research, set the chosen keyword as the page's focus keyword,\n * then trigger. Returns a `predictionId` to poll Get Page Optimization\n * Results with.\n *\n * Triggering is idempotent per page: while a generation for the page is in\n * progress, calling again returns the same `predictionId` instead of\n * starting a new job — unless the page's focus keyword changed since the\n * job started, which returns a `SUGGESTIONS_ALREADY_IN_PROGRESS` error.\n * @param pageId - ID of the site page to optimize.\n * @public\n * @documentationMaturity preview\n * @requiredField options\n * @requiredField options.pagePath\n * @requiredField pageId\n * @permissionId seo:suggestions:v1:page_optimization:trigger_page_optimization\n * @applicableIdentity APP\n * @fqn wix.seo.suggestions.v1.PageOptimizationService.TriggerPageOptimization\n */\nexport async function triggerPageOptimization(\n pageId: string,\n options: NonNullablePaths<TriggerPageOptimizationOptions, `pagePath`, 2>\n): Promise<\n NonNullablePaths<TriggerPageOptimizationResponse, `predictionId`, 2> & {\n __applicationErrorsType?: TriggerPageOptimizationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n pageId: pageId,\n pagePath: options?.pagePath,\n });\n\n const reqOpts =\n ambassadorWixSeoSuggestionsV1PageOptimization.triggerPageOptimization(\n payload\n );\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: { pageId: '$[0]', pagePath: '$[1].pagePath' },\n singleArgumentUnchanged: false,\n },\n ['pageId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TriggerPageOptimizationOptions {\n /**\n * URL path of the page, relative to the site's domain. For example,\n * `/about`.\n * @maxLength 1000\n * @minLength 1\n */\n pagePath: string;\n}\n\n/**\n * Starts generating optimization suggestions for the site's homepage.\n *\n * The homepage gets its own method because its suggestions are generated\n * with homepage-specific guidance — representing the whole site, not one\n * topic. Same contract as Trigger Page Optimization: the homepage's focus\n * keyword must be set first, the call returns a `predictionId` to poll,\n * and triggering is idempotent per page while a job is in progress.\n * @param pageId - ID of the site's homepage.\n * @public\n * @documentationMaturity preview\n * @requiredField options\n * @requiredField options.pagePath\n * @requiredField pageId\n * @permissionId seo:suggestions:v1:page_optimization:trigger_home_page_optimization\n * @applicableIdentity APP\n * @fqn wix.seo.suggestions.v1.PageOptimizationService.TriggerHomePageOptimization\n */\nexport async function triggerHomePageOptimization(\n pageId: string,\n options: NonNullablePaths<TriggerHomePageOptimizationOptions, `pagePath`, 2>\n): Promise<\n NonNullablePaths<TriggerHomePageOptimizationResponse, `predictionId`, 2> & {\n __applicationErrorsType?: TriggerHomePageOptimizationApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n pageId: pageId,\n pagePath: options?.pagePath,\n });\n\n const reqOpts =\n ambassadorWixSeoSuggestionsV1PageOptimization.triggerHomePageOptimization(\n payload\n );\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: { pageId: '$[0]', pagePath: '$[1].pagePath' },\n singleArgumentUnchanged: false,\n },\n ['pageId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TriggerHomePageOptimizationOptions {\n /**\n * URL path of the homepage. Usually `/`.\n * @maxLength 1000\n * @minLength 1\n */\n pagePath: string;\n}\n\n/**\n * Retrieves the optimization suggestions generated for a page.\n *\n * Poll this method after a trigger call. The response's `status` reports\n * where the job stands: while generation is still in progress the\n * suggestions are empty and `status` is `IN_PROGRESS`; when it completes,\n * the response carries the full suggestion set with `status` `COMPLETED`.\n * A job that failed reports `FAILED` — trigger again to retry. Suggestions\n * are stored per page — a later trigger for the same page replaces them,\n * and a replaced job's lookup reports `NOT_FOUND`.\n *\n * Look up by `predictionId` (from the trigger call), or by `pageId`.\n * @public\n * @documentationMaturity preview\n * @permissionId seo:suggestions:v1:page_optimization:get_page_optimization_results\n * @applicableIdentity APP\n * @fqn wix.seo.suggestions.v1.PageOptimizationService.GetPageOptimizationResults\n */\nexport async function getPageOptimizationResults(\n options?: GetPageOptimizationResultsOptions\n): Promise<\n NonNullablePaths<\n GetPageOptimizationResultsResponse,\n `pageOptimization.metaTitle.after` | `pageOptimization.content` | `status`,\n 4\n > & {\n __applicationErrorsType?: GetPageOptimizationResultsApplicationErrors;\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 predictionId: options?.predictionId,\n pageId: options?.pageId,\n });\n\n const reqOpts =\n ambassadorWixSeoSuggestionsV1PageOptimization.getPageOptimizationResults(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n predictionId: '$[0].predictionId',\n pageId: '$[0].pageId',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface GetPageOptimizationResultsOptions {\n /**\n * ID of the generation job, from the trigger call.\n * @maxLength 200\n */\n predictionId?: string | null;\n /**\n * ID of the page to retrieve suggestions for. An alternative to\n * `predictionId` — returns the page's latest generation.\n * @maxLength 1000\n */\n pageId?: string | null;\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 resolveWixSeoSuggestionsV1PageOptimizationServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/_serverless/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_serverless/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_serverless/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_serverless/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/seo-tags-suggestions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-suggestions/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_page-optimization';\n\n/**\n * Starts generating optimization suggestions for a site page.\n *\n * The suggestions target the page's focus keyword, so set it first: run\n * keyword research, set the chosen keyword as the page's focus keyword,\n * then trigger. Returns a `predictionId` to poll Get Page Optimization\n * Results with.\n *\n * Triggering is idempotent per page: while a generation for the page is in\n * progress, calling again returns the same `predictionId` instead of\n * starting a new job — unless the page's focus keyword changed since the\n * job started, which returns a `SUGGESTIONS_ALREADY_IN_PROGRESS` error.\n */\nexport function triggerPageOptimization(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerPageOptimization({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.seo.suggestions.v1.page_optimization',\n method: 'POST' as any,\n methodFqn:\n 'wix.seo.suggestions.v1.PageOptimizationService.TriggerPageOptimization',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({\n protoPath: '/v1/page-optimization/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerPageOptimization;\n}\n\n/**\n * Starts generating optimization suggestions for the site's homepage.\n *\n * The homepage gets its own method because its suggestions are generated\n * with homepage-specific guidance — representing the whole site, not one\n * topic. Same contract as Trigger Page Optimization: the homepage's focus\n * keyword must be set first, the call returns a `predictionId` to poll,\n * and triggering is idempotent per page while a job is in progress.\n */\nexport function triggerHomePageOptimization(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerHomePageOptimization({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.seo.suggestions.v1.page_optimization',\n method: 'POST' as any,\n methodFqn:\n 'wix.seo.suggestions.v1.PageOptimizationService.TriggerHomePageOptimization',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({\n protoPath: '/v1/page-optimization/trigger-home',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerHomePageOptimization;\n}\n\n/**\n * Retrieves the optimization suggestions generated for a page.\n *\n * Poll this method after a trigger call. The response's `status` reports\n * where the job stands: while generation is still in progress the\n * suggestions are empty and `status` is `IN_PROGRESS`; when it completes,\n * the response carries the full suggestion set with `status` `COMPLETED`.\n * A job that failed reports `FAILED` — trigger again to retry. Suggestions\n * are stored per page — a later trigger for the same page replaces them,\n * and a replaced job's lookup reports `NOT_FOUND`.\n *\n * Look up by `predictionId` (from the trigger call), or by `pageId`.\n */\nexport function getPageOptimizationResults(\n payload: object\n): RequestOptionsFactory<any> {\n function __getPageOptimizationResults({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.seo.suggestions.v1.page_optimization',\n method: 'GET' as any,\n methodFqn:\n 'wix.seo.suggestions.v1.PageOptimizationService.GetPageOptimizationResults',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({\n protoPath: '/v1/page-optimization/results',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getPageOptimizationResults;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,oCAAAA;AAAA,EAAA,mCA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;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,cAAc;AAAA,UACd,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getPageOptimizationResults","triggerHomePageOptimization","triggerPageOptimization","import_rest_modules","OptimizationStatus","triggerPageOptimization","sdkTransformError","triggerHomePageOptimization","getPageOptimizationResults"]}