@wix/auto_sdk_crm_notes 1.0.0
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.
- package/build/cjs/index.d.ts +85 -0
- package/build/cjs/index.js +500 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +662 -0
- package/build/cjs/index.typings.js +390 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +236 -0
- package/build/cjs/meta.js +301 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +85 -0
- package/build/es/index.mjs +465 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +662 -0
- package/build/es/index.typings.mjs +358 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +236 -0
- package/build/es/meta.mjs +270 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +85 -0
- package/build/internal/cjs/index.js +500 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +662 -0
- package/build/internal/cjs/index.typings.js +390 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +236 -0
- package/build/internal/cjs/meta.js +301 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/es/index.d.mts +85 -0
- package/build/internal/es/index.mjs +465 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +662 -0
- package/build/internal/es/index.typings.mjs +358 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +236 -0
- package/build/internal/es/meta.mjs +270 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +54 -0
|
@@ -0,0 +1,662 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
3
|
+
/** A note contains textual information associated with a contact. */
|
|
4
|
+
interface Note {
|
|
5
|
+
/**
|
|
6
|
+
* Note ID.
|
|
7
|
+
* @format GUID
|
|
8
|
+
* @readonly
|
|
9
|
+
*/
|
|
10
|
+
_id?: string | null;
|
|
11
|
+
/**
|
|
12
|
+
* Revision number, which increments by 1 each time the note is updated.
|
|
13
|
+
* To prevent conflicting changes, the current revision must be passed when updating the note.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
revision?: string | null;
|
|
17
|
+
/**
|
|
18
|
+
* Date and time the note was created.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
_createdDate?: Date | null;
|
|
22
|
+
/**
|
|
23
|
+
* Date and time the note was last updated.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
_updatedDate?: Date | null;
|
|
27
|
+
/**
|
|
28
|
+
* Contact ID associated with the note.
|
|
29
|
+
* @format GUID
|
|
30
|
+
* @immutable
|
|
31
|
+
*/
|
|
32
|
+
contactId?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Note text.
|
|
35
|
+
* @maxLength 2048
|
|
36
|
+
*/
|
|
37
|
+
text?: string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Note type for organizing notes by their purpose.
|
|
40
|
+
*
|
|
41
|
+
* Default: `NOT_SET`
|
|
42
|
+
*/
|
|
43
|
+
type?: NoteTypeWithLiterals;
|
|
44
|
+
/**
|
|
45
|
+
* Information about who created the note.
|
|
46
|
+
* @readonly
|
|
47
|
+
*/
|
|
48
|
+
source?: NoteSource;
|
|
49
|
+
}
|
|
50
|
+
declare enum NoteType {
|
|
51
|
+
/** Unknown note type. */
|
|
52
|
+
UNKNOWN_TYPE = "UNKNOWN_TYPE",
|
|
53
|
+
/** Note doesn't have a specific classification. */
|
|
54
|
+
NOT_SET = "NOT_SET",
|
|
55
|
+
/** Note is a summary of a meeting related to the contact. */
|
|
56
|
+
MEETING_SUMMARY = "MEETING_SUMMARY",
|
|
57
|
+
/** Note is a summary of a call related to the contact. */
|
|
58
|
+
CALL_SUMMARY = "CALL_SUMMARY"
|
|
59
|
+
}
|
|
60
|
+
/** @enumType */
|
|
61
|
+
type NoteTypeWithLiterals = NoteType | 'UNKNOWN_TYPE' | 'NOT_SET' | 'MEETING_SUMMARY' | 'CALL_SUMMARY';
|
|
62
|
+
interface NoteSource {
|
|
63
|
+
/**
|
|
64
|
+
* Note creator.
|
|
65
|
+
* @readonly
|
|
66
|
+
*/
|
|
67
|
+
sourceType?: SourceTypeWithLiterals;
|
|
68
|
+
/**
|
|
69
|
+
* App ID, if the note was created by an app.
|
|
70
|
+
* @format GUID
|
|
71
|
+
* @readonly
|
|
72
|
+
*/
|
|
73
|
+
appId?: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* User ID, if the note was created by a Wix user.
|
|
76
|
+
* @format GUID
|
|
77
|
+
* @readonly
|
|
78
|
+
*/
|
|
79
|
+
userId?: string | null;
|
|
80
|
+
}
|
|
81
|
+
/** Note creator. */
|
|
82
|
+
declare enum SourceType {
|
|
83
|
+
UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
|
|
84
|
+
APP = "APP",
|
|
85
|
+
USER = "USER"
|
|
86
|
+
}
|
|
87
|
+
/** @enumType */
|
|
88
|
+
type SourceTypeWithLiterals = SourceType | 'UNKNOWN_SOURCE_TYPE' | 'APP' | 'USER';
|
|
89
|
+
interface CreateNoteRequest {
|
|
90
|
+
/** Note to create. */
|
|
91
|
+
note: Note;
|
|
92
|
+
}
|
|
93
|
+
interface CreateNoteResponse {
|
|
94
|
+
/** Created note. */
|
|
95
|
+
note?: Note;
|
|
96
|
+
}
|
|
97
|
+
interface GetNoteRequest {
|
|
98
|
+
/**
|
|
99
|
+
* Note ID.
|
|
100
|
+
* @format GUID
|
|
101
|
+
*/
|
|
102
|
+
noteId: string;
|
|
103
|
+
}
|
|
104
|
+
interface GetNoteResponse {
|
|
105
|
+
/** Retrieved note. */
|
|
106
|
+
note?: Note;
|
|
107
|
+
}
|
|
108
|
+
interface UpdateNoteRequest {
|
|
109
|
+
/** Note to update. */
|
|
110
|
+
note: Note;
|
|
111
|
+
}
|
|
112
|
+
interface UpdateNoteResponse {
|
|
113
|
+
/** Updated note. */
|
|
114
|
+
note?: Note;
|
|
115
|
+
}
|
|
116
|
+
interface DeleteNoteRequest {
|
|
117
|
+
/**
|
|
118
|
+
* Note ID.
|
|
119
|
+
* @format GUID
|
|
120
|
+
*/
|
|
121
|
+
noteId: string;
|
|
122
|
+
}
|
|
123
|
+
interface DeleteNoteResponse {
|
|
124
|
+
}
|
|
125
|
+
interface QueryNotesRequest {
|
|
126
|
+
/**
|
|
127
|
+
* WQL query object.
|
|
128
|
+
*
|
|
129
|
+
* For more information, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language).
|
|
130
|
+
*/
|
|
131
|
+
query?: CursorQuery;
|
|
132
|
+
/**
|
|
133
|
+
* Contact ID to retrieve notes for. Required when not using cursor pagination.
|
|
134
|
+
* @format GUID
|
|
135
|
+
*/
|
|
136
|
+
contactId?: string | null;
|
|
137
|
+
}
|
|
138
|
+
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
139
|
+
/** 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`. */
|
|
140
|
+
cursorPaging?: CursorPaging;
|
|
141
|
+
/**
|
|
142
|
+
* Filter object in the following format:
|
|
143
|
+
* `"filter" : {
|
|
144
|
+
* "fieldName1": "value1",
|
|
145
|
+
* "fieldName2":{"$operator":"value2"}
|
|
146
|
+
* }`
|
|
147
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
148
|
+
*/
|
|
149
|
+
filter?: Record<string, any> | null;
|
|
150
|
+
/**
|
|
151
|
+
* Sort object in the following format:
|
|
152
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
153
|
+
*/
|
|
154
|
+
sort?: Sorting[];
|
|
155
|
+
}
|
|
156
|
+
/** @oneof */
|
|
157
|
+
interface CursorQueryPagingMethodOneOf {
|
|
158
|
+
/** 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`. */
|
|
159
|
+
cursorPaging?: CursorPaging;
|
|
160
|
+
}
|
|
161
|
+
interface Sorting {
|
|
162
|
+
/** Name of the field to sort by. */
|
|
163
|
+
fieldName?: string;
|
|
164
|
+
/** Sort order. */
|
|
165
|
+
order?: SortOrderWithLiterals;
|
|
166
|
+
}
|
|
167
|
+
declare enum SortOrder {
|
|
168
|
+
ASC = "ASC",
|
|
169
|
+
DESC = "DESC"
|
|
170
|
+
}
|
|
171
|
+
/** @enumType */
|
|
172
|
+
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
173
|
+
interface CursorPaging {
|
|
174
|
+
/**
|
|
175
|
+
* Number of items to load.
|
|
176
|
+
* @max 1000
|
|
177
|
+
*/
|
|
178
|
+
limit?: number | null;
|
|
179
|
+
/**
|
|
180
|
+
* Pointer to the next or previous page in the list of results.
|
|
181
|
+
*
|
|
182
|
+
* You can get the relevant cursor token
|
|
183
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
184
|
+
* Not relevant for the first request.
|
|
185
|
+
*/
|
|
186
|
+
cursor?: string | null;
|
|
187
|
+
}
|
|
188
|
+
interface QueryNotesResponse {
|
|
189
|
+
/** Retrieved notes. */
|
|
190
|
+
notes?: Note[];
|
|
191
|
+
/** Paging information. */
|
|
192
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
193
|
+
}
|
|
194
|
+
interface CursorPagingMetadata {
|
|
195
|
+
/** Number of items returned in the response. */
|
|
196
|
+
count?: number | null;
|
|
197
|
+
/** Offset that was requested. */
|
|
198
|
+
cursors?: Cursors;
|
|
199
|
+
/**
|
|
200
|
+
* Indicates if there are more results after the current page.
|
|
201
|
+
* If `true`, another page of results can be retrieved.
|
|
202
|
+
* If `false`, this is the last page.
|
|
203
|
+
*/
|
|
204
|
+
hasNext?: boolean | null;
|
|
205
|
+
}
|
|
206
|
+
interface Cursors {
|
|
207
|
+
/** Cursor pointing to next page in the list of results. */
|
|
208
|
+
next?: string | null;
|
|
209
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
210
|
+
prev?: string | null;
|
|
211
|
+
}
|
|
212
|
+
interface DomainEvent extends DomainEventBodyOneOf {
|
|
213
|
+
createdEvent?: EntityCreatedEvent;
|
|
214
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
215
|
+
deletedEvent?: EntityDeletedEvent;
|
|
216
|
+
actionEvent?: ActionEvent;
|
|
217
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
218
|
+
_id?: string;
|
|
219
|
+
/**
|
|
220
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
221
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
222
|
+
*/
|
|
223
|
+
entityFqdn?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
226
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
227
|
+
*/
|
|
228
|
+
slug?: string;
|
|
229
|
+
/** ID of the entity associated with the event. */
|
|
230
|
+
entityId?: string;
|
|
231
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
232
|
+
eventTime?: Date | null;
|
|
233
|
+
/**
|
|
234
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
235
|
+
* (for example, GDPR).
|
|
236
|
+
*/
|
|
237
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
238
|
+
/** If present, indicates the action that triggered the event. */
|
|
239
|
+
originatedFrom?: string | null;
|
|
240
|
+
/**
|
|
241
|
+
* 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.
|
|
242
|
+
* 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.
|
|
243
|
+
*/
|
|
244
|
+
entityEventSequence?: string | null;
|
|
245
|
+
}
|
|
246
|
+
/** @oneof */
|
|
247
|
+
interface DomainEventBodyOneOf {
|
|
248
|
+
createdEvent?: EntityCreatedEvent;
|
|
249
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
250
|
+
deletedEvent?: EntityDeletedEvent;
|
|
251
|
+
actionEvent?: ActionEvent;
|
|
252
|
+
}
|
|
253
|
+
interface EntityCreatedEvent {
|
|
254
|
+
entity?: string;
|
|
255
|
+
}
|
|
256
|
+
interface RestoreInfo {
|
|
257
|
+
deletedDate?: Date | null;
|
|
258
|
+
}
|
|
259
|
+
interface EntityUpdatedEvent {
|
|
260
|
+
/**
|
|
261
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
262
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
263
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
264
|
+
*/
|
|
265
|
+
currentEntity?: string;
|
|
266
|
+
}
|
|
267
|
+
interface EntityDeletedEvent {
|
|
268
|
+
/** Entity that was deleted. */
|
|
269
|
+
deletedEntity?: string | null;
|
|
270
|
+
}
|
|
271
|
+
interface ActionEvent {
|
|
272
|
+
body?: string;
|
|
273
|
+
}
|
|
274
|
+
interface MessageEnvelope {
|
|
275
|
+
/**
|
|
276
|
+
* App instance ID.
|
|
277
|
+
* @format GUID
|
|
278
|
+
*/
|
|
279
|
+
instanceId?: string | null;
|
|
280
|
+
/**
|
|
281
|
+
* Event type.
|
|
282
|
+
* @maxLength 150
|
|
283
|
+
*/
|
|
284
|
+
eventType?: string;
|
|
285
|
+
/** The identification type and identity data. */
|
|
286
|
+
identity?: IdentificationData;
|
|
287
|
+
/** Stringify payload. */
|
|
288
|
+
data?: string;
|
|
289
|
+
}
|
|
290
|
+
interface IdentificationData extends IdentificationDataIdOneOf {
|
|
291
|
+
/**
|
|
292
|
+
* ID of a site visitor that has not logged in to the site.
|
|
293
|
+
* @format GUID
|
|
294
|
+
*/
|
|
295
|
+
anonymousVisitorId?: string;
|
|
296
|
+
/**
|
|
297
|
+
* ID of a site visitor that has logged in to the site.
|
|
298
|
+
* @format GUID
|
|
299
|
+
*/
|
|
300
|
+
memberId?: string;
|
|
301
|
+
/**
|
|
302
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
303
|
+
* @format GUID
|
|
304
|
+
*/
|
|
305
|
+
wixUserId?: string;
|
|
306
|
+
/**
|
|
307
|
+
* ID of an app.
|
|
308
|
+
* @format GUID
|
|
309
|
+
*/
|
|
310
|
+
appId?: string;
|
|
311
|
+
/** @readonly */
|
|
312
|
+
identityType?: WebhookIdentityTypeWithLiterals;
|
|
313
|
+
}
|
|
314
|
+
/** @oneof */
|
|
315
|
+
interface IdentificationDataIdOneOf {
|
|
316
|
+
/**
|
|
317
|
+
* ID of a site visitor that has not logged in to the site.
|
|
318
|
+
* @format GUID
|
|
319
|
+
*/
|
|
320
|
+
anonymousVisitorId?: string;
|
|
321
|
+
/**
|
|
322
|
+
* ID of a site visitor that has logged in to the site.
|
|
323
|
+
* @format GUID
|
|
324
|
+
*/
|
|
325
|
+
memberId?: string;
|
|
326
|
+
/**
|
|
327
|
+
* ID of a Wix user (site owner, contributor, etc.).
|
|
328
|
+
* @format GUID
|
|
329
|
+
*/
|
|
330
|
+
wixUserId?: string;
|
|
331
|
+
/**
|
|
332
|
+
* ID of an app.
|
|
333
|
+
* @format GUID
|
|
334
|
+
*/
|
|
335
|
+
appId?: string;
|
|
336
|
+
}
|
|
337
|
+
declare enum WebhookIdentityType {
|
|
338
|
+
UNKNOWN = "UNKNOWN",
|
|
339
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
340
|
+
MEMBER = "MEMBER",
|
|
341
|
+
WIX_USER = "WIX_USER",
|
|
342
|
+
APP = "APP"
|
|
343
|
+
}
|
|
344
|
+
/** @enumType */
|
|
345
|
+
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
346
|
+
/** @docsIgnore */
|
|
347
|
+
type QueryNotesApplicationErrors = {
|
|
348
|
+
code?: 'MISSING_CONTACT_ID';
|
|
349
|
+
description?: string;
|
|
350
|
+
data?: Record<string, any>;
|
|
351
|
+
};
|
|
352
|
+
interface BaseEventMetadata {
|
|
353
|
+
/**
|
|
354
|
+
* App instance ID.
|
|
355
|
+
* @format GUID
|
|
356
|
+
*/
|
|
357
|
+
instanceId?: string | null;
|
|
358
|
+
/**
|
|
359
|
+
* Event type.
|
|
360
|
+
* @maxLength 150
|
|
361
|
+
*/
|
|
362
|
+
eventType?: string;
|
|
363
|
+
/** The identification type and identity data. */
|
|
364
|
+
identity?: IdentificationData;
|
|
365
|
+
}
|
|
366
|
+
interface EventMetadata extends BaseEventMetadata {
|
|
367
|
+
/** Event ID. With this ID you can easily spot duplicated events and ignore them. */
|
|
368
|
+
_id?: string;
|
|
369
|
+
/**
|
|
370
|
+
* Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
|
|
371
|
+
* For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
|
|
372
|
+
*/
|
|
373
|
+
entityFqdn?: string;
|
|
374
|
+
/**
|
|
375
|
+
* Event action name, placed at the top level to make it easier for users to dispatch messages.
|
|
376
|
+
* For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
|
|
377
|
+
*/
|
|
378
|
+
slug?: string;
|
|
379
|
+
/** ID of the entity associated with the event. */
|
|
380
|
+
entityId?: string;
|
|
381
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
|
|
382
|
+
eventTime?: Date | null;
|
|
383
|
+
/**
|
|
384
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
385
|
+
* (for example, GDPR).
|
|
386
|
+
*/
|
|
387
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
388
|
+
/** If present, indicates the action that triggered the event. */
|
|
389
|
+
originatedFrom?: string | null;
|
|
390
|
+
/**
|
|
391
|
+
* 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.
|
|
392
|
+
* 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.
|
|
393
|
+
*/
|
|
394
|
+
entityEventSequence?: string | null;
|
|
395
|
+
}
|
|
396
|
+
interface NoteCreatedEnvelope {
|
|
397
|
+
entity: Note;
|
|
398
|
+
metadata: EventMetadata;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Triggered when a note is created.
|
|
402
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
403
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
404
|
+
* @permissionScope Manage Notes
|
|
405
|
+
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
406
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
407
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
408
|
+
* @permissionScope Read Notes
|
|
409
|
+
* @permissionScopeId SCOPE.DC-CRM.READ-NOTES
|
|
410
|
+
* @permissionId CRM_NOTES.NOTE_READ
|
|
411
|
+
* @webhook
|
|
412
|
+
* @eventType wix.crm.notes.v2.note_created
|
|
413
|
+
* @serviceIdentifier wix.crm.notes.v2.Notes
|
|
414
|
+
* @slug created
|
|
415
|
+
* @documentationMaturity preview
|
|
416
|
+
*/
|
|
417
|
+
declare function onNoteCreated(handler: (event: NoteCreatedEnvelope) => void | Promise<void>): void;
|
|
418
|
+
interface NoteDeletedEnvelope {
|
|
419
|
+
metadata: EventMetadata;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Triggered when a note is deleted.
|
|
423
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
424
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
425
|
+
* @permissionScope Manage Notes
|
|
426
|
+
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
427
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
428
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
429
|
+
* @permissionScope Read Notes
|
|
430
|
+
* @permissionScopeId SCOPE.DC-CRM.READ-NOTES
|
|
431
|
+
* @permissionId CRM_NOTES.NOTE_READ
|
|
432
|
+
* @webhook
|
|
433
|
+
* @eventType wix.crm.notes.v2.note_deleted
|
|
434
|
+
* @serviceIdentifier wix.crm.notes.v2.Notes
|
|
435
|
+
* @slug deleted
|
|
436
|
+
* @documentationMaturity preview
|
|
437
|
+
*/
|
|
438
|
+
declare function onNoteDeleted(handler: (event: NoteDeletedEnvelope) => void | Promise<void>): void;
|
|
439
|
+
interface NoteUpdatedEnvelope {
|
|
440
|
+
entity: Note;
|
|
441
|
+
metadata: EventMetadata;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Triggered when a note is updated.
|
|
445
|
+
* @permissionScope Read Members and Contacts - all read permissions
|
|
446
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
447
|
+
* @permissionScope Manage Notes
|
|
448
|
+
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
449
|
+
* @permissionScope Manage Members and Contacts - all permissions
|
|
450
|
+
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
451
|
+
* @permissionScope Read Notes
|
|
452
|
+
* @permissionScopeId SCOPE.DC-CRM.READ-NOTES
|
|
453
|
+
* @permissionId CRM_NOTES.NOTE_READ
|
|
454
|
+
* @webhook
|
|
455
|
+
* @eventType wix.crm.notes.v2.note_updated
|
|
456
|
+
* @serviceIdentifier wix.crm.notes.v2.Notes
|
|
457
|
+
* @slug updated
|
|
458
|
+
* @documentationMaturity preview
|
|
459
|
+
*/
|
|
460
|
+
declare function onNoteUpdated(handler: (event: NoteUpdatedEnvelope) => void | Promise<void>): void;
|
|
461
|
+
/**
|
|
462
|
+
* Creates a new note associated with a specific contact.
|
|
463
|
+
* @param note - Note to create.
|
|
464
|
+
* @public
|
|
465
|
+
* @documentationMaturity preview
|
|
466
|
+
* @requiredField note
|
|
467
|
+
* @requiredField note.contactId
|
|
468
|
+
* @permissionId CRM_NOTES.NOTE_CREATE
|
|
469
|
+
* @applicableIdentity APP
|
|
470
|
+
* @returns Created note.
|
|
471
|
+
* @fqn wix.crm.notes.v2.Notes.CreateNote
|
|
472
|
+
*/
|
|
473
|
+
declare function createNote(note: NonNullablePaths<Note, `contactId`, 2>): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
474
|
+
/**
|
|
475
|
+
* Retrieves a note by ID.
|
|
476
|
+
* @param noteId - Note ID.
|
|
477
|
+
* @public
|
|
478
|
+
* @documentationMaturity preview
|
|
479
|
+
* @requiredField noteId
|
|
480
|
+
* @permissionId CRM_NOTES.NOTE_READ
|
|
481
|
+
* @applicableIdentity APP
|
|
482
|
+
* @returns Retrieved note.
|
|
483
|
+
* @fqn wix.crm.notes.v2.Notes.GetNote
|
|
484
|
+
*/
|
|
485
|
+
declare function getNote(noteId: string): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
486
|
+
/**
|
|
487
|
+
* Updates a note.
|
|
488
|
+
*
|
|
489
|
+
* This method supports partial updates.
|
|
490
|
+
* To prevent conflicting changes, the current revision must be passed when updating the note.
|
|
491
|
+
* @param _id - Note ID.
|
|
492
|
+
* @public
|
|
493
|
+
* @documentationMaturity preview
|
|
494
|
+
* @requiredField _id
|
|
495
|
+
* @requiredField note
|
|
496
|
+
* @requiredField note.revision
|
|
497
|
+
* @permissionId CRM_NOTES.NOTE_UPDATE
|
|
498
|
+
* @applicableIdentity APP
|
|
499
|
+
* @returns Updated note.
|
|
500
|
+
* @fqn wix.crm.notes.v2.Notes.UpdateNote
|
|
501
|
+
*/
|
|
502
|
+
declare function updateNote(_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
503
|
+
interface UpdateNote {
|
|
504
|
+
/**
|
|
505
|
+
* Note ID.
|
|
506
|
+
* @format GUID
|
|
507
|
+
* @readonly
|
|
508
|
+
*/
|
|
509
|
+
_id?: string | null;
|
|
510
|
+
/**
|
|
511
|
+
* Revision number, which increments by 1 each time the note is updated.
|
|
512
|
+
* To prevent conflicting changes, the current revision must be passed when updating the note.
|
|
513
|
+
* @readonly
|
|
514
|
+
*/
|
|
515
|
+
revision?: string | null;
|
|
516
|
+
/**
|
|
517
|
+
* Date and time the note was created.
|
|
518
|
+
* @readonly
|
|
519
|
+
*/
|
|
520
|
+
_createdDate?: Date | null;
|
|
521
|
+
/**
|
|
522
|
+
* Date and time the note was last updated.
|
|
523
|
+
* @readonly
|
|
524
|
+
*/
|
|
525
|
+
_updatedDate?: Date | null;
|
|
526
|
+
/**
|
|
527
|
+
* Contact ID associated with the note.
|
|
528
|
+
* @format GUID
|
|
529
|
+
* @immutable
|
|
530
|
+
*/
|
|
531
|
+
contactId?: string | null;
|
|
532
|
+
/**
|
|
533
|
+
* Note text.
|
|
534
|
+
* @maxLength 2048
|
|
535
|
+
*/
|
|
536
|
+
text?: string | null;
|
|
537
|
+
/**
|
|
538
|
+
* Note type for organizing notes by their purpose.
|
|
539
|
+
*
|
|
540
|
+
* Default: `NOT_SET`
|
|
541
|
+
*/
|
|
542
|
+
type?: NoteTypeWithLiterals;
|
|
543
|
+
/**
|
|
544
|
+
* Information about who created the note.
|
|
545
|
+
* @readonly
|
|
546
|
+
*/
|
|
547
|
+
source?: NoteSource;
|
|
548
|
+
}
|
|
549
|
+
/**
|
|
550
|
+
* Deletes a note.
|
|
551
|
+
* @param noteId - Note ID.
|
|
552
|
+
* @public
|
|
553
|
+
* @documentationMaturity preview
|
|
554
|
+
* @requiredField noteId
|
|
555
|
+
* @permissionId CRM_NOTES.NOTE_DELETE
|
|
556
|
+
* @applicableIdentity APP
|
|
557
|
+
* @fqn wix.crm.notes.v2.Notes.DeleteNote
|
|
558
|
+
*/
|
|
559
|
+
declare function deleteNote(noteId: string): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.
|
|
562
|
+
*
|
|
563
|
+
* <blockquote class="important">
|
|
564
|
+
*
|
|
565
|
+
* __Important:__
|
|
566
|
+
* When making the first query request without a cursor, the `contactId` field is required. For subsequent requests using cursor pagination, `contactId` becomes optional as the cursor contains the context from the previous query.
|
|
567
|
+
*
|
|
568
|
+
* </blockquote>
|
|
569
|
+
*
|
|
570
|
+
* By default, notes are sorted by created date in descending order.
|
|
571
|
+
*
|
|
572
|
+
* Refer to [*Notes: Supported Filters and Sorting*](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/notes/notes-v2/supported-filters-and-sorting) for a complete list of supported filters and sorting options.
|
|
573
|
+
*
|
|
574
|
+
* To learn about working with *Query* endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).
|
|
575
|
+
* @public
|
|
576
|
+
* @documentationMaturity preview
|
|
577
|
+
* @permissionId CRM_NOTES.NOTE_READ
|
|
578
|
+
* @applicableIdentity APP
|
|
579
|
+
* @fqn wix.crm.notes.v2.Notes.QueryNotes
|
|
580
|
+
*/
|
|
581
|
+
declare function queryNotes(options?: QueryNotesOptions): NotesQueryBuilder;
|
|
582
|
+
interface QueryNotesOptions {
|
|
583
|
+
/**
|
|
584
|
+
* Contact ID to retrieve notes for. Required when not using cursor pagination.
|
|
585
|
+
* @format GUID
|
|
586
|
+
*/
|
|
587
|
+
contactId?: string | null | undefined;
|
|
588
|
+
}
|
|
589
|
+
interface QueryCursorResult {
|
|
590
|
+
cursors: Cursors;
|
|
591
|
+
hasNext: () => boolean;
|
|
592
|
+
hasPrev: () => boolean;
|
|
593
|
+
length: number;
|
|
594
|
+
pageSize: number;
|
|
595
|
+
}
|
|
596
|
+
interface NotesQueryResult extends QueryCursorResult {
|
|
597
|
+
items: Note[];
|
|
598
|
+
query: NotesQueryBuilder;
|
|
599
|
+
next: () => Promise<NotesQueryResult>;
|
|
600
|
+
prev: () => Promise<NotesQueryResult>;
|
|
601
|
+
}
|
|
602
|
+
interface NotesQueryBuilder {
|
|
603
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
604
|
+
* @param value - Value to compare against.
|
|
605
|
+
* @documentationMaturity preview
|
|
606
|
+
*/
|
|
607
|
+
eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'contactId' | 'type', value: any) => NotesQueryBuilder;
|
|
608
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
609
|
+
* @param value - Value to compare against.
|
|
610
|
+
* @documentationMaturity preview
|
|
611
|
+
*/
|
|
612
|
+
ne: (propertyName: '_createdDate' | '_updatedDate' | 'type', value: any) => NotesQueryBuilder;
|
|
613
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
614
|
+
* @param value - Value to compare against.
|
|
615
|
+
* @documentationMaturity preview
|
|
616
|
+
*/
|
|
617
|
+
ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => NotesQueryBuilder;
|
|
618
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
619
|
+
* @param value - Value to compare against.
|
|
620
|
+
* @documentationMaturity preview
|
|
621
|
+
*/
|
|
622
|
+
gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => NotesQueryBuilder;
|
|
623
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
624
|
+
* @param value - Value to compare against.
|
|
625
|
+
* @documentationMaturity preview
|
|
626
|
+
*/
|
|
627
|
+
le: (propertyName: '_createdDate' | '_updatedDate', value: any) => NotesQueryBuilder;
|
|
628
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
629
|
+
* @param value - Value to compare against.
|
|
630
|
+
* @documentationMaturity preview
|
|
631
|
+
*/
|
|
632
|
+
lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => NotesQueryBuilder;
|
|
633
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
634
|
+
* @param values - List of values to compare against.
|
|
635
|
+
* @documentationMaturity preview
|
|
636
|
+
*/
|
|
637
|
+
hasSome: (propertyName: '_createdDate' | '_updatedDate', value: any[]) => NotesQueryBuilder;
|
|
638
|
+
/** @documentationMaturity preview */
|
|
639
|
+
in: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'contactId' | 'type', value: any) => NotesQueryBuilder;
|
|
640
|
+
/** @documentationMaturity preview */
|
|
641
|
+
exists: (propertyName: '_createdDate' | '_updatedDate', value: boolean) => NotesQueryBuilder;
|
|
642
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
643
|
+
* @documentationMaturity preview
|
|
644
|
+
*/
|
|
645
|
+
ascending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => NotesQueryBuilder;
|
|
646
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
647
|
+
* @documentationMaturity preview
|
|
648
|
+
*/
|
|
649
|
+
descending: (...propertyNames: Array<'_createdDate' | '_updatedDate'>) => NotesQueryBuilder;
|
|
650
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
651
|
+
* @documentationMaturity preview
|
|
652
|
+
*/
|
|
653
|
+
limit: (limit: number) => NotesQueryBuilder;
|
|
654
|
+
/** @param cursor - A pointer to specific record
|
|
655
|
+
* @documentationMaturity preview
|
|
656
|
+
*/
|
|
657
|
+
skipTo: (cursor: string) => NotesQueryBuilder;
|
|
658
|
+
/** @documentationMaturity preview */
|
|
659
|
+
find: () => Promise<NotesQueryResult>;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export { type ActionEvent, type BaseEventMetadata, type CreateNoteRequest, type CreateNoteResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteNoteRequest, type DeleteNoteResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetNoteRequest, type GetNoteResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type Note, type NoteCreatedEnvelope, type NoteDeletedEnvelope, type NoteSource, NoteType, type NoteTypeWithLiterals, type NoteUpdatedEnvelope, type NotesQueryBuilder, type NotesQueryResult, type QueryNotesApplicationErrors, type QueryNotesOptions, type QueryNotesRequest, type QueryNotesResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, SourceType, type SourceTypeWithLiterals, type UpdateNote, type UpdateNoteRequest, type UpdateNoteResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createNote, deleteNote, getNote, onNoteCreated, onNoteDeleted, onNoteUpdated, queryNotes, updateNote };
|