import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** * A step represents a piece of program content within a section. * A step can contain article, video, or quiz content. */ interface Step extends StepStepTypeOptionsOneOf { /** Video-specific settings. */ videoOptions?: VideoOptions; /** Quiz-specific settings. */ quizOptions?: QuizOptions; /** * Step ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step. * @readonly */ revision?: string | null; /** * Date and time the step was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the step was updated. * @readonly */ _updatedDate?: Date | null; /** * Parent section ID. To move a step within a section or to another section, call `MoveStep`. * @format GUID * @readonly */ sectionId?: string; /** Step title, rich text content, and optional media. */ description?: Description; /** Step position within the section. */ ordering?: number; /** Type of content in the step. */ stepType?: StepTypeWithLiterals; /** Custom field data for the step object. */ extendedFields?: ExtendedFields; /** * Program ID. * @format GUID * @readonly */ programId?: string; } /** @oneof */ interface StepStepTypeOptionsOneOf { /** Video-specific settings. */ videoOptions?: VideoOptions; /** Quiz-specific settings. */ quizOptions?: QuizOptions; } /** Video details for videos hosted in Wix Video. */ interface WixVideo { /** * Wix Video ID. * @format GUID */ _id?: string; /** Whether the Wix Video is paid content. */ paid?: boolean; } interface VideoResolution { /** Video URL. */ url?: string; /** Video height. */ height?: number; /** Video width. */ width?: number; /** Video format for example, mp4, hls. */ format?: string; } interface FocalPoint { /** X-coordinate of the focal point. */ x?: number; /** Y-coordinate of the focal point. */ y?: number; /** crop by height */ height?: number | null; /** crop by width */ width?: number | null; } interface Description extends DescriptionMediaOneOf { /** @maxLength 250 */ title?: string; /** @maxLength 1000000 */ details?: string | null; } /** @oneof */ interface DescriptionMediaOneOf { } declare enum StepType { /** Text-based step. */ ARTICLE = "ARTICLE", /** Step with video content. */ VIDEO = "VIDEO", /** Step linked to a quiz. */ QUIZ = "QUIZ" } /** @enumType */ type StepTypeWithLiterals = StepType | 'ARTICLE' | 'VIDEO' | 'QUIZ'; /** Additional settings for video steps. */ interface VideoOptions extends VideoOptionsVideoSourceOneOf { /** Video from Wix Video. */ wixVideo?: WixVideo; /** Video uploaded with Media Manager. */ video?: string; /** Percentage of the video that must be watched to complete the step. */ requiredCompletionPercentage?: number; /** Cover image for the video. */ coverImage?: string; /** Video duration in milliseconds. */ durationInMilliseconds?: number | null; /** Whether the uploaded video was deleted from Media Manager. */ deleted?: boolean; } /** @oneof */ interface VideoOptionsVideoSourceOneOf { /** Video from Wix Video. */ wixVideo?: WixVideo; /** Video uploaded with Media Manager. */ video?: string; } /** Additional settings for quiz steps. */ interface QuizOptions { /** * Quiz ID. Provide it when creating a quiz step. After creation, the quiz reference can't be changed. * @format GUID * @readonly * @immutable */ _id?: string; /** * Total number of questions in the quiz. * @readonly */ totalQuestions?: number; /** Minimum percentage required to pass the quiz. */ passingGrade?: number | null; } interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface UpdateDocumentsEvent extends UpdateDocumentsEventOperationOneOf { /** insert/update documents */ update?: DocumentUpdateOperation; /** delete by document ids */ deleteByIds?: DeleteByIdsOperation; /** delete documents matching filter */ deleteByFilter?: DeleteByFilterOperation; /** update documents matching filter */ updateByFilter?: UpdateByFilterOperation; /** update only existing documents */ updateExisting?: UpdateExistingOperation; /** * application which owns documents * @minLength 2 */ appDefId?: string | null; /** * type of the documents * @minLength 2 */ documentType?: string | null; /** * language of the documents * @minLength 2 */ language?: string | null; /** * site documents belong to * @minLength 2 */ msId?: string | null; } /** @oneof */ interface UpdateDocumentsEventOperationOneOf { /** insert/update documents */ update?: DocumentUpdateOperation; /** delete by document ids */ deleteByIds?: DeleteByIdsOperation; /** delete documents matching filter */ deleteByFilter?: DeleteByFilterOperation; /** update documents matching filter */ updateByFilter?: UpdateByFilterOperation; /** update only existing documents */ updateExisting?: UpdateExistingOperation; } interface DocumentUpdateOperation { /** documents to index or update */ documents?: IndexDocument[]; } interface IndexDocument { /** data bag with non-searchable fields (url, image) */ payload?: DocumentPayload; /** what type of users should documents be visible to */ exposure?: EnumWithLiterals; /** document with mandatory fields (id, title, description) and with fields specific to the type of the document */ document?: Record | null; /** what member groups is the document exposed to. Used only with GROUP_PROTECTED exposure */ permittedMemberGroups?: string[]; /** if true SEO is disabled for this document */ seoHidden?: boolean | null; /** if true the page is a lightbox popup */ isPopup?: boolean | null; } interface DocumentPayload { /** url of the page representing the document */ url?: string | null; /** image which represents the document */ documentImage?: DocumentImage; } interface DocumentImage { /** the name of the image */ name?: string; /** the width of the image */ width?: number; /** the height of the image */ height?: number; } declare enum Enum { /** Default value. Means that permission not set */ UNKNOWN = "UNKNOWN", /** Protected exposure. Exposed to members and owners */ PROTECTED = "PROTECTED", /** Private exposure. Exposed to owners */ PRIVATE = "PRIVATE", /** Public exposure. Visible to everyone */ PUBLIC = "PUBLIC", /** Used for partial updates, to state that exposure is not changing */ UNCHANGED = "UNCHANGED", /** Protected to members of permitted groups and owners */ GROUP_PROTECTED = "GROUP_PROTECTED" } /** @enumType */ type EnumWithLiterals = Enum | 'UNKNOWN' | 'PROTECTED' | 'PRIVATE' | 'PUBLIC' | 'UNCHANGED' | 'GROUP_PROTECTED'; interface DeleteByIdsOperation { /** ids of the documents to delete */ documentIds?: string[]; } interface DeleteByFilterOperation { /** documents matching this filter wil be deleted. only filterable documents defined in document_type can be used for filtering */ filter?: Record | null; } interface UpdateByFilterOperation { /** documents matching this filter will be updated */ filter?: Record | null; /** partial document to apply */ document?: IndexDocument; } interface UpdateExistingOperation { /** documents to update */ documents?: IndexDocument[]; } /** Payload for the step moved webhook. */ interface StepMoved { /** * Target section ID. * @format GUID */ sectionId?: string; /** * Moved step ID. * @format GUID */ stepId?: string; /** New step position. */ newPosition?: number; /** * Program ID. * @format GUID */ programId?: string; /** * Previous section ID. * @format GUID */ prevSectionId?: string; } interface CreateStepRequest { /** Step to create. */ step: Step; } /** Optional read-time fields. Unknown-only selections perform no classification. */ declare enum RequestedFields { } /** @enumType */ type RequestedFieldsWithLiterals = RequestedFields; interface CreateStepResponse { /** Created step. */ step?: Step; } interface BulkCreateStepsRequest { /** * Steps to create. * @minSize 1 * @maxSize 100 */ steps: Step[]; /** Whether to return created steps in the response. */ returnEntity?: boolean; } interface BulkCreateStepsResponse { /** Results for each processed step. */ results?: BulkStepResult[]; /** Metadata about the bulk action. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkStepResult { /** Metadata for the processed step. */ itemMetadata?: ItemMetadata; /** Processed step. Empty when `returnEntity` is `false`. */ item?: Step; /** Bulk action performed for the step. */ action?: BulkActionTypeWithLiterals; } interface ItemMetadata { /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } declare enum BulkActionType { UNKNOWN_ACTION_TYPE = "UNKNOWN_ACTION_TYPE", INSERT = "INSERT", UPDATE = "UPDATE", DELETE = "DELETE" } /** @enumType */ type BulkActionTypeWithLiterals = BulkActionType | 'UNKNOWN_ACTION_TYPE' | 'INSERT' | 'UPDATE' | 'DELETE'; interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } /** * NOT-PRECEDENT: AIP-7001 requests fields on all entity-returning methods. * This private/deprecated method intentionally does not offer preview classification. */ interface BulkCreateStepRequest { /** * Steps to create. * @minSize 1 * @maxSize 100 */ steps?: Step[]; /** Whether to return created steps in the response. */ returnEntity?: boolean; } interface BulkCreateStepResponse { /** Results for each processed step. */ results?: BulkStepResult[]; /** Metadata about the bulk action. */ bulkActionMetadata?: BulkActionMetadata; } /** * NOT-PRECEDENT: AIP-7001 requests fields on all entity-returning methods. * This private/deprecated method intentionally does not offer preview classification. */ interface BulkCreateStepMigrationRequest { /** * List of steps you want to create * @minSize 1 * @maxSize 100 */ steps?: Step[]; /** * Program in which steps are to be created. * @format GUID */ programId?: string; } interface BulkCreateStepMigrationResponse { /** Results of bulk action. */ results?: BulkStepResult[]; /** Metadata about whole bulk action. */ bulkActionMetadata?: BulkActionMetadata; } interface GetStepRequest { /** * Step ID. * @format GUID */ stepId: string; /** Predefined set of description fields to return. */ descriptionFieldSet?: DescriptionFieldSetWithLiterals; } declare enum DescriptionFieldSet { /** Returns the standard step description fields. */ STANDARD = "STANDARD", /** Returns additional step description fields when they're available to the caller. */ EXTENDED = "EXTENDED" } /** @enumType */ type DescriptionFieldSetWithLiterals = DescriptionFieldSet | 'STANDARD' | 'EXTENDED'; interface GetStepResponse { /** Retrieved step. */ step?: Step; } interface UpdateStepRequest { /** Step to update. May be partial. */ step: Step; } interface UpdateStepResponse { /** Updated step. */ step?: Step; } interface BulkUpdateStepsRequest { /** * Steps to update. A missing `step.id` is returned as a failed item result. * @minSize 1 * @maxSize 100 */ steps: MaskedStep[]; /** Whether to return updated steps in the response. */ returnEntity?: boolean; } interface MaskedStep { /** Step to update. May be partial. */ step?: Step; /** Explicit list of fields to update. */ fieldMask?: string[]; } interface BulkUpdateStepsResponse { /** * @minSize 1 * @maxSize 100 */ results?: BulkUpdateStepResult[]; /** Metadata about the bulk action. */ bulkActionMetadata?: CommonBulkActionMetadata; } interface CommonItemMetadata { /** * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). * @format GUID */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface BulkUpdateStepResult { /** Metadata for the processed step. */ itemMetadata?: CommonItemMetadata; /** Updated step. Returned only when `returnEntity` is `true`. */ item?: Step; } interface CommonBulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } interface DeleteStepRequest { /** * Step ID. * @format GUID */ stepId: string; } interface DeleteStepResponse { } interface QueryStepsRequest { /** Query object. */ query?: CursorQuery; /** Predefined set of description fields to return. */ descriptionFieldSet?: DescriptionFieldSetWithLiterals; /** * Program ID. * @maxLength 36 */ programId?: string; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; /** * Origin point for geo-distance sorting on a GEO field * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first). */ origin?: AddressLocation; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface AddressLocation { /** Address latitude. */ latitude?: number | null; /** Address longitude. */ longitude?: number | null; } interface CursorPaging { /** * Maximum number of items to return in the results. * @max 500 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryStepsResponse { /** Retrieved steps. */ steps?: Step[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } interface CursorPagingMetadata { /** Number of items returned in current page. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } /** * NOT-PRECEDENT: AIP-7001 requests fields on all entity-returning methods. * This private/deprecated method intentionally does not offer preview classification. */ interface QueryStepsWithoutPagingRequest { /** WQL expression. Cursor paging is not supported in this endpoint. */ query?: CursorQuery; /** Whenever to return description only with title or with details as well */ descriptionFieldSet?: DescriptionFieldSetWithLiterals; /** * Program id to query steps * @maxLength 36 */ programId?: string; } interface QueryStepsWithoutPagingResponse { /** List of Steps. */ steps?: Step[]; } interface ListStepOrderingMetadataRequest { /** * Program whose Steps are listed. Authorization is checked on every page. * @format GUID */ programId?: string; /** * Optional Section filter. No matches returns an empty page, including for a foreign Section. * @format GUID */ sectionId?: string | null; /** * Cursor paging. The default limit is 100; the maximum is 500. * Keep the Program and Section filters unchanged when following a cursor. */ paging?: CursorPaging; } interface ListStepOrderingMetadataResponse { /** * Raw Step positions, without content or enrichment. * @maxSize 500 */ steps?: StepOrderingMetadata[]; /** Cursors for traversing all matching Steps. */ pagingMetadata?: CursorPagingMetadata; } interface StepOrderingMetadata { /** * Step ID. * @format GUID */ stepId?: string; /** * Owning Program ID. * @format GUID */ programId?: string; /** * Containing Section ID. * @format GUID */ sectionId?: string; /** Raw ordering value within the Section. Equal values are ordered by Step ID. */ ordering?: number; /** Observed revision. It does not lock the Step or reserve the gap. */ revision?: string | null; } interface GetStepOrderingNeighborsRequest { /** * Program containing the requested gap. * @format GUID */ programId?: string; /** * Section containing the requested gap. Existence must be checked through Sections separately. * @format GUID */ sectionId?: string; /** Requested insertion gap. */ placement?: PlacementWithLiterals; /** * Required for AFTER_STEP and forbidden for FIRST/LAST. * @format GUID */ afterStepId?: string | null; } declare enum Placement { /** Before the first Step. */ FIRST = "FIRST", /** After the last Step. */ LAST = "LAST", /** After the anchor, including an equal-ranked successor when present. */ AFTER_STEP = "AFTER_STEP" } /** @enumType */ type PlacementWithLiterals = Placement | 'FIRST' | 'LAST' | 'AFTER_STEP'; interface GetStepOrderingNeighborsResponse { /** Anchor for AFTER_STEP, last Step for LAST, absent for FIRST or an empty container. */ leftNeighbor?: StepOrderingMetadata; /** * First Step for FIRST, immediate successor for AFTER_STEP, absent for LAST or at the end. * Both neighbors are absent for an empty container; this does not prove that the Section exists. */ rightNeighbor?: StepOrderingMetadata; } /** * NOT-PRECEDENT: AIP-7001 requests fields on all entity-returning methods. * This private/deprecated method intentionally does not offer preview classification. */ interface ListAllProgramStepsRequest { /** * program id of requested steps * @format GUID */ programId?: string; /** Whenever to return description only with title or with details as well */ descriptionFieldSet?: DescriptionFieldSetWithLiterals; } interface ListAllProgramStepsResponse { /** List of Steps. */ steps?: Step[]; } interface DeleteAllProgramStepsRequest { /** * Program id to delete steps from * @format GUID */ programId?: string; } interface DeleteAllProgramStepsResponse { /** Total count of steps in the program */ stepsTotal?: number; /** Count of successfully deleted steps */ successfulCount?: number; /** Count of steps that failed to be deleted */ failedCount?: number; } interface BulkCloneStepRequest { /** * id of program which was cloned * @format GUID */ prototypeProgramId?: string; /** * id of program which was cloned * @format GUID */ clonedProgramId?: string; /** mapping of original to cloned section ids */ prototypeIdToClonedId?: Record; } interface BulkCloneStepResponse { /** * ids of newly created steps * @format GUID * @maxSize 100 */ createdStepIds?: string[]; } interface MoveStepRequest { /** * Step ID. * @format GUID */ stepId: string; /** * Target section ID. * @format GUID */ sectionId: string; /** * Step ID after which to place the moved step. Leave empty to move the step to the beginning of the target section. * @format GUID */ afterStepId?: string | null; /** Current revision of the step. Pass it when available to protect against conflicting updates. */ revision?: string; } interface MoveStepResponse { /** Moved step. */ step?: Step; } interface CloneStepRequest { /** * Step ID. * @format GUID */ stepId: string; } interface CloneStepResponse { /** Created step. */ step?: Step; } /** * NOT-PRECEDENT: AIP-7001 requests fields on all entity-returning methods. * This private/deprecated method intentionally does not offer preview classification. */ interface RestoreStepFromTrashRequest { /** * step id to restore * @format GUID */ stepId?: string; } interface RestoreStepFromTrashResponse { /** restored step */ step?: Step; } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface Empty { } interface SearchIndexingNotification { /** new state of indexing for the site specified in ms_id */ indexState?: StateWithLiterals; /** type of the document the notification is targeted for. Applies to all types if not provided */ documentType?: string | null; /** languaInternalDocumentUpdateByFilterOperationge the notification is targeted for. Applies to all languages if not provided */ language?: string | null; /** * site for which notification is targeted * @minLength 2 */ msId?: string | null; } declare enum State { /** default state */ Unknown = "Unknown", /** metasite does not require site search indexing */ Off = "Off", /** metasite requires site search indexing */ On = "On" } /** @enumType */ type StateWithLiterals = State | 'Unknown' | 'Off' | 'On'; interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface StepCreatedEnvelope { entity: Step; metadata: EventMetadata; } /** * Triggered when a step is created. * @permissionScope Manage Online Programs * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionId ONLINE_PROGRAMS.STEP_READ * @webhook * @eventType wix.online_programs.v3.step_created * @slug created * @documentationMaturity preview */ declare function onStepCreated(handler: (event: StepCreatedEnvelope) => void | Promise): void; interface StepDeletedEnvelope { entity: Step; metadata: EventMetadata; } /** * Triggered when a step is deleted. * @permissionScope Manage Online Programs * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionId ONLINE_PROGRAMS.STEP_READ * @webhook * @eventType wix.online_programs.v3.step_deleted * @slug deleted * @documentationMaturity preview */ declare function onStepDeleted(handler: (event: StepDeletedEnvelope) => void | Promise): void; interface StepMovedEnvelope { data: StepMoved; metadata: EventMetadata; } /** * Triggered when a step is moved. * @permissionScope Manage Online Programs * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionId ONLINE_PROGRAMS.STEP_READ * @webhook * @eventType wix.online_programs.v3.step_moved * @slug moved * @documentationMaturity preview */ declare function onStepMoved(handler: (event: StepMovedEnvelope) => void | Promise): void; interface StepUpdatedEnvelope { entity: Step; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when a step is updated. * @permissionScope Manage Online Programs * @permissionScopeId SCOPE.CHALLENGES.MANAGE * @permissionId ONLINE_PROGRAMS.STEP_READ * @webhook * @eventType wix.online_programs.v3.step_updated * @slug updated * @documentationMaturity preview */ declare function onStepUpdated(handler: (event: StepUpdatedEnvelope) => void | Promise): void; /** * Creates a step. * * Specify the parent section in `step.sectionId`. * The service derives the parent program automatically. * To create a quiz step, create or clone the quiz separately, then specify its ID in `step.quizOptions.id`. * * To create multiple steps in a single API call, call [BulkCreateSteps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-create-steps). * @param step - Step to create. * @public * @documentationMaturity preview * @requiredField step * @requiredField step.sectionId * @permissionId ONLINE_PROGRAMS.STEP_CREATE * @applicableIdentity APP * @returns Created step. * @fqn wix.onlineprograms.steps.v3.StepsService.CreateStep */ declare function createStep(step: NonNullablePaths, options?: CreateStepOptions): Promise>; interface CreateStepOptions { } /** * Creates up to 100 steps in a single API call. * * Specify the parent section in each step's `sectionId`. * The service derives the parent program automatically. * To create quiz steps, create or clone the quizzes separately, then specify their IDs in each step's `quizOptions.id`. * * This is the preferred bulk-create method. * To create a single step, call [CreateStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/create-step). * @param steps - Steps to create. * @public * @documentationMaturity preview * @requiredField steps * @requiredField steps.sectionId * @permissionId ONLINE_PROGRAMS.STEP_CREATE * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.BulkCreateSteps */ declare function bulkCreateSteps(steps: NonNullablePaths[], options?: BulkCreateStepsOptions): Promise>; interface BulkCreateStepsOptions { /** Whether to return created steps in the response. */ returnEntity?: boolean; } /** * Retrieves a step. * * Use `descriptionFieldSet` to control how much description content to return. * Some returned fields depend on the caller's permissions. * @param stepId - Step ID. * @public * @documentationMaturity preview * @requiredField stepId * @permissionId ONLINE_PROGRAMS.STEP_READ * @applicableIdentity APP * @returns Retrieved step. * @fqn wix.onlineprograms.steps.v3.StepsService.GetStep */ declare function getStep(stepId: string, options?: GetStepOptions): Promise>; interface GetStepOptions { /** Predefined set of description fields to return. */ descriptionFieldSet?: DescriptionFieldSetWithLiterals; } /** * Updates a step. * * Each time the step is updated, `revision` increments by 1. The current `revision` must be passed when updating the step. This ensures you're working with the latest step and prevents unintended overwrites. * * Use this method to update step content and quiz settings. * To move a step within a section or to another section, call [MoveStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/move-step) instead of updating `step.sectionId`. * To attach a quiz to the step, create or clone the quiz separately, then specify its ID in `step.quizOptions.id`. * * To update multiple steps in a single API call, call [BulkUpdateSteps](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/bulk-update-steps). * @param _id - Step ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField step * @requiredField step.revision * @permissionId ONLINE_PROGRAMS.STEP_UPDATE * @applicableIdentity APP * @returns Updated step. * @fqn wix.onlineprograms.steps.v3.StepsService.UpdateStep */ declare function updateStep(_id: string, step: NonNullablePaths, options?: UpdateStepOptions): Promise>; interface UpdateStep { /** Video-specific settings. */ videoOptions?: VideoOptions; /** Quiz-specific settings. */ quizOptions?: QuizOptions; /** * Step ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the step is updated. To prevent conflicting changes, the current `revision` must be passed when updating the step. * @readonly */ revision?: string | null; /** * Date and time the step was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the step was updated. * @readonly */ _updatedDate?: Date | null; /** * Parent section ID. To move a step within a section or to another section, call `MoveStep`. * @format GUID * @readonly */ sectionId?: string; /** Step title, rich text content, and optional media. */ description?: Description; /** Step position within the section. */ ordering?: number; /** Type of content in the step. */ stepType?: StepTypeWithLiterals; /** Custom field data for the step object. */ extendedFields?: ExtendedFields; /** * Program ID. * @format GUID * @readonly */ programId?: string; } interface UpdateStepOptions { } /** * Updates up to 100 steps in a single API call. * * Each time a step is updated, `revision` increments by 1. The current `revision` must be passed when updating the step. This ensures you're working with the latest step and prevents unintended overwrites. * * Use this method for content updates across multiple steps. Each `steps.step.revision` must be the current revision. * A partial step may omit `sectionId` and `programId`; the service resolves those values from the existing step. * If a requested `steps.step.id` does not identify an existing step, its result is returned as a failed item. * To move a step within a section or to another section, call [MoveStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/move-step). * * To update a single step, call [UpdateStep](https://dev.wix.com/docs/api-reference/business-management/online-programs/steps/update-step). * @param steps - Steps to update. A missing `step.id` is returned as a failed item result. * @public * @documentationMaturity preview * @requiredField steps * @requiredField steps.step._id * @requiredField steps.step.revision * @permissionId ONLINE_PROGRAMS.STEP_UPDATE * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.BulkUpdateSteps */ declare function bulkUpdateSteps(steps: NonNullablePaths[], options?: BulkUpdateStepsOptions): Promise>; interface BulkUpdateStepsOptions { /** Whether to return updated steps in the response. */ returnEntity?: boolean; } /** * Deletes a step from active program content. * * The public API doesn't provide a restore flow for deleted steps. * * If the deleted step is the last step that references a quiz, the quiz is also deleted. * @param stepId - Step ID. * @public * @documentationMaturity preview * @requiredField stepId * @permissionId ONLINE_PROGRAMS.STEP_DELETE * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.DeleteStep */ declare function deleteStep(stepId: string): Promise; /** * Retrieves a list of steps, given the provided paging, filtering, and sorting. * * Query Steps runs with these defaults, which you can override: * * - `createdDate` is sorted in `DESC` order. * - `paging.offset` is `0`. * * For predictable response sizes, we recommend setting `paging.limit` up to `100`. * * If your app is already scoped to a specific program, pass `programId` in addition to the query filters. `programId` adds program context to the request and doesn't replace section-based filtering in `query`. * Supported sorting fields are `createdDate`, `id`, `programId`, and `ordering`. When sorting by `ordering`, also filter by `sectionId`. * Use `descriptionFieldSet` to control how much description content to return. * Some returned fields depend on the caller's permissions. * * To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection). * @public * @documentationMaturity preview * @permissionId ONLINE_PROGRAMS.STEP_READ * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.QuerySteps */ declare function querySteps(options?: QueryStepsOptions): StepsQueryBuilder; interface QueryStepsOptions { /** Predefined set of description fields to return. */ descriptionFieldSet?: DescriptionFieldSetWithLiterals | undefined; /** * Program ID. * @maxLength 36 */ programId?: string | undefined; } interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface StepsQueryResult extends QueryCursorResult { items: Step[]; query: StepsQueryBuilder; next: () => Promise; prev: () => Promise; } interface StepsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id' | 'sectionId' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ge: (propertyName: '_id' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ gt: (propertyName: '_id' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ le: (propertyName: '_id' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ lt: (propertyName: '_id' | 'programId', value: any) => StepsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id' | 'programId', value: string) => StepsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id' | 'sectionId' | 'programId', value: any) => StepsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id' | 'programId', value: boolean) => StepsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'ordering' | 'programId'>) => StepsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_id' | '_createdDate' | 'ordering' | 'programId'>) => StepsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => StepsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => StepsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * @hidden * @fqn wix.onlineprograms.steps.v3.StepsService.QuerySteps * @requiredField query */ declare function typedQuerySteps(query: StepQuery, options?: QueryStepsOptions): Promise>; interface StepQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: ['sectionId']; operators: ['$eq', '$in']; sort: 'NONE'; }, { fields: ['_createdDate']; operators: []; sort: 'BOTH'; }, { fields: ['ordering']; operators: []; sort: 'BOTH'; }, { fields: ['_id', 'programId']; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type StepQuery = { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: { /** Maximum number of items to return in the results. @max: 500 */ limit?: NonNullable['limit'] | null; /** Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. @maxLength: 16000 */ cursor?: NonNullable['cursor'] | null; }; /** Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; /** Origin point for geo-distance sorting on a GEO field results are ordered by distance from this point (ASC = nearest first, DESC = farthest first). */ origin?: NonNullable[number]['origin']; }[]; }; declare const utils: { query: _wix_sdk_types.QueryHelpers; }; /** * Moves a step within a section or to a different section. * * Each time the step is updated, `revision` increments by 1. Pass the current `revision` when possible to protect against conflicting updates. * * If `afterStepId` isn't specified, the step is moved to the beginning of the target section. * The step's ordering is recalculated automatically. * @param stepId - Step ID. * @param sectionId - Target section ID. * @public * @documentationMaturity preview * @requiredField sectionId * @requiredField stepId * @permissionId ONLINE_PROGRAMS.STEP_UPDATE * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.MoveStep */ declare function moveStep(stepId: string, sectionId: string, options?: MoveStepOptions): Promise>; interface MoveStepOptions { /** * Step ID after which to place the moved step. Leave empty to move the step to the beginning of the target section. * @format GUID */ afterStepId?: string | null; /** Current revision of the step. Pass it when available to protect against conflicting updates. */ revision?: string; } /** * Clones a step. * * The cloned step is added to the same section as the original step. * If the original step is linked to a quiz, the quiz is cloned and the cloned step references the new quiz. * @param stepId - Step ID. * @public * @documentationMaturity preview * @requiredField stepId * @permissionId ONLINE_PROGRAMS.STEP_CREATE * @applicableIdentity APP * @fqn wix.onlineprograms.steps.v3.StepsService.CloneStep */ declare function cloneStep(stepId: string, options?: CloneStepOptions): Promise>; interface CloneStepOptions { } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddressLocation, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, BulkActionType, type BulkActionTypeWithLiterals, type BulkCloneStepRequest, type BulkCloneStepResponse, type BulkCreateStepMigrationRequest, type BulkCreateStepMigrationResponse, type BulkCreateStepRequest, type BulkCreateStepResponse, type BulkCreateStepsOptions, type BulkCreateStepsRequest, type BulkCreateStepsResponse, type BulkStepResult, type BulkUpdateStepResult, type BulkUpdateStepsOptions, type BulkUpdateStepsRequest, type BulkUpdateStepsResponse, type CloneStepOptions, type CloneStepRequest, type CloneStepResponse, type CommonBulkActionMetadata, type CommonItemMetadata, type CommonQueryWithEntityContext, type CreateStepOptions, type CreateStepRequest, type CreateStepResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteAllProgramStepsRequest, type DeleteAllProgramStepsResponse, type DeleteByFilterOperation, type DeleteByIdsOperation, type DeleteStepRequest, type DeleteStepResponse, type Description, DescriptionFieldSet, type DescriptionFieldSetWithLiterals, type DescriptionMediaOneOf, type DocumentImage, type DocumentPayload, type DocumentUpdateOperation, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, Enum, type EnumWithLiterals, type EventMetadata, type ExtendedFields, type FocalPoint, type GetStepOptions, type GetStepOrderingNeighborsRequest, type GetStepOrderingNeighborsResponse, type GetStepRequest, type GetStepResponse, type IdentificationData, type IdentificationDataIdOneOf, type IndexDocument, type ItemMetadata, type ListAllProgramStepsRequest, type ListAllProgramStepsResponse, type ListStepOrderingMetadataRequest, type ListStepOrderingMetadataResponse, type MaskedStep, type MessageEnvelope, type MoveStepOptions, type MoveStepRequest, type MoveStepResponse, Placement, type PlacementWithLiterals, type QueryStepsOptions, type QueryStepsRequest, type QueryStepsResponse, type QueryStepsWithoutPagingRequest, type QueryStepsWithoutPagingResponse, type QuizOptions, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, type RestoreStepFromTrashRequest, type RestoreStepFromTrashResponse, type SearchIndexingNotification, SortOrder, type SortOrderWithLiterals, type Sorting, State, type StateWithLiterals, type Step, type StepCreatedEnvelope, type StepDeletedEnvelope, type StepMoved, type StepMovedEnvelope, type StepOrderingMetadata, type StepQuery, type StepQuerySpec, type StepStepTypeOptionsOneOf, StepType, type StepTypeWithLiterals, type StepUpdatedEnvelope, type StepsQueryBuilder, type StepsQueryResult, type UpdateByFilterOperation, type UpdateDocumentsEvent, type UpdateDocumentsEventOperationOneOf, type UpdateExistingOperation, type UpdateStep, type UpdateStepOptions, type UpdateStepRequest, type UpdateStepResponse, type VideoOptions, type VideoOptionsVideoSourceOneOf, type VideoResolution, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WixVideo, bulkCreateSteps, bulkUpdateSteps, cloneStep, createStep, deleteStep, getStep, moveStep, onStepCreated, onStepDeleted, onStepMoved, onStepUpdated, querySteps, typedQuerySteps, updateStep, utils };