export interface Task { /** * Task ID. * @readonly */ id?: string | null; /** * Revision number, which increments by 1 each time the task is updated. To prevent conflicting changes, the existing `revision` must be used when updating a task. * @readonly */ revision?: string | null; /** Title of the task. */ title?: string | null; /** Description of the task. */ description?: string | null; /** * Date and time the task was created. * @readonly */ createdDate?: Date | null; /** * Date and time the task was last updated. * @readonly */ updatedDate?: Date | null; /** Due date for the task. */ dueDate?: Date | null; /** * Status of the task. * * Default: `ACTION_NEEDED` */ status?: TaskStatus; /** Details about the task source. */ source?: TaskSource; /** Information about the contact associated with the task. */ contact?: ContactInfo; } /** Possible statuses in which the task may be. */ export declare enum TaskStatus { /** Action needed. */ ACTION_NEEDED = "ACTION_NEEDED", /** Task completed. */ COMPLETED = "COMPLETED" } export interface TaskSource { /** * How the task was created. * @readonly */ sourceType?: SourceType; /** * App ID, if the task was created by an app. * @readonly */ appId?: string | null; /** * User ID, if the task was created by a Wix user. * @readonly */ userId?: string | null; } /** Possible sources that can create tasks. */ export declare enum SourceType { /** Task was created by an app. */ APP = "APP", /** Task was created by a Wix user. */ USER = "USER" } export interface ContactInfo { /** ID of the contact associated with the task. */ id?: string | null; /** * Contact's first name. * @readonly */ firstName?: string | null; /** * Contact's last name. * @readonly */ lastName?: string | null; /** * Contact's image URL. * @readonly */ imageUrl?: string | null; /** * Contact's primary email. * @readonly */ email?: string | null; /** * Contact's primary phone. * @readonly */ phone?: string | null; } export interface DeleteCompletedTasksRequest { /** Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used. */ taskIds?: string[]; /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */ filter?: Record | null; } export interface DeleteCompletedTasksResponse { } export interface SendTasksReminderRequest { /** Ids of the tasks to remind */ taskIds?: string[]; /** The reminder type */ reminderType?: ReminderType; } export declare enum ReminderType { UNKNOWN_REMINDER_TYPE = "UNKNOWN_REMINDER_TYPE", FIRST_REMINDER = "FIRST_REMINDER", LAST_REMINDER = "LAST_REMINDER" } export interface SendTasksReminderResponse { } export interface RepositionTask { /** The id of the last task that was re-positioned */ taskId?: string | null; /** The position of the last task that was re-positioned */ position?: string | null; } export interface TaskOverdue { /** The overdue task. */ task?: Task; } export interface TaskAssigned { /** The id of the assignee */ assigneeId?: string; /** The task that was assigned */ task?: Task; } export interface CreateTaskRequest { /** Task to create. */ task: Task; } export interface CreateTaskResponse { /** The created task. */ task?: Task; } export interface ContactNotFoundError { contactId?: string; } export interface GetTaskRequest { /** ID of the task to retrieve. */ taskId: string; } export interface GetTaskResponse { /** The retrieved task. */ task?: Task; } export interface UpdateTaskRequest { /** Task to update. */ task: Task; } export interface UpdateTaskResponse { /** The updated task. */ task?: Task; } export interface DeleteTaskRequest { /** ID of the task to delete. */ taskId: string; } export interface DeleteTaskResponse { } export interface QueryTasksRequest { /** Query options. */ query?: CursorQuery; } export 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 */ export 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; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { /** Sort by ascending order. */ ASC = "ASC", /** Sort by descending order. */ DESC = "DESC" } export interface CursorPaging { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryTasksResponse { /** The retrieved tasks. */ tasks?: Task[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface CountTasksRequest { /** * Filter which tasks to count. See supported filters ([REST](https://dev.wix.com/docs/rest/api-reference/crm/tasks/task-v2/filter-and-sort)| [SDK](https://dev.wix.com/docs/sdk/backend-modules/crm/tasks/query-tasks)). * * Filter tasks 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; } export interface CountTasksResponse { /** The number of tasks that match the specified filter. */ count?: number; } export interface QueryTasksInternalRequest { /** WQL expression */ query?: QueryV2; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** 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[]; /** 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[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** 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; } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface QueryTasksInternalResponse { /** The retrieved tasks. */ tasks?: Task[]; /** Details on the paged set of results returned. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface MoveTaskAfterRequest { /** ID of the task to move. */ taskId: string; /** * The ID of the task after which the moved task is positioned in the task display. * If `beforeTaskId` is not specified, the moved task is positioned first in the task display. */ beforeTaskId?: string | null; } export interface MoveTaskAfterResponse { } export interface TaskNotFoundError { /** The task id that was not found */ taskId?: string; } export interface Empty { } export 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 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 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 */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entityAsJson?: string; /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */ restoreInfo?: RestoreInfo; } export interface RestoreInfo { deletedDate?: Date | null; } export 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. */ currentEntityAsJson?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntityAsJson?: string | null; } export interface ActionEvent { bodyAsJson?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export 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 */ export 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; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } interface TaskSourceNonNullableFields { sourceType: SourceType; } interface TaskNonNullableFields { status: TaskStatus; source?: TaskSourceNonNullableFields; } export interface CreateTaskResponseNonNullableFields { task?: TaskNonNullableFields; } export interface GetTaskResponseNonNullableFields { task?: TaskNonNullableFields; } export interface UpdateTaskResponseNonNullableFields { task?: TaskNonNullableFields; } export interface QueryTasksResponseNonNullableFields { tasks: TaskNonNullableFields[]; } export interface CountTasksResponseNonNullableFields { count: number; } export {};