@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.
- package/build/cjs/index.d.ts +65 -0
- package/build/cjs/index.js +289 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +306 -0
- package/build/cjs/index.typings.js +258 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +224 -0
- package/build/cjs/meta.js +229 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +65 -0
- package/build/es/index.mjs +262 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +306 -0
- package/build/es/index.typings.mjs +231 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +224 -0
- package/build/es/meta.mjs +199 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +65 -0
- package/build/internal/cjs/index.typings.d.ts +306 -0
- package/build/internal/cjs/meta.d.ts +224 -0
- package/build/internal/es/index.d.mts +65 -0
- package/build/internal/es/index.typings.d.mts +306 -0
- package/build/internal/es/meta.d.mts +224 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { TriggerPageOptimizationRequest as TriggerPageOptimizationRequest$1, TriggerPageOptimizationResponse as TriggerPageOptimizationResponse$1, TriggerHomePageOptimizationRequest as TriggerHomePageOptimizationRequest$1, TriggerHomePageOptimizationResponse as TriggerHomePageOptimizationResponse$1, GetPageOptimizationResultsRequest as GetPageOptimizationResultsRequest$1, GetPageOptimizationResultsResponse as GetPageOptimizationResultsResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A whole-page set of SEO optimization suggestions, generated for one page
|
|
6
|
+
* and focus keyword.
|
|
7
|
+
*
|
|
8
|
+
* Each suggestion is a before/after pair: `before` is the page's current
|
|
9
|
+
* text (empty when the page has none, such as a missing meta description),
|
|
10
|
+
* and `after` is the suggested replacement. Locate the element to change by
|
|
11
|
+
* its `before` text.
|
|
12
|
+
*/
|
|
13
|
+
interface PageOptimization {
|
|
14
|
+
/**
|
|
15
|
+
* ID of this suggestion set.
|
|
16
|
+
* @format GUID
|
|
17
|
+
* @readonly
|
|
18
|
+
*/
|
|
19
|
+
id?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Suggested title tag.
|
|
22
|
+
* @readonly
|
|
23
|
+
*/
|
|
24
|
+
metaTitle?: TextSuggestion;
|
|
25
|
+
/**
|
|
26
|
+
* Suggested description tag.
|
|
27
|
+
* @readonly
|
|
28
|
+
*/
|
|
29
|
+
metaDescription?: TextSuggestion;
|
|
30
|
+
/**
|
|
31
|
+
* Suggested H1 heading.
|
|
32
|
+
* @readonly
|
|
33
|
+
*/
|
|
34
|
+
h1?: TextSuggestion;
|
|
35
|
+
/**
|
|
36
|
+
* Suggested H2 or H3 heading.
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
h2OrH3?: TextSuggestion;
|
|
40
|
+
/**
|
|
41
|
+
* Suggested body text rewrites.
|
|
42
|
+
* @readonly
|
|
43
|
+
* @maxSize 100
|
|
44
|
+
*/
|
|
45
|
+
content?: TextSuggestion[];
|
|
46
|
+
}
|
|
47
|
+
/** One suggested text change. */
|
|
48
|
+
interface TextSuggestion {
|
|
49
|
+
/**
|
|
50
|
+
* The page's current text. Empty when the page has no text in this slot —
|
|
51
|
+
* for example, a missing meta description.
|
|
52
|
+
* @readonly
|
|
53
|
+
* @maxLength 1000
|
|
54
|
+
*/
|
|
55
|
+
before?: string | null;
|
|
56
|
+
/**
|
|
57
|
+
* The suggested text.
|
|
58
|
+
* @readonly
|
|
59
|
+
* @maxLength 1000
|
|
60
|
+
*/
|
|
61
|
+
after?: string;
|
|
62
|
+
}
|
|
63
|
+
interface TriggerPageOptimizationRequest {
|
|
64
|
+
/**
|
|
65
|
+
* ID of the site page to optimize.
|
|
66
|
+
* @maxLength 1000
|
|
67
|
+
* @minLength 1
|
|
68
|
+
*/
|
|
69
|
+
pageId: string;
|
|
70
|
+
/**
|
|
71
|
+
* URL path of the page, relative to the site's domain. For example,
|
|
72
|
+
* `/about`.
|
|
73
|
+
* @maxLength 1000
|
|
74
|
+
* @minLength 1
|
|
75
|
+
*/
|
|
76
|
+
pagePath: string;
|
|
77
|
+
}
|
|
78
|
+
interface TriggerPageOptimizationResponse {
|
|
79
|
+
/**
|
|
80
|
+
* ID of the generation job. Pass to Get Page Optimization Results.
|
|
81
|
+
* @readonly
|
|
82
|
+
* @maxLength 200
|
|
83
|
+
*/
|
|
84
|
+
predictionId?: string;
|
|
85
|
+
}
|
|
86
|
+
interface TriggerHomePageOptimizationRequest {
|
|
87
|
+
/**
|
|
88
|
+
* ID of the site's homepage.
|
|
89
|
+
* @maxLength 1000
|
|
90
|
+
* @minLength 1
|
|
91
|
+
*/
|
|
92
|
+
pageId: string;
|
|
93
|
+
/**
|
|
94
|
+
* URL path of the homepage. Usually `/`.
|
|
95
|
+
* @maxLength 1000
|
|
96
|
+
* @minLength 1
|
|
97
|
+
*/
|
|
98
|
+
pagePath: string;
|
|
99
|
+
}
|
|
100
|
+
interface TriggerHomePageOptimizationResponse {
|
|
101
|
+
/**
|
|
102
|
+
* ID of the generation job. Pass to Get Page Optimization Results.
|
|
103
|
+
* @readonly
|
|
104
|
+
* @maxLength 200
|
|
105
|
+
*/
|
|
106
|
+
predictionId?: string;
|
|
107
|
+
}
|
|
108
|
+
interface GetPageOptimizationResultsRequest {
|
|
109
|
+
/**
|
|
110
|
+
* ID of the generation job, from the trigger call.
|
|
111
|
+
* @maxLength 200
|
|
112
|
+
*/
|
|
113
|
+
predictionId?: string | null;
|
|
114
|
+
/**
|
|
115
|
+
* ID of the page to retrieve suggestions for. An alternative to
|
|
116
|
+
* `predictionId` — returns the page's latest generation.
|
|
117
|
+
* @maxLength 1000
|
|
118
|
+
*/
|
|
119
|
+
pageId?: string | null;
|
|
120
|
+
}
|
|
121
|
+
interface GetPageOptimizationResultsResponse {
|
|
122
|
+
/** The generated suggestions. Returned only when `status` is `COMPLETED`. */
|
|
123
|
+
pageOptimization?: PageOptimization;
|
|
124
|
+
/**
|
|
125
|
+
* Status of the generation job the lookup matched.
|
|
126
|
+
* @readonly
|
|
127
|
+
*/
|
|
128
|
+
status?: OptimizationStatusWithLiterals;
|
|
129
|
+
}
|
|
130
|
+
/** Status of a page optimization generation job. */
|
|
131
|
+
declare enum OptimizationStatus {
|
|
132
|
+
UNKNOWN_OPTIMIZATION_STATUS = "UNKNOWN_OPTIMIZATION_STATUS",
|
|
133
|
+
/**
|
|
134
|
+
* No generation job matches the lookup — it never existed, or a later
|
|
135
|
+
* trigger for the same page replaced it.
|
|
136
|
+
*/
|
|
137
|
+
NOT_FOUND = "NOT_FOUND",
|
|
138
|
+
/** Generation is still running. Poll again. */
|
|
139
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
140
|
+
/** Generation finished; the response carries the suggestions. */
|
|
141
|
+
COMPLETED = "COMPLETED",
|
|
142
|
+
/** Generation failed. Trigger again to retry. */
|
|
143
|
+
FAILED = "FAILED"
|
|
144
|
+
}
|
|
145
|
+
/** @enumType */
|
|
146
|
+
type OptimizationStatusWithLiterals = OptimizationStatus | 'UNKNOWN_OPTIMIZATION_STATUS' | 'NOT_FOUND' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILED';
|
|
147
|
+
/** @docsIgnore */
|
|
148
|
+
type TriggerPageOptimizationApplicationErrors = {
|
|
149
|
+
code?: 'SITE_NOT_SUPPORTED';
|
|
150
|
+
description?: string;
|
|
151
|
+
data?: Record<string, any>;
|
|
152
|
+
} | {
|
|
153
|
+
code?: 'FOCUS_KEYWORD_NOT_SET';
|
|
154
|
+
description?: string;
|
|
155
|
+
data?: Record<string, any>;
|
|
156
|
+
} | {
|
|
157
|
+
code?: 'CONTENT_TOO_SHORT';
|
|
158
|
+
description?: string;
|
|
159
|
+
data?: Record<string, any>;
|
|
160
|
+
} | {
|
|
161
|
+
code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';
|
|
162
|
+
description?: string;
|
|
163
|
+
data?: Record<string, any>;
|
|
164
|
+
} | {
|
|
165
|
+
code?: 'GENERATION_FAILED';
|
|
166
|
+
description?: string;
|
|
167
|
+
data?: Record<string, any>;
|
|
168
|
+
} | {
|
|
169
|
+
code?: 'QUOTA_LIMIT_REACHED';
|
|
170
|
+
description?: string;
|
|
171
|
+
data?: Record<string, any>;
|
|
172
|
+
};
|
|
173
|
+
/** @docsIgnore */
|
|
174
|
+
type TriggerHomePageOptimizationApplicationErrors = {
|
|
175
|
+
code?: 'SITE_NOT_SUPPORTED';
|
|
176
|
+
description?: string;
|
|
177
|
+
data?: Record<string, any>;
|
|
178
|
+
} | {
|
|
179
|
+
code?: 'FOCUS_KEYWORD_NOT_SET';
|
|
180
|
+
description?: string;
|
|
181
|
+
data?: Record<string, any>;
|
|
182
|
+
} | {
|
|
183
|
+
code?: 'CONTENT_TOO_SHORT';
|
|
184
|
+
description?: string;
|
|
185
|
+
data?: Record<string, any>;
|
|
186
|
+
} | {
|
|
187
|
+
code?: 'SUGGESTIONS_ALREADY_IN_PROGRESS';
|
|
188
|
+
description?: string;
|
|
189
|
+
data?: Record<string, any>;
|
|
190
|
+
} | {
|
|
191
|
+
code?: 'GENERATION_FAILED';
|
|
192
|
+
description?: string;
|
|
193
|
+
data?: Record<string, any>;
|
|
194
|
+
} | {
|
|
195
|
+
code?: 'QUOTA_LIMIT_REACHED';
|
|
196
|
+
description?: string;
|
|
197
|
+
data?: Record<string, any>;
|
|
198
|
+
};
|
|
199
|
+
/** @docsIgnore */
|
|
200
|
+
type GetPageOptimizationResultsApplicationErrors = {
|
|
201
|
+
code?: 'GENERATION_FAILED';
|
|
202
|
+
description?: string;
|
|
203
|
+
data?: Record<string, any>;
|
|
204
|
+
} | {
|
|
205
|
+
code?: 'QUOTA_LIMIT_REACHED';
|
|
206
|
+
description?: string;
|
|
207
|
+
data?: Record<string, any>;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
211
|
+
getUrl: (context: any) => string;
|
|
212
|
+
httpMethod: K;
|
|
213
|
+
path: string;
|
|
214
|
+
pathParams: M;
|
|
215
|
+
__requestType: T;
|
|
216
|
+
__originalRequestType: S;
|
|
217
|
+
__responseType: Q;
|
|
218
|
+
__originalResponseType: R;
|
|
219
|
+
};
|
|
220
|
+
declare function triggerPageOptimization(): __PublicMethodMetaInfo<'POST', {}, TriggerPageOptimizationRequest$1, TriggerPageOptimizationRequest, TriggerPageOptimizationResponse$1, TriggerPageOptimizationResponse>;
|
|
221
|
+
declare function triggerHomePageOptimization(): __PublicMethodMetaInfo<'POST', {}, TriggerHomePageOptimizationRequest$1, TriggerHomePageOptimizationRequest, TriggerHomePageOptimizationResponse$1, TriggerHomePageOptimizationResponse>;
|
|
222
|
+
declare function getPageOptimizationResults(): __PublicMethodMetaInfo<'GET', {}, GetPageOptimizationResultsRequest$1, GetPageOptimizationResultsRequest, GetPageOptimizationResultsResponse$1, GetPageOptimizationResultsResponse>;
|
|
223
|
+
|
|
224
|
+
export { type GetPageOptimizationResultsApplicationErrors as GetPageOptimizationResultsApplicationErrorsOriginal, type GetPageOptimizationResultsRequest as GetPageOptimizationResultsRequestOriginal, type GetPageOptimizationResultsResponse as GetPageOptimizationResultsResponseOriginal, OptimizationStatus as OptimizationStatusOriginal, type OptimizationStatusWithLiterals as OptimizationStatusWithLiteralsOriginal, type PageOptimization as PageOptimizationOriginal, type TextSuggestion as TextSuggestionOriginal, type TriggerHomePageOptimizationApplicationErrors as TriggerHomePageOptimizationApplicationErrorsOriginal, type TriggerHomePageOptimizationRequest as TriggerHomePageOptimizationRequestOriginal, type TriggerHomePageOptimizationResponse as TriggerHomePageOptimizationResponseOriginal, type TriggerPageOptimizationApplicationErrors as TriggerPageOptimizationApplicationErrorsOriginal, type TriggerPageOptimizationRequest as TriggerPageOptimizationRequestOriginal, type TriggerPageOptimizationResponse as TriggerPageOptimizationResponseOriginal, type __PublicMethodMetaInfo, getPageOptimizationResults, triggerHomePageOptimization, triggerPageOptimization };
|
|
@@ -0,0 +1,229 @@
|
|
|
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
|
+
// meta.ts
|
|
21
|
+
var meta_exports = {};
|
|
22
|
+
__export(meta_exports, {
|
|
23
|
+
OptimizationStatusOriginal: () => OptimizationStatus,
|
|
24
|
+
getPageOptimizationResults: () => getPageOptimizationResults2,
|
|
25
|
+
triggerHomePageOptimization: () => triggerHomePageOptimization2,
|
|
26
|
+
triggerPageOptimization: () => triggerPageOptimization2
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(meta_exports);
|
|
29
|
+
|
|
30
|
+
// src/seo-suggestions-v1-page-optimization-page-optimization.http.ts
|
|
31
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
32
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
function resolveWixSeoSuggestionsV1PageOptimizationServiceUrl(opts) {
|
|
34
|
+
const domainToMappings = {
|
|
35
|
+
"bo._base_domain_": [
|
|
36
|
+
{
|
|
37
|
+
srcPath: "/_serverless/seo-tags-suggestions-service",
|
|
38
|
+
destPath: ""
|
|
39
|
+
}
|
|
40
|
+
],
|
|
41
|
+
"wixbo.ai": [
|
|
42
|
+
{
|
|
43
|
+
srcPath: "/_serverless/seo-tags-suggestions-service",
|
|
44
|
+
destPath: ""
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
"wix-bo.com": [
|
|
48
|
+
{
|
|
49
|
+
srcPath: "/_serverless/seo-tags-suggestions-service",
|
|
50
|
+
destPath: ""
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"manage._base_domain_": [
|
|
54
|
+
{
|
|
55
|
+
srcPath: "/_serverless/seo-tags-suggestions-service",
|
|
56
|
+
destPath: ""
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"editor._base_domain_": [
|
|
60
|
+
{
|
|
61
|
+
srcPath: "/_api/seo-tags-suggestions-service",
|
|
62
|
+
destPath: ""
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"blocks._base_domain_": [
|
|
66
|
+
{
|
|
67
|
+
srcPath: "/_api/seo-tags-suggestions-service",
|
|
68
|
+
destPath: ""
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
"create.editorx": [
|
|
72
|
+
{
|
|
73
|
+
srcPath: "/_api/seo-tags-suggestions-service",
|
|
74
|
+
destPath: ""
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"www.wixapis.com": [
|
|
78
|
+
{
|
|
79
|
+
srcPath: "/seo-suggestions/v1",
|
|
80
|
+
destPath: "/v1"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
};
|
|
84
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
85
|
+
}
|
|
86
|
+
var PACKAGE_NAME = "@wix/auto_sdk_seo_page-optimization";
|
|
87
|
+
function triggerPageOptimization(payload) {
|
|
88
|
+
function __triggerPageOptimization({ host }) {
|
|
89
|
+
const metadata = {
|
|
90
|
+
entityFqdn: "wix.seo.suggestions.v1.page_optimization",
|
|
91
|
+
method: "POST",
|
|
92
|
+
methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.TriggerPageOptimization",
|
|
93
|
+
packageName: PACKAGE_NAME,
|
|
94
|
+
migrationOptions: {
|
|
95
|
+
optInTransformResponse: true
|
|
96
|
+
},
|
|
97
|
+
url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
|
|
98
|
+
protoPath: "/v1/page-optimization/trigger",
|
|
99
|
+
data: payload,
|
|
100
|
+
host
|
|
101
|
+
}),
|
|
102
|
+
data: payload
|
|
103
|
+
};
|
|
104
|
+
return metadata;
|
|
105
|
+
}
|
|
106
|
+
return __triggerPageOptimization;
|
|
107
|
+
}
|
|
108
|
+
function triggerHomePageOptimization(payload) {
|
|
109
|
+
function __triggerHomePageOptimization({ host }) {
|
|
110
|
+
const metadata = {
|
|
111
|
+
entityFqdn: "wix.seo.suggestions.v1.page_optimization",
|
|
112
|
+
method: "POST",
|
|
113
|
+
methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.TriggerHomePageOptimization",
|
|
114
|
+
packageName: PACKAGE_NAME,
|
|
115
|
+
migrationOptions: {
|
|
116
|
+
optInTransformResponse: true
|
|
117
|
+
},
|
|
118
|
+
url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
|
|
119
|
+
protoPath: "/v1/page-optimization/trigger-home",
|
|
120
|
+
data: payload,
|
|
121
|
+
host
|
|
122
|
+
}),
|
|
123
|
+
data: payload
|
|
124
|
+
};
|
|
125
|
+
return metadata;
|
|
126
|
+
}
|
|
127
|
+
return __triggerHomePageOptimization;
|
|
128
|
+
}
|
|
129
|
+
function getPageOptimizationResults(payload) {
|
|
130
|
+
function __getPageOptimizationResults({ host }) {
|
|
131
|
+
const metadata = {
|
|
132
|
+
entityFqdn: "wix.seo.suggestions.v1.page_optimization",
|
|
133
|
+
method: "GET",
|
|
134
|
+
methodFqn: "wix.seo.suggestions.v1.PageOptimizationService.GetPageOptimizationResults",
|
|
135
|
+
packageName: PACKAGE_NAME,
|
|
136
|
+
migrationOptions: {
|
|
137
|
+
optInTransformResponse: true
|
|
138
|
+
},
|
|
139
|
+
url: resolveWixSeoSuggestionsV1PageOptimizationServiceUrl({
|
|
140
|
+
protoPath: "/v1/page-optimization/results",
|
|
141
|
+
data: payload,
|
|
142
|
+
host
|
|
143
|
+
}),
|
|
144
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
145
|
+
};
|
|
146
|
+
return metadata;
|
|
147
|
+
}
|
|
148
|
+
return __getPageOptimizationResults;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// src/seo-suggestions-v1-page-optimization-page-optimization.types.ts
|
|
152
|
+
var OptimizationStatus = /* @__PURE__ */ ((OptimizationStatus2) => {
|
|
153
|
+
OptimizationStatus2["UNKNOWN_OPTIMIZATION_STATUS"] = "UNKNOWN_OPTIMIZATION_STATUS";
|
|
154
|
+
OptimizationStatus2["NOT_FOUND"] = "NOT_FOUND";
|
|
155
|
+
OptimizationStatus2["IN_PROGRESS"] = "IN_PROGRESS";
|
|
156
|
+
OptimizationStatus2["COMPLETED"] = "COMPLETED";
|
|
157
|
+
OptimizationStatus2["FAILED"] = "FAILED";
|
|
158
|
+
return OptimizationStatus2;
|
|
159
|
+
})(OptimizationStatus || {});
|
|
160
|
+
|
|
161
|
+
// src/seo-suggestions-v1-page-optimization-page-optimization.meta.ts
|
|
162
|
+
function triggerPageOptimization2() {
|
|
163
|
+
const payload = {};
|
|
164
|
+
const getRequestOptions = triggerPageOptimization(
|
|
165
|
+
payload
|
|
166
|
+
);
|
|
167
|
+
const getUrl = (context) => {
|
|
168
|
+
const { url } = getRequestOptions(context);
|
|
169
|
+
return url;
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
getUrl,
|
|
173
|
+
httpMethod: "POST",
|
|
174
|
+
path: "/v1/page-optimization/trigger",
|
|
175
|
+
pathParams: {},
|
|
176
|
+
__requestType: null,
|
|
177
|
+
__originalRequestType: null,
|
|
178
|
+
__responseType: null,
|
|
179
|
+
__originalResponseType: null
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
function triggerHomePageOptimization2() {
|
|
183
|
+
const payload = {};
|
|
184
|
+
const getRequestOptions = triggerHomePageOptimization(
|
|
185
|
+
payload
|
|
186
|
+
);
|
|
187
|
+
const getUrl = (context) => {
|
|
188
|
+
const { url } = getRequestOptions(context);
|
|
189
|
+
return url;
|
|
190
|
+
};
|
|
191
|
+
return {
|
|
192
|
+
getUrl,
|
|
193
|
+
httpMethod: "POST",
|
|
194
|
+
path: "/v1/page-optimization/trigger-home",
|
|
195
|
+
pathParams: {},
|
|
196
|
+
__requestType: null,
|
|
197
|
+
__originalRequestType: null,
|
|
198
|
+
__responseType: null,
|
|
199
|
+
__originalResponseType: null
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function getPageOptimizationResults2() {
|
|
203
|
+
const payload = {};
|
|
204
|
+
const getRequestOptions = getPageOptimizationResults(
|
|
205
|
+
payload
|
|
206
|
+
);
|
|
207
|
+
const getUrl = (context) => {
|
|
208
|
+
const { url } = getRequestOptions(context);
|
|
209
|
+
return url;
|
|
210
|
+
};
|
|
211
|
+
return {
|
|
212
|
+
getUrl,
|
|
213
|
+
httpMethod: "GET",
|
|
214
|
+
path: "/v1/page-optimization/results",
|
|
215
|
+
pathParams: {},
|
|
216
|
+
__requestType: null,
|
|
217
|
+
__originalRequestType: null,
|
|
218
|
+
__responseType: null,
|
|
219
|
+
__originalResponseType: null
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
223
|
+
0 && (module.exports = {
|
|
224
|
+
OptimizationStatusOriginal,
|
|
225
|
+
getPageOptimizationResults,
|
|
226
|
+
triggerHomePageOptimization,
|
|
227
|
+
triggerPageOptimization
|
|
228
|
+
});
|
|
229
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/seo-suggestions-v1-page-optimization-page-optimization.http.ts","../../src/seo-suggestions-v1-page-optimization-page-optimization.types.ts","../../src/seo-suggestions-v1-page-optimization-page-optimization.meta.ts"],"sourcesContent":["export * from './src/seo-suggestions-v1-page-optimization-page-optimization.meta.js';\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","/**\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","import * as ambassadorWixSeoSuggestionsV1PageOptimization from './seo-suggestions-v1-page-optimization-page-optimization.http.js';\nimport * as ambassadorWixSeoSuggestionsV1PageOptimizationTypes from './seo-suggestions-v1-page-optimization-page-optimization.types.js';\nimport * as ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes from './seo-suggestions-v1-page-optimization-page-optimization.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function triggerPageOptimization(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.TriggerPageOptimizationRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.TriggerPageOptimizationRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.TriggerPageOptimizationResponse,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.TriggerPageOptimizationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixSeoSuggestionsV1PageOptimization.triggerPageOptimization(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/page-optimization/trigger',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function triggerHomePageOptimization(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.TriggerHomePageOptimizationRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.TriggerHomePageOptimizationRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.TriggerHomePageOptimizationResponse,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.TriggerHomePageOptimizationResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixSeoSuggestionsV1PageOptimization.triggerHomePageOptimization(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/page-optimization/trigger-home',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getPageOptimizationResults(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.GetPageOptimizationResultsRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.GetPageOptimizationResultsRequest,\n ambassadorWixSeoSuggestionsV1PageOptimizationUniversalTypes.GetPageOptimizationResultsResponse,\n ambassadorWixSeoSuggestionsV1PageOptimizationTypes.GetPageOptimizationResultsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixSeoSuggestionsV1PageOptimization.getPageOptimizationResults(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/page-optimization/results',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport {\n PageOptimization as PageOptimizationOriginal,\n TextSuggestion as TextSuggestionOriginal,\n TriggerPageOptimizationRequest as TriggerPageOptimizationRequestOriginal,\n TriggerPageOptimizationResponse as TriggerPageOptimizationResponseOriginal,\n TriggerHomePageOptimizationRequest as TriggerHomePageOptimizationRequestOriginal,\n TriggerHomePageOptimizationResponse as TriggerHomePageOptimizationResponseOriginal,\n GetPageOptimizationResultsRequest as GetPageOptimizationResultsRequestOriginal,\n GetPageOptimizationResultsResponse as GetPageOptimizationResultsResponseOriginal,\n OptimizationStatus as OptimizationStatusOriginal,\n OptimizationStatusWithLiterals as OptimizationStatusWithLiteralsOriginal,\n TriggerPageOptimizationApplicationErrors as TriggerPageOptimizationApplicationErrorsOriginal,\n TriggerHomePageOptimizationApplicationErrors as TriggerHomePageOptimizationApplicationErrorsOriginal,\n GetPageOptimizationResultsApplicationErrors as GetPageOptimizationResultsApplicationErrorsOriginal,\n} from './seo-suggestions-v1-page-optimization-page-optimization.types.js';\n"],"mappings":"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","names":["getPageOptimizationResults","triggerHomePageOptimization","triggerPageOptimization","import_rest_modules","OptimizationStatus","triggerPageOptimization","triggerHomePageOptimization","getPageOptimizationResults"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { TriggerPageOptimizationOptions, TriggerPageOptimizationResponse, TriggerPageOptimizationApplicationErrors, TriggerHomePageOptimizationOptions, TriggerHomePageOptimizationResponse, TriggerHomePageOptimizationApplicationErrors, GetPageOptimizationResultsOptions, GetPageOptimizationResultsResponse, GetPageOptimizationResultsApplicationErrors } from './index.typings.mjs';
|
|
3
|
+
export { GetPageOptimizationResultsRequest, OptimizationStatus, OptimizationStatusWithLiterals, PageOptimization, TextSuggestion, TriggerHomePageOptimizationRequest, TriggerPageOptimizationRequest } from './index.typings.mjs';
|
|
4
|
+
|
|
5
|
+
declare function triggerPageOptimization$1(httpClient: HttpClient): TriggerPageOptimizationSignature;
|
|
6
|
+
interface TriggerPageOptimizationSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Starts generating optimization suggestions for a site page.
|
|
9
|
+
*
|
|
10
|
+
* The suggestions target the page's focus keyword, so set it first: run
|
|
11
|
+
* keyword research, set the chosen keyword as the page's focus keyword,
|
|
12
|
+
* then trigger. Returns a `predictionId` to poll Get Page Optimization
|
|
13
|
+
* Results with.
|
|
14
|
+
*
|
|
15
|
+
* Triggering is idempotent per page: while a generation for the page is in
|
|
16
|
+
* progress, calling again returns the same `predictionId` instead of
|
|
17
|
+
* starting a new job — unless the page's focus keyword changed since the
|
|
18
|
+
* job started, which returns a `SUGGESTIONS_ALREADY_IN_PROGRESS` error.
|
|
19
|
+
* @param - ID of the site page to optimize.
|
|
20
|
+
*/
|
|
21
|
+
(pageId: string, options: NonNullablePaths<TriggerPageOptimizationOptions, `pagePath`, 2>): Promise<NonNullablePaths<TriggerPageOptimizationResponse, `predictionId`, 2> & {
|
|
22
|
+
__applicationErrorsType?: TriggerPageOptimizationApplicationErrors;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
declare function triggerHomePageOptimization$1(httpClient: HttpClient): TriggerHomePageOptimizationSignature;
|
|
26
|
+
interface TriggerHomePageOptimizationSignature {
|
|
27
|
+
/**
|
|
28
|
+
* Starts generating optimization suggestions for the site's homepage.
|
|
29
|
+
*
|
|
30
|
+
* The homepage gets its own method because its suggestions are generated
|
|
31
|
+
* with homepage-specific guidance — representing the whole site, not one
|
|
32
|
+
* topic. Same contract as Trigger Page Optimization: the homepage's focus
|
|
33
|
+
* keyword must be set first, the call returns a `predictionId` to poll,
|
|
34
|
+
* and triggering is idempotent per page while a job is in progress.
|
|
35
|
+
* @param - ID of the site's homepage.
|
|
36
|
+
*/
|
|
37
|
+
(pageId: string, options: NonNullablePaths<TriggerHomePageOptimizationOptions, `pagePath`, 2>): Promise<NonNullablePaths<TriggerHomePageOptimizationResponse, `predictionId`, 2> & {
|
|
38
|
+
__applicationErrorsType?: TriggerHomePageOptimizationApplicationErrors;
|
|
39
|
+
}>;
|
|
40
|
+
}
|
|
41
|
+
declare function getPageOptimizationResults$1(httpClient: HttpClient): GetPageOptimizationResultsSignature;
|
|
42
|
+
interface GetPageOptimizationResultsSignature {
|
|
43
|
+
/**
|
|
44
|
+
* Retrieves the optimization suggestions generated for a page.
|
|
45
|
+
*
|
|
46
|
+
* Poll this method after a trigger call. The response's `status` reports
|
|
47
|
+
* where the job stands: while generation is still in progress the
|
|
48
|
+
* suggestions are empty and `status` is `IN_PROGRESS`; when it completes,
|
|
49
|
+
* the response carries the full suggestion set with `status` `COMPLETED`.
|
|
50
|
+
* A job that failed reports `FAILED` — trigger again to retry. Suggestions
|
|
51
|
+
* are stored per page — a later trigger for the same page replaces them,
|
|
52
|
+
* and a replaced job's lookup reports `NOT_FOUND`.
|
|
53
|
+
*
|
|
54
|
+
* Look up by `predictionId` (from the trigger call), or by `pageId`.
|
|
55
|
+
*/
|
|
56
|
+
(options?: GetPageOptimizationResultsOptions): Promise<NonNullablePaths<GetPageOptimizationResultsResponse, `pageOptimization.metaTitle.after` | `pageOptimization.content` | `status`, 4> & {
|
|
57
|
+
__applicationErrorsType?: GetPageOptimizationResultsApplicationErrors;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
declare const triggerPageOptimization: MaybeContext<BuildRESTFunction<typeof triggerPageOptimization$1> & typeof triggerPageOptimization$1>;
|
|
62
|
+
declare const triggerHomePageOptimization: MaybeContext<BuildRESTFunction<typeof triggerHomePageOptimization$1> & typeof triggerHomePageOptimization$1>;
|
|
63
|
+
declare const getPageOptimizationResults: MaybeContext<BuildRESTFunction<typeof getPageOptimizationResults$1> & typeof getPageOptimizationResults$1>;
|
|
64
|
+
|
|
65
|
+
export { GetPageOptimizationResultsApplicationErrors, GetPageOptimizationResultsOptions, GetPageOptimizationResultsResponse, TriggerHomePageOptimizationApplicationErrors, TriggerHomePageOptimizationOptions, TriggerHomePageOptimizationResponse, TriggerPageOptimizationApplicationErrors, TriggerPageOptimizationOptions, TriggerPageOptimizationResponse, getPageOptimizationResults, triggerHomePageOptimization, triggerPageOptimization };
|