interface Card { /** Card details. */ info?: CardInfo; } /** entity representing a card-info */ interface CardInfo { /** * Card ID. * @readonly */ _id?: string | null; /** Display name shown at the top of the card. */ name?: string | null; /** Card description. */ description?: string | null; /** Details about the contact attached to the card. */ primaryAttachment?: Attachment; /** Due date. */ dueDate?: Date | null; /** Name of the app or service that created the contact. */ source?: string | null; /** * @internal * @internal * @readonly * @deprecated */ createdAt?: Date | null; /** * @internal * @internal * @readonly * @deprecated */ updatedAt?: Date | null; /** * ID of the phase that currently holds the card. * @readonly */ phaseId?: string | null; /** * Date and time the card was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the card was updated. * @readonly */ _updatedDate?: Date | null; } interface Attachment { /** * Attachment ID. For internal use. * @readonly */ attachmentId?: string; /** * @internal * @internal * @deprecated */ value?: string; /** * @internal * @internal * @deprecated */ attachmentType?: AttachmentType; /** ID of the contact attached to the card. */ contactId?: string; } /** describes the supported types of attachments (currently only supports Contact which is the default type) */ declare enum AttachmentType { ContactType = "ContactType" } interface QueryCardsRequest { /** Query, sort, and paging options. */ query?: Query; } interface Query { /** * 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?: any; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface QueryCardsResponse { /** List of cards that matched the query criteria. */ cards?: Card[]; /** Metadata for the page of results. */ pagination?: PaginationResponse; } interface PaginationResponse { /** Number of items that were skipped in the current sort order. */ offset?: number; /** Total number of items that matched the filter. */ total?: number; /** Number of returned items. */ count?: number; } interface ListCardsRequest { /** ID of the workflow whose cards will be listed. */ workflowId: string; /** Filters for cards in the specified phase. */ phaseId?: string | null; /** * Number of items to return. * * Defaults to `50`. */ limit?: number | null; /** * Number of items to skip in the current sort order. * * Defaults to `0`. */ offset?: number | null; /** Filters for cards with the specified contact ID. */ attachmentValue?: string | null; /** * Filters for archived cards. * If set to `true`, * only archived cards are returned. * If set to `false`, * only cards that are not archived are returned. * * Defaults to `false`. */ fetchArchived?: boolean | null; /** * Supported fields: * `id`, `name`, `createdDate`, `updatedDate`, `phaseId` * * List of fields to sort by. * Formatted as `field:direction`, * where field is the field name * and direction is `asc` (ascending) or `desc` (descending). * * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`. */ sort?: string[]; } interface ListCardsResponse { /** List of cards. */ cards?: Card[]; /** Metadata for the page of results. */ pagination?: PaginationResponse; } interface GetCardRequest { /** ID of the card to retrieve. */ _id: string; } interface GetCardResponse { /** Requested card. */ card?: Card; } interface UpdateCardRequest { /** ID of the card to update. */ _id: string; /** Card details. */ cardInfo?: CardInfo; } interface UpdateCardResponse { } interface CreateCardRequest { /** ID of the workflow to create the card in. */ workflowId: string; /** ID of the phase to create the card in. */ phaseId: string; /** Card details. */ card?: CardInfo; /** * Card position, where the first card is `0`. * * If a card already occupies the specified position, * that card and any subsequent cards are shifted to the right by 1. * * Defaults to the last position. */ position?: number | null; } interface CreateCardResponse { /** ID of the newly created card. */ _id?: string | null; } interface DeleteCardRequest { /** ID of the card to delete. */ _id: string; } interface DeleteCardResponse { } interface MoveCardRequest { /** ID of the card to move. */ _id: string; /** ID of the phase to move the card to. */ newPhaseId?: string | null; /** Position of the card in the phase, where the first card is `0`. */ newPosition?: number | null; } interface MoveCardResponse { } interface RestoreCardRequest { /** ID of the card to restore. */ _id: string; /** ID of the phase to restore the card to. */ newPhaseId: string; /** * Position of the restored card in the phase, * where the first card is `0`. */ newPosition?: number | null; } interface RestoreCardResponse { } interface ArchiveCardRequest { /** ID of the card to archive. */ _id: string; } interface ArchiveCardResponse { } interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp. */ 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } 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 MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface AttachmentNonNullableFields { attachmentId: string; value: string; attachmentType: AttachmentType; contactId: string; } interface CardInfoNonNullableFields { primaryAttachment?: AttachmentNonNullableFields; } interface CardNonNullableFields { info?: CardInfoNonNullableFields; } interface PaginationResponseNonNullableFields { offset: number; limit: number; total: number; count: number; } interface ListCardsResponseNonNullableFields { cards: CardNonNullableFields[]; pagination?: PaginationResponseNonNullableFields; } interface GetCardResponseNonNullableFields { card?: CardNonNullableFields; } /** * Retrieves a list of a workflow's cards. * * * The `listCards()` function returns a Promise that resolves to a list of the specified workflow's cards. * * * Use the `options` parameter to specify which cards to retrieve and in which order to retrieve them. Must use either `phaseId` or `fetchOnlyArchived`. * * * Cards can be sorted based on their `"id"`, `"name"`, `"phaseId"`, `"createdDate"`, `"updatedDate"`, `"source"`, and `"position"`. * * * If no `limit` parameter is passed, the first 50 cards are returned. * * * Sort order defaults to by `"phaseId"` and then by `"position"` ascending. * * * This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param workflowId - ID of the workflow whose cards will be listed. * @public * @requiredField workflowId * @param options - Options to use when retrieving the list of cards. * @permissionId workflows.view */ declare function listCards(workflowId: string, options?: ListCardsOptions): Promise; interface ListCardsOptions { /** Filters for cards in the specified phase. */ phaseId?: string | null; /** * Number of items to return. * * Defaults to `50`. */ limit?: number | null; /** * Number of items to skip in the current sort order. * * Defaults to `0`. */ offset?: number | null; /** Filters for cards with the specified contact ID. */ attachmentValue?: string | null; /** * Filters for archived cards. * If set to `true`, * only archived cards are returned. * If set to `false`, * only cards that are not archived are returned. * * Defaults to `false`. */ fetchArchived?: boolean | null; /** * Supported fields: * `id`, `name`, `createdDate`, `updatedDate`, `phaseId` * * List of fields to sort by. * Formatted as `field:direction`, * where field is the field name * and direction is `asc` (ascending) or `desc` (descending). * * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`. */ sort?: string[]; } /** * Retrieves a workflow card by ID. * * * The `getCard()` function returns a Promise that resolves to the card with the specified ID. * * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param _id - ID of the card to retrieve. * @public * @requiredField _id * @permissionId workflows.view * @returns Requested card. */ declare function getCard(_id: string): Promise; /** * Updates an existing workflow card. * * * The `updateCard()` function returns a Promise that resolves when the card has been updated with the specified values. * * * `contactId` is not a required field, but if the parameter is not passed, the field will default to empty and the card will not be associated with any contact. * * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param _id - ID of the card to update. * @param cardInfo - Card details. * @public * @requiredField _id * @requiredField cardInfo * @param options - Options to use when updating a card. * @permissionId workflows.modify */ declare function updateCard(_id: string, cardInfo: CardInfo): Promise; /** * Creates a new workflow card. * * * The `createCard()` function returns a Promise that resolves to the created card's ID when the card is created in the specified workflow phase. * * Pass a value for the `position` parameter to specify the newly created card's position within the specified phase. Positions are zero-based, meaning the first position is `0`. * * When omitted, the newly created card is added to the specified phase as the top card within the phase. * * * This function requires you to specify the ID of a workflow and phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * * > **Note:** * > Each workflow is limited to 5,000 cards. * > If this limit is reached, `createCard()` throws an error. * > [Archive cards](#archivecard) when they're no longer needed * > to reduce card count and avoid hitting the limit. * @param card - Card details. * @public * @requiredField card * @requiredField identifiers * @requiredField identifiers.phaseId * @requiredField identifiers.workflowId * @param options - Options to use when creating a card. * @permissionId workflows.modify */ declare function createCard(identifiers: CreateCardIdentifiers, card: CardInfo, options?: CreateCardOptions): Promise; interface CreateCardIdentifiers { /** ID of the workflow to create the card in. */ workflowId: string; /** ID of the phase to create the card in. */ phaseId: string; } interface CreateCardOptions { /** * Card position, where the first card is `0`. * * If a card already occupies the specified position, * that card and any subsequent cards are shifted to the right by 1. * * Defaults to the last position. */ position?: number | null; } /** * Deletes a workflow card by ID. * * * The `deleteCard()` function returns a Promise when the specified card has been deleted. * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param _id - ID of the card to delete. * @public * @requiredField _id * @permissionId workflows.modify */ declare function deleteCard(_id: string): Promise; /** * Moves a card to a new position within a workflow. * * * The `moveCard()` function returns a Promise when the specified card has been moved to the new position. * * Use the `options` parameter to specify the phase and position within that phase to move the card to. Positions are zero-based, meaning the first position is `0`. * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param _id - ID of the card to move. * @public * @requiredField _id * @param options - Information about where to move the card. * @permissionId workflows.modify */ declare function moveCard(_id: string, options?: MoveCardOptions): Promise; interface MoveCardOptions { /** ID of the phase to move the card to. */ newPhaseId?: string | null; /** Position of the card in the phase, where the first card is `0`. */ newPosition?: number | null; } /** * Restores an archived workflow card. * * * The `restoreCard()` function returns a Promise that resolves when the archived card has been restored. * * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * * * > **Note:** * > Each workflow is limited to 5,000 cards. * > If this limit is reached, `createCard()` throws an error. * > [Archive cards](#archivecard) when they're no longer needed * > to reduce card count and avoid hitting the limit. * @param _id - ID of the card to restore. * @param newPhaseId - ID of the phase to restore the card to. * @public * @requiredField _id * @requiredField newPhaseId * @param options - Options to use when restoring a card. * @permissionId workflows.modify */ declare function restoreCard(_id: string, newPhaseId: string, options?: RestoreCardOptions): Promise; interface RestoreCardOptions { /** * Position of the restored card in the phase, * where the first card is `0`. */ newPosition?: number | null; } /** * Archives a workflow card. * * * The `archiveCard()` function returns a Promise that resolves when the card has been archived. * * * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids). * @param _id - ID of the card to archive. * @public * @requiredField _id * @permissionId workflows.modify */ declare function archiveCard(_id: string): Promise; export { type ActionEvent, type ArchiveCardRequest, type ArchiveCardResponse, type Attachment, AttachmentType, type Card, type CardInfo, type CardNonNullableFields, type CreateCardIdentifiers, type CreateCardOptions, type CreateCardRequest, type CreateCardResponse, type DeleteCardRequest, type DeleteCardResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCardRequest, type GetCardResponse, type GetCardResponseNonNullableFields, type IdentificationData, type IdentificationDataIdOneOf, type ListCardsOptions, type ListCardsRequest, type ListCardsResponse, type ListCardsResponseNonNullableFields, type MessageEnvelope, type MoveCardOptions, type MoveCardRequest, type MoveCardResponse, type PaginationResponse, type Paging, type Query, type QueryCardsRequest, type QueryCardsResponse, type RestoreCardOptions, type RestoreCardRequest, type RestoreCardResponse, SortOrder, type Sorting, type UpdateCardRequest, type UpdateCardResponse, WebhookIdentityType, archiveCard, createCard, deleteCard, getCard, listCards, moveCard, restoreCard, updateCard };