@wix/auto_sdk_seo_content-plan-flows 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,531 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
3
+ /**
4
+ * A content plan flow tracks the generation of an SEO content plan for a site.
5
+ *
6
+ * A content plan is a set of blog post briefs built from the site's pages, its
7
+ * business category, and real search volume data. Generating one takes several
8
+ * minutes, so the flow runs asynchronously and reports its progress in `status`.
9
+ *
10
+ * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`
11
+ * and waits for a call to Create Content Plan before it continues.
12
+ */
13
+ interface ContentPlanFlow {
14
+ /**
15
+ * Content plan flow ID.
16
+ * @format GUID
17
+ * @readonly
18
+ */
19
+ _id?: string | null;
20
+ /**
21
+ * Date and time the content plan flow was created.
22
+ * @maxLength 100
23
+ */
24
+ createdAt?: string | null;
25
+ /**
26
+ * Date and time the content plan flow was updated.
27
+ * @maxLength 100
28
+ */
29
+ updatedAt?: string | null;
30
+ /**
31
+ * Current status of the content plan flow.
32
+ *
33
+ * The status advances on its own as generation progresses, except at
34
+ * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content
35
+ * Plan.
36
+ */
37
+ status?: StatusWithLiterals;
38
+ /**
39
+ * What started the content plan flow. Flows started by an app are
40
+ * recorded as `AGENT`.
41
+ * @maxLength 100
42
+ */
43
+ origin?: string | null;
44
+ /**
45
+ * ID of the site content summary the flow produced.
46
+ * @format GUID
47
+ */
48
+ summaryId?: string | null;
49
+ /**
50
+ * ID of the keyword research the flow produced.
51
+ *
52
+ * Available once `status` is `KEYWORD_RESEARCH` or later.
53
+ * @format GUID
54
+ */
55
+ keywordResearchId?: string | null;
56
+ }
57
+ declare enum Status {
58
+ /** The flow is created and the generation pipeline is starting. */
59
+ CREATED = "CREATED",
60
+ /** The site's existing content is being summarized. */
61
+ SITE_SUMMARY = "SITE_SUMMARY",
62
+ /**
63
+ * Keyword research is complete and the flow is waiting. Call Create
64
+ * Content Plan to generate the blog post briefs and continue the flow.
65
+ */
66
+ KEYWORD_RESEARCH = "KEYWORD_RESEARCH",
67
+ /** Blog post briefs are being generated from the keyword research. */
68
+ CONTENT_PLAN = "CONTENT_PLAN",
69
+ /**
70
+ * Generation is complete. Retrieve the results with List Blog Post
71
+ * Candidates and List Keyword Research Items.
72
+ */
73
+ SUCCESS = "SUCCESS",
74
+ /** Generation failed. Trigger a flow to try again. */
75
+ FAIL = "FAIL",
76
+ /**
77
+ * The site is missing business information that keyword research
78
+ * requires. The flow resumes automatically once the information is
79
+ * added to the site.
80
+ */
81
+ PENDING_REQUIREMENTS = "PENDING_REQUIREMENTS",
82
+ /** The flow was canceled and can't be resumed. */
83
+ CANCELED = "CANCELED",
84
+ /** The site's pages are being analyzed. */
85
+ SITE_ANALYSIS = "SITE_ANALYSIS"
86
+ }
87
+ /** @enumType */
88
+ type StatusWithLiterals = Status | 'CREATED' | 'SITE_SUMMARY' | 'KEYWORD_RESEARCH' | 'CONTENT_PLAN' | 'SUCCESS' | 'FAIL' | 'PENDING_REQUIREMENTS' | 'CANCELED' | 'SITE_ANALYSIS';
89
+ interface GetContentPlanFlowRequest {
90
+ /**
91
+ * ID of the content plan flow to retrieve.
92
+ *
93
+ * Omit to retrieve the site's most recent successful flow.
94
+ * @format GUID
95
+ */
96
+ contentPlanFlowId: string | null;
97
+ }
98
+ interface GetContentPlanFlowResponse {
99
+ /** Retrieved content plan flow. */
100
+ contentPlanFlow?: ContentPlanFlow;
101
+ }
102
+ interface TriggerContentPlanGenerationFlowRequest {
103
+ }
104
+ interface TriggerContentPlanGenerationFlowResponse {
105
+ /**
106
+ * ID of the content plan flow that was created.
107
+ *
108
+ * Poll Get Content Plan Flow with this ID to follow the flow's progress.
109
+ * @format GUID
110
+ */
111
+ contentPlanFlowId?: string | null;
112
+ }
113
+ interface ExecuteActionRequest {
114
+ /**
115
+ * the execution id
116
+ * @format GUID
117
+ */
118
+ executionId?: string;
119
+ /**
120
+ * the action id
121
+ * @maxLength 1000
122
+ */
123
+ actionId?: string;
124
+ /** item data - if relevant */
125
+ item?: ItemData;
126
+ /** whether to reset the current content of the action */
127
+ reset?: boolean;
128
+ }
129
+ interface ItemData extends ItemDataPayloadDataOneOf {
130
+ blogData?: BlogData;
131
+ /**
132
+ * id
133
+ * @maxLength 1000
134
+ */
135
+ _id?: string;
136
+ /**
137
+ * type
138
+ * @maxLength 1000
139
+ */
140
+ type?: string;
141
+ }
142
+ /** @oneof */
143
+ interface ItemDataPayloadDataOneOf {
144
+ blogData?: BlogData;
145
+ }
146
+ interface BlogData {
147
+ /**
148
+ * prompt
149
+ * @maxLength 10000
150
+ */
151
+ prompt?: string;
152
+ }
153
+ interface ExecuteActionResponse {
154
+ /** Whether the suggestion succeeded */
155
+ success?: boolean;
156
+ /** Whether the operation is async */
157
+ async?: boolean;
158
+ /**
159
+ * Optional internal message
160
+ * @maxLength 1000
161
+ */
162
+ message?: string;
163
+ /** Optional display message */
164
+ displayMessage?: DisplayMessage;
165
+ /** The payload of the action, also the suggestion itself. */
166
+ payload?: ActionPayload;
167
+ /** Total action cost in microcents (1 microcent = $0.00001). If omitted or zero, PMA uses configured credit cost. */
168
+ costInMicrocents?: number | null;
169
+ }
170
+ interface DisplayMessage {
171
+ /**
172
+ * Message to show to the user
173
+ * @maxLength 1000
174
+ */
175
+ message?: string;
176
+ /** Optional call to action */
177
+ cta?: ActionCta;
178
+ }
179
+ interface ActionCta {
180
+ /**
181
+ * CTA title
182
+ * @maxLength 1000
183
+ */
184
+ title?: string;
185
+ /**
186
+ * CTA URL
187
+ * @maxLength 1000
188
+ */
189
+ url?: string;
190
+ }
191
+ interface ActionPayload {
192
+ /**
193
+ * Description of the suggestion
194
+ * @maxLength 1000
195
+ */
196
+ description?: string;
197
+ /**
198
+ * Optional motivation for the suggestion
199
+ * @maxLength 1000
200
+ */
201
+ motivation?: string;
202
+ /** Optional entity being suggested */
203
+ entity?: Entity;
204
+ /**
205
+ * Optional changes suggested
206
+ * @maxSize 100
207
+ */
208
+ changes?: Change[];
209
+ /**
210
+ * Optional items suggested
211
+ * @maxSize 100
212
+ */
213
+ items?: Item[];
214
+ /** Optional preview link */
215
+ previewLink?: ActionCta;
216
+ }
217
+ interface Entity {
218
+ /**
219
+ * Entity ID
220
+ * @maxLength 100
221
+ */
222
+ _id?: string;
223
+ /**
224
+ * Optional entity name
225
+ * @maxLength 1000
226
+ */
227
+ name?: string;
228
+ }
229
+ interface Change {
230
+ /**
231
+ * Change ID
232
+ * @maxLength 100
233
+ */
234
+ _id?: string;
235
+ /**
236
+ * Change title
237
+ * @maxLength 1000
238
+ */
239
+ title?: string;
240
+ /**
241
+ * The resulting state after the change
242
+ * @maxLength 1000
243
+ */
244
+ after?: string;
245
+ /**
246
+ * Optional description
247
+ * @maxLength 1000
248
+ */
249
+ description?: string;
250
+ /**
251
+ * Optional state before the change
252
+ * @maxLength 1000
253
+ */
254
+ before?: string;
255
+ /** Optional: is this a suggestion or a confirmed change */
256
+ isSuggestion?: boolean;
257
+ /**
258
+ * Optional type of change
259
+ * @maxLength 100
260
+ */
261
+ type?: string;
262
+ }
263
+ interface Item {
264
+ /**
265
+ * Item ID
266
+ * @maxLength 100
267
+ */
268
+ _id?: string;
269
+ /**
270
+ * Item title
271
+ * @maxLength 1000
272
+ */
273
+ title?: string;
274
+ /**
275
+ * Optional description
276
+ * @maxLength 1000
277
+ */
278
+ description?: string;
279
+ /**
280
+ * Optional images
281
+ * @maxSize 100
282
+ * @maxLength 1000
283
+ */
284
+ images?: string[];
285
+ /** Optional preview link */
286
+ previewLink?: ActionCta;
287
+ /**
288
+ * Optional motivation for suggesting this item
289
+ * @maxLength 1000
290
+ */
291
+ motivation?: string;
292
+ /** Data */
293
+ data?: Record<string, any> | null;
294
+ /**
295
+ * The content plan item id which this item created by
296
+ * @maxLength 100
297
+ */
298
+ contentPlanItemId?: string;
299
+ /** scheduled date */
300
+ scheduledDate?: Date | null;
301
+ }
302
+ interface CancelContentPlanFlowRequest {
303
+ /**
304
+ * ID of the content plan flow to cancel.
305
+ * @format GUID
306
+ */
307
+ contentPlanFlowId: string | null;
308
+ }
309
+ interface CancelContentPlanFlowResponse {
310
+ }
311
+ interface DomainEvent extends DomainEventBodyOneOf {
312
+ createdEvent?: EntityCreatedEvent;
313
+ updatedEvent?: EntityUpdatedEvent;
314
+ deletedEvent?: EntityDeletedEvent;
315
+ actionEvent?: ActionEvent;
316
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
317
+ _id?: string;
318
+ /**
319
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
320
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
321
+ */
322
+ entityFqdn?: string;
323
+ /**
324
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
325
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
326
+ */
327
+ slug?: string;
328
+ /** ID of the entity associated with the event. */
329
+ entityId?: string;
330
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
331
+ eventTime?: Date | null;
332
+ /**
333
+ * Whether the event was triggered as a result of a privacy regulation application
334
+ * (for example, GDPR).
335
+ */
336
+ triggeredByAnonymizeRequest?: boolean | null;
337
+ /** If present, indicates the action that triggered the event. */
338
+ originatedFrom?: string | null;
339
+ /**
340
+ * 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.
341
+ * 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.
342
+ */
343
+ entityEventSequence?: string | null;
344
+ }
345
+ /** @oneof */
346
+ interface DomainEventBodyOneOf {
347
+ createdEvent?: EntityCreatedEvent;
348
+ updatedEvent?: EntityUpdatedEvent;
349
+ deletedEvent?: EntityDeletedEvent;
350
+ actionEvent?: ActionEvent;
351
+ }
352
+ interface EntityCreatedEvent {
353
+ entity?: string;
354
+ }
355
+ interface RestoreInfo {
356
+ deletedDate?: Date | null;
357
+ }
358
+ interface EntityUpdatedEvent {
359
+ /**
360
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
361
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
362
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
363
+ */
364
+ currentEntity?: string;
365
+ }
366
+ interface EntityDeletedEvent {
367
+ /** Entity that was deleted. */
368
+ deletedEntity?: string | null;
369
+ }
370
+ interface ActionEvent {
371
+ body?: string;
372
+ }
373
+ interface MessageEnvelope {
374
+ /**
375
+ * App instance ID.
376
+ * @format GUID
377
+ */
378
+ instanceId?: string | null;
379
+ /**
380
+ * Event type.
381
+ * @maxLength 150
382
+ */
383
+ eventType?: string;
384
+ /** The identification type and identity data. */
385
+ identity?: IdentificationData;
386
+ /** Stringify payload. */
387
+ data?: string;
388
+ /** Details related to the account */
389
+ accountInfo?: AccountInfo;
390
+ }
391
+ interface IdentificationData extends IdentificationDataIdOneOf {
392
+ /**
393
+ * ID of a site visitor that has not logged in to the site.
394
+ * @format GUID
395
+ */
396
+ anonymousVisitorId?: string;
397
+ /**
398
+ * ID of a site visitor that has logged in to the site.
399
+ * @format GUID
400
+ */
401
+ memberId?: string;
402
+ /**
403
+ * ID of a Wix user (site owner, contributor, etc.).
404
+ * @format GUID
405
+ */
406
+ wixUserId?: string;
407
+ /**
408
+ * ID of an app.
409
+ * @format GUID
410
+ */
411
+ appId?: string;
412
+ /** @readonly */
413
+ identityType?: WebhookIdentityTypeWithLiterals;
414
+ }
415
+ /** @oneof */
416
+ interface IdentificationDataIdOneOf {
417
+ /**
418
+ * ID of a site visitor that has not logged in to the site.
419
+ * @format GUID
420
+ */
421
+ anonymousVisitorId?: string;
422
+ /**
423
+ * ID of a site visitor that has logged in to the site.
424
+ * @format GUID
425
+ */
426
+ memberId?: string;
427
+ /**
428
+ * ID of a Wix user (site owner, contributor, etc.).
429
+ * @format GUID
430
+ */
431
+ wixUserId?: string;
432
+ /**
433
+ * ID of an app.
434
+ * @format GUID
435
+ */
436
+ appId?: string;
437
+ }
438
+ declare enum WebhookIdentityType {
439
+ UNKNOWN = "UNKNOWN",
440
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
441
+ MEMBER = "MEMBER",
442
+ WIX_USER = "WIX_USER",
443
+ APP = "APP"
444
+ }
445
+ /** @enumType */
446
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
447
+ interface AccountInfo {
448
+ /**
449
+ * ID of the Wix account associated with the event.
450
+ * @format GUID
451
+ */
452
+ accountId?: string | null;
453
+ /**
454
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
455
+ * @format GUID
456
+ */
457
+ parentAccountId?: string | null;
458
+ /**
459
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
460
+ * @format GUID
461
+ */
462
+ siteId?: string | null;
463
+ }
464
+ /**
465
+ * Retrieves a content plan flow.
466
+ *
467
+ * While a flow is generating, poll this method with the
468
+ * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to
469
+ * follow the flow's progress.
470
+ *
471
+ * Omit `contentPlanFlowId` to retrieve the site's most recent successful
472
+ * flow. This is useful for picking up a content plan that was generated in
473
+ * the site dashboard. A flow that's still running is never returned this
474
+ * way, and a site with no successful flow returns a not found error.
475
+ * @param contentPlanFlowId - ID of the content plan flow to retrieve.
476
+ *
477
+ * Omit to retrieve the site's most recent successful flow.
478
+ * @public
479
+ * @documentationMaturity preview
480
+ * @requiredField contentPlanFlowId
481
+ * @permissionId promote:seo:v1:content_plan_content_plan_flow:get_content_plan_flow
482
+ * @applicableIdentity APP
483
+ * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow
484
+ */
485
+ declare function getContentPlanFlow(contentPlanFlowId: string): Promise<NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>>;
486
+ /**
487
+ * Creates and starts a content plan flow for a site.
488
+ *
489
+ * Generation runs asynchronously and takes several minutes. This method
490
+ * returns a `contentPlanFlowId` as soon as the flow is created, before any
491
+ * content is generated. Poll Get Content Plan Flow with that ID to follow
492
+ * the flow's progress.
493
+ *
494
+ * A successful response means the flow was created, not that generation
495
+ * succeeded. Check `status` rather than relying on the response alone.
496
+ *
497
+ * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan
498
+ * to generate the blog post briefs and let the flow continue to `SUCCESS`.
499
+ *
500
+ * A failed flow is retried automatically, and each retry creates a separate
501
+ * flow with its own ID. The original flow keeps its `FAIL` status, so call
502
+ * Get Content Plan Flow without an ID to retrieve the site's most recent
503
+ * successful flow.
504
+ * @public
505
+ * @documentationMaturity preview
506
+ * @permissionId promote:seo:v1:content_plan_content_plan_flow:trigger_content_plan_generation_flow
507
+ * @applicableIdentity APP
508
+ * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow
509
+ */
510
+ declare function triggerContentPlanGenerationFlow(): Promise<TriggerContentPlanGenerationFlowResponse>;
511
+ /**
512
+ * Cancels a content plan flow.
513
+ *
514
+ * Cancellation is permanent. A canceled flow can't be resumed or restarted,
515
+ * and the keyword research linked to it is canceled with it. To generate a
516
+ * content plan afterwards, call Trigger Content Plan Generation Flow to
517
+ * start a flow.
518
+ *
519
+ * Calling this method on a flow that's already canceled succeeds and
520
+ * changes nothing.
521
+ * @param contentPlanFlowId - ID of the content plan flow to cancel.
522
+ * @public
523
+ * @documentationMaturity preview
524
+ * @requiredField contentPlanFlowId
525
+ * @permissionId promote:seo:v1:content_plan_content_plan_flow:cancel_content_plan_flow
526
+ * @applicableIdentity APP
527
+ * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow
528
+ */
529
+ declare function cancelContentPlanFlow(contentPlanFlowId: string): Promise<void>;
530
+
531
+ export { type AccountInfo, type ActionCta, type ActionEvent, type ActionPayload, type BlogData, type CancelContentPlanFlowRequest, type CancelContentPlanFlowResponse, type Change, type ContentPlanFlow, type DisplayMessage, type DomainEvent, type DomainEventBodyOneOf, type Entity, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExecuteActionRequest, type ExecuteActionResponse, type GetContentPlanFlowRequest, type GetContentPlanFlowResponse, type IdentificationData, type IdentificationDataIdOneOf, type Item, type ItemData, type ItemDataPayloadDataOneOf, type MessageEnvelope, type RestoreInfo, Status, type StatusWithLiterals, type TriggerContentPlanGenerationFlowRequest, type TriggerContentPlanGenerationFlowResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, cancelContentPlanFlow, getContentPlanFlow, triggerContentPlanGenerationFlow };