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