@wix/crm 1.0.80 → 1.0.82

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.
Files changed (194) hide show
  1. package/build/cjs/context.d.ts +5 -0
  2. package/build/cjs/context.js +32 -0
  3. package/build/cjs/context.js.map +1 -0
  4. package/build/cjs/index.d.ts +1 -0
  5. package/build/cjs/index.js +7 -2
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/index.typings.d.ts +1 -0
  8. package/build/cjs/index.typings.js +7 -2
  9. package/build/cjs/index.typings.js.map +1 -1
  10. package/build/cjs/meta.d.ts +1 -0
  11. package/build/cjs/meta.js +7 -2
  12. package/build/cjs/meta.js.map +1 -1
  13. package/build/cjs/src/contacts-v4-contact.context.d.ts +9 -0
  14. package/build/cjs/src/contacts-v4-contact.context.js +82 -0
  15. package/build/cjs/src/contacts-v4-contact.context.js.map +1 -0
  16. package/build/cjs/src/contacts-v4-contact.http.d.ts +20 -94
  17. package/build/cjs/src/contacts-v4-contact.http.js +211 -249
  18. package/build/cjs/src/contacts-v4-contact.http.js.map +1 -1
  19. package/build/cjs/src/contacts-v4-contact.meta.d.ts +1 -1
  20. package/build/cjs/src/contacts-v4-contact.meta.js +5 -1
  21. package/build/cjs/src/contacts-v4-contact.meta.js.map +1 -1
  22. package/build/cjs/src/contacts-v4-contact.public.d.ts +7 -6
  23. package/build/cjs/src/contacts-v4-contact.public.js +10 -2
  24. package/build/cjs/src/contacts-v4-contact.public.js.map +1 -1
  25. package/build/cjs/src/contacts-v4-contact.types.d.ts +265 -5
  26. package/build/cjs/src/contacts-v4-contact.types.js +40 -19
  27. package/build/cjs/src/contacts-v4-contact.types.js.map +1 -1
  28. package/build/cjs/src/contacts-v4-contact.universal.d.ts +234 -155
  29. package/build/cjs/src/contacts-v4-contact.universal.js +145 -168
  30. package/build/cjs/src/contacts-v4-contact.universal.js.map +1 -1
  31. package/build/cjs/src/contacts-v4-extended-field.context.d.ts +7 -0
  32. package/build/cjs/src/contacts-v4-extended-field.context.js +60 -0
  33. package/build/cjs/src/contacts-v4-extended-field.context.js.map +1 -0
  34. package/build/cjs/src/contacts-v4-extended-field.http.d.ts +7 -14
  35. package/build/cjs/src/contacts-v4-extended-field.http.js +60 -70
  36. package/build/cjs/src/contacts-v4-extended-field.http.js.map +1 -1
  37. package/build/cjs/src/contacts-v4-extended-field.meta.d.ts +1 -1
  38. package/build/cjs/src/contacts-v4-extended-field.meta.js +5 -1
  39. package/build/cjs/src/contacts-v4-extended-field.meta.js.map +1 -1
  40. package/build/cjs/src/contacts-v4-extended-field.public.d.ts +2 -1
  41. package/build/cjs/src/contacts-v4-extended-field.public.js +5 -1
  42. package/build/cjs/src/contacts-v4-extended-field.public.js.map +1 -1
  43. package/build/cjs/src/contacts-v4-extended-field.types.d.ts +68 -1
  44. package/build/cjs/src/contacts-v4-extended-field.types.js +3 -3
  45. package/build/cjs/src/contacts-v4-extended-field.types.js.map +1 -1
  46. package/build/cjs/src/contacts-v4-extended-field.universal.d.ts +116 -30
  47. package/build/cjs/src/contacts-v4-extended-field.universal.js +62 -51
  48. package/build/cjs/src/contacts-v4-extended-field.universal.js.map +1 -1
  49. package/build/cjs/src/contacts-v4-label.context.d.ts +7 -0
  50. package/build/cjs/src/contacts-v4-label.context.js +60 -0
  51. package/build/cjs/src/contacts-v4-label.context.js.map +1 -0
  52. package/build/cjs/src/contacts-v4-label.http.d.ts +13 -14
  53. package/build/cjs/src/contacts-v4-label.http.js +66 -72
  54. package/build/cjs/src/contacts-v4-label.http.js.map +1 -1
  55. package/build/cjs/src/contacts-v4-label.meta.d.ts +1 -1
  56. package/build/cjs/src/contacts-v4-label.meta.js +5 -1
  57. package/build/cjs/src/contacts-v4-label.meta.js.map +1 -1
  58. package/build/cjs/src/contacts-v4-label.public.d.ts +6 -5
  59. package/build/cjs/src/contacts-v4-label.public.js +5 -1
  60. package/build/cjs/src/contacts-v4-label.public.js.map +1 -1
  61. package/build/cjs/src/contacts-v4-label.types.d.ts +76 -9
  62. package/build/cjs/src/contacts-v4-label.types.js +2 -2
  63. package/build/cjs/src/contacts-v4-label.types.js.map +1 -1
  64. package/build/cjs/src/contacts-v4-label.universal.d.ts +125 -40
  65. package/build/cjs/src/contacts-v4-label.universal.js +76 -62
  66. package/build/cjs/src/contacts-v4-label.universal.js.map +1 -1
  67. package/build/cjs/src/contacts-v4-submit-contact.context.d.ts +3 -0
  68. package/build/cjs/src/contacts-v4-submit-contact.context.js +16 -0
  69. package/build/cjs/src/contacts-v4-submit-contact.context.js.map +1 -0
  70. package/build/cjs/src/contacts-v4-submit-contact.http.js +20 -34
  71. package/build/cjs/src/contacts-v4-submit-contact.http.js.map +1 -1
  72. package/build/cjs/src/contacts-v4-submit-contact.meta.d.ts +1 -1
  73. package/build/cjs/src/contacts-v4-submit-contact.meta.js +5 -1
  74. package/build/cjs/src/contacts-v4-submit-contact.meta.js.map +1 -1
  75. package/build/cjs/src/contacts-v4-submit-contact.public.d.ts +2 -2
  76. package/build/cjs/src/contacts-v4-submit-contact.types.d.ts +8 -3
  77. package/build/cjs/src/contacts-v4-submit-contact.types.js +9 -9
  78. package/build/cjs/src/contacts-v4-submit-contact.types.js.map +1 -1
  79. package/build/cjs/src/contacts-v4-submit-contact.universal.d.ts +8 -9
  80. package/build/cjs/src/contacts-v4-submit-contact.universal.js +25 -28
  81. package/build/cjs/src/contacts-v4-submit-contact.universal.js.map +1 -1
  82. package/build/cjs/src/crm-tasks-v2-task.context.d.ts +9 -0
  83. package/build/cjs/src/crm-tasks-v2-task.context.js +82 -0
  84. package/build/cjs/src/crm-tasks-v2-task.context.js.map +1 -0
  85. package/build/cjs/src/crm-tasks-v2-task.http.d.ts +60 -0
  86. package/build/cjs/src/crm-tasks-v2-task.http.js +268 -0
  87. package/build/cjs/src/crm-tasks-v2-task.http.js.map +1 -0
  88. package/build/cjs/src/crm-tasks-v2-task.meta.d.ts +27 -0
  89. package/build/cjs/src/crm-tasks-v2-task.meta.js +161 -0
  90. package/build/cjs/src/crm-tasks-v2-task.meta.js.map +1 -0
  91. package/build/cjs/src/crm-tasks-v2-task.public.d.ts +30 -0
  92. package/build/cjs/src/crm-tasks-v2-task.public.js +58 -0
  93. package/build/cjs/src/crm-tasks-v2-task.public.js.map +1 -0
  94. package/build/cjs/src/crm-tasks-v2-task.types.d.ts +430 -0
  95. package/build/cjs/src/crm-tasks-v2-task.types.js +29 -0
  96. package/build/cjs/src/crm-tasks-v2-task.types.js.map +1 -0
  97. package/build/cjs/src/crm-tasks-v2-task.universal.d.ts +678 -0
  98. package/build/cjs/src/crm-tasks-v2-task.universal.js +520 -0
  99. package/build/cjs/src/crm-tasks-v2-task.universal.js.map +1 -0
  100. package/build/cjs/src/ping-notifications-v3-notification.public.d.ts +1 -1
  101. package/build/cjs/src/ping-notifications-v3-notification.types.js +1 -1
  102. package/build/cjs/src/ping-notifications-v3-notification.types.js.map +1 -1
  103. package/build/cjs/src/ping-notifications-v3-notification.universal.js +6 -2
  104. package/build/cjs/src/ping-notifications-v3-notification.universal.js.map +1 -1
  105. package/build/es/context.d.ts +5 -0
  106. package/build/es/context.js +6 -0
  107. package/build/es/context.js.map +1 -0
  108. package/build/es/index.d.ts +1 -0
  109. package/build/es/index.js +1 -0
  110. package/build/es/index.js.map +1 -1
  111. package/build/es/index.typings.d.ts +1 -0
  112. package/build/es/index.typings.js +1 -0
  113. package/build/es/index.typings.js.map +1 -1
  114. package/build/es/meta.d.ts +1 -0
  115. package/build/es/meta.js +1 -0
  116. package/build/es/meta.js.map +1 -1
  117. package/build/es/src/contacts-v4-contact.context.d.ts +9 -0
  118. package/build/es/src/contacts-v4-contact.context.js +72 -0
  119. package/build/es/src/contacts-v4-contact.context.js.map +1 -0
  120. package/build/es/src/contacts-v4-contact.http.d.ts +20 -94
  121. package/build/es/src/contacts-v4-contact.http.js +211 -249
  122. package/build/es/src/contacts-v4-contact.http.js.map +1 -1
  123. package/build/es/src/contacts-v4-contact.meta.d.ts +1 -1
  124. package/build/es/src/contacts-v4-contact.public.d.ts +7 -6
  125. package/build/es/src/contacts-v4-contact.public.js +3 -2
  126. package/build/es/src/contacts-v4-contact.public.js.map +1 -1
  127. package/build/es/src/contacts-v4-contact.types.d.ts +265 -5
  128. package/build/es/src/contacts-v4-contact.types.js +21 -0
  129. package/build/es/src/contacts-v4-contact.types.js.map +1 -1
  130. package/build/es/src/contacts-v4-contact.universal.d.ts +234 -155
  131. package/build/es/src/contacts-v4-contact.universal.js +122 -149
  132. package/build/es/src/contacts-v4-contact.universal.js.map +1 -1
  133. package/build/es/src/contacts-v4-extended-field.context.d.ts +7 -0
  134. package/build/es/src/contacts-v4-extended-field.context.js +52 -0
  135. package/build/es/src/contacts-v4-extended-field.context.js.map +1 -0
  136. package/build/es/src/contacts-v4-extended-field.http.d.ts +7 -14
  137. package/build/es/src/contacts-v4-extended-field.http.js +60 -70
  138. package/build/es/src/contacts-v4-extended-field.http.js.map +1 -1
  139. package/build/es/src/contacts-v4-extended-field.meta.d.ts +1 -1
  140. package/build/es/src/contacts-v4-extended-field.public.d.ts +2 -1
  141. package/build/es/src/contacts-v4-extended-field.public.js +1 -0
  142. package/build/es/src/contacts-v4-extended-field.public.js.map +1 -1
  143. package/build/es/src/contacts-v4-extended-field.types.d.ts +68 -1
  144. package/build/es/src/contacts-v4-extended-field.universal.d.ts +116 -30
  145. package/build/es/src/contacts-v4-extended-field.universal.js +53 -46
  146. package/build/es/src/contacts-v4-extended-field.universal.js.map +1 -1
  147. package/build/es/src/contacts-v4-label.context.d.ts +7 -0
  148. package/build/es/src/contacts-v4-label.context.js +52 -0
  149. package/build/es/src/contacts-v4-label.context.js.map +1 -0
  150. package/build/es/src/contacts-v4-label.http.d.ts +13 -14
  151. package/build/es/src/contacts-v4-label.http.js +66 -72
  152. package/build/es/src/contacts-v4-label.http.js.map +1 -1
  153. package/build/es/src/contacts-v4-label.meta.d.ts +1 -1
  154. package/build/es/src/contacts-v4-label.public.d.ts +6 -5
  155. package/build/es/src/contacts-v4-label.public.js +1 -0
  156. package/build/es/src/contacts-v4-label.public.js.map +1 -1
  157. package/build/es/src/contacts-v4-label.types.d.ts +76 -9
  158. package/build/es/src/contacts-v4-label.universal.d.ts +125 -40
  159. package/build/es/src/contacts-v4-label.universal.js +68 -58
  160. package/build/es/src/contacts-v4-label.universal.js.map +1 -1
  161. package/build/es/src/contacts-v4-submit-contact.context.d.ts +3 -0
  162. package/build/es/src/contacts-v4-submit-contact.context.js +12 -0
  163. package/build/es/src/contacts-v4-submit-contact.context.js.map +1 -0
  164. package/build/es/src/contacts-v4-submit-contact.http.js +20 -34
  165. package/build/es/src/contacts-v4-submit-contact.http.js.map +1 -1
  166. package/build/es/src/contacts-v4-submit-contact.meta.d.ts +1 -1
  167. package/build/es/src/contacts-v4-submit-contact.public.d.ts +2 -2
  168. package/build/es/src/contacts-v4-submit-contact.types.d.ts +8 -3
  169. package/build/es/src/contacts-v4-submit-contact.types.js.map +1 -1
  170. package/build/es/src/contacts-v4-submit-contact.universal.d.ts +8 -9
  171. package/build/es/src/contacts-v4-submit-contact.universal.js +11 -18
  172. package/build/es/src/contacts-v4-submit-contact.universal.js.map +1 -1
  173. package/build/es/src/crm-tasks-v2-task.context.d.ts +9 -0
  174. package/build/es/src/crm-tasks-v2-task.context.js +72 -0
  175. package/build/es/src/crm-tasks-v2-task.context.js.map +1 -0
  176. package/build/es/src/crm-tasks-v2-task.http.d.ts +60 -0
  177. package/build/es/src/crm-tasks-v2-task.http.js +258 -0
  178. package/build/es/src/crm-tasks-v2-task.http.js.map +1 -0
  179. package/build/es/src/crm-tasks-v2-task.meta.d.ts +27 -0
  180. package/build/es/src/crm-tasks-v2-task.meta.js +128 -0
  181. package/build/es/src/crm-tasks-v2-task.meta.js.map +1 -0
  182. package/build/es/src/crm-tasks-v2-task.public.d.ts +30 -0
  183. package/build/es/src/crm-tasks-v2-task.public.js +40 -0
  184. package/build/es/src/crm-tasks-v2-task.public.js.map +1 -0
  185. package/build/es/src/crm-tasks-v2-task.types.d.ts +430 -0
  186. package/build/es/src/crm-tasks-v2-task.types.js +26 -0
  187. package/build/es/src/crm-tasks-v2-task.types.js.map +1 -0
  188. package/build/es/src/crm-tasks-v2-task.universal.d.ts +678 -0
  189. package/build/es/src/crm-tasks-v2-task.universal.js +487 -0
  190. package/build/es/src/crm-tasks-v2-task.universal.js.map +1 -0
  191. package/build/es/src/ping-notifications-v3-notification.public.d.ts +1 -1
  192. package/build/es/src/ping-notifications-v3-notification.universal.js.map +1 -1
  193. package/context/package.json +6 -0
  194. package/package.json +12 -6
@@ -0,0 +1,678 @@
1
+ import { EventDefinition } from '@wix/sdk-types';
2
+ export interface Task {
3
+ /**
4
+ * Task ID.
5
+ * @readonly
6
+ */
7
+ _id?: string | null;
8
+ /**
9
+ * 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.
10
+ * @readonly
11
+ */
12
+ revision?: string | null;
13
+ /** Title of the task. */
14
+ title?: string | null;
15
+ /** Description of the task. */
16
+ description?: string | null;
17
+ /**
18
+ * Date and time the task was created.
19
+ * @readonly
20
+ */
21
+ _createdDate?: Date;
22
+ /**
23
+ * Date and time the task was last updated.
24
+ * @readonly
25
+ */
26
+ _updatedDate?: Date;
27
+ /** Due date for the task. */
28
+ dueDate?: Date;
29
+ /**
30
+ * Status of the task.
31
+ *
32
+ * Supported values: `"ACTION_NEEDED"`, `"COMPLETED"`.
33
+ *
34
+ * Default: `"ACTION_NEEDED"`
35
+ */
36
+ status?: TaskStatus;
37
+ /** Details about the task source. */
38
+ source?: TaskSource;
39
+ /** Information about the contact associated with the task. */
40
+ contact?: ContactInfo;
41
+ }
42
+ /** Possible statuses in which the task may be. */
43
+ export declare enum TaskStatus {
44
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
45
+ ACTION_NEEDED = "ACTION_NEEDED",
46
+ COMPLETED = "COMPLETED"
47
+ }
48
+ export interface TaskSource {
49
+ /**
50
+ * How the task was created.
51
+ *
52
+ * Supported values: `"APP"`, `"USER"`.
53
+ * @readonly
54
+ */
55
+ sourceType?: SourceType;
56
+ /**
57
+ * App ID, if the task was created by an app.
58
+ * @readonly
59
+ */
60
+ appId?: string | null;
61
+ /**
62
+ * User ID, if the task was created by a user.
63
+ * @readonly
64
+ */
65
+ userId?: string | null;
66
+ }
67
+ /** Possible sources that can create tasks. */
68
+ export declare enum SourceType {
69
+ UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
70
+ APP = "APP",
71
+ USER = "USER"
72
+ }
73
+ export interface ContactInfo {
74
+ /** ID of the contact associated with the task. */
75
+ _id?: string | null;
76
+ /**
77
+ * Contact's first name.
78
+ * @readonly
79
+ */
80
+ firstName?: string | null;
81
+ /**
82
+ * Contact's last name.
83
+ * @readonly
84
+ */
85
+ lastName?: string | null;
86
+ /**
87
+ * Contact's image url.
88
+ * @readonly
89
+ */
90
+ imageUrl?: string | null;
91
+ /**
92
+ * Contact's primary email.
93
+ * @readonly
94
+ */
95
+ email?: string | null;
96
+ /**
97
+ * Contact's primary phone.
98
+ * @readonly
99
+ */
100
+ phone?: string | null;
101
+ }
102
+ export interface DeleteCompletedTasksRequest {
103
+ /** Optional list of tasks ids of the tasks to delete. If the list is not provided the filter is used. */
104
+ taskIds?: string[];
105
+ /** An optional filter of tasks to count. See 'queryTasks' for supported filter options. */
106
+ filter?: Record<string, any> | null;
107
+ }
108
+ export interface DeleteCompletedTasksResponse {
109
+ }
110
+ export interface SendTasksReminderRequest {
111
+ /** Ids of the tasks to remind */
112
+ taskIds?: string[];
113
+ /** The reminder type */
114
+ reminderType?: ReminderType;
115
+ }
116
+ export declare enum ReminderType {
117
+ UNKNOWN_REMINDER_TYPE = "UNKNOWN_REMINDER_TYPE",
118
+ FIRST_REMINDER = "FIRST_REMINDER",
119
+ LAST_REMINDER = "LAST_REMINDER"
120
+ }
121
+ export interface SendTasksReminderResponse {
122
+ }
123
+ export interface RepositionTask {
124
+ /** The id of the last task that was re-positioned */
125
+ taskId?: string | null;
126
+ /** The position of the last task that was re-positioned */
127
+ position?: string | null;
128
+ }
129
+ export interface TaskOverdue {
130
+ /** The overdue task. */
131
+ task?: Task;
132
+ }
133
+ export interface TaskAssigned {
134
+ /** The id of the assignee */
135
+ assigneeId?: string;
136
+ /** The task that was assigned */
137
+ task?: Task;
138
+ }
139
+ export interface CreateTaskRequest {
140
+ /** Task to create. */
141
+ task: Task;
142
+ }
143
+ export interface CreateTaskResponse {
144
+ /** The created task. */
145
+ task?: Task;
146
+ }
147
+ export interface ContactNotFoundError {
148
+ contactId?: string;
149
+ }
150
+ export interface GetTaskRequest {
151
+ /** ID of the task to retrieve. */
152
+ taskId: string;
153
+ }
154
+ export interface GetTaskResponse {
155
+ /** The retrieved task. */
156
+ task?: Task;
157
+ }
158
+ export interface UpdateTaskRequest {
159
+ /** Task to update. */
160
+ task: Task;
161
+ }
162
+ export interface UpdateTaskResponse {
163
+ /** The updated task. */
164
+ task?: Task;
165
+ }
166
+ export interface DeleteTaskRequest {
167
+ /** ID of the task to delete. */
168
+ taskId: string;
169
+ }
170
+ export interface DeleteTaskResponse {
171
+ }
172
+ export interface QueryTasksRequest {
173
+ /** Query options. */
174
+ query?: CursorQuery;
175
+ }
176
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
177
+ /** 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`. */
178
+ cursorPaging?: CursorPaging;
179
+ /**
180
+ * Filter object in the following format:
181
+ * `"filter" : {
182
+ * "fieldName1": "value1",
183
+ * "fieldName2":{"$operator":"value2"}
184
+ * }`
185
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
186
+ */
187
+ filter?: Record<string, any> | null;
188
+ /**
189
+ * Sort object in the following format:
190
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
191
+ */
192
+ sort?: Sorting[];
193
+ }
194
+ /** @oneof */
195
+ export interface CursorQueryPagingMethodOneOf {
196
+ /** 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`. */
197
+ cursorPaging?: CursorPaging;
198
+ }
199
+ export interface Sorting {
200
+ /** Name of the field to sort by. */
201
+ fieldName?: string;
202
+ /** Sort order. */
203
+ order?: SortOrder;
204
+ }
205
+ export declare enum SortOrder {
206
+ ASC = "ASC",
207
+ DESC = "DESC"
208
+ }
209
+ export interface CursorPaging {
210
+ /** Number of items to load. */
211
+ limit?: number | null;
212
+ /**
213
+ * Pointer to the next or previous page in the list of results.
214
+ *
215
+ * You can get the relevant cursor token
216
+ * from the `pagingMetadata` object in the previous call's response.
217
+ * Not relevant for the first request.
218
+ */
219
+ cursor?: string | null;
220
+ }
221
+ export interface QueryTasksResponse {
222
+ /** The retrieved tasks. */
223
+ tasks?: Task[];
224
+ /** Paging metadata. */
225
+ pagingMetadata?: CursorPagingMetadata;
226
+ }
227
+ export interface CursorPagingMetadata {
228
+ /** Number of items returned in the response. */
229
+ count?: number | null;
230
+ /** Offset that was requested. */
231
+ cursors?: Cursors;
232
+ /**
233
+ * Indicates if there are more results after the current page.
234
+ * If `true`, another page of results can be retrieved.
235
+ * If `false`, this is the last page.
236
+ */
237
+ hasNext?: boolean | null;
238
+ }
239
+ export interface Cursors {
240
+ /** Cursor pointing to next page in the list of results. */
241
+ next?: string | null;
242
+ /** Cursor pointing to previous page in the list of results. */
243
+ prev?: string | null;
244
+ }
245
+ export interface CountTasksRequest {
246
+ /**
247
+ * Filter which tasks to count. See the list of supported filters in `queryContacts`.
248
+ *
249
+ * Filterable fields include:
250
+ * - `_id`
251
+ * - `_createdDate`
252
+ * - `_updatedDate`
253
+ * - `dueDate`
254
+ * - `status`
255
+ * - `contact.id`
256
+ */
257
+ filter?: Record<string, any> | null;
258
+ }
259
+ export interface CountTasksResponse {
260
+ /** The number of tasks that match the provided filter. */
261
+ count?: number;
262
+ }
263
+ export interface QueryTasksInternalRequest {
264
+ /** WQL expression */
265
+ query?: QueryV2;
266
+ }
267
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
268
+ /** Paging options to limit and skip the number of items. */
269
+ paging?: Paging;
270
+ /** 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`. */
271
+ cursorPaging?: CursorPaging;
272
+ /**
273
+ * Filter object in the following format:
274
+ * `"filter" : {
275
+ * "fieldName1": "value1",
276
+ * "fieldName2":{"$operator":"value2"}
277
+ * }`
278
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
279
+ */
280
+ filter?: Record<string, any> | null;
281
+ /**
282
+ * Sort object in the following format:
283
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
284
+ */
285
+ sort?: Sorting[];
286
+ /** 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. */
287
+ fields?: string[];
288
+ /** 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. */
289
+ fieldsets?: string[];
290
+ }
291
+ /** @oneof */
292
+ export interface QueryV2PagingMethodOneOf {
293
+ /** Paging options to limit and skip the number of items. */
294
+ paging?: Paging;
295
+ /** 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`. */
296
+ cursorPaging?: CursorPaging;
297
+ }
298
+ export interface Paging {
299
+ /** Number of items to load. */
300
+ limit?: number | null;
301
+ /** Number of items to skip in the current sort order. */
302
+ offset?: number | null;
303
+ }
304
+ export interface QueryTasksInternalResponse {
305
+ /** The retrieved Tasks */
306
+ tasks?: Task[];
307
+ /** Details on the paged set of results returned. */
308
+ pagingMetadata?: PagingMetadataV2;
309
+ }
310
+ export interface PagingMetadataV2 {
311
+ /** Number of items returned in the response. */
312
+ count?: number | null;
313
+ /** Offset that was requested. */
314
+ offset?: number | null;
315
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
316
+ total?: number | null;
317
+ /** Flag that indicates the server failed to calculate the `total` field. */
318
+ tooManyToCount?: boolean | null;
319
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
320
+ cursors?: Cursors;
321
+ }
322
+ export interface MoveTaskAfterRequest {
323
+ /** The task ID to move. */
324
+ taskId: string;
325
+ /**
326
+ * The task ID after which the moved task is positioned in the display.
327
+ * If `beforeTaskId` is not provided, the moved task is positioned first in the display of tasks.
328
+ */
329
+ beforeTaskId?: string | null;
330
+ }
331
+ export interface MoveTaskAfterResponse {
332
+ }
333
+ export interface TaskNotFoundError {
334
+ /** The task id that was not found */
335
+ taskId?: string;
336
+ }
337
+ export interface Empty {
338
+ }
339
+ export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
340
+ createdEvent?: EntityCreatedEvent<T>;
341
+ updatedEvent?: EntityUpdatedEvent<T>;
342
+ deletedEvent?: EntityDeletedEvent<T>;
343
+ actionEvent?: ActionEvent<T>;
344
+ /**
345
+ * Unique event ID.
346
+ * Allows clients to ignore duplicate webhooks.
347
+ */
348
+ _id?: string;
349
+ /**
350
+ * Assumes actions are also always typed to an entity_type
351
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
352
+ */
353
+ entityFqdn?: string;
354
+ /**
355
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
356
+ * This is although the created/updated/deleted notion is duplication of the oneof types
357
+ * Example: created/updated/deleted/started/completed/email_opened
358
+ */
359
+ slug?: string;
360
+ /** ID of the entity associated with the event. */
361
+ entityId?: string;
362
+ /** Event timestamp. */
363
+ eventTime?: Date;
364
+ /**
365
+ * Whether the event was triggered as a result of a privacy regulation application
366
+ * (for example, GDPR).
367
+ */
368
+ triggeredByAnonymizeRequest?: boolean | null;
369
+ /** If present, indicates the action that triggered the event. */
370
+ originatedFrom?: string | null;
371
+ /**
372
+ * A sequence number defining the order of updates to the underlying entity.
373
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
374
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
375
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
376
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
377
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
378
+ */
379
+ entityEventSequence?: string | null;
380
+ }
381
+ export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
382
+ }
383
+ export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
384
+ }
385
+ export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
386
+ }
387
+ export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
388
+ }
389
+ /** @oneof */
390
+ export interface DomainEventBodyOneOf<T> {
391
+ createdEvent?: EntityCreatedEvent<T>;
392
+ updatedEvent?: EntityUpdatedEvent<T>;
393
+ deletedEvent?: EntityDeletedEvent<T>;
394
+ actionEvent?: ActionEvent<T>;
395
+ }
396
+ export interface EntityCreatedEvent<T> {
397
+ entity?: T;
398
+ }
399
+ export interface EntityUpdatedEvent<T> {
400
+ /**
401
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
402
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
403
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
404
+ */
405
+ currentEntity?: T;
406
+ }
407
+ export interface EntityDeletedEvent<T> {
408
+ /** Entity that was deleted */
409
+ deletedEntity?: T | null;
410
+ }
411
+ export interface ActionEvent<T> {
412
+ body?: T;
413
+ }
414
+ export interface CreateTaskResponseNonNullableFields {
415
+ task?: {
416
+ status: TaskStatus;
417
+ source?: {
418
+ sourceType: SourceType;
419
+ };
420
+ };
421
+ }
422
+ export interface GetTaskResponseNonNullableFields {
423
+ task?: {
424
+ status: TaskStatus;
425
+ source?: {
426
+ sourceType: SourceType;
427
+ };
428
+ };
429
+ }
430
+ export interface UpdateTaskResponseNonNullableFields {
431
+ task?: {
432
+ status: TaskStatus;
433
+ source?: {
434
+ sourceType: SourceType;
435
+ };
436
+ };
437
+ }
438
+ export interface QueryTasksResponseNonNullableFields {
439
+ tasks: {
440
+ status: TaskStatus;
441
+ source?: {
442
+ sourceType: SourceType;
443
+ };
444
+ }[];
445
+ }
446
+ export interface CountTasksResponseNonNullableFields {
447
+ count: number;
448
+ }
449
+ export declare const onTaskOverdue: EventDefinition<DomainActionEvent<TaskOverdue>, "wix.crm.tasks.v2.task_task_overdue">;
450
+ export declare const onTaskCreated: EventDefinition<DomainCreatedEvent<Task>, "wix.crm.tasks.v2.task_created">;
451
+ export declare const onTaskUpdated: EventDefinition<DomainUpdatedEvent<Task>, "wix.crm.tasks.v2.task_updated">;
452
+ export declare const onTaskDeleted: EventDefinition<DomainDeletedEvent<Task>, "wix.crm.tasks.v2.task_deleted">;
453
+ /**
454
+ * Creates a new task.
455
+ *
456
+ * All fields in the `task` object are optional. If you don't pass any fields in the `task` object, the function returns a task with the following core properties:
457
+ * - `_id`
458
+ * - `_createdDate`
459
+ * - `_updatedDate`
460
+ * - `status`
461
+ * - `source`
462
+ * - `revision`
463
+ *
464
+ * @param task - Task to create.
465
+ * @public
466
+ * @requiredField task
467
+ * @permissionScope Manage Tasks
468
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
469
+ * @applicableIdentity APP
470
+ * @returns The created task.
471
+ */
472
+ export declare function createTask(task: Task): Promise<Task & NonNullable<CreateTaskResponseNonNullableFields>['task']>;
473
+ /**
474
+ * Retrieves a task by ID.
475
+ * @param taskId - ID of the task to retrieve.
476
+ * @public
477
+ * @requiredField taskId
478
+ * @permissionScope Read Tasks
479
+ * @permissionScopeId SCOPE.DC-CRM.READ-TASKS
480
+ * @permissionScope Manage Tasks
481
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
482
+ * @applicableIdentity APP
483
+ * @returns The retrieved task.
484
+ */
485
+ export declare function getTask(taskId: string): Promise<Task & NonNullable<GetTaskResponseNonNullableFields>['task']>;
486
+ /**
487
+ * Updates a task.
488
+ *
489
+ * Each time the task is updated, `revision` increments by 1.
490
+ * The existing `revision` must be included when updating the task.
491
+ * This ensures you're working with the latest task
492
+ * and prevents unintended overwrites.
493
+ * @param _id - Task ID.
494
+ * @public
495
+ * @requiredField _id
496
+ * @requiredField task
497
+ * @requiredField task.revision
498
+ * @param task - Task to update.
499
+ * @permissionScope Manage Tasks
500
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
501
+ * @applicableIdentity APP
502
+ * @returns The updated task.
503
+ */
504
+ export declare function updateTask(_id: string | null, task: UpdateTask): Promise<Task & NonNullable<UpdateTaskResponseNonNullableFields>['task']>;
505
+ export interface UpdateTask {
506
+ /**
507
+ * Task ID.
508
+ * @readonly
509
+ */
510
+ _id?: string | null;
511
+ /**
512
+ * 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.
513
+ * @readonly
514
+ */
515
+ revision?: string | null;
516
+ /** Title of the task. */
517
+ title?: string | null;
518
+ /** Description of the task. */
519
+ description?: string | null;
520
+ /**
521
+ * Date and time the task was created.
522
+ * @readonly
523
+ */
524
+ _createdDate?: Date;
525
+ /**
526
+ * Date and time the task was last updated.
527
+ * @readonly
528
+ */
529
+ _updatedDate?: Date;
530
+ /** Due date for the task. */
531
+ dueDate?: Date;
532
+ /**
533
+ * Status of the task.
534
+ *
535
+ * Supported values: `"ACTION_NEEDED"`, `"COMPLETED"`.
536
+ *
537
+ * Default: `"ACTION_NEEDED"`
538
+ */
539
+ status?: TaskStatus;
540
+ /** Details about the task source. */
541
+ source?: TaskSource;
542
+ /** Information about the contact associated with the task. */
543
+ contact?: ContactInfo;
544
+ }
545
+ /**
546
+ * Deletes a task by ID.
547
+ * @param taskId - ID of the task to delete.
548
+ * @public
549
+ * @requiredField taskId
550
+ * @permissionScope Manage Tasks
551
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
552
+ * @applicableIdentity APP
553
+ */
554
+ export declare function deleteTask(taskId: string): Promise<void>;
555
+ /**
556
+ * Creates a query to retrieve a list of tasks.
557
+ *
558
+ * The `queryTasks()` function builds a query to retrieve a list of tasks and returns a `TasksQueryBuilder` object.
559
+ *
560
+ * The returned object contains the query definition which is typically used to run the query using the `find()` function. You can refine the query by chaining `TasksQueryBuilder` functions onto the query. `TasksQueryBuilder` functions enable you to sort, filter, and control the results that `queryTasks()` returns.
561
+ *
562
+ * `queryTasks()` runs with these `TasksQueryBuilder` defaults, which you can override:
563
+ * - `limit(50)`
564
+ * - `descending('_createdDate')`
565
+ *
566
+ * The functions 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.
567
+ *
568
+ * The following `TasksQueryBuilder` functions are supported for `queryTasks()`. For a full description of the `task` object, see the object returned for the `items` property in `TasksQueryResult`.
569
+ * @public
570
+ * @permissionScope Read Tasks
571
+ * @permissionScopeId SCOPE.DC-CRM.READ-TASKS
572
+ * @permissionScope Manage Tasks
573
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
574
+ * @applicableIdentity APP
575
+ */
576
+ export declare function queryTasks(): TasksQueryBuilder;
577
+ interface QueryCursorResult {
578
+ cursors: Cursors;
579
+ hasNext: () => boolean;
580
+ hasPrev: () => boolean;
581
+ length: number;
582
+ pageSize: number;
583
+ }
584
+ export interface TasksQueryResult extends QueryCursorResult {
585
+ items: Task[];
586
+ query: TasksQueryBuilder;
587
+ next: () => Promise<TasksQueryResult>;
588
+ prev: () => Promise<TasksQueryResult>;
589
+ }
590
+ export interface TasksQueryBuilder {
591
+ /** @param propertyName - Property whose value is compared with `value`.
592
+ * @param value - Value to compare against.
593
+ */
594
+ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'dueDate' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
595
+ /** @param propertyName - Property whose value is compared with `value`.
596
+ * @param value - Value to compare against.
597
+ */
598
+ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'dueDate' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
599
+ /** @param propertyName - Property whose value is compared with `value`.
600
+ * @param value - Value to compare against.
601
+ */
602
+ ge: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
603
+ /** @param propertyName - Property whose value is compared with `value`.
604
+ * @param value - Value to compare against.
605
+ */
606
+ gt: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
607
+ /** @param propertyName - Property whose value is compared with `value`.
608
+ * @param value - Value to compare against.
609
+ */
610
+ le: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
611
+ /** @param propertyName - Property whose value is compared with `value`.
612
+ * @param value - Value to compare against.
613
+ */
614
+ lt: (propertyName: '_createdDate' | '_updatedDate' | 'dueDate', value: any) => TasksQueryBuilder;
615
+ in: (propertyName: '_id' | 'status' | 'contact.id', value: any) => TasksQueryBuilder;
616
+ exists: (propertyName: 'contact.id', value: boolean) => TasksQueryBuilder;
617
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
618
+ ascending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>) => TasksQueryBuilder;
619
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
620
+ descending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'dueDate'>) => TasksQueryBuilder;
621
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
622
+ limit: (limit: number) => TasksQueryBuilder;
623
+ /** @param cursor - A pointer to specific record */
624
+ skipTo: (cursor: string) => TasksQueryBuilder;
625
+ find: () => Promise<TasksQueryResult>;
626
+ }
627
+ /**
628
+ * Counts the number of tasks.
629
+ *
630
+ *
631
+ * This endpoint returns the count of all tasks regardless of the task `status`.
632
+ *
633
+ * Optionally, you can pass a filter to count only tasks based
634
+ * on specified criteria.
635
+ * @public
636
+ * @param options - Filtering options.
637
+ * @permissionScope Read Tasks
638
+ * @permissionScopeId SCOPE.DC-CRM.READ-TASKS
639
+ * @permissionScope Manage Tasks
640
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
641
+ * @applicableIdentity APP
642
+ */
643
+ export declare function countTasks(options?: CountTasksOptions): Promise<CountTasksResponse & CountTasksResponseNonNullableFields>;
644
+ export interface CountTasksOptions {
645
+ /**
646
+ * Filter which tasks to count. See the list of supported filters in `queryContacts`.
647
+ *
648
+ * Filterable fields include:
649
+ * - `_id`
650
+ * - `_createdDate`
651
+ * - `_updatedDate`
652
+ * - `dueDate`
653
+ * - `status`
654
+ * - `contact.id`
655
+ */
656
+ filter?: Record<string, any> | null;
657
+ }
658
+ /**
659
+ * Moves a task specified by ID to be placed after another task in the display.
660
+ *
661
+ * You can reposition a task to be first in the display by ommitting `beforeTaskId`.
662
+ * @param taskId - The task ID to move.
663
+ * @public
664
+ * @requiredField taskId
665
+ * @param options - Options for moving the task.
666
+ * @permissionScope Manage Tasks
667
+ * @permissionScopeId SCOPE.DC-CRM.MANAGE-TASKS
668
+ * @applicableIdentity APP
669
+ */
670
+ export declare function moveTaskAfter(taskId: string, options?: MoveTaskAfterOptions): Promise<void>;
671
+ export interface MoveTaskAfterOptions {
672
+ /**
673
+ * The task ID after which the moved task is positioned in the display.
674
+ * If `beforeTaskId` is not provided, the moved task is positioned first in the display of tasks.
675
+ */
676
+ beforeTaskId?: string | null;
677
+ }
678
+ export {};