@wix/auto_sdk_seo_content-plan-flows 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +5 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +18 -17
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +13 -13
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +5 -4
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +18 -17
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +13 -13
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -4
- package/build/internal/cjs/index.typings.d.ts +18 -17
- package/build/internal/cjs/meta.d.ts +13 -13
- package/build/internal/es/index.d.mts +5 -4
- package/build/internal/es/index.typings.d.mts +18 -17
- package/build/internal/es/meta.d.mts +13 -13
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -34,10 +34,11 @@ 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
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* `
|
|
37
|
+
* Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,
|
|
38
|
+
* use Get Site Keyword Research to check its matching research. After
|
|
39
|
+
* research `SUCCESS`, re-read the flow and call Create Content Plan once
|
|
40
|
+
* only if it still waits at `KEYWORD_RESEARCH` with the same research ID.
|
|
41
|
+
* Skip Create if the flow is already at `CONTENT_PLAN` or `SUCCESS`.
|
|
41
42
|
*
|
|
42
43
|
* A failed flow is retried automatically, and each retry creates a separate
|
|
43
44
|
* flow with its own ID. The original flow keeps its `FAIL` status, so call
|
package/build/cjs/index.js.map
CHANGED
|
@@ -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. 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,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,Q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BAGK,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 reaches `KEYWORD_RESEARCH` when keyword research starts, not when it\n * finishes. Some flows advance automatically. For a flow still waiting here,\n * check its matching research with Get Site Keyword Research, then re-read the\n * flow before calling Create Content Plan once. Skip Create if the flow has\n * already advanced to `CONTENT_PLAN` or `SUCCESS`.\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 * `KEYWORD_RESEARCH` can mean research is running or the flow is waiting\n * for Create Content Plan. Get Site Keyword Research reports research's\n * own status. A flow already at `CONTENT_PLAN` or `SUCCESS` needs no\n * release call.\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. This does not prove research is ready.\n * Check the matching research with Get Site Keyword Research. After\n * research succeeds, re-read the flow before calling Create Content\n * Plan once if it still waits here.\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 * Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,\n * use Get Site Keyword Research to check its matching research. After\n * research `SUCCESS`, re-read the flow and call Create Content Plan once\n * only if it still waits at `KEYWORD_RESEARCH` with the same research ID.\n * Skip Create if the flow is already at `CONTENT_PLAN` or `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 * Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,\n * use Get Site Keyword Research to check its matching research. After\n * research `SUCCESS`, re-read the flow and call Create Content Plan once\n * only if it still waits at `KEYWORD_RESEARCH` with the same research ID.\n * Skip Create if the flow is already at `CONTENT_PLAN` or `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 * Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,\n * use Get Site Keyword Research to check its matching research. After\n * research `SUCCESS`, re-read the flow and call Create Content Plan once\n * only if it still waits at `KEYWORD_RESEARCH` with the same research ID.\n * Skip Create if the flow is already at `CONTENT_PLAN` or `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,MACZ;AAAA,IACF;AAAA,IACA,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA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AE1B,UAAM;AAAA,EACR;AACF;;;AEntBO,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;AA4BO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,sBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACnFA,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"]}
|
|
@@ -7,11 +7,11 @@ import { NonNullablePaths } from '@wix/sdk-types';
|
|
|
7
7
|
* business category, and real search volume data. Generating one takes several
|
|
8
8
|
* minutes, so the flow runs asynchronously and reports its progress in `status`.
|
|
9
9
|
*
|
|
10
|
-
* A flow
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
10
|
+
* A flow reaches `KEYWORD_RESEARCH` when keyword research starts, not when it
|
|
11
|
+
* finishes. Some flows advance automatically. For a flow still waiting here,
|
|
12
|
+
* check its matching research with Get Site Keyword Research, then re-read the
|
|
13
|
+
* flow before calling Create Content Plan once. Skip Create if the flow has
|
|
14
|
+
* already advanced to `CONTENT_PLAN` or `SUCCESS`.
|
|
15
15
|
*/
|
|
16
16
|
interface ContentPlanFlow {
|
|
17
17
|
/**
|
|
@@ -33,10 +33,10 @@ interface ContentPlanFlow {
|
|
|
33
33
|
/**
|
|
34
34
|
* Current status of the content plan flow.
|
|
35
35
|
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
36
|
+
* `KEYWORD_RESEARCH` can mean research is running or the flow is waiting
|
|
37
|
+
* for Create Content Plan. Get Site Keyword Research reports research's
|
|
38
|
+
* own status. A flow already at `CONTENT_PLAN` or `SUCCESS` needs no
|
|
39
|
+
* release call.
|
|
40
40
|
*/
|
|
41
41
|
status?: StatusWithLiterals;
|
|
42
42
|
/**
|
|
@@ -65,10 +65,10 @@ declare enum Status {
|
|
|
65
65
|
/** The site's existing content is being summarized. */
|
|
66
66
|
SITE_SUMMARY = "SITE_SUMMARY",
|
|
67
67
|
/**
|
|
68
|
-
* Keyword research has started
|
|
69
|
-
*
|
|
70
|
-
* succeeds
|
|
71
|
-
*
|
|
68
|
+
* Keyword research has started. This does not prove research is ready.
|
|
69
|
+
* Check the matching research with Get Site Keyword Research. After
|
|
70
|
+
* research succeeds, re-read the flow before calling Create Content
|
|
71
|
+
* Plan once if it still waits here.
|
|
72
72
|
*/
|
|
73
73
|
KEYWORD_RESEARCH = "KEYWORD_RESEARCH",
|
|
74
74
|
/** Blog post briefs are being generated from the keyword research. */
|
|
@@ -501,10 +501,11 @@ declare function getContentPlanFlow(contentPlanFlowId: string): Promise<NonNulla
|
|
|
501
501
|
* A successful response means the flow was created, not that generation
|
|
502
502
|
* succeeded. Check `status` rather than relying on the response alone.
|
|
503
503
|
*
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
* `
|
|
504
|
+
* Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,
|
|
505
|
+
* use Get Site Keyword Research to check its matching research. After
|
|
506
|
+
* research `SUCCESS`, re-read the flow and call Create Content Plan once
|
|
507
|
+
* only if it still waits at `KEYWORD_RESEARCH` with the same research ID.
|
|
508
|
+
* Skip Create if the flow is already at `CONTENT_PLAN` or `SUCCESS`.
|
|
508
509
|
*
|
|
509
510
|
* A failed flow is retried automatically, and each retry creates a separate
|
|
510
511
|
* 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. 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;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A,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 reaches `KEYWORD_RESEARCH` when keyword research starts, not when it\n * finishes. Some flows advance automatically. For a flow still waiting here,\n * check its matching research with Get Site Keyword Research, then re-read the\n * flow before calling Create Content Plan once. Skip Create if the flow has\n * already advanced to `CONTENT_PLAN` or `SUCCESS`.\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 * `KEYWORD_RESEARCH` can mean research is running or the flow is waiting\n * for Create Content Plan. Get Site Keyword Research reports research's\n * own status. A flow already at `CONTENT_PLAN` or `SUCCESS` needs no\n * release call.\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. This does not prove research is ready.\n * Check the matching research with Get Site Keyword Research. After\n * research succeeds, re-read the flow before calling Create Content\n * Plan once if it still waits here.\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 * Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,\n * use Get Site Keyword Research to check its matching research. After\n * research `SUCCESS`, re-read the flow and call Create Content Plan once\n * only if it still waits at `KEYWORD_RESEARCH` with the same research ID.\n * Skip Create if the flow is already at `CONTENT_PLAN` or `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 * Some flows advance automatically. For a flow at `KEYWORD_RESEARCH`,\n * use Get Site Keyword Research to check its matching research. After\n * research `SUCCESS`, re-read the flow and call Create Content Plan once\n * only if it still waits at `KEYWORD_RESEARCH` with the same research ID.\n * Skip Create if the flow is already at `CONTENT_PLAN` or `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,SAAS;AAAA,QACT,UAAU;AAAA,MAC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AA,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"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ import '@wix/sdk-types';
|
|
|
8
8
|
* business category, and real search volume data. Generating one takes several
|
|
9
9
|
* minutes, so the flow runs asynchronously and reports its progress in `status`.
|
|
10
10
|
*
|
|
11
|
-
* A flow
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* A flow reaches `KEYWORD_RESEARCH` when keyword research starts, not when it
|
|
12
|
+
* finishes. Some flows advance automatically. For a flow still waiting here,
|
|
13
|
+
* check its matching research with Get Site Keyword Research, then re-read the
|
|
14
|
+
* flow before calling Create Content Plan once. Skip Create if the flow has
|
|
15
|
+
* already advanced to `CONTENT_PLAN` or `SUCCESS`.
|
|
16
16
|
*/
|
|
17
17
|
interface ContentPlanFlow {
|
|
18
18
|
/**
|
|
@@ -34,10 +34,10 @@ interface ContentPlanFlow {
|
|
|
34
34
|
/**
|
|
35
35
|
* Current status of the content plan flow.
|
|
36
36
|
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
37
|
+
* `KEYWORD_RESEARCH` can mean research is running or the flow is waiting
|
|
38
|
+
* for Create Content Plan. Get Site Keyword Research reports research's
|
|
39
|
+
* own status. A flow already at `CONTENT_PLAN` or `SUCCESS` needs no
|
|
40
|
+
* release call.
|
|
41
41
|
*/
|
|
42
42
|
status?: StatusWithLiterals;
|
|
43
43
|
/**
|
|
@@ -66,10 +66,10 @@ declare enum Status {
|
|
|
66
66
|
/** The site's existing content is being summarized. */
|
|
67
67
|
SITE_SUMMARY = "SITE_SUMMARY",
|
|
68
68
|
/**
|
|
69
|
-
* Keyword research has started
|
|
70
|
-
*
|
|
71
|
-
* succeeds
|
|
72
|
-
*
|
|
69
|
+
* Keyword research has started. This does not prove research is ready.
|
|
70
|
+
* Check the matching research with Get Site Keyword Research. After
|
|
71
|
+
* research succeeds, re-read the flow before calling Create Content
|
|
72
|
+
* Plan once if it still waits here.
|
|
73
73
|
*/
|
|
74
74
|
KEYWORD_RESEARCH = "KEYWORD_RESEARCH",
|
|
75
75
|
/** Blog post briefs are being generated from the keyword research. */
|