@wix/auto_sdk_crm_tasks 1.0.46 → 1.0.47

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.typings.ts","../../../src/crm-tasks-v2-task-tasks.universal.ts","../../../src/crm-tasks-v2-task-tasks.http.ts"],"sourcesContent":["export * from './src/crm-tasks-v2-task-tasks.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCrmTasksV2Task from './crm-tasks-v2-task-tasks.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Task {\n /**\n * Task ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 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.\n * @readonly\n */\n revision?: string | null;\n /**\n * Title of the task.\n * @minLength 1\n * @maxLength 250\n */\n title?: string | null;\n /**\n * Description of the task.\n * @minLength 1\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Date and time the task was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the task was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Due date for the task. */\n dueDate?: Date | null;\n /**\n * Status of the task.\n *\n * Default: `ACTION_NEEDED`\n */\n status?: TaskStatusWithLiterals;\n /** Details about the task source. */\n source?: TaskSource;\n /** Information about the contact associated with the task. */\n contact?: ContactInfo;\n}\n\n/** Possible statuses in which the task may be. */\nexport enum TaskStatus {\n /** Action needed. */\n ACTION_NEEDED = 'ACTION_NEEDED',\n /** Task completed. */\n COMPLETED = 'COMPLETED',\n}\n\n/** @enumType */\nexport type TaskStatusWithLiterals = TaskStatus | 'ACTION_NEEDED' | 'COMPLETED';\n\nexport interface TaskSource {\n /**\n * How the task was created.\n * @readonly\n */\n sourceType?: SourceTypeWithLiterals;\n /**\n * App ID, if the task was created by an app.\n * @format GUID\n * @readonly\n */\n appId?: string | null;\n /**\n * User ID, if the task was created by a Wix user.\n * @format GUID\n * @readonly\n */\n userId?: string | null;\n}\n\n/** Possible sources that can create tasks. */\nexport enum SourceType {\n /** Task was created by an app. */\n APP = 'APP',\n /** Task was created by a Wix user. */\n USER = 'USER',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals = SourceType | 'APP' | 'USER';\n\nexport interface ContactInfo {\n /**\n * ID of the contact associated with the task.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Contact's first name.\n * @readonly\n */\n firstName?: string | null;\n /**\n * Contact's last name.\n * @readonly\n */\n lastName?: string | null;\n /**\n * Contact's image URL.\n * @readonly\n */\n imageUrl?: string | null;\n /**\n * Contact's primary email.\n * @readonly\n */\n email?: string | null;\n /**\n * Contact's primary phone.\n * @readonly\n */\n phone?: string | null;\n /**\n * Image URL expiration date.\n * @readonly\n */\n imageUrlExpirationDate?: Date | null;\n}\n\nexport interface RepositionTask {\n /**\n * The id of the last task that was re-positioned\n * @format GUID\n */\n taskId?: string | null;\n /** The position of the last task that was re-positioned */\n position?: string | null;\n}\n\nexport interface TaskOverdue {\n /** The overdue task. */\n task?: Task;\n}\n\nexport interface TaskAssigned {\n /**\n * The id of the assignee\n * @format GUID\n */\n assigneeId?: string;\n /** The task that was assigned */\n task?: Task;\n}\n\nexport interface CreateTaskRequest {\n /** Task to create. */\n task: Task;\n}\n\nexport interface CreateTaskResponse {\n /** The created task. */\n task?: Task;\n}\n\nexport interface ContactNotFoundError {\n /** @format GUID */\n contactId?: string;\n}\n\nexport interface GetTaskRequest {\n /**\n * ID of the task to retrieve.\n * @format GUID\n */\n taskId: string;\n}\n\nexport interface GetTaskResponse {\n /** The retrieved task. */\n task?: Task;\n}\n\nexport interface UpdateTaskRequest {\n /** Task to update. */\n task: Task;\n}\n\nexport interface UpdateTaskResponse {\n /** The updated task. */\n task?: Task;\n}\n\nexport interface DeleteTaskRequest {\n /**\n * ID of the task to delete.\n * @format GUID\n */\n taskId: string;\n}\n\nexport interface DeleteTaskResponse {}\n\nexport interface QueryTasksRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Sort by ascending order. */\n ASC = 'ASC',\n /** Sort by descending order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null;\n}\n\nexport interface QueryTasksResponse {\n /** The retrieved tasks. */\n tasks?: Task[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null;\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null;\n}\n\nexport interface CountTasksRequest {\n /**\n * Filter which tasks to count. See [supported filters](https://dev.wix.com/docs/rest/api-reference/crm/tasks/task-v2/filter-and-sort).\n *\n * Filter tasks in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n */\n filter?: Record<string, any> | null;\n}\n\nexport interface CountTasksResponse {\n /** The number of tasks that match the specified filter. */\n count?: number;\n}\n\nexport interface QueryTasksInternalRequest {\n /** WQL expression */\n query?: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging;\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n /** 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. */\n fields?: string[];\n /** 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. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging;\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Paging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface QueryTasksInternalResponse {\n /** The retrieved tasks. */\n tasks?: Task[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\n}\n\nexport interface MoveTaskAfterRequest {\n /**\n * ID of the task to move.\n * @format GUID\n */\n taskId: string;\n /**\n * The ID of the task after which the moved task is positioned in the task display.\n * If `beforeTaskId` is not specified, the moved task is positioned first in the task display.\n * @format GUID\n */\n beforeTaskId?: string | null;\n}\n\nexport interface MoveTaskAfterResponse {}\n\nexport interface TaskNotFoundError {\n /**\n * The task id that was not found\n * @format GUID\n */\n taskId?: string;\n}\n\nexport interface Empty {}\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}\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 DeleteCompletedTasksRequest {\n /**\n * Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used.\n * @format GUID\n * @maxSize 1000\n */\n taskIds?: string[];\n /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */\n filter?: Record<string, any> | null;\n}\n\nexport interface DeleteCompletedTasksResponse {}\n\nexport interface SendTasksReminderRequest {\n /**\n * Ids of the tasks to remind\n * @format GUID\n * @maxSize 50\n */\n taskIds?: string[];\n /** The reminder type */\n reminderType?: ReminderTypeWithLiterals;\n}\n\nexport enum ReminderType {\n UNKNOWN_REMINDER_TYPE = 'UNKNOWN_REMINDER_TYPE',\n FIRST_REMINDER = 'FIRST_REMINDER',\n LAST_REMINDER = 'LAST_REMINDER',\n}\n\n/** @enumType */\nexport type ReminderTypeWithLiterals =\n | ReminderType\n | 'UNKNOWN_REMINDER_TYPE'\n | 'FIRST_REMINDER'\n | 'LAST_REMINDER';\n\nexport interface SendTasksReminderResponse {}\n\n/** @docsIgnore */\nexport type CreateTaskApplicationErrors = {\n code?: 'CONTACT_NOT_FOUND';\n description?: string;\n data?: ContactNotFoundError;\n};\n/** @docsIgnore */\nexport type UpdateTaskApplicationErrors = {\n code?: 'CONTACT_NOT_FOUND';\n description?: string;\n data?: ContactNotFoundError;\n};\n/** @docsIgnore */\nexport type CountTasksApplicationErrors = {\n code?: 'TOO_MANY_TO_COUNT';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type MoveTaskAfterApplicationErrors = {\n code?: 'TASK_NOT_FOUND';\n description?: string;\n data?: TaskNotFoundError;\n};\n\nexport interface BaseEventMetadata {\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}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\nexport interface TaskCreatedEnvelope {\n entity: Task;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_created\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug created\n */\nexport declare function onTaskCreated(\n handler: (event: TaskCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task is deleted.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_deleted\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug deleted\n */\nexport declare function onTaskDeleted(\n handler: (event: TaskDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskOverdueEnvelope {\n data: TaskOverdue;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task reaches its due date.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_task_overdue\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug task_overdue\n */\nexport declare function onTaskOverdue(\n handler: (event: TaskOverdueEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskUpdatedEnvelope {\n entity: Task;\n metadata: EventMetadata;\n /** @hidden */\n modifiedFields: Record<string, any>;\n}\n\n/**\n * Triggered when a task is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_updated\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug updated\n */\nexport declare function onTaskUpdated(\n handler: (event: TaskUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a new task.\n * @param task - Task to create.\n * @public\n * @requiredField task\n * @permissionId CRM_TASKS.TASK_CREATE\n * @applicableIdentity APP\n * @returns The created task.\n * @fqn wix.crm.tasks.v2.Tasks.CreateTask\n */\nexport async function createTask(task: Task): Promise<\n NonNullablePaths<Task, `status` | `source.sourceType`, 3> & {\n __applicationErrorsType?: CreateTaskApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ task: task });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.createTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { task: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['task']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a task by ID.\n * @param taskId - ID of the task to retrieve.\n * @public\n * @requiredField taskId\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @returns The retrieved task.\n * @fqn wix.crm.tasks.v2.Tasks.GetTask\n */\nexport async function getTask(\n taskId: string\n): Promise<NonNullablePaths<Task, `status` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taskId: taskId });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.getTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taskId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taskId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a task.\n *\n * Each time the task is updated, `revision` increments by 1.\n * The existing `revision` must be included when updating the task.\n * This ensures you're working with the latest task\n * and prevents unintended overwrites.\n * @param _id - Task ID.\n * @public\n * @requiredField _id\n * @requiredField task\n * @requiredField task.revision\n * @param task - Task to update.\n * @permissionId CRM_TASKS.TASK_UPDATE\n * @applicableIdentity APP\n * @returns The updated task.\n * @fqn wix.crm.tasks.v2.Tasks.UpdateTask\n */\nexport async function updateTask(\n _id: string,\n task: NonNullablePaths<UpdateTask, `revision`, 2>\n): Promise<\n NonNullablePaths<Task, `status` | `source.sourceType`, 3> & {\n __applicationErrorsType?: UpdateTaskApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n task: { ...task, id: _id },\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.updateTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { task: '$[1]' },\n explicitPathsToArguments: { 'task.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'task']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTask {\n /**\n * Task ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 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.\n * @readonly\n */\n revision?: string | null;\n /**\n * Title of the task.\n * @minLength 1\n * @maxLength 250\n */\n title?: string | null;\n /**\n * Description of the task.\n * @minLength 1\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Date and time the task was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the task was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Due date for the task. */\n dueDate?: Date | null;\n /**\n * Status of the task.\n *\n * Default: `ACTION_NEEDED`\n */\n status?: TaskStatusWithLiterals;\n /** Details about the task source. */\n source?: TaskSource;\n /** Information about the contact associated with the task. */\n contact?: ContactInfo;\n}\n\n/**\n * Deletes a task by ID.\n * @param taskId - ID of the task to delete.\n * @public\n * @requiredField taskId\n * @permissionId CRM_TASKS.TASK_DELETE\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.DeleteTask\n */\nexport async function deleteTask(taskId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taskId: taskId });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.deleteTask(payload);\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: { taskId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taskId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tasks.\n *\n * The `queryTasks()` method builds a query to retrieve a list of tasks and returns a `TasksQueryBuilder` object.\n *\n * The returned object contains the query definition which is typically used to run the query using the `find()` method. You can refine the query by chaining `TasksQueryBuilder` methods onto the query. `TasksQueryBuilder` methods enable you to sort, filter, and control the results that `queryTasks()` returns.\n *\n * `queryTasks()` runs with these `TasksQueryBuilder` defaults, which you can override:\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The methods that are chained to `queryTasks()` are applied in the order they are called. For example, if you apply `ascending('_createdDate')` and then `descending('_updatedDate')`, the results are sorted first by the created date and then, if there are multiple results with the same date, the items are sorted by the updated date.\n *\n * The following `TasksQueryBuilder` methods are supported for `queryTasks()`. For a full description of the `task` object, see the object returned for the `items` property in `TasksQueryResult`.\n * @public\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.QueryTasks\n */\nexport function queryTasks(): TasksQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Task, 'CURSOR', QueryTasksRequest, QueryTasksResponse>({\n func: async (payload: QueryTasksRequest) => {\n const reqOpts = ambassadorWixCrmTasksV2Task.queryTasks(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryTasksRequest['query']) => {\n const args = [query, {}] as [QueryTasksRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTasksResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.tasks,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TasksQueryResult extends QueryCursorResult {\n items: Task[];\n query: TasksQueryBuilder;\n next: () => Promise<TasksQueryResult>;\n prev: () => Promise<TasksQueryResult>;\n}\n\nexport interface TasksQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'dueDate'\n | 'status'\n | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'dueDate'\n | 'status'\n | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n in: (\n propertyName: '_id' | 'status' | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n exists: (propertyName: 'contact.id', value: boolean) => TasksQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>\n ) => TasksQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>\n ) => TasksQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => TasksQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => TasksQueryBuilder;\n find: () => Promise<TasksQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.crm.tasks.v2.Tasks.QueryTasks\n * @requiredField query\n */\nexport async function typedQueryTasks(\n query: TaskQuery\n): Promise<\n NonNullablePaths<\n QueryTasksResponse,\n `tasks` | `tasks.${number}.status` | `tasks.${number}.source.sourceType`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.queryTasks(payload);\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: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TaskQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Task, TaskQuerySpec>;\nexport type TaskQuery = {\n /** \n 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`. \n */\n cursorPaging?: {\n /** \n Number of items to load. \n @max: 1000 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n You can get the relevant cursor token\n from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n */\n sort?: {\n /** \n Name of the field to sort by. \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\n/**\n * Counts the number of tasks.\n *\n *\n * This method returns the count of all tasks regardless of their `status`.\n *\n * Optionally, you can specify a filter to count only tasks that meet certain criteria.\n * @public\n * @param options - Filtering options.\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.CountTasks\n */\nexport async function countTasks(options?: CountTasksOptions): Promise<\n NonNullablePaths<CountTasksResponse, `count`, 2> & {\n __applicationErrorsType?: CountTasksApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.countTasks(payload);\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: { filter: '$[0].filter' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CountTasksOptions {\n /**\n * Filter which tasks to count. See [supported filters](https://dev.wix.com/docs/rest/api-reference/crm/tasks/task-v2/filter-and-sort).\n *\n * Filter tasks in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n */\n filter?: Record<string, any> | null;\n}\n\n/**\n * Moves a task specified by ID to be placed after another task in the task display.\n *\n * You can reposition a task to be first in the display by omitting `beforeTaskId`.\n * @param taskId - ID of the task to move.\n * @public\n * @requiredField taskId\n * @param options - Options for moving the task.\n * @permissionId CRM_TASKS.TASK_UPDATE\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.MoveTaskAfter\n */\nexport async function moveTaskAfter(\n taskId: string,\n options?: MoveTaskAfterOptions\n): Promise<\n void & {\n __applicationErrorsType?: MoveTaskAfterApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taskId: taskId,\n beforeTaskId: options?.beforeTaskId,\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.moveTaskAfter(payload);\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 taskId: '$[0]',\n beforeTaskId: '$[1].beforeTaskId',\n },\n singleArgumentUnchanged: false,\n },\n ['taskId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface MoveTaskAfterOptions {\n /**\n * The ID of the task after which the moved task is positioned in the task display.\n * If `beforeTaskId` is not specified, the moved task is positioned first in the task display.\n * @format GUID\n */\n beforeTaskId?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCrmTasksV2TasksUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/crm/tasks/v2/tasks',\n destPath: '/v2/tasks',\n },\n ],\n _: [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_tasks';\n\n/** Creates a new task. */\nexport function createTask(payload: object): RequestOptionsFactory<any> {\n function __createTask({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.CreateTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTask;\n}\n\n/** Retrieves a task by ID. */\nexport function getTask(payload: object): RequestOptionsFactory<any> {\n function __getTask({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'GET' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.GetTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTask;\n}\n\n/**\n * Updates a task.\n *\n * Each time the task is updated, `revision` increments by 1.\n * The existing `revision` must be included when updating the task.\n * This ensures you're working with the latest task\n * and prevents unintended overwrites.\n */\nexport function updateTask(payload: object): RequestOptionsFactory<any> {\n function __updateTask({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.UpdateTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{task.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTask;\n}\n\n/** Deletes a task by ID. */\nexport function deleteTask(payload: object): RequestOptionsFactory<any> {\n function __deleteTask({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.DeleteTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTask;\n}\n\n/**\n * Creates a query to retrieve a list of tasks.\n *\n * The `queryTasks()` method builds a query to retrieve a list of tasks and returns a `TasksQueryBuilder` object.\n *\n * The returned object contains the query definition which is typically used to run the query using the `find()` method. You can refine the query by chaining `TasksQueryBuilder` methods onto the query. `TasksQueryBuilder` methods enable you to sort, filter, and control the results that `queryTasks()` returns.\n *\n * `queryTasks()` runs with these `TasksQueryBuilder` defaults, which you can override:\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The methods that are chained to `queryTasks()` are applied in the order they are called. For example, if you apply `ascending('_createdDate')` and then `descending('_updatedDate')`, the results are sorted first by the created date and then, if there are multiple results with the same date, the items are sorted by the updated date.\n *\n * The following `TasksQueryBuilder` methods are supported for `queryTasks()`. For a full description of the `task` object, see the object returned for the `items` property in `TasksQueryResult`.\n */\nexport function queryTasks(payload: object): RequestOptionsFactory<any> {\n function __queryTasks({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.QueryTasks',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'tasks.createdDate' },\n { path: 'tasks.updatedDate' },\n { path: 'tasks.dueDate' },\n { path: 'tasks.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTasks;\n}\n\n/**\n * Counts the number of tasks.\n *\n *\n * This method returns the count of all tasks regardless of their `status`.\n *\n * Optionally, you can specify a filter to count only tasks that meet certain criteria.\n */\nexport function countTasks(payload: object): RequestOptionsFactory<any> {\n function __countTasks({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.CountTasks',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/count',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __countTasks;\n}\n\n/**\n * Moves a task specified by ID to be placed after another task in the task display.\n *\n * You can reposition a task to be first in the display by omitting `beforeTaskId`.\n */\nexport function moveTaskAfter(payload: object): RequestOptionsFactory<any> {\n function __moveTaskAfter({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.MoveTaskAfter',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}/move-after',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __moveTaskAfter;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA,oBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sB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AAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,QAAQ;AAAA,UACR,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,UAAU,SAAS;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["countTasks","createTask","deleteTask","getTask","moveTaskAfter","queryTasks","updateTask","import_timestamp","import_rest_modules","payload","import_transform_paths","TaskStatus","SourceType","SortOrder","WebhookIdentityType","ReminderType","createTask","sdkTransformError","getTask","updateTask","deleteTask","queryTasks","countTasks","moveTaskAfter"]}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/crm-tasks-v2-task-tasks.universal.ts","../../../src/crm-tasks-v2-task-tasks.http.ts"],"sourcesContent":["export * from './src/crm-tasks-v2-task-tasks.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCrmTasksV2Task from './crm-tasks-v2-task-tasks.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Task {\n /**\n * Task ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 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.\n * @readonly\n */\n revision?: string | null;\n /**\n * Title of the task.\n * @minLength 1\n * @maxLength 250\n */\n title?: string | null;\n /**\n * Description of the task.\n * @minLength 1\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Date and time the task was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the task was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Due date for the task. */\n dueDate?: Date | null;\n /**\n * Status of the task.\n *\n * Default: `ACTION_NEEDED`\n */\n status?: TaskStatusWithLiterals;\n /** Details about the task source. */\n source?: TaskSource;\n /** Information about the contact associated with the task. */\n contact?: ContactInfo;\n}\n\n/** Possible statuses in which the task may be. */\nexport enum TaskStatus {\n /** Action needed. */\n ACTION_NEEDED = 'ACTION_NEEDED',\n /** Task completed. */\n COMPLETED = 'COMPLETED',\n}\n\n/** @enumType */\nexport type TaskStatusWithLiterals = TaskStatus | 'ACTION_NEEDED' | 'COMPLETED';\n\nexport interface TaskSource {\n /**\n * How the task was created.\n * @readonly\n */\n sourceType?: SourceTypeWithLiterals;\n /**\n * App ID, if the task was created by an app.\n * @format GUID\n * @readonly\n */\n appId?: string | null;\n /**\n * User ID, if the task was created by a Wix user.\n * @format GUID\n * @readonly\n */\n userId?: string | null;\n}\n\n/** Possible sources that can create tasks. */\nexport enum SourceType {\n /** Task was created by an app. */\n APP = 'APP',\n /** Task was created by a Wix user. */\n USER = 'USER',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals = SourceType | 'APP' | 'USER';\n\nexport interface ContactInfo {\n /**\n * ID of the contact associated with the task.\n * @format GUID\n */\n _id?: string | null;\n /**\n * Contact's first name.\n * @readonly\n */\n firstName?: string | null;\n /**\n * Contact's last name.\n * @readonly\n */\n lastName?: string | null;\n /**\n * Contact's image URL.\n * @readonly\n */\n imageUrl?: string | null;\n /**\n * Contact's primary email.\n * @readonly\n */\n email?: string | null;\n /**\n * Contact's primary phone.\n * @readonly\n */\n phone?: string | null;\n /**\n * Image URL expiration date.\n * @readonly\n */\n imageUrlExpirationDate?: Date | null;\n}\n\nexport interface DeleteCompletedTasksRequest {\n /**\n * Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used.\n * @format GUID\n * @maxSize 1000\n */\n taskIds?: string[];\n /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */\n filter?: Record<string, any> | null;\n}\n\nexport interface DeleteCompletedTasksResponse {}\n\nexport interface SendTasksReminderRequest {\n /**\n * Ids of the tasks to remind\n * @format GUID\n * @maxSize 50\n */\n taskIds?: string[];\n /** The reminder type */\n reminderType?: ReminderTypeWithLiterals;\n}\n\nexport enum ReminderType {\n UNKNOWN_REMINDER_TYPE = 'UNKNOWN_REMINDER_TYPE',\n FIRST_REMINDER = 'FIRST_REMINDER',\n LAST_REMINDER = 'LAST_REMINDER',\n}\n\n/** @enumType */\nexport type ReminderTypeWithLiterals =\n | ReminderType\n | 'UNKNOWN_REMINDER_TYPE'\n | 'FIRST_REMINDER'\n | 'LAST_REMINDER';\n\nexport interface SendTasksReminderResponse {}\n\nexport interface RepositionTask {\n /**\n * The id of the last task that was re-positioned\n * @format GUID\n */\n taskId?: string | null;\n /** The position of the last task that was re-positioned */\n position?: string | null;\n}\n\nexport interface TaskOverdue {\n /** The overdue task. */\n task?: Task;\n}\n\nexport interface TaskAssigned {\n /**\n * The id of the assignee\n * @format GUID\n */\n assigneeId?: string;\n /** The task that was assigned */\n task?: Task;\n}\n\nexport interface CreateTaskRequest {\n /** Task to create. */\n task: Task;\n}\n\nexport interface CreateTaskResponse {\n /** The created task. */\n task?: Task;\n}\n\nexport interface ContactNotFoundError {\n /** @format GUID */\n contactId?: string;\n}\n\nexport interface GetTaskRequest {\n /**\n * ID of the task to retrieve.\n * @format GUID\n */\n taskId: string;\n}\n\nexport interface GetTaskResponse {\n /** The retrieved task. */\n task?: Task;\n}\n\nexport interface UpdateTaskRequest {\n /** Task to update. */\n task: Task;\n}\n\nexport interface UpdateTaskResponse {\n /** The updated task. */\n task?: Task;\n}\n\nexport interface DeleteTaskRequest {\n /**\n * ID of the task to delete.\n * @format GUID\n */\n taskId: string;\n}\n\nexport interface DeleteTaskResponse {}\n\nexport interface QueryTasksRequest {\n /** Query options. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n /** Sort by ascending order. */\n ASC = 'ASC',\n /** Sort by descending order. */\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null;\n}\n\nexport interface QueryTasksResponse {\n /** The retrieved tasks. */\n tasks?: Task[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null;\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null;\n}\n\nexport interface CountTasksRequest {\n /**\n * Filter which tasks to count. See [supported filters](https://dev.wix.com/docs/rest/api-reference/crm/tasks/task-v2/filter-and-sort).\n *\n * Filter tasks in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n */\n filter?: Record<string, any> | null;\n}\n\nexport interface CountTasksResponse {\n /** The number of tasks that match the specified filter. */\n count?: number;\n}\n\nexport interface QueryTasksInternalRequest {\n /** WQL expression */\n query?: QueryV2;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging;\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n /** 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. */\n fields?: string[];\n /** 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. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and skip the number of items. */\n paging?: Paging;\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Paging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface QueryTasksInternalResponse {\n /** The retrieved tasks. */\n tasks?: Task[];\n /** Details on the paged set of results returned. */\n pagingMetadata?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\n}\n\nexport interface MoveTaskAfterRequest {\n /**\n * ID of the task to move.\n * @format GUID\n */\n taskId: string;\n /**\n * The ID of the task after which the moved task is positioned in the task display.\n * If `beforeTaskId` is not specified, the moved task is positioned first in the task display.\n * @format GUID\n */\n beforeTaskId?: string | null;\n}\n\nexport interface MoveTaskAfterResponse {}\n\nexport interface TaskNotFoundError {\n /**\n * The task id that was not found\n * @format GUID\n */\n taskId?: string;\n}\n\nexport interface Empty {}\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}\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/** @docsIgnore */\nexport type CreateTaskApplicationErrors = {\n code?: 'CONTACT_NOT_FOUND';\n description?: string;\n data?: ContactNotFoundError;\n};\n/** @docsIgnore */\nexport type UpdateTaskApplicationErrors = {\n code?: 'CONTACT_NOT_FOUND';\n description?: string;\n data?: ContactNotFoundError;\n};\n/** @docsIgnore */\nexport type CountTasksApplicationErrors = {\n code?: 'TOO_MANY_TO_COUNT';\n description?: string;\n data?: Record<string, any>;\n};\n/** @docsIgnore */\nexport type MoveTaskAfterApplicationErrors = {\n code?: 'TASK_NOT_FOUND';\n description?: string;\n data?: TaskNotFoundError;\n};\n\nexport interface BaseEventMetadata {\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}\n\nexport interface EventMetadata extends BaseEventMetadata {\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\nexport interface TaskCreatedEnvelope {\n entity: Task;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task is created.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_created\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug created\n */\nexport declare function onTaskCreated(\n handler: (event: TaskCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task is deleted.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_deleted\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug deleted\n */\nexport declare function onTaskDeleted(\n handler: (event: TaskDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskOverdueEnvelope {\n data: TaskOverdue;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a task reaches its due date.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_task_overdue\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug task_overdue\n */\nexport declare function onTaskOverdue(\n handler: (event: TaskOverdueEnvelope) => void | Promise<void>\n): void;\n\nexport interface TaskUpdatedEnvelope {\n entity: Task;\n metadata: EventMetadata;\n /** @hidden */\n modifiedFields: Record<string, any>;\n}\n\n/**\n * Triggered when a task is updated.\n * @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Read Tasks\n * @permissionScopeId SCOPE.DC-CRM.READ-TASKS\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Manage Tasks\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS\n * @permissionId CRM_TASKS.TASK_READ\n * @webhook\n * @eventType wix.crm.tasks.v2.task_updated\n * @serviceIdentifier wix.crm.tasks.v2.Tasks\n * @slug updated\n */\nexport declare function onTaskUpdated(\n handler: (event: TaskUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a new task.\n * @param task - Task to create.\n * @public\n * @requiredField task\n * @permissionId CRM_TASKS.TASK_CREATE\n * @applicableIdentity APP\n * @returns The created task.\n * @fqn wix.crm.tasks.v2.Tasks.CreateTask\n */\nexport async function createTask(task: Task): Promise<\n NonNullablePaths<Task, `status` | `source.sourceType`, 3> & {\n __applicationErrorsType?: CreateTaskApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ task: task });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.createTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { task: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['task']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a task by ID.\n * @param taskId - ID of the task to retrieve.\n * @public\n * @requiredField taskId\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @returns The retrieved task.\n * @fqn wix.crm.tasks.v2.Tasks.GetTask\n */\nexport async function getTask(\n taskId: string\n): Promise<NonNullablePaths<Task, `status` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taskId: taskId });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.getTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { taskId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taskId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a task.\n *\n * Each time the task is updated, `revision` increments by 1.\n * The existing `revision` must be included when updating the task.\n * This ensures you're working with the latest task\n * and prevents unintended overwrites.\n * @param _id - Task ID.\n * @public\n * @requiredField _id\n * @requiredField task\n * @requiredField task.revision\n * @param task - Task to update.\n * @permissionId CRM_TASKS.TASK_UPDATE\n * @applicableIdentity APP\n * @returns The updated task.\n * @fqn wix.crm.tasks.v2.Tasks.UpdateTask\n */\nexport async function updateTask(\n _id: string,\n task: NonNullablePaths<UpdateTask, `revision`, 2>\n): Promise<\n NonNullablePaths<Task, `status` | `source.sourceType`, 3> & {\n __applicationErrorsType?: UpdateTaskApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n task: { ...task, id: _id },\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.updateTask(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.task!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { task: '$[1]' },\n explicitPathsToArguments: { 'task.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'task']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateTask {\n /**\n * Task ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * 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.\n * @readonly\n */\n revision?: string | null;\n /**\n * Title of the task.\n * @minLength 1\n * @maxLength 250\n */\n title?: string | null;\n /**\n * Description of the task.\n * @minLength 1\n * @maxLength 500\n */\n description?: string | null;\n /**\n * Date and time the task was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the task was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Due date for the task. */\n dueDate?: Date | null;\n /**\n * Status of the task.\n *\n * Default: `ACTION_NEEDED`\n */\n status?: TaskStatusWithLiterals;\n /** Details about the task source. */\n source?: TaskSource;\n /** Information about the contact associated with the task. */\n contact?: ContactInfo;\n}\n\n/**\n * Deletes a task by ID.\n * @param taskId - ID of the task to delete.\n * @public\n * @requiredField taskId\n * @permissionId CRM_TASKS.TASK_DELETE\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.DeleteTask\n */\nexport async function deleteTask(taskId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ taskId: taskId });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.deleteTask(payload);\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: { taskId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['taskId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates a query to retrieve a list of tasks.\n *\n * The `queryTasks()` method builds a query to retrieve a list of tasks and returns a `TasksQueryBuilder` object.\n *\n * The returned object contains the query definition which is typically used to run the query using the `find()` method. You can refine the query by chaining `TasksQueryBuilder` methods onto the query. `TasksQueryBuilder` methods enable you to sort, filter, and control the results that `queryTasks()` returns.\n *\n * `queryTasks()` runs with these `TasksQueryBuilder` defaults, which you can override:\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The methods that are chained to `queryTasks()` are applied in the order they are called. For example, if you apply `ascending('_createdDate')` and then `descending('_updatedDate')`, the results are sorted first by the created date and then, if there are multiple results with the same date, the items are sorted by the updated date.\n *\n * The following `TasksQueryBuilder` methods are supported for `queryTasks()`. For a full description of the `task` object, see the object returned for the `items` property in `TasksQueryResult`.\n * @public\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.QueryTasks\n */\nexport function queryTasks(): TasksQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Task, 'CURSOR', QueryTasksRequest, QueryTasksResponse>({\n func: async (payload: QueryTasksRequest) => {\n const reqOpts = ambassadorWixCrmTasksV2Task.queryTasks(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryTasksRequest['query']) => {\n const args = [query, {}] as [QueryTasksRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryTasksResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.tasks,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface TasksQueryResult extends QueryCursorResult {\n items: Task[];\n query: TasksQueryBuilder;\n next: () => Promise<TasksQueryResult>;\n prev: () => Promise<TasksQueryResult>;\n}\n\nexport interface TasksQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'dueDate'\n | 'status'\n | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'dueDate'\n | 'status'\n | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate' | 'dueDate',\n value: any\n ) => TasksQueryBuilder;\n in: (\n propertyName: '_id' | 'status' | 'contact.id',\n value: any\n ) => TasksQueryBuilder;\n exists: (propertyName: 'contact.id', value: boolean) => TasksQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>\n ) => TasksQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>\n ) => TasksQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => TasksQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => TasksQueryBuilder;\n find: () => Promise<TasksQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.crm.tasks.v2.Tasks.QueryTasks\n * @requiredField query\n */\nexport async function typedQueryTasks(\n query: TaskQuery\n): Promise<\n NonNullablePaths<\n QueryTasksResponse,\n `tasks` | `tasks.${number}.status` | `tasks.${number}.source.sourceType`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ query: query });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.queryTasks(payload);\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: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface TaskQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Task, TaskQuerySpec>;\nexport type TaskQuery = {\n /** \n 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`. \n */\n cursorPaging?: {\n /** \n Number of items to load. \n @max: 1000 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n You can get the relevant cursor token\n from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n */\n sort?: {\n /** \n Name of the field to sort by. \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\n/**\n * Counts the number of tasks.\n *\n *\n * This method returns the count of all tasks regardless of their `status`.\n *\n * Optionally, you can specify a filter to count only tasks that meet certain criteria.\n * @public\n * @param options - Filtering options.\n * @permissionId CRM_TASKS.TASK_READ\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.CountTasks\n */\nexport async function countTasks(options?: CountTasksOptions): Promise<\n NonNullablePaths<CountTasksResponse, `count`, 2> & {\n __applicationErrorsType?: CountTasksApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.countTasks(payload);\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: { filter: '$[0].filter' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CountTasksOptions {\n /**\n * Filter which tasks to count. See [supported filters](https://dev.wix.com/docs/rest/api-reference/crm/tasks/task-v2/filter-and-sort).\n *\n * Filter tasks in the following format:\n *\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n *\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`.\n */\n filter?: Record<string, any> | null;\n}\n\n/**\n * Moves a task specified by ID to be placed after another task in the task display.\n *\n * You can reposition a task to be first in the display by omitting `beforeTaskId`.\n * @param taskId - ID of the task to move.\n * @public\n * @requiredField taskId\n * @param options - Options for moving the task.\n * @permissionId CRM_TASKS.TASK_UPDATE\n * @applicableIdentity APP\n * @fqn wix.crm.tasks.v2.Tasks.MoveTaskAfter\n */\nexport async function moveTaskAfter(\n taskId: string,\n options?: MoveTaskAfterOptions\n): Promise<\n void & {\n __applicationErrorsType?: MoveTaskAfterApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n taskId: taskId,\n beforeTaskId: options?.beforeTaskId,\n });\n\n const reqOpts = ambassadorWixCrmTasksV2Task.moveTaskAfter(payload);\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 taskId: '$[0]',\n beforeTaskId: '$[1].beforeTaskId',\n },\n singleArgumentUnchanged: false,\n },\n ['taskId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface MoveTaskAfterOptions {\n /**\n * The ID of the task after which the moved task is positioned in the task display.\n * If `beforeTaskId` is not specified, the moved task is positioned first in the task display.\n * @format GUID\n */\n beforeTaskId?: string | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCrmTasksV2TasksUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/crm/tasks/v2/tasks',\n destPath: '/v2/tasks',\n },\n ],\n _: [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/tasks-app',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_tasks';\n\n/** Creates a new task. */\nexport function createTask(payload: object): RequestOptionsFactory<any> {\n function __createTask({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.CreateTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createTask;\n}\n\n/** Retrieves a task by ID. */\nexport function getTask(payload: object): RequestOptionsFactory<any> {\n function __getTask({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'GET' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.GetTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getTask;\n}\n\n/**\n * Updates a task.\n *\n * Each time the task is updated, `revision` increments by 1.\n * The existing `revision` must be included when updating the task.\n * This ensures you're working with the latest task\n * and prevents unintended overwrites.\n */\nexport function updateTask(payload: object): RequestOptionsFactory<any> {\n function __updateTask({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.UpdateTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{task.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'task.createdDate' },\n { path: 'task.updatedDate' },\n { path: 'task.dueDate' },\n { path: 'task.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateTask;\n}\n\n/** Deletes a task by ID. */\nexport function deleteTask(payload: object): RequestOptionsFactory<any> {\n function __deleteTask({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.DeleteTask',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteTask;\n}\n\n/**\n * Creates a query to retrieve a list of tasks.\n *\n * The `queryTasks()` method builds a query to retrieve a list of tasks and returns a `TasksQueryBuilder` object.\n *\n * The returned object contains the query definition which is typically used to run the query using the `find()` method. You can refine the query by chaining `TasksQueryBuilder` methods onto the query. `TasksQueryBuilder` methods enable you to sort, filter, and control the results that `queryTasks()` returns.\n *\n * `queryTasks()` runs with these `TasksQueryBuilder` defaults, which you can override:\n * - `limit(50)`\n * - `descending('_createdDate')`\n *\n * The methods that are chained to `queryTasks()` are applied in the order they are called. For example, if you apply `ascending('_createdDate')` and then `descending('_updatedDate')`, the results are sorted first by the created date and then, if there are multiple results with the same date, the items are sorted by the updated date.\n *\n * The following `TasksQueryBuilder` methods are supported for `queryTasks()`. For a full description of the `task` object, see the object returned for the `items` property in `TasksQueryResult`.\n */\nexport function queryTasks(payload: object): RequestOptionsFactory<any> {\n function __queryTasks({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.QueryTasks',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'tasks.createdDate' },\n { path: 'tasks.updatedDate' },\n { path: 'tasks.dueDate' },\n { path: 'tasks.contact.imageUrlExpirationDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryTasks;\n}\n\n/**\n * Counts the number of tasks.\n *\n *\n * This method returns the count of all tasks regardless of their `status`.\n *\n * Optionally, you can specify a filter to count only tasks that meet certain criteria.\n */\nexport function countTasks(payload: object): RequestOptionsFactory<any> {\n function __countTasks({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.CountTasks',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/count',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __countTasks;\n}\n\n/**\n * Moves a task specified by ID to be placed after another task in the task display.\n *\n * You can reposition a task to be first in the display by omitting `beforeTaskId`.\n */\nexport function moveTaskAfter(payload: object): RequestOptionsFactory<any> {\n function __moveTaskAfter({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.tasks.v2.task',\n method: 'POST' as any,\n methodFqn: 'wix.crm.tasks.v2.Tasks.MoveTaskAfter',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixCrmTasksV2TasksUrl({\n protoPath: '/v2/tasks/{taskId}/move-after',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __moveTaskAfter;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA,oBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IAC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AAS;AAAA,EACzB,CAAC;AAED,QAAM,UAAsC,cAAc,OAAO;AAEjE,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,uBAAAN;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,QAAQ;AAAA,UACR,cAAc;AAAA,QAChB;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,UAAU,SAAS;AAAA,IACtB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["countTasks","createTask","deleteTask","getTask","moveTaskAfter","queryTasks","updateTask","import_timestamp","import_rest_modules","payload","import_transform_paths","TaskStatus","SourceType","ReminderType","SortOrder","WebhookIdentityType","createTask","sdkTransformError","getTask","updateTask","deleteTask","queryTasks","countTasks","moveTaskAfter"]}
@@ -122,6 +122,37 @@ interface ContactInfo {
122
122
  */
123
123
  imageUrlExpirationDate?: Date | null;
124
124
  }
125
+ interface DeleteCompletedTasksRequest {
126
+ /**
127
+ * Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used.
128
+ * @format GUID
129
+ * @maxSize 1000
130
+ */
131
+ taskIds?: string[];
132
+ /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */
133
+ filter?: Record<string, any> | null;
134
+ }
135
+ interface DeleteCompletedTasksResponse {
136
+ }
137
+ interface SendTasksReminderRequest {
138
+ /**
139
+ * Ids of the tasks to remind
140
+ * @format GUID
141
+ * @maxSize 50
142
+ */
143
+ taskIds?: string[];
144
+ /** The reminder type */
145
+ reminderType?: ReminderTypeWithLiterals;
146
+ }
147
+ declare enum ReminderType {
148
+ UNKNOWN_REMINDER_TYPE = "UNKNOWN_REMINDER_TYPE",
149
+ FIRST_REMINDER = "FIRST_REMINDER",
150
+ LAST_REMINDER = "LAST_REMINDER"
151
+ }
152
+ /** @enumType */
153
+ type ReminderTypeWithLiterals = ReminderType | 'UNKNOWN_REMINDER_TYPE' | 'FIRST_REMINDER' | 'LAST_REMINDER';
154
+ interface SendTasksReminderResponse {
155
+ }
125
156
  interface RepositionTask {
126
157
  /**
127
158
  * The id of the last task that was re-positioned
@@ -505,37 +536,6 @@ declare enum WebhookIdentityType {
505
536
  }
506
537
  /** @enumType */
507
538
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
508
- interface DeleteCompletedTasksRequest {
509
- /**
510
- * Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used.
511
- * @format GUID
512
- * @maxSize 1000
513
- */
514
- taskIds?: string[];
515
- /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */
516
- filter?: Record<string, any> | null;
517
- }
518
- interface DeleteCompletedTasksResponse {
519
- }
520
- interface SendTasksReminderRequest {
521
- /**
522
- * Ids of the tasks to remind
523
- * @format GUID
524
- * @maxSize 50
525
- */
526
- taskIds?: string[];
527
- /** The reminder type */
528
- reminderType?: ReminderTypeWithLiterals;
529
- }
530
- declare enum ReminderType {
531
- UNKNOWN_REMINDER_TYPE = "UNKNOWN_REMINDER_TYPE",
532
- FIRST_REMINDER = "FIRST_REMINDER",
533
- LAST_REMINDER = "LAST_REMINDER"
534
- }
535
- /** @enumType */
536
- type ReminderTypeWithLiterals = ReminderType | 'UNKNOWN_REMINDER_TYPE' | 'FIRST_REMINDER' | 'LAST_REMINDER';
537
- interface SendTasksReminderResponse {
538
- }
539
539
  /** @docsIgnore */
540
540
  type CreateTaskApplicationErrors = {
541
541
  code?: 'CONTACT_NOT_FOUND';
@@ -301,6 +301,12 @@ var SourceType = /* @__PURE__ */ ((SourceType2) => {
301
301
  SourceType2["USER"] = "USER";
302
302
  return SourceType2;
303
303
  })(SourceType || {});
304
+ var ReminderType = /* @__PURE__ */ ((ReminderType2) => {
305
+ ReminderType2["UNKNOWN_REMINDER_TYPE"] = "UNKNOWN_REMINDER_TYPE";
306
+ ReminderType2["FIRST_REMINDER"] = "FIRST_REMINDER";
307
+ ReminderType2["LAST_REMINDER"] = "LAST_REMINDER";
308
+ return ReminderType2;
309
+ })(ReminderType || {});
304
310
  var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
305
311
  SortOrder2["ASC"] = "ASC";
306
312
  SortOrder2["DESC"] = "DESC";
@@ -314,12 +320,6 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
314
320
  WebhookIdentityType2["APP"] = "APP";
315
321
  return WebhookIdentityType2;
316
322
  })(WebhookIdentityType || {});
317
- var ReminderType = /* @__PURE__ */ ((ReminderType2) => {
318
- ReminderType2["UNKNOWN_REMINDER_TYPE"] = "UNKNOWN_REMINDER_TYPE";
319
- ReminderType2["FIRST_REMINDER"] = "FIRST_REMINDER";
320
- ReminderType2["LAST_REMINDER"] = "LAST_REMINDER";
321
- return ReminderType2;
322
- })(ReminderType || {});
323
323
 
324
324
  // src/crm-tasks-v2-task-tasks.meta.ts
325
325
  function createTask2() {