@wix/auto_sdk_seo_content-plan-flows 1.0.0 → 1.0.2

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.
@@ -19,7 +19,7 @@ interface GetContentPlanFlowSignature {
19
19
  *
20
20
  * Omit to retrieve the site's most recent successful flow.
21
21
  */
22
- (contentPlanFlowId: string): Promise<NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>>;
22
+ (contentPlanFlowId: string): Promise<NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 1>>;
23
23
  }
24
24
  declare function triggerContentPlanGenerationFlow$1(httpClient: HttpClient): TriggerContentPlanGenerationFlowSignature;
25
25
  interface TriggerContentPlanGenerationFlowSignature {
@@ -34,8 +34,10 @@ interface TriggerContentPlanGenerationFlowSignature {
34
34
  * A successful response means the flow was created, not that generation
35
35
  * succeeded. Check `status` rather than relying on the response alone.
36
36
  *
37
- * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan
38
- * to generate the blog post briefs and let the flow continue to `SUCCESS`.
37
+ * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword
38
+ * Research reports the flow's research as `SUCCESS`, call Create Content
39
+ * Plan to generate the blog post briefs and let the flow continue to
40
+ * `SUCCESS`.
39
41
  *
40
42
  * A failed flow is retried automatically, and each retry creates a separate
41
43
  * flow with its own ID. The original flow keeps its `FAIL` status, so call
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.public.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.context.ts"],"sourcesContent":["export * from './src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.context.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 ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.js';\n\n/**\n * A content plan flow tracks the generation of an SEO content plan for a site.\n *\n * A content plan is a set of blog post briefs built from the site's pages, its\n * business category, and real search volume data. Generating one takes several\n * minutes, so the flow runs asynchronously and reports its progress in `status`.\n *\n * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`\n * and waits for a call to Create Content Plan before it continues.\n */\nexport interface ContentPlanFlow {\n /**\n * Content plan flow ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Date and time the content plan flow was created.\n * @maxLength 100\n */\n createdAt?: string | null;\n /**\n * Date and time the content plan flow was updated.\n * @maxLength 100\n */\n updatedAt?: string | null;\n /**\n * Current status of the content plan flow.\n *\n * The status advances on its own as generation progresses, except at\n * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content\n * Plan.\n */\n status?: StatusWithLiterals;\n /**\n * What started the content plan flow. Flows started by an app are\n * recorded as `AGENT`.\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * ID of the site content summary the flow produced.\n * @format GUID\n */\n summaryId?: string | null;\n /**\n * Untyped diagnostic detail about the current status. Carries\n * `failedOnStep` when `status` is `FAIL`.\n * @internal\n */\n statusAdditionalData?: Record<string, any> | null;\n /**\n * ID of the keyword research the flow produced.\n *\n * Available once `status` is `KEYWORD_RESEARCH` or later.\n * @format GUID\n */\n keywordResearchId?: string | null;\n /**\n * retry attempt number\n * @internal\n */\n retryAttempt?: number | null;\n /**\n * Execution ID for async Proactive Marketing Assistant (PMA) operations.\n * @internal\n * @format GUID\n */\n pmaExecutionId?: string | null;\n}\n\nexport enum Status {\n /** The flow is created and the generation pipeline is starting. */\n CREATED = 'CREATED',\n /** The site's existing content is being summarized. */\n SITE_SUMMARY = 'SITE_SUMMARY',\n /**\n * Keyword research is complete and the flow is waiting. Call Create\n * Content Plan to generate the blog post briefs and continue the flow.\n */\n KEYWORD_RESEARCH = 'KEYWORD_RESEARCH',\n /** Blog post briefs are being generated from the keyword research. */\n CONTENT_PLAN = 'CONTENT_PLAN',\n /**\n * Generation is complete. Retrieve the results with List Blog Post\n * Candidates and List Keyword Research Items.\n */\n SUCCESS = 'SUCCESS',\n /** Generation failed. Trigger a flow to try again. */\n FAIL = 'FAIL',\n /**\n * The site is missing business information that keyword research\n * requires. The flow resumes automatically once the information is\n * added to the site.\n */\n PENDING_REQUIREMENTS = 'PENDING_REQUIREMENTS',\n /** The flow was canceled and can't be resumed. */\n CANCELED = 'CANCELED',\n /** The site's pages are being analyzed. */\n SITE_ANALYSIS = 'SITE_ANALYSIS',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'CREATED'\n | 'SITE_SUMMARY'\n | 'KEYWORD_RESEARCH'\n | 'CONTENT_PLAN'\n | 'SUCCESS'\n | 'FAIL'\n | 'PENDING_REQUIREMENTS'\n | 'CANCELED'\n | 'SITE_ANALYSIS';\n\nexport interface GetContentPlanFlowRequest {\n /**\n * ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface GetContentPlanFlowResponse {\n /** Retrieved content plan flow. */\n contentPlanFlow?: ContentPlanFlow;\n}\n\nexport interface TriggerContentPlanGenerationFlowRequest {\n /**\n * Internal. External app callers get AGENT; internal callers keep their value.\n * @internal\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * Execution ID supplied by the Proactive Marketing Assistant. No external\n * caller has one. No removal owner is assigned yet.\n * @internal\n * @format GUID\n */\n executionId?: string | null;\n}\n\nexport interface TriggerContentPlanGenerationFlowResponse {\n /**\n * ID of the content plan flow that was created.\n *\n * Poll Get Content Plan Flow with this ID to follow the flow's progress.\n * @format GUID\n */\n contentPlanFlowId?: string | null;\n}\n\nexport interface ExecuteActionRequest {\n /**\n * the execution id\n * @format GUID\n */\n executionId?: string;\n /**\n * the action id\n * @maxLength 1000\n */\n actionId?: string;\n /** item data - if relevant */\n item?: ItemData;\n /** whether to reset the current content of the action */\n reset?: boolean;\n}\n\nexport interface ItemData extends ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n /**\n * id\n * @maxLength 1000\n */\n _id?: string;\n /**\n * type\n * @maxLength 1000\n */\n type?: string;\n}\n\n/** @oneof */\nexport interface ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n}\n\nexport interface BlogData {\n /**\n * prompt\n * @maxLength 10000\n */\n prompt?: string;\n}\n\nexport interface ExecuteActionResponse {\n /** Whether the suggestion succeeded */\n success?: boolean;\n /** Whether the operation is async */\n async?: boolean;\n /**\n * Optional internal message\n * @maxLength 1000\n */\n message?: string;\n /** Optional display message */\n displayMessage?: DisplayMessage;\n /** The payload of the action, also the suggestion itself. */\n payload?: ActionPayload;\n /** Total action cost in microcents (1 microcent = $0.00001). If omitted or zero, PMA uses configured credit cost. */\n costInMicrocents?: number | null;\n}\n\nexport interface DisplayMessage {\n /**\n * Message to show to the user\n * @maxLength 1000\n */\n message?: string;\n /** Optional call to action */\n cta?: ActionCta;\n}\n\nexport interface ActionCta {\n /**\n * CTA title\n * @maxLength 1000\n */\n title?: string;\n /**\n * CTA URL\n * @maxLength 1000\n */\n url?: string;\n}\n\nexport interface ActionPayload {\n /**\n * Description of the suggestion\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional motivation for the suggestion\n * @maxLength 1000\n */\n motivation?: string;\n /** Optional entity being suggested */\n entity?: Entity;\n /**\n * Optional changes suggested\n * @maxSize 100\n */\n changes?: Change[];\n /**\n * Optional items suggested\n * @maxSize 100\n */\n items?: Item[];\n /** Optional preview link */\n previewLink?: ActionCta;\n}\n\nexport interface Entity {\n /**\n * Entity ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Optional entity name\n * @maxLength 1000\n */\n name?: string;\n}\n\nexport interface Change {\n /**\n * Change ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Change title\n * @maxLength 1000\n */\n title?: string;\n /**\n * The resulting state after the change\n * @maxLength 1000\n */\n after?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional state before the change\n * @maxLength 1000\n */\n before?: string;\n /** Optional: is this a suggestion or a confirmed change */\n isSuggestion?: boolean;\n /**\n * Optional type of change\n * @maxLength 100\n */\n type?: string;\n}\n\nexport interface Item {\n /**\n * Item ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Item title\n * @maxLength 1000\n */\n title?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional images\n * @maxSize 100\n * @maxLength 1000\n */\n images?: string[];\n /** Optional preview link */\n previewLink?: ActionCta;\n /**\n * Optional motivation for suggesting this item\n * @maxLength 1000\n */\n motivation?: string;\n /** Data */\n data?: Record<string, any> | null;\n /**\n * The content plan item id which this item created by\n * @maxLength 100\n */\n contentPlanItemId?: string;\n /** scheduled date */\n scheduledDate?: Date | null;\n}\n\nexport interface CancelContentPlanFlowRequest {\n /**\n * ID of the content plan flow to cancel.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface CancelContentPlanFlowResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param contentPlanFlowId - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:get_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow\n */\nexport async function getContentPlanFlow(\n contentPlanFlowId: string\n): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.getContentPlanFlow(\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: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan\n * to generate the blog post briefs and let the flow continue to `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n * @public\n * @documentationMaturity preview\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:trigger_content_plan_generation_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow\n */\nexport async function triggerContentPlanGenerationFlow(): Promise<TriggerContentPlanGenerationFlowResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.triggerContentPlanGenerationFlow(\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param contentPlanFlowId - ID of the content plan flow to cancel.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:cancel_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow\n */\nexport async function cancelContentPlanFlow(\n contentPlanFlowId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.cancelContentPlanFlow(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n _: [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_content-plan-flows';\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n */\nexport function getContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __getContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'GET' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n\n fallback: [\n {\n method: 'GET' as any,\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __getContentPlanFlow;\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan\n * to generate the blog post briefs and let the flow continue to `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\nexport function triggerContentPlanGenerationFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerContentPlanGenerationFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerContentPlanGenerationFlow;\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n */\nexport function cancelContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __cancelContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}/cancel',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __cancelContentPlanFlow;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetContentPlanFlowResponse,\n TriggerContentPlanGenerationFlowResponse,\n cancelContentPlanFlow as universalCancelContentPlanFlow,\n getContentPlanFlow as universalGetContentPlanFlow,\n triggerContentPlanGenerationFlow as universalTriggerContentPlanGenerationFlow,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getContentPlanFlow(\n httpClient: HttpClient\n): GetContentPlanFlowSignature {\n return (contentPlanFlowId: string) =>\n universalGetContentPlanFlow(\n contentPlanFlowId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetContentPlanFlowSignature {\n /**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n */\n (contentPlanFlowId: string): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>\n >;\n}\n\nexport function triggerContentPlanGenerationFlow(\n httpClient: HttpClient\n): TriggerContentPlanGenerationFlowSignature {\n return () =>\n universalTriggerContentPlanGenerationFlow(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TriggerContentPlanGenerationFlowSignature {\n /**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan\n * to generate the blog post briefs and let the flow continue to `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\n (): Promise<TriggerContentPlanGenerationFlowResponse>;\n}\n\nexport function cancelContentPlanFlow(\n httpClient: HttpClient\n): CancelContentPlanFlowSignature {\n return (contentPlanFlowId: string) =>\n universalCancelContentPlanFlow(\n contentPlanFlowId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CancelContentPlanFlowSignature {\n /**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param - ID of the content plan flow to cancel.\n */\n (contentPlanFlowId: string): Promise<void>;\n}\n\nexport {\n AccountInfo,\n ActionCta,\n ActionEvent,\n ActionPayload,\n BlogData,\n CancelContentPlanFlowRequest,\n CancelContentPlanFlowResponse,\n Change,\n ContentPlanFlow,\n DisplayMessage,\n DomainEvent,\n DomainEventBodyOneOf,\n Entity,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExecuteActionRequest,\n ExecuteActionResponse,\n GetContentPlanFlowRequest,\n GetContentPlanFlowResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n Item,\n ItemData,\n ItemDataPayloadDataOneOf,\n MessageEnvelope,\n RestoreInfo,\n Status,\n TriggerContentPlanGenerationFlowRequest,\n TriggerContentPlanGenerationFlowResponse,\n WebhookIdentityType,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n","import {\n getContentPlanFlow as publicGetContentPlanFlow,\n triggerContentPlanGenerationFlow as publicTriggerContentPlanGenerationFlow,\n cancelContentPlanFlow as publicCancelContentPlanFlow,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getContentPlanFlow: MaybeContext<\n BuildRESTFunction<typeof publicGetContentPlanFlow> &\n typeof publicGetContentPlanFlow\n> = /*#__PURE__*/ createRESTModule(publicGetContentPlanFlow);\nexport const triggerContentPlanGenerationFlow: MaybeContext<\n BuildRESTFunction<typeof publicTriggerContentPlanGenerationFlow> &\n typeof publicTriggerContentPlanGenerationFlow\n> = /*#__PURE__*/ createRESTModule(publicTriggerContentPlanGenerationFlow);\nexport const cancelContentPlanFlow: MaybeContext<\n BuildRESTFunction<typeof publicCancelContentPlanFlow> &\n typeof publicCancelContentPlanFlow\n> = /*#__PURE__*/ createRESTModule(publicCancelContentPlanFlow);\n\nexport {\n Status,\n WebhookIdentityType,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\nexport {\n ContentPlanFlow,\n GetContentPlanFlowRequest,\n GetContentPlanFlowResponse,\n TriggerContentPlanGenerationFlowRequest,\n TriggerContentPlanGenerationFlowResponse,\n ExecuteActionRequest,\n ItemData,\n ItemDataPayloadDataOneOf,\n BlogData,\n ExecuteActionResponse,\n DisplayMessage,\n ActionCta,\n ActionPayload,\n Entity,\n Change,\n Item,\n CancelContentPlanFlowRequest,\n CancelContentPlanFlowResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\nexport {\n StatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,wCAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,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BAAmB,OAAO;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,mBAAmB;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEzsBO,SAASG,oBACd,YAC6B;AAC7B,SAAO,CAAC,sBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,kCACd,YAC2C;AAC3C,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAyBO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,sBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AChFA,IAAAC,uBAAiC;AAG1B,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,oCAGK,2DAAiBA,iCAAsC;AAClE,IAAMC,yBAGK,2DAAiBA,sBAA2B;","names":["cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","import_rest_modules","Status","WebhookIdentityType","getContentPlanFlow","sdkTransformError","triggerContentPlanGenerationFlow","cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","cancelContentPlanFlow","import_rest_modules","getContentPlanFlow","triggerContentPlanGenerationFlow","cancelContentPlanFlow"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.public.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.context.ts"],"sourcesContent":["export * from './src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.context.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 ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.js';\n\n/**\n * A content plan flow tracks the generation of an SEO content plan for a site.\n *\n * A content plan is a set of blog post briefs built from the site's pages, its\n * business category, and real search volume data. Generating one takes several\n * minutes, so the flow runs asynchronously and reports its progress in `status`.\n *\n * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`\n * and waits for a call to Create Content Plan before it continues. The flow\n * reaches `KEYWORD_RESEARCH` when keyword research starts, so check that the\n * research finished with Get Site Keyword Research before you call Create\n * Content Plan.\n */\nexport interface ContentPlanFlow {\n /**\n * Content plan flow ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Date and time the content plan flow was created.\n * @maxLength 100\n */\n createdAt?: string | null;\n /**\n * Date and time the content plan flow was updated.\n * @maxLength 100\n */\n updatedAt?: string | null;\n /**\n * Current status of the content plan flow.\n *\n * The status advances on its own as generation progresses, except at\n * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content\n * Plan. Keyword research may still be running at that point; its own\n * status is on Get Site Keyword Research.\n */\n status?: StatusWithLiterals;\n /**\n * What started the content plan flow. Flows started by an app are\n * recorded as `AGENT`.\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * ID of the site content summary the flow produced.\n * @format GUID\n */\n summaryId?: string | null;\n /**\n * Untyped diagnostic detail about the current status. Carries\n * `failedOnStep` when `status` is `FAIL`.\n * @internal\n */\n statusAdditionalData?: Record<string, any> | null;\n /**\n * ID of the keyword research the flow started.\n *\n * Available once `status` is `KEYWORD_RESEARCH` or later. Pass it to Get\n * Site Keyword Research to check whether the research finished.\n * @format GUID\n */\n keywordResearchId?: string | null;\n /**\n * retry attempt number\n * @internal\n */\n retryAttempt?: number | null;\n /**\n * Execution ID for async Proactive Marketing Assistant (PMA) operations.\n * @internal\n * @format GUID\n */\n pmaExecutionId?: string | null;\n}\n\nexport enum Status {\n /** The flow is created and the generation pipeline is starting. */\n CREATED = 'CREATED',\n /** The site's existing content is being summarized. */\n SITE_SUMMARY = 'SITE_SUMMARY',\n /**\n * Keyword research has started, and the flow waits here until Create\n * Content Plan is called. This status doesn't change when the research\n * succeeds. Poll Get Site Keyword Research with `keywordResearchId`\n * until its status is `SUCCESS`, then call Create Content Plan.\n */\n KEYWORD_RESEARCH = 'KEYWORD_RESEARCH',\n /** Blog post briefs are being generated from the keyword research. */\n CONTENT_PLAN = 'CONTENT_PLAN',\n /**\n * Generation is complete. Retrieve the results with List Blog Post\n * Candidates and List Keyword Research Items.\n */\n SUCCESS = 'SUCCESS',\n /** Generation failed. Trigger a flow to try again. */\n FAIL = 'FAIL',\n /**\n * The site is missing business information that keyword research\n * requires. The flow resumes automatically once the information is\n * added to the site.\n */\n PENDING_REQUIREMENTS = 'PENDING_REQUIREMENTS',\n /** The flow was canceled and can't be resumed. */\n CANCELED = 'CANCELED',\n /** The site's pages are being analyzed. */\n SITE_ANALYSIS = 'SITE_ANALYSIS',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'CREATED'\n | 'SITE_SUMMARY'\n | 'KEYWORD_RESEARCH'\n | 'CONTENT_PLAN'\n | 'SUCCESS'\n | 'FAIL'\n | 'PENDING_REQUIREMENTS'\n | 'CANCELED'\n | 'SITE_ANALYSIS';\n\nexport interface GetContentPlanFlowRequest {\n /**\n * ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface GetContentPlanFlowResponse {\n /** Retrieved content plan flow. */\n contentPlanFlow?: ContentPlanFlow;\n}\n\nexport interface TriggerContentPlanGenerationFlowRequest {\n /**\n * Internal. External app callers get AGENT; internal callers keep their value.\n * @internal\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * Execution ID supplied by the Proactive Marketing Assistant. No external\n * caller has one. No removal owner is assigned yet.\n * @internal\n * @format GUID\n */\n executionId?: string | null;\n}\n\nexport interface TriggerContentPlanGenerationFlowResponse {\n /**\n * ID of the content plan flow that was created.\n *\n * Poll Get Content Plan Flow with this ID to follow the flow's progress.\n * @format GUID\n */\n contentPlanFlowId?: string | null;\n}\n\nexport interface ExecuteActionRequest {\n /**\n * the execution id\n * @format GUID\n */\n executionId?: string;\n /**\n * the action id\n * @maxLength 1000\n */\n actionId?: string;\n /** item data - if relevant */\n item?: ItemData;\n /** whether to reset the current content of the action */\n reset?: boolean;\n}\n\nexport interface ItemData extends ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n /**\n * id\n * @maxLength 1000\n */\n _id?: string;\n /**\n * type\n * @maxLength 1000\n */\n type?: string;\n}\n\n/** @oneof */\nexport interface ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n}\n\nexport interface BlogData {\n /**\n * prompt\n * @maxLength 10000\n */\n prompt?: string;\n}\n\nexport interface ExecuteActionResponse {\n /** Whether the suggestion succeeded */\n success?: boolean;\n /** Whether the operation is async */\n async?: boolean;\n /**\n * Optional internal message\n * @maxLength 1000\n */\n message?: string;\n /** Optional display message */\n displayMessage?: DisplayMessage;\n /** The payload of the action, also the suggestion itself. */\n payload?: ActionPayload;\n /** Total action cost in microcents (1 microcent = $0.00001). If omitted or zero, PMA uses configured credit cost. */\n costInMicrocents?: number | null;\n}\n\nexport interface DisplayMessage {\n /**\n * Message to show to the user\n * @maxLength 1000\n */\n message?: string;\n /** Optional call to action */\n cta?: ActionCta;\n}\n\nexport interface ActionCta {\n /**\n * CTA title\n * @maxLength 1000\n */\n title?: string;\n /**\n * CTA URL\n * @maxLength 1000\n */\n url?: string;\n}\n\nexport interface ActionPayload {\n /**\n * Description of the suggestion\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional motivation for the suggestion\n * @maxLength 1000\n */\n motivation?: string;\n /** Optional entity being suggested */\n entity?: Entity;\n /**\n * Optional changes suggested\n * @maxSize 100\n */\n changes?: Change[];\n /**\n * Optional items suggested\n * @maxSize 100\n */\n items?: Item[];\n /** Optional preview link */\n previewLink?: ActionCta;\n}\n\nexport interface Entity {\n /**\n * Entity ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Optional entity name\n * @maxLength 1000\n */\n name?: string;\n}\n\nexport interface Change {\n /**\n * Change ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Change title\n * @maxLength 1000\n */\n title?: string;\n /**\n * The resulting state after the change\n * @maxLength 1000\n */\n after?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional state before the change\n * @maxLength 1000\n */\n before?: string;\n /** Optional: is this a suggestion or a confirmed change */\n isSuggestion?: boolean;\n /**\n * Optional type of change\n * @maxLength 100\n */\n type?: string;\n}\n\nexport interface Item {\n /**\n * Item ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Item title\n * @maxLength 1000\n */\n title?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional images\n * @maxSize 100\n * @maxLength 1000\n */\n images?: string[];\n /** Optional preview link */\n previewLink?: ActionCta;\n /**\n * Optional motivation for suggesting this item\n * @maxLength 1000\n */\n motivation?: string;\n /** Data */\n data?: Record<string, any> | null;\n /**\n * The content plan item id which this item created by\n * @maxLength 100\n */\n contentPlanItemId?: string;\n /** scheduled date */\n scheduledDate?: Date | null;\n}\n\nexport interface CancelContentPlanFlowRequest {\n /**\n * ID of the content plan flow to cancel.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface CancelContentPlanFlowResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param contentPlanFlowId - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:get_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow\n */\nexport async function getContentPlanFlow(\n contentPlanFlowId: string\n): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 1>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.getContentPlanFlow(\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: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword\n * Research reports the flow's research as `SUCCESS`, call Create Content\n * Plan to generate the blog post briefs and let the flow continue to\n * `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n * @public\n * @documentationMaturity preview\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:trigger_content_plan_generation_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow\n */\nexport async function triggerContentPlanGenerationFlow(): Promise<TriggerContentPlanGenerationFlowResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.triggerContentPlanGenerationFlow(\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param contentPlanFlowId - ID of the content plan flow to cancel.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:cancel_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow\n */\nexport async function cancelContentPlanFlow(\n contentPlanFlowId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.cancelContentPlanFlow(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n _: [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_content-plan-flows';\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n */\nexport function getContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __getContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'GET' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n\n fallback: [\n {\n method: 'GET' as any,\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __getContentPlanFlow;\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword\n * Research reports the flow's research as `SUCCESS`, call Create Content\n * Plan to generate the blog post briefs and let the flow continue to\n * `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\nexport function triggerContentPlanGenerationFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerContentPlanGenerationFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerContentPlanGenerationFlow;\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n */\nexport function cancelContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __cancelContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}/cancel',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __cancelContentPlanFlow;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n GetContentPlanFlowResponse,\n TriggerContentPlanGenerationFlowResponse,\n cancelContentPlanFlow as universalCancelContentPlanFlow,\n getContentPlanFlow as universalGetContentPlanFlow,\n triggerContentPlanGenerationFlow as universalTriggerContentPlanGenerationFlow,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/seo' };\n\nexport function getContentPlanFlow(\n httpClient: HttpClient\n): GetContentPlanFlowSignature {\n return (contentPlanFlowId: string) =>\n universalGetContentPlanFlow(\n contentPlanFlowId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetContentPlanFlowSignature {\n /**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n */\n (contentPlanFlowId: string): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 1>\n >;\n}\n\nexport function triggerContentPlanGenerationFlow(\n httpClient: HttpClient\n): TriggerContentPlanGenerationFlowSignature {\n return () =>\n universalTriggerContentPlanGenerationFlow(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TriggerContentPlanGenerationFlowSignature {\n /**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword\n * Research reports the flow's research as `SUCCESS`, call Create Content\n * Plan to generate the blog post briefs and let the flow continue to\n * `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\n (): Promise<TriggerContentPlanGenerationFlowResponse>;\n}\n\nexport function cancelContentPlanFlow(\n httpClient: HttpClient\n): CancelContentPlanFlowSignature {\n return (contentPlanFlowId: string) =>\n universalCancelContentPlanFlow(\n contentPlanFlowId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CancelContentPlanFlowSignature {\n /**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param - ID of the content plan flow to cancel.\n */\n (contentPlanFlowId: string): Promise<void>;\n}\n\nexport {\n AccountInfo,\n ActionCta,\n ActionEvent,\n ActionPayload,\n BlogData,\n CancelContentPlanFlowRequest,\n CancelContentPlanFlowResponse,\n Change,\n ContentPlanFlow,\n DisplayMessage,\n DomainEvent,\n DomainEventBodyOneOf,\n Entity,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n ExecuteActionRequest,\n ExecuteActionResponse,\n GetContentPlanFlowRequest,\n GetContentPlanFlowResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n Item,\n ItemData,\n ItemDataPayloadDataOneOf,\n MessageEnvelope,\n RestoreInfo,\n Status,\n TriggerContentPlanGenerationFlowRequest,\n TriggerContentPlanGenerationFlowResponse,\n WebhookIdentityType,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n","import {\n getContentPlanFlow as publicGetContentPlanFlow,\n triggerContentPlanGenerationFlow as publicTriggerContentPlanGenerationFlow,\n cancelContentPlanFlow as publicCancelContentPlanFlow,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getContentPlanFlow: MaybeContext<\n BuildRESTFunction<typeof publicGetContentPlanFlow> &\n typeof publicGetContentPlanFlow\n> = /*#__PURE__*/ createRESTModule(publicGetContentPlanFlow);\nexport const triggerContentPlanGenerationFlow: MaybeContext<\n BuildRESTFunction<typeof publicTriggerContentPlanGenerationFlow> &\n typeof publicTriggerContentPlanGenerationFlow\n> = /*#__PURE__*/ createRESTModule(publicTriggerContentPlanGenerationFlow);\nexport const cancelContentPlanFlow: MaybeContext<\n BuildRESTFunction<typeof publicCancelContentPlanFlow> &\n typeof publicCancelContentPlanFlow\n> = /*#__PURE__*/ createRESTModule(publicCancelContentPlanFlow);\n\nexport {\n Status,\n WebhookIdentityType,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\nexport {\n ContentPlanFlow,\n GetContentPlanFlowRequest,\n GetContentPlanFlowResponse,\n TriggerContentPlanGenerationFlowRequest,\n TriggerContentPlanGenerationFlowResponse,\n ExecuteActionRequest,\n ItemData,\n ItemDataPayloadDataOneOf,\n BlogData,\n ExecuteActionResponse,\n DisplayMessage,\n ActionCta,\n ActionPayload,\n Entity,\n Change,\n Item,\n CancelContentPlanFlowRequest,\n CancelContentPlanFlowResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\nexport {\n StatusWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,wCAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QA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D;AAAA,IAClD;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,mBAAmB,OAAO;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,mBAAmB;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEltBO,SAASG,oBACd,YAC6B;AAC7B,SAAO,CAAC,sBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,kCACd,YAC2C;AAC3C,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AA2BO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,sBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AClFA,IAAAC,uBAAiC;AAG1B,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,oCAGK,2DAAiBA,iCAAsC;AAClE,IAAMC,yBAGK,2DAAiBA,sBAA2B;","names":["cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","import_rest_modules","Status","WebhookIdentityType","getContentPlanFlow","sdkTransformError","triggerContentPlanGenerationFlow","cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","cancelContentPlanFlow","import_rest_modules","getContentPlanFlow","triggerContentPlanGenerationFlow","cancelContentPlanFlow"]}
@@ -8,7 +8,10 @@ import { NonNullablePaths } from '@wix/sdk-types';
8
8
  * minutes, so the flow runs asynchronously and reports its progress in `status`.
9
9
  *
10
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.
11
+ * and waits for a call to Create Content Plan before it continues. The flow
12
+ * reaches `KEYWORD_RESEARCH` when keyword research starts, so check that the
13
+ * research finished with Get Site Keyword Research before you call Create
14
+ * Content Plan.
12
15
  */
13
16
  interface ContentPlanFlow {
14
17
  /**
@@ -32,7 +35,8 @@ interface ContentPlanFlow {
32
35
  *
33
36
  * The status advances on its own as generation progresses, except at
34
37
  * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content
35
- * Plan.
38
+ * Plan. Keyword research may still be running at that point; its own
39
+ * status is on Get Site Keyword Research.
36
40
  */
37
41
  status?: StatusWithLiterals;
38
42
  /**
@@ -47,9 +51,10 @@ interface ContentPlanFlow {
47
51
  */
48
52
  summaryId?: string | null;
49
53
  /**
50
- * ID of the keyword research the flow produced.
54
+ * ID of the keyword research the flow started.
51
55
  *
52
- * Available once `status` is `KEYWORD_RESEARCH` or later.
56
+ * Available once `status` is `KEYWORD_RESEARCH` or later. Pass it to Get
57
+ * Site Keyword Research to check whether the research finished.
53
58
  * @format GUID
54
59
  */
55
60
  keywordResearchId?: string | null;
@@ -60,8 +65,10 @@ declare enum Status {
60
65
  /** The site's existing content is being summarized. */
61
66
  SITE_SUMMARY = "SITE_SUMMARY",
62
67
  /**
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.
68
+ * Keyword research has started, and the flow waits here until Create
69
+ * Content Plan is called. This status doesn't change when the research
70
+ * succeeds. Poll Get Site Keyword Research with `keywordResearchId`
71
+ * until its status is `SUCCESS`, then call Create Content Plan.
65
72
  */
66
73
  KEYWORD_RESEARCH = "KEYWORD_RESEARCH",
67
74
  /** Blog post briefs are being generated from the keyword research. */
@@ -482,7 +489,7 @@ interface AccountInfo {
482
489
  * @applicableIdentity APP
483
490
  * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow
484
491
  */
485
- declare function getContentPlanFlow(contentPlanFlowId: string): Promise<NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>>;
492
+ declare function getContentPlanFlow(contentPlanFlowId: string): Promise<NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 1>>;
486
493
  /**
487
494
  * Creates and starts a content plan flow for a site.
488
495
  *
@@ -494,8 +501,10 @@ declare function getContentPlanFlow(contentPlanFlowId: string): Promise<NonNulla
494
501
  * A successful response means the flow was created, not that generation
495
502
  * succeeded. Check `status` rather than relying on the response alone.
496
503
  *
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`.
504
+ * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword
505
+ * Research reports the flow's research as `SUCCESS`, call Create Content
506
+ * Plan to generate the blog post briefs and let the flow continue to
507
+ * `SUCCESS`.
499
508
  *
500
509
  * A failed flow is retried automatically, and each retry creates a separate
501
510
  * flow with its own ID. The original flow keeps its `FAIL` status, so call
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.ts"],"sourcesContent":["export * from './src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.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 ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.js';\n\n/**\n * A content plan flow tracks the generation of an SEO content plan for a site.\n *\n * A content plan is a set of blog post briefs built from the site's pages, its\n * business category, and real search volume data. Generating one takes several\n * minutes, so the flow runs asynchronously and reports its progress in `status`.\n *\n * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`\n * and waits for a call to Create Content Plan before it continues.\n */\nexport interface ContentPlanFlow {\n /**\n * Content plan flow ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Date and time the content plan flow was created.\n * @maxLength 100\n */\n createdAt?: string | null;\n /**\n * Date and time the content plan flow was updated.\n * @maxLength 100\n */\n updatedAt?: string | null;\n /**\n * Current status of the content plan flow.\n *\n * The status advances on its own as generation progresses, except at\n * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content\n * Plan.\n */\n status?: StatusWithLiterals;\n /**\n * What started the content plan flow. Flows started by an app are\n * recorded as `AGENT`.\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * ID of the site content summary the flow produced.\n * @format GUID\n */\n summaryId?: string | null;\n /**\n * Untyped diagnostic detail about the current status. Carries\n * `failedOnStep` when `status` is `FAIL`.\n * @internal\n */\n statusAdditionalData?: Record<string, any> | null;\n /**\n * ID of the keyword research the flow produced.\n *\n * Available once `status` is `KEYWORD_RESEARCH` or later.\n * @format GUID\n */\n keywordResearchId?: string | null;\n /**\n * retry attempt number\n * @internal\n */\n retryAttempt?: number | null;\n /**\n * Execution ID for async Proactive Marketing Assistant (PMA) operations.\n * @internal\n * @format GUID\n */\n pmaExecutionId?: string | null;\n}\n\nexport enum Status {\n /** The flow is created and the generation pipeline is starting. */\n CREATED = 'CREATED',\n /** The site's existing content is being summarized. */\n SITE_SUMMARY = 'SITE_SUMMARY',\n /**\n * Keyword research is complete and the flow is waiting. Call Create\n * Content Plan to generate the blog post briefs and continue the flow.\n */\n KEYWORD_RESEARCH = 'KEYWORD_RESEARCH',\n /** Blog post briefs are being generated from the keyword research. */\n CONTENT_PLAN = 'CONTENT_PLAN',\n /**\n * Generation is complete. Retrieve the results with List Blog Post\n * Candidates and List Keyword Research Items.\n */\n SUCCESS = 'SUCCESS',\n /** Generation failed. Trigger a flow to try again. */\n FAIL = 'FAIL',\n /**\n * The site is missing business information that keyword research\n * requires. The flow resumes automatically once the information is\n * added to the site.\n */\n PENDING_REQUIREMENTS = 'PENDING_REQUIREMENTS',\n /** The flow was canceled and can't be resumed. */\n CANCELED = 'CANCELED',\n /** The site's pages are being analyzed. */\n SITE_ANALYSIS = 'SITE_ANALYSIS',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'CREATED'\n | 'SITE_SUMMARY'\n | 'KEYWORD_RESEARCH'\n | 'CONTENT_PLAN'\n | 'SUCCESS'\n | 'FAIL'\n | 'PENDING_REQUIREMENTS'\n | 'CANCELED'\n | 'SITE_ANALYSIS';\n\nexport interface GetContentPlanFlowRequest {\n /**\n * ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface GetContentPlanFlowResponse {\n /** Retrieved content plan flow. */\n contentPlanFlow?: ContentPlanFlow;\n}\n\nexport interface TriggerContentPlanGenerationFlowRequest {\n /**\n * Internal. External app callers get AGENT; internal callers keep their value.\n * @internal\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * Execution ID supplied by the Proactive Marketing Assistant. No external\n * caller has one. No removal owner is assigned yet.\n * @internal\n * @format GUID\n */\n executionId?: string | null;\n}\n\nexport interface TriggerContentPlanGenerationFlowResponse {\n /**\n * ID of the content plan flow that was created.\n *\n * Poll Get Content Plan Flow with this ID to follow the flow's progress.\n * @format GUID\n */\n contentPlanFlowId?: string | null;\n}\n\nexport interface ExecuteActionRequest {\n /**\n * the execution id\n * @format GUID\n */\n executionId?: string;\n /**\n * the action id\n * @maxLength 1000\n */\n actionId?: string;\n /** item data - if relevant */\n item?: ItemData;\n /** whether to reset the current content of the action */\n reset?: boolean;\n}\n\nexport interface ItemData extends ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n /**\n * id\n * @maxLength 1000\n */\n _id?: string;\n /**\n * type\n * @maxLength 1000\n */\n type?: string;\n}\n\n/** @oneof */\nexport interface ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n}\n\nexport interface BlogData {\n /**\n * prompt\n * @maxLength 10000\n */\n prompt?: string;\n}\n\nexport interface ExecuteActionResponse {\n /** Whether the suggestion succeeded */\n success?: boolean;\n /** Whether the operation is async */\n async?: boolean;\n /**\n * Optional internal message\n * @maxLength 1000\n */\n message?: string;\n /** Optional display message */\n displayMessage?: DisplayMessage;\n /** The payload of the action, also the suggestion itself. */\n payload?: ActionPayload;\n /** Total action cost in microcents (1 microcent = $0.00001). If omitted or zero, PMA uses configured credit cost. */\n costInMicrocents?: number | null;\n}\n\nexport interface DisplayMessage {\n /**\n * Message to show to the user\n * @maxLength 1000\n */\n message?: string;\n /** Optional call to action */\n cta?: ActionCta;\n}\n\nexport interface ActionCta {\n /**\n * CTA title\n * @maxLength 1000\n */\n title?: string;\n /**\n * CTA URL\n * @maxLength 1000\n */\n url?: string;\n}\n\nexport interface ActionPayload {\n /**\n * Description of the suggestion\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional motivation for the suggestion\n * @maxLength 1000\n */\n motivation?: string;\n /** Optional entity being suggested */\n entity?: Entity;\n /**\n * Optional changes suggested\n * @maxSize 100\n */\n changes?: Change[];\n /**\n * Optional items suggested\n * @maxSize 100\n */\n items?: Item[];\n /** Optional preview link */\n previewLink?: ActionCta;\n}\n\nexport interface Entity {\n /**\n * Entity ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Optional entity name\n * @maxLength 1000\n */\n name?: string;\n}\n\nexport interface Change {\n /**\n * Change ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Change title\n * @maxLength 1000\n */\n title?: string;\n /**\n * The resulting state after the change\n * @maxLength 1000\n */\n after?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional state before the change\n * @maxLength 1000\n */\n before?: string;\n /** Optional: is this a suggestion or a confirmed change */\n isSuggestion?: boolean;\n /**\n * Optional type of change\n * @maxLength 100\n */\n type?: string;\n}\n\nexport interface Item {\n /**\n * Item ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Item title\n * @maxLength 1000\n */\n title?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional images\n * @maxSize 100\n * @maxLength 1000\n */\n images?: string[];\n /** Optional preview link */\n previewLink?: ActionCta;\n /**\n * Optional motivation for suggesting this item\n * @maxLength 1000\n */\n motivation?: string;\n /** Data */\n data?: Record<string, any> | null;\n /**\n * The content plan item id which this item created by\n * @maxLength 100\n */\n contentPlanItemId?: string;\n /** scheduled date */\n scheduledDate?: Date | null;\n}\n\nexport interface CancelContentPlanFlowRequest {\n /**\n * ID of the content plan flow to cancel.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface CancelContentPlanFlowResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param contentPlanFlowId - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:get_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow\n */\nexport async function getContentPlanFlow(\n contentPlanFlowId: string\n): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 3>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.getContentPlanFlow(\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: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan\n * to generate the blog post briefs and let the flow continue to `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n * @public\n * @documentationMaturity preview\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:trigger_content_plan_generation_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow\n */\nexport async function triggerContentPlanGenerationFlow(): Promise<TriggerContentPlanGenerationFlowResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.triggerContentPlanGenerationFlow(\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param contentPlanFlowId - ID of the content plan flow to cancel.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:cancel_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow\n */\nexport async function cancelContentPlanFlow(\n contentPlanFlowId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.cancelContentPlanFlow(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n _: [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_content-plan-flows';\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n */\nexport function getContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __getContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'GET' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n\n fallback: [\n {\n method: 'GET' as any,\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __getContentPlanFlow;\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Call Create Content Plan\n * to generate the blog post briefs and let the flow continue to `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\nexport function triggerContentPlanGenerationFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerContentPlanGenerationFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerContentPlanGenerationFlow;\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n */\nexport function cancelContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __cancelContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}/cancel',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __cancelContentPlanFlow;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,wCAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAA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1B,UAAM;AAAA,EACR;AACF;AA0BA,eAAsBC,oCAAsF;AAE1G,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,CAAC,CAAC;AAExD,QAAM,UACgD;AAAA,IAClD;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,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAoBA,eAAsBE,uBACpB,mBACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UACgD;AAAA,IAClD;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,mBAAmB,OAAO;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,mBAAmB;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","import_rest_modules","Status","WebhookIdentityType","getContentPlanFlow","sdkTransformError","triggerContentPlanGenerationFlow","cancelContentPlanFlow"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.universal.ts","../../src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.ts"],"sourcesContent":["export * from './src/promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.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 ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow from './promote-seo-v1-content-plan-content-plan-flow-content-plan-flows.http.js';\n\n/**\n * A content plan flow tracks the generation of an SEO content plan for a site.\n *\n * A content plan is a set of blog post briefs built from the site's pages, its\n * business category, and real search volume data. Generating one takes several\n * minutes, so the flow runs asynchronously and reports its progress in `status`.\n *\n * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`\n * and waits for a call to Create Content Plan before it continues. The flow\n * reaches `KEYWORD_RESEARCH` when keyword research starts, so check that the\n * research finished with Get Site Keyword Research before you call Create\n * Content Plan.\n */\nexport interface ContentPlanFlow {\n /**\n * Content plan flow ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Date and time the content plan flow was created.\n * @maxLength 100\n */\n createdAt?: string | null;\n /**\n * Date and time the content plan flow was updated.\n * @maxLength 100\n */\n updatedAt?: string | null;\n /**\n * Current status of the content plan flow.\n *\n * The status advances on its own as generation progresses, except at\n * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content\n * Plan. Keyword research may still be running at that point; its own\n * status is on Get Site Keyword Research.\n */\n status?: StatusWithLiterals;\n /**\n * What started the content plan flow. Flows started by an app are\n * recorded as `AGENT`.\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * ID of the site content summary the flow produced.\n * @format GUID\n */\n summaryId?: string | null;\n /**\n * Untyped diagnostic detail about the current status. Carries\n * `failedOnStep` when `status` is `FAIL`.\n * @internal\n */\n statusAdditionalData?: Record<string, any> | null;\n /**\n * ID of the keyword research the flow started.\n *\n * Available once `status` is `KEYWORD_RESEARCH` or later. Pass it to Get\n * Site Keyword Research to check whether the research finished.\n * @format GUID\n */\n keywordResearchId?: string | null;\n /**\n * retry attempt number\n * @internal\n */\n retryAttempt?: number | null;\n /**\n * Execution ID for async Proactive Marketing Assistant (PMA) operations.\n * @internal\n * @format GUID\n */\n pmaExecutionId?: string | null;\n}\n\nexport enum Status {\n /** The flow is created and the generation pipeline is starting. */\n CREATED = 'CREATED',\n /** The site's existing content is being summarized. */\n SITE_SUMMARY = 'SITE_SUMMARY',\n /**\n * Keyword research has started, and the flow waits here until Create\n * Content Plan is called. This status doesn't change when the research\n * succeeds. Poll Get Site Keyword Research with `keywordResearchId`\n * until its status is `SUCCESS`, then call Create Content Plan.\n */\n KEYWORD_RESEARCH = 'KEYWORD_RESEARCH',\n /** Blog post briefs are being generated from the keyword research. */\n CONTENT_PLAN = 'CONTENT_PLAN',\n /**\n * Generation is complete. Retrieve the results with List Blog Post\n * Candidates and List Keyword Research Items.\n */\n SUCCESS = 'SUCCESS',\n /** Generation failed. Trigger a flow to try again. */\n FAIL = 'FAIL',\n /**\n * The site is missing business information that keyword research\n * requires. The flow resumes automatically once the information is\n * added to the site.\n */\n PENDING_REQUIREMENTS = 'PENDING_REQUIREMENTS',\n /** The flow was canceled and can't be resumed. */\n CANCELED = 'CANCELED',\n /** The site's pages are being analyzed. */\n SITE_ANALYSIS = 'SITE_ANALYSIS',\n}\n\n/** @enumType */\nexport type StatusWithLiterals =\n | Status\n | 'CREATED'\n | 'SITE_SUMMARY'\n | 'KEYWORD_RESEARCH'\n | 'CONTENT_PLAN'\n | 'SUCCESS'\n | 'FAIL'\n | 'PENDING_REQUIREMENTS'\n | 'CANCELED'\n | 'SITE_ANALYSIS';\n\nexport interface GetContentPlanFlowRequest {\n /**\n * ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface GetContentPlanFlowResponse {\n /** Retrieved content plan flow. */\n contentPlanFlow?: ContentPlanFlow;\n}\n\nexport interface TriggerContentPlanGenerationFlowRequest {\n /**\n * Internal. External app callers get AGENT; internal callers keep their value.\n * @internal\n * @maxLength 100\n */\n origin?: string | null;\n /**\n * Execution ID supplied by the Proactive Marketing Assistant. No external\n * caller has one. No removal owner is assigned yet.\n * @internal\n * @format GUID\n */\n executionId?: string | null;\n}\n\nexport interface TriggerContentPlanGenerationFlowResponse {\n /**\n * ID of the content plan flow that was created.\n *\n * Poll Get Content Plan Flow with this ID to follow the flow's progress.\n * @format GUID\n */\n contentPlanFlowId?: string | null;\n}\n\nexport interface ExecuteActionRequest {\n /**\n * the execution id\n * @format GUID\n */\n executionId?: string;\n /**\n * the action id\n * @maxLength 1000\n */\n actionId?: string;\n /** item data - if relevant */\n item?: ItemData;\n /** whether to reset the current content of the action */\n reset?: boolean;\n}\n\nexport interface ItemData extends ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n /**\n * id\n * @maxLength 1000\n */\n _id?: string;\n /**\n * type\n * @maxLength 1000\n */\n type?: string;\n}\n\n/** @oneof */\nexport interface ItemDataPayloadDataOneOf {\n blogData?: BlogData;\n}\n\nexport interface BlogData {\n /**\n * prompt\n * @maxLength 10000\n */\n prompt?: string;\n}\n\nexport interface ExecuteActionResponse {\n /** Whether the suggestion succeeded */\n success?: boolean;\n /** Whether the operation is async */\n async?: boolean;\n /**\n * Optional internal message\n * @maxLength 1000\n */\n message?: string;\n /** Optional display message */\n displayMessage?: DisplayMessage;\n /** The payload of the action, also the suggestion itself. */\n payload?: ActionPayload;\n /** Total action cost in microcents (1 microcent = $0.00001). If omitted or zero, PMA uses configured credit cost. */\n costInMicrocents?: number | null;\n}\n\nexport interface DisplayMessage {\n /**\n * Message to show to the user\n * @maxLength 1000\n */\n message?: string;\n /** Optional call to action */\n cta?: ActionCta;\n}\n\nexport interface ActionCta {\n /**\n * CTA title\n * @maxLength 1000\n */\n title?: string;\n /**\n * CTA URL\n * @maxLength 1000\n */\n url?: string;\n}\n\nexport interface ActionPayload {\n /**\n * Description of the suggestion\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional motivation for the suggestion\n * @maxLength 1000\n */\n motivation?: string;\n /** Optional entity being suggested */\n entity?: Entity;\n /**\n * Optional changes suggested\n * @maxSize 100\n */\n changes?: Change[];\n /**\n * Optional items suggested\n * @maxSize 100\n */\n items?: Item[];\n /** Optional preview link */\n previewLink?: ActionCta;\n}\n\nexport interface Entity {\n /**\n * Entity ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Optional entity name\n * @maxLength 1000\n */\n name?: string;\n}\n\nexport interface Change {\n /**\n * Change ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Change title\n * @maxLength 1000\n */\n title?: string;\n /**\n * The resulting state after the change\n * @maxLength 1000\n */\n after?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional state before the change\n * @maxLength 1000\n */\n before?: string;\n /** Optional: is this a suggestion or a confirmed change */\n isSuggestion?: boolean;\n /**\n * Optional type of change\n * @maxLength 100\n */\n type?: string;\n}\n\nexport interface Item {\n /**\n * Item ID\n * @maxLength 100\n */\n _id?: string;\n /**\n * Item title\n * @maxLength 1000\n */\n title?: string;\n /**\n * Optional description\n * @maxLength 1000\n */\n description?: string;\n /**\n * Optional images\n * @maxSize 100\n * @maxLength 1000\n */\n images?: string[];\n /** Optional preview link */\n previewLink?: ActionCta;\n /**\n * Optional motivation for suggesting this item\n * @maxLength 1000\n */\n motivation?: string;\n /** Data */\n data?: Record<string, any> | null;\n /**\n * The content plan item id which this item created by\n * @maxLength 100\n */\n contentPlanItemId?: string;\n /** scheduled date */\n scheduledDate?: Date | null;\n}\n\nexport interface CancelContentPlanFlowRequest {\n /**\n * ID of the content plan flow to cancel.\n * @format GUID\n */\n contentPlanFlowId: string | null;\n}\n\nexport interface CancelContentPlanFlowResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n * @param contentPlanFlowId - ID of the content plan flow to retrieve.\n *\n * Omit to retrieve the site's most recent successful flow.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:get_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow\n */\nexport async function getContentPlanFlow(\n contentPlanFlowId: string\n): Promise<\n NonNullablePaths<GetContentPlanFlowResponse, `contentPlanFlow.status`, 1>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.getContentPlanFlow(\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: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword\n * Research reports the flow's research as `SUCCESS`, call Create Content\n * Plan to generate the blog post briefs and let the flow continue to\n * `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n * @public\n * @documentationMaturity preview\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:trigger_content_plan_generation_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow\n */\nexport async function triggerContentPlanGenerationFlow(): Promise<TriggerContentPlanGenerationFlowResponse> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.triggerContentPlanGenerationFlow(\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n * @param contentPlanFlowId - ID of the content plan flow to cancel.\n * @public\n * @documentationMaturity preview\n * @requiredField contentPlanFlowId\n * @permissionId promote:seo:v1:content_plan_content_plan_flow:cancel_content_plan_flow\n * @applicableIdentity APP\n * @fqn wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow\n */\nexport async function cancelContentPlanFlow(\n contentPlanFlowId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contentPlanFlowId: contentPlanFlowId,\n });\n\n const reqOpts =\n ambassadorWixPromoteSeoV1ContentPlanContentPlanFlow.cancelContentPlanFlow(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { contentPlanFlowId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['contentPlanFlowId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/_serverless/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/seo-content-plan-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n _: [\n {\n srcPath: '/seo-content-plan-service',\n destPath: '',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flows',\n destPath: '/v1/content-plan-flows',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-flow',\n destPath: '/v1/content-plan-flow',\n },\n {\n srcPath: '/promote/seo/v1/content-plan-keyword-research-items',\n destPath: '/v1/content-plan-keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/keyword-research-items',\n destPath: '/v1/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/bulk/keyword-research-items',\n destPath: '/v1/bulk/keyword-research-items',\n },\n {\n srcPath: '/promote/seo/v1/create-content-plan',\n destPath: '/v1/create-content-plan',\n },\n {\n srcPath: '/promote/seo/v1/trigger-content-plan-generation-flow',\n destPath: '/v1/trigger-content-plan-generation-flow',\n },\n {\n srcPath: '/promote/seo/v1/cancel-content-plan-flow',\n destPath: '/v1/cancel-content-plan-flow',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_seo_content-plan-flows';\n\n/**\n * Retrieves a content plan flow.\n *\n * While a flow is generating, poll this method with the\n * `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to\n * follow the flow's progress.\n *\n * Omit `contentPlanFlowId` to retrieve the site's most recent successful\n * flow. This is useful for picking up a content plan that was generated in\n * the site dashboard. A flow that's still running is never returned this\n * way, and a site with no successful flow returns a not found error.\n */\nexport function getContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __getContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'GET' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.GetContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n\n fallback: [\n {\n method: 'GET' as any,\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n },\n ],\n };\n\n return metadata;\n }\n\n return __getContentPlanFlow;\n}\n\n/**\n * Creates and starts a content plan flow for a site.\n *\n * Generation runs asynchronously and takes several minutes. This method\n * returns a `contentPlanFlowId` as soon as the flow is created, before any\n * content is generated. Poll Get Content Plan Flow with that ID to follow\n * the flow's progress.\n *\n * A successful response means the flow was created, not that generation\n * succeeded. Check `status` rather than relying on the response alone.\n *\n * The flow stops at `KEYWORD_RESEARCH` and waits. Once Get Site Keyword\n * Research reports the flow's research as `SUCCESS`, call Create Content\n * Plan to generate the blog post briefs and let the flow continue to\n * `SUCCESS`.\n *\n * A failed flow is retried automatically, and each retry creates a separate\n * flow with its own ID. The original flow keeps its `FAIL` status, so call\n * Get Content Plan Flow without an ID to retrieve the site's most recent\n * successful flow.\n */\nexport function triggerContentPlanGenerationFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __triggerContentPlanGenerationFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.TriggerContentPlanGenerationFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/trigger',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __triggerContentPlanGenerationFlow;\n}\n\n/**\n * Cancels a content plan flow.\n *\n * Cancellation is permanent. A canceled flow can't be resumed or restarted,\n * and the keyword research linked to it is canceled with it. To generate a\n * content plan afterwards, call Trigger Content Plan Generation Flow to\n * start a flow.\n *\n * Calling this method on a flow that's already canceled succeeds and\n * changes nothing.\n */\nexport function cancelContentPlanFlow(\n payload: object\n): RequestOptionsFactory<any> {\n function __cancelContentPlanFlow({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.promote.seo.v1.content_plan_content_plan_flow',\n method: 'POST' as any,\n methodFqn:\n 'wix.promote.seo.content.plan.v1.ContentPlanFlowServiceV1.CancelContentPlanFlow',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixPromoteSeoContentPlanV1ContentPlanFlowServiceV1Url({\n protoPath: '/v1/content-plan-flows/{contentPlanFlowId}/cancel',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __cancelContentPlanFlow;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,0BAAAC;AAAA,EAAA,wCAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,S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ACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAoBA,eAAsBE,uBACpB,mBACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UACgD;AAAA,IAClD;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,mBAAmB,OAAO;AAAA,QACtD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,mBAAmB;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["cancelContentPlanFlow","getContentPlanFlow","triggerContentPlanGenerationFlow","import_rest_modules","Status","WebhookIdentityType","getContentPlanFlow","sdkTransformError","triggerContentPlanGenerationFlow","cancelContentPlanFlow"]}
@@ -9,7 +9,10 @@ import '@wix/sdk-types';
9
9
  * minutes, so the flow runs asynchronously and reports its progress in `status`.
10
10
  *
11
11
  * A flow doesn't run to completion on its own. It stops at `KEYWORD_RESEARCH`
12
- * and waits for a call to Create Content Plan before it continues.
12
+ * and waits for a call to Create Content Plan before it continues. The flow
13
+ * reaches `KEYWORD_RESEARCH` when keyword research starts, so check that the
14
+ * research finished with Get Site Keyword Research before you call Create
15
+ * Content Plan.
13
16
  */
14
17
  interface ContentPlanFlow {
15
18
  /**
@@ -33,7 +36,8 @@ interface ContentPlanFlow {
33
36
  *
34
37
  * The status advances on its own as generation progresses, except at
35
38
  * `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content
36
- * Plan.
39
+ * Plan. Keyword research may still be running at that point; its own
40
+ * status is on Get Site Keyword Research.
37
41
  */
38
42
  status?: StatusWithLiterals;
39
43
  /**
@@ -48,9 +52,10 @@ interface ContentPlanFlow {
48
52
  */
49
53
  summaryId?: string | null;
50
54
  /**
51
- * ID of the keyword research the flow produced.
55
+ * ID of the keyword research the flow started.
52
56
  *
53
- * Available once `status` is `KEYWORD_RESEARCH` or later.
57
+ * Available once `status` is `KEYWORD_RESEARCH` or later. Pass it to Get
58
+ * Site Keyword Research to check whether the research finished.
54
59
  * @format GUID
55
60
  */
56
61
  keywordResearchId?: string | null;
@@ -61,8 +66,10 @@ declare enum Status {
61
66
  /** The site's existing content is being summarized. */
62
67
  SITE_SUMMARY = "SITE_SUMMARY",
63
68
  /**
64
- * Keyword research is complete and the flow is waiting. Call Create
65
- * Content Plan to generate the blog post briefs and continue the flow.
69
+ * Keyword research has started, and the flow waits here until Create
70
+ * Content Plan is called. This status doesn't change when the research
71
+ * succeeds. Poll Get Site Keyword Research with `keywordResearchId`
72
+ * until its status is `SUCCESS`, then call Create Content Plan.
66
73
  */
67
74
  KEYWORD_RESEARCH = "KEYWORD_RESEARCH",
68
75
  /** Blog post briefs are being generated from the keyword research. */