@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,236 @@
|
|
|
1
|
+
import { CreateNoteRequest as CreateNoteRequest$1, CreateNoteResponse as CreateNoteResponse$1, GetNoteRequest as GetNoteRequest$1, GetNoteResponse as GetNoteResponse$1, UpdateNoteRequest as UpdateNoteRequest$1, UpdateNoteResponse as UpdateNoteResponse$1, DeleteNoteRequest as DeleteNoteRequest$1, DeleteNoteResponse as DeleteNoteResponse$1, QueryNotesRequest as QueryNotesRequest$1, QueryNotesResponse as QueryNotesResponse$1 } from './index.typings.js';
|
|
2
|
+
import '@wix/sdk-types';
|
|
3
|
+
|
|
4
|
+
/** A note contains textual information associated with a contact. */
|
|
5
|
+
interface Note {
|
|
6
|
+
/**
|
|
7
|
+
* Note ID.
|
|
8
|
+
* @format GUID
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
11
|
+
id?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Revision number, which increments by 1 each time the note is updated.
|
|
14
|
+
* To prevent conflicting changes, the current revision must be passed when updating the note.
|
|
15
|
+
* @readonly
|
|
16
|
+
*/
|
|
17
|
+
revision?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Date and time the note was created.
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
createdDate?: Date | null;
|
|
23
|
+
/**
|
|
24
|
+
* Date and time the note was last updated.
|
|
25
|
+
* @readonly
|
|
26
|
+
*/
|
|
27
|
+
updatedDate?: Date | null;
|
|
28
|
+
/**
|
|
29
|
+
* Contact ID associated with the note.
|
|
30
|
+
* @format GUID
|
|
31
|
+
* @immutable
|
|
32
|
+
*/
|
|
33
|
+
contactId?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* Note text.
|
|
36
|
+
* @maxLength 2048
|
|
37
|
+
*/
|
|
38
|
+
text?: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* Note type for organizing notes by their purpose.
|
|
41
|
+
*
|
|
42
|
+
* Default: `NOT_SET`
|
|
43
|
+
*/
|
|
44
|
+
type?: NoteTypeWithLiterals;
|
|
45
|
+
/**
|
|
46
|
+
* Information about who created the note.
|
|
47
|
+
* @readonly
|
|
48
|
+
*/
|
|
49
|
+
source?: NoteSource;
|
|
50
|
+
}
|
|
51
|
+
declare enum NoteType {
|
|
52
|
+
/** Unknown note type. */
|
|
53
|
+
UNKNOWN_TYPE = "UNKNOWN_TYPE",
|
|
54
|
+
/** Note doesn't have a specific classification. */
|
|
55
|
+
NOT_SET = "NOT_SET",
|
|
56
|
+
/** Note is a summary of a meeting related to the contact. */
|
|
57
|
+
MEETING_SUMMARY = "MEETING_SUMMARY",
|
|
58
|
+
/** Note is a summary of a call related to the contact. */
|
|
59
|
+
CALL_SUMMARY = "CALL_SUMMARY"
|
|
60
|
+
}
|
|
61
|
+
/** @enumType */
|
|
62
|
+
type NoteTypeWithLiterals = NoteType | 'UNKNOWN_TYPE' | 'NOT_SET' | 'MEETING_SUMMARY' | 'CALL_SUMMARY';
|
|
63
|
+
interface NoteSource {
|
|
64
|
+
/**
|
|
65
|
+
* Note creator.
|
|
66
|
+
* @readonly
|
|
67
|
+
*/
|
|
68
|
+
sourceType?: SourceTypeWithLiterals;
|
|
69
|
+
/**
|
|
70
|
+
* App ID, if the note was created by an app.
|
|
71
|
+
* @format GUID
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
74
|
+
appId?: string | null;
|
|
75
|
+
/**
|
|
76
|
+
* User ID, if the note was created by a Wix user.
|
|
77
|
+
* @format GUID
|
|
78
|
+
* @readonly
|
|
79
|
+
*/
|
|
80
|
+
userId?: string | null;
|
|
81
|
+
}
|
|
82
|
+
/** Note creator. */
|
|
83
|
+
declare enum SourceType {
|
|
84
|
+
UNKNOWN_SOURCE_TYPE = "UNKNOWN_SOURCE_TYPE",
|
|
85
|
+
APP = "APP",
|
|
86
|
+
USER = "USER"
|
|
87
|
+
}
|
|
88
|
+
/** @enumType */
|
|
89
|
+
type SourceTypeWithLiterals = SourceType | 'UNKNOWN_SOURCE_TYPE' | 'APP' | 'USER';
|
|
90
|
+
interface CreateNoteRequest {
|
|
91
|
+
/** Note to create. */
|
|
92
|
+
note: Note;
|
|
93
|
+
}
|
|
94
|
+
interface CreateNoteResponse {
|
|
95
|
+
/** Created note. */
|
|
96
|
+
note?: Note;
|
|
97
|
+
}
|
|
98
|
+
interface GetNoteRequest {
|
|
99
|
+
/**
|
|
100
|
+
* Note ID.
|
|
101
|
+
* @format GUID
|
|
102
|
+
*/
|
|
103
|
+
noteId: string;
|
|
104
|
+
}
|
|
105
|
+
interface GetNoteResponse {
|
|
106
|
+
/** Retrieved note. */
|
|
107
|
+
note?: Note;
|
|
108
|
+
}
|
|
109
|
+
interface UpdateNoteRequest {
|
|
110
|
+
/** Note to update. */
|
|
111
|
+
note: Note;
|
|
112
|
+
}
|
|
113
|
+
interface UpdateNoteResponse {
|
|
114
|
+
/** Updated note. */
|
|
115
|
+
note?: Note;
|
|
116
|
+
}
|
|
117
|
+
interface DeleteNoteRequest {
|
|
118
|
+
/**
|
|
119
|
+
* Note ID.
|
|
120
|
+
* @format GUID
|
|
121
|
+
*/
|
|
122
|
+
noteId: string;
|
|
123
|
+
}
|
|
124
|
+
interface DeleteNoteResponse {
|
|
125
|
+
}
|
|
126
|
+
interface QueryNotesRequest {
|
|
127
|
+
/**
|
|
128
|
+
* WQL query object.
|
|
129
|
+
*
|
|
130
|
+
* For more information, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language).
|
|
131
|
+
*/
|
|
132
|
+
query?: CursorQuery;
|
|
133
|
+
/**
|
|
134
|
+
* Contact ID to retrieve notes for. Required when not using cursor pagination.
|
|
135
|
+
* @format GUID
|
|
136
|
+
*/
|
|
137
|
+
contactId?: string | null;
|
|
138
|
+
}
|
|
139
|
+
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
140
|
+
/** 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`. */
|
|
141
|
+
cursorPaging?: CursorPaging;
|
|
142
|
+
/**
|
|
143
|
+
* Filter object in the following format:
|
|
144
|
+
* `"filter" : {
|
|
145
|
+
* "fieldName1": "value1",
|
|
146
|
+
* "fieldName2":{"$operator":"value2"}
|
|
147
|
+
* }`
|
|
148
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
149
|
+
*/
|
|
150
|
+
filter?: Record<string, any> | null;
|
|
151
|
+
/**
|
|
152
|
+
* Sort object in the following format:
|
|
153
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
154
|
+
*/
|
|
155
|
+
sort?: Sorting[];
|
|
156
|
+
}
|
|
157
|
+
/** @oneof */
|
|
158
|
+
interface CursorQueryPagingMethodOneOf {
|
|
159
|
+
/** 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`. */
|
|
160
|
+
cursorPaging?: CursorPaging;
|
|
161
|
+
}
|
|
162
|
+
interface Sorting {
|
|
163
|
+
/** Name of the field to sort by. */
|
|
164
|
+
fieldName?: string;
|
|
165
|
+
/** Sort order. */
|
|
166
|
+
order?: SortOrderWithLiterals;
|
|
167
|
+
}
|
|
168
|
+
declare enum SortOrder {
|
|
169
|
+
ASC = "ASC",
|
|
170
|
+
DESC = "DESC"
|
|
171
|
+
}
|
|
172
|
+
/** @enumType */
|
|
173
|
+
type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';
|
|
174
|
+
interface CursorPaging {
|
|
175
|
+
/**
|
|
176
|
+
* Number of items to load.
|
|
177
|
+
* @max 1000
|
|
178
|
+
*/
|
|
179
|
+
limit?: number | null;
|
|
180
|
+
/**
|
|
181
|
+
* Pointer to the next or previous page in the list of results.
|
|
182
|
+
*
|
|
183
|
+
* You can get the relevant cursor token
|
|
184
|
+
* from the `pagingMetadata` object in the previous call's response.
|
|
185
|
+
* Not relevant for the first request.
|
|
186
|
+
*/
|
|
187
|
+
cursor?: string | null;
|
|
188
|
+
}
|
|
189
|
+
interface QueryNotesResponse {
|
|
190
|
+
/** Retrieved notes. */
|
|
191
|
+
notes?: Note[];
|
|
192
|
+
/** Paging information. */
|
|
193
|
+
pagingMetadata?: CursorPagingMetadata;
|
|
194
|
+
}
|
|
195
|
+
interface CursorPagingMetadata {
|
|
196
|
+
/** Number of items returned in the response. */
|
|
197
|
+
count?: number | null;
|
|
198
|
+
/** Offset that was requested. */
|
|
199
|
+
cursors?: Cursors;
|
|
200
|
+
/**
|
|
201
|
+
* Indicates if there are more results after the current page.
|
|
202
|
+
* If `true`, another page of results can be retrieved.
|
|
203
|
+
* If `false`, this is the last page.
|
|
204
|
+
*/
|
|
205
|
+
hasNext?: boolean | null;
|
|
206
|
+
}
|
|
207
|
+
interface Cursors {
|
|
208
|
+
/** Cursor pointing to next page in the list of results. */
|
|
209
|
+
next?: string | null;
|
|
210
|
+
/** Cursor pointing to previous page in the list of results. */
|
|
211
|
+
prev?: string | null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
|
|
215
|
+
getUrl: (context: any) => string;
|
|
216
|
+
httpMethod: K;
|
|
217
|
+
path: string;
|
|
218
|
+
pathParams: M;
|
|
219
|
+
__requestType: T;
|
|
220
|
+
__originalRequestType: S;
|
|
221
|
+
__responseType: Q;
|
|
222
|
+
__originalResponseType: R;
|
|
223
|
+
};
|
|
224
|
+
declare function createNote(): __PublicMethodMetaInfo<'POST', {}, CreateNoteRequest$1, CreateNoteRequest, CreateNoteResponse$1, CreateNoteResponse>;
|
|
225
|
+
declare function getNote(): __PublicMethodMetaInfo<'GET', {
|
|
226
|
+
noteId: string;
|
|
227
|
+
}, GetNoteRequest$1, GetNoteRequest, GetNoteResponse$1, GetNoteResponse>;
|
|
228
|
+
declare function updateNote(): __PublicMethodMetaInfo<'PATCH', {
|
|
229
|
+
noteId: string;
|
|
230
|
+
}, UpdateNoteRequest$1, UpdateNoteRequest, UpdateNoteResponse$1, UpdateNoteResponse>;
|
|
231
|
+
declare function deleteNote(): __PublicMethodMetaInfo<'DELETE', {
|
|
232
|
+
noteId: string;
|
|
233
|
+
}, DeleteNoteRequest$1, DeleteNoteRequest, DeleteNoteResponse$1, DeleteNoteResponse>;
|
|
234
|
+
declare function queryNotes(): __PublicMethodMetaInfo<'POST', {}, QueryNotesRequest$1, QueryNotesRequest, QueryNotesResponse$1, QueryNotesResponse>;
|
|
235
|
+
|
|
236
|
+
export { type __PublicMethodMetaInfo, createNote, deleteNote, getNote, queryNotes, updateNote };
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// meta.ts
|
|
21
|
+
var meta_exports = {};
|
|
22
|
+
__export(meta_exports, {
|
|
23
|
+
createNote: () => createNote2,
|
|
24
|
+
deleteNote: () => deleteNote2,
|
|
25
|
+
getNote: () => getNote2,
|
|
26
|
+
queryNotes: () => queryNotes2,
|
|
27
|
+
updateNote: () => updateNote2
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(meta_exports);
|
|
30
|
+
|
|
31
|
+
// src/crm-notes-v2-note-notes.http.ts
|
|
32
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
33
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
34
|
+
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
35
|
+
var import_field_mask = require("@wix/sdk-runtime/transformations/field-mask");
|
|
36
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
37
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
38
|
+
function resolveWixCrmNotesV2NotesUrl(opts) {
|
|
39
|
+
const domainToMappings = {
|
|
40
|
+
"manage._base_domain_": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/_api/notes-app/v2/notes",
|
|
43
|
+
destPath: "/v2/notes"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"www.wixapis.com": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/crm/notes/v2/notes",
|
|
49
|
+
destPath: "/v2/notes"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
_: [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/notes-app/v2/notes",
|
|
55
|
+
destPath: "/v2/notes"
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
"*.dev.wix-code.com": [
|
|
59
|
+
{
|
|
60
|
+
srcPath: "/_api/notes-app/v2/notes",
|
|
61
|
+
destPath: "/v2/notes"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
};
|
|
65
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
66
|
+
}
|
|
67
|
+
var PACKAGE_NAME = "@wix/auto_sdk_crm_notes";
|
|
68
|
+
function createNote(payload) {
|
|
69
|
+
function __createNote({ host }) {
|
|
70
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
71
|
+
{
|
|
72
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
73
|
+
paths: [{ path: "note.createdDate" }, { path: "note.updatedDate" }]
|
|
74
|
+
}
|
|
75
|
+
]);
|
|
76
|
+
const metadata = {
|
|
77
|
+
entityFqdn: "wix.crm.notes.v2.note",
|
|
78
|
+
method: "POST",
|
|
79
|
+
methodFqn: "wix.crm.notes.v2.Notes.CreateNote",
|
|
80
|
+
packageName: PACKAGE_NAME,
|
|
81
|
+
url: resolveWixCrmNotesV2NotesUrl({
|
|
82
|
+
protoPath: "/v2/notes",
|
|
83
|
+
data: serializedData,
|
|
84
|
+
host
|
|
85
|
+
}),
|
|
86
|
+
data: serializedData,
|
|
87
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
88
|
+
{
|
|
89
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
90
|
+
paths: [{ path: "note.createdDate" }, { path: "note.updatedDate" }]
|
|
91
|
+
}
|
|
92
|
+
])
|
|
93
|
+
};
|
|
94
|
+
return metadata;
|
|
95
|
+
}
|
|
96
|
+
return __createNote;
|
|
97
|
+
}
|
|
98
|
+
function getNote(payload) {
|
|
99
|
+
function __getNote({ host }) {
|
|
100
|
+
const metadata = {
|
|
101
|
+
entityFqdn: "wix.crm.notes.v2.note",
|
|
102
|
+
method: "GET",
|
|
103
|
+
methodFqn: "wix.crm.notes.v2.Notes.GetNote",
|
|
104
|
+
packageName: PACKAGE_NAME,
|
|
105
|
+
url: resolveWixCrmNotesV2NotesUrl({
|
|
106
|
+
protoPath: "/v2/notes/{noteId}",
|
|
107
|
+
data: payload,
|
|
108
|
+
host
|
|
109
|
+
}),
|
|
110
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
111
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
112
|
+
{
|
|
113
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
114
|
+
paths: [{ path: "note.createdDate" }, { path: "note.updatedDate" }]
|
|
115
|
+
}
|
|
116
|
+
])
|
|
117
|
+
};
|
|
118
|
+
return metadata;
|
|
119
|
+
}
|
|
120
|
+
return __getNote;
|
|
121
|
+
}
|
|
122
|
+
function updateNote(payload) {
|
|
123
|
+
function __updateNote({ host }) {
|
|
124
|
+
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
125
|
+
{
|
|
126
|
+
transformFn: import_field_mask.transformSDKFieldMaskToRESTFieldMask,
|
|
127
|
+
paths: [{ path: "mask" }]
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
131
|
+
paths: [{ path: "note.createdDate" }, { path: "note.updatedDate" }]
|
|
132
|
+
}
|
|
133
|
+
]);
|
|
134
|
+
const metadata = {
|
|
135
|
+
entityFqdn: "wix.crm.notes.v2.note",
|
|
136
|
+
method: "PATCH",
|
|
137
|
+
methodFqn: "wix.crm.notes.v2.Notes.UpdateNote",
|
|
138
|
+
packageName: PACKAGE_NAME,
|
|
139
|
+
url: resolveWixCrmNotesV2NotesUrl({
|
|
140
|
+
protoPath: "/v2/notes/{note.id}",
|
|
141
|
+
data: serializedData,
|
|
142
|
+
host
|
|
143
|
+
}),
|
|
144
|
+
data: serializedData,
|
|
145
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
146
|
+
{
|
|
147
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
148
|
+
paths: [{ path: "note.createdDate" }, { path: "note.updatedDate" }]
|
|
149
|
+
}
|
|
150
|
+
])
|
|
151
|
+
};
|
|
152
|
+
return metadata;
|
|
153
|
+
}
|
|
154
|
+
return __updateNote;
|
|
155
|
+
}
|
|
156
|
+
function deleteNote(payload) {
|
|
157
|
+
function __deleteNote({ host }) {
|
|
158
|
+
const metadata = {
|
|
159
|
+
entityFqdn: "wix.crm.notes.v2.note",
|
|
160
|
+
method: "DELETE",
|
|
161
|
+
methodFqn: "wix.crm.notes.v2.Notes.DeleteNote",
|
|
162
|
+
packageName: PACKAGE_NAME,
|
|
163
|
+
url: resolveWixCrmNotesV2NotesUrl({
|
|
164
|
+
protoPath: "/v2/notes/{noteId}",
|
|
165
|
+
data: payload,
|
|
166
|
+
host
|
|
167
|
+
}),
|
|
168
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload)
|
|
169
|
+
};
|
|
170
|
+
return metadata;
|
|
171
|
+
}
|
|
172
|
+
return __deleteNote;
|
|
173
|
+
}
|
|
174
|
+
function queryNotes(payload) {
|
|
175
|
+
function __queryNotes({ host }) {
|
|
176
|
+
const metadata = {
|
|
177
|
+
entityFqdn: "wix.crm.notes.v2.note",
|
|
178
|
+
method: "POST",
|
|
179
|
+
methodFqn: "wix.crm.notes.v2.Notes.QueryNotes",
|
|
180
|
+
packageName: PACKAGE_NAME,
|
|
181
|
+
url: resolveWixCrmNotesV2NotesUrl({
|
|
182
|
+
protoPath: "/v2/notes/query",
|
|
183
|
+
data: payload,
|
|
184
|
+
host
|
|
185
|
+
}),
|
|
186
|
+
data: payload,
|
|
187
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
188
|
+
{
|
|
189
|
+
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
190
|
+
paths: [
|
|
191
|
+
{ path: "notes.createdDate" },
|
|
192
|
+
{ path: "notes.updatedDate" }
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
])
|
|
196
|
+
};
|
|
197
|
+
return metadata;
|
|
198
|
+
}
|
|
199
|
+
return __queryNotes;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/crm-notes-v2-note-notes.meta.ts
|
|
203
|
+
function createNote2() {
|
|
204
|
+
const payload = {};
|
|
205
|
+
const getRequestOptions = createNote(payload);
|
|
206
|
+
const getUrl = (context) => {
|
|
207
|
+
const { url } = getRequestOptions(context);
|
|
208
|
+
return url;
|
|
209
|
+
};
|
|
210
|
+
return {
|
|
211
|
+
getUrl,
|
|
212
|
+
httpMethod: "POST",
|
|
213
|
+
path: "/v2/notes",
|
|
214
|
+
pathParams: {},
|
|
215
|
+
__requestType: null,
|
|
216
|
+
__originalRequestType: null,
|
|
217
|
+
__responseType: null,
|
|
218
|
+
__originalResponseType: null
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function getNote2() {
|
|
222
|
+
const payload = { noteId: ":noteId" };
|
|
223
|
+
const getRequestOptions = getNote(payload);
|
|
224
|
+
const getUrl = (context) => {
|
|
225
|
+
const { url } = getRequestOptions(context);
|
|
226
|
+
return url;
|
|
227
|
+
};
|
|
228
|
+
return {
|
|
229
|
+
getUrl,
|
|
230
|
+
httpMethod: "GET",
|
|
231
|
+
path: "/v2/notes/{noteId}",
|
|
232
|
+
pathParams: { noteId: "noteId" },
|
|
233
|
+
__requestType: null,
|
|
234
|
+
__originalRequestType: null,
|
|
235
|
+
__responseType: null,
|
|
236
|
+
__originalResponseType: null
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
function updateNote2() {
|
|
240
|
+
const payload = { note: { id: ":noteId" } };
|
|
241
|
+
const getRequestOptions = updateNote(payload);
|
|
242
|
+
const getUrl = (context) => {
|
|
243
|
+
const { url } = getRequestOptions(context);
|
|
244
|
+
return url;
|
|
245
|
+
};
|
|
246
|
+
return {
|
|
247
|
+
getUrl,
|
|
248
|
+
httpMethod: "PATCH",
|
|
249
|
+
path: "/v2/notes/{note.id}",
|
|
250
|
+
pathParams: { noteId: "noteId" },
|
|
251
|
+
__requestType: null,
|
|
252
|
+
__originalRequestType: null,
|
|
253
|
+
__responseType: null,
|
|
254
|
+
__originalResponseType: null
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function deleteNote2() {
|
|
258
|
+
const payload = { noteId: ":noteId" };
|
|
259
|
+
const getRequestOptions = deleteNote(payload);
|
|
260
|
+
const getUrl = (context) => {
|
|
261
|
+
const { url } = getRequestOptions(context);
|
|
262
|
+
return url;
|
|
263
|
+
};
|
|
264
|
+
return {
|
|
265
|
+
getUrl,
|
|
266
|
+
httpMethod: "DELETE",
|
|
267
|
+
path: "/v2/notes/{noteId}",
|
|
268
|
+
pathParams: { noteId: "noteId" },
|
|
269
|
+
__requestType: null,
|
|
270
|
+
__originalRequestType: null,
|
|
271
|
+
__responseType: null,
|
|
272
|
+
__originalResponseType: null
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function queryNotes2() {
|
|
276
|
+
const payload = {};
|
|
277
|
+
const getRequestOptions = queryNotes(payload);
|
|
278
|
+
const getUrl = (context) => {
|
|
279
|
+
const { url } = getRequestOptions(context);
|
|
280
|
+
return url;
|
|
281
|
+
};
|
|
282
|
+
return {
|
|
283
|
+
getUrl,
|
|
284
|
+
httpMethod: "POST",
|
|
285
|
+
path: "/v2/notes/query",
|
|
286
|
+
pathParams: {},
|
|
287
|
+
__requestType: null,
|
|
288
|
+
__originalRequestType: null,
|
|
289
|
+
__responseType: null,
|
|
290
|
+
__originalResponseType: null
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
294
|
+
0 && (module.exports = {
|
|
295
|
+
createNote,
|
|
296
|
+
deleteNote,
|
|
297
|
+
getNote,
|
|
298
|
+
queryNotes,
|
|
299
|
+
updateNote
|
|
300
|
+
});
|
|
301
|
+
//# sourceMappingURL=meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/crm-notes-v2-note-notes.http.ts","../../src/crm-notes-v2-note-notes.meta.ts"],"sourcesContent":["export * from './src/crm-notes-v2-note-notes.meta.js';\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 resolveWixCrmNotesV2NotesUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/notes-app/v2/notes',\n destPath: '/v2/notes',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/crm/notes/v2/notes',\n destPath: '/v2/notes',\n },\n ],\n _: [\n {\n srcPath: '/_api/notes-app/v2/notes',\n destPath: '/v2/notes',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/notes-app/v2/notes',\n destPath: '/v2/notes',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_notes';\n\n/** Creates a new note associated with a specific contact. */\nexport function createNote(payload: object): RequestOptionsFactory<any> {\n function __createNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.CreateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createNote;\n}\n\n/** Retrieves a note by ID. */\nexport function getNote(payload: object): RequestOptionsFactory<any> {\n function __getNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'GET' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.GetNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getNote;\n}\n\n/**\n * Updates a note.\n *\n * This method supports partial updates.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n */\nexport function updateNote(payload: object): RequestOptionsFactory<any> {\n function __updateNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.UpdateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{note.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateNote;\n}\n\n/** Deletes a note. */\nexport function deleteNote(payload: object): RequestOptionsFactory<any> {\n function __deleteNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.DeleteNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteNote;\n}\n\n/**\n * Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.\n *\n * <blockquote class=\"important\">\n *\n * __Important:__\n * 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.\n *\n * </blockquote>\n *\n * By default, notes are sorted by created date in descending order.\n *\n * 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.\n *\n * 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).\n */\nexport function queryNotes(payload: object): RequestOptionsFactory<any> {\n function __queryNotes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.QueryNotes',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/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: 'notes.createdDate' },\n { path: 'notes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryNotes;\n}\n","import * as ambassadorWixCrmNotesV2Note from './crm-notes-v2-note-notes.http.js';\nimport * as ambassadorWixCrmNotesV2NoteTypes from './crm-notes-v2-note-notes.types.js';\nimport * as ambassadorWixCrmNotesV2NoteUniversalTypes from './crm-notes-v2-note-notes.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function createNote(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixCrmNotesV2NoteUniversalTypes.CreateNoteRequest,\n ambassadorWixCrmNotesV2NoteTypes.CreateNoteRequest,\n ambassadorWixCrmNotesV2NoteUniversalTypes.CreateNoteResponse,\n ambassadorWixCrmNotesV2NoteTypes.CreateNoteResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixCrmNotesV2Note.createNote(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notes',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getNote(): __PublicMethodMetaInfo<\n 'GET',\n { noteId: string },\n ambassadorWixCrmNotesV2NoteUniversalTypes.GetNoteRequest,\n ambassadorWixCrmNotesV2NoteTypes.GetNoteRequest,\n ambassadorWixCrmNotesV2NoteUniversalTypes.GetNoteResponse,\n ambassadorWixCrmNotesV2NoteTypes.GetNoteResponse\n> {\n const payload = { noteId: ':noteId' } as any;\n\n const getRequestOptions = ambassadorWixCrmNotesV2Note.getNote(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/notes/{noteId}',\n pathParams: { noteId: 'noteId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateNote(): __PublicMethodMetaInfo<\n 'PATCH',\n { noteId: string },\n ambassadorWixCrmNotesV2NoteUniversalTypes.UpdateNoteRequest,\n ambassadorWixCrmNotesV2NoteTypes.UpdateNoteRequest,\n ambassadorWixCrmNotesV2NoteUniversalTypes.UpdateNoteResponse,\n ambassadorWixCrmNotesV2NoteTypes.UpdateNoteResponse\n> {\n const payload = { note: { id: ':noteId' } } as any;\n\n const getRequestOptions = ambassadorWixCrmNotesV2Note.updateNote(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/notes/{note.id}',\n pathParams: { noteId: 'noteId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function deleteNote(): __PublicMethodMetaInfo<\n 'DELETE',\n { noteId: string },\n ambassadorWixCrmNotesV2NoteUniversalTypes.DeleteNoteRequest,\n ambassadorWixCrmNotesV2NoteTypes.DeleteNoteRequest,\n ambassadorWixCrmNotesV2NoteUniversalTypes.DeleteNoteResponse,\n ambassadorWixCrmNotesV2NoteTypes.DeleteNoteResponse\n> {\n const payload = { noteId: ':noteId' } as any;\n\n const getRequestOptions = ambassadorWixCrmNotesV2Note.deleteNote(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'DELETE',\n path: '/v2/notes/{noteId}',\n pathParams: { noteId: 'noteId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function queryNotes(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixCrmNotesV2NoteUniversalTypes.QueryNotesRequest,\n ambassadorWixCrmNotesV2NoteTypes.QueryNotesRequest,\n ambassadorWixCrmNotesV2NoteUniversalTypes.QueryNotesResponse,\n ambassadorWixCrmNotesV2NoteTypes.QueryNotesResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions = ambassadorWixCrmNotesV2Note.queryNotes(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v2/notes/query',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __respon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,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,cAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAAgD,WAAW,OAAO;AAExE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["createNote","deleteNote","getNote","queryNotes","updateNote","import_timestamp","import_rest_modules","payload","createNote","getNote","updateNote","deleteNote","queryNotes"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
|
+
import { Note, UpdateNote, QueryNotesOptions, NotesQueryBuilder, NoteCreatedEnvelope, NoteDeletedEnvelope, NoteUpdatedEnvelope } from './index.typings.mjs';
|
|
3
|
+
export { ActionEvent, BaseEventMetadata, CreateNoteRequest, CreateNoteResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteNoteRequest, DeleteNoteResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetNoteRequest, GetNoteResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, NoteSource, NoteType, NoteTypeWithLiterals, NotesQueryResult, QueryNotesApplicationErrors, QueryNotesRequest, QueryNotesResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, SourceType, SourceTypeWithLiterals, UpdateNoteRequest, UpdateNoteResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
|
|
4
|
+
|
|
5
|
+
declare function createNote$1(httpClient: HttpClient): CreateNoteSignature;
|
|
6
|
+
interface CreateNoteSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new note associated with a specific contact.
|
|
9
|
+
* @param - Note to create.
|
|
10
|
+
* @returns Created note.
|
|
11
|
+
*/
|
|
12
|
+
(note: NonNullablePaths<Note, `contactId`, 2>): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
13
|
+
}
|
|
14
|
+
declare function getNote$1(httpClient: HttpClient): GetNoteSignature;
|
|
15
|
+
interface GetNoteSignature {
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves a note by ID.
|
|
18
|
+
* @param - Note ID.
|
|
19
|
+
* @returns Retrieved note.
|
|
20
|
+
*/
|
|
21
|
+
(noteId: string): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
22
|
+
}
|
|
23
|
+
declare function updateNote$1(httpClient: HttpClient): UpdateNoteSignature;
|
|
24
|
+
interface UpdateNoteSignature {
|
|
25
|
+
/**
|
|
26
|
+
* Updates a note.
|
|
27
|
+
*
|
|
28
|
+
* This method supports partial updates.
|
|
29
|
+
* To prevent conflicting changes, the current revision must be passed when updating the note.
|
|
30
|
+
* @param - Note ID.
|
|
31
|
+
* @returns Updated note.
|
|
32
|
+
*/
|
|
33
|
+
(_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>>;
|
|
34
|
+
}
|
|
35
|
+
declare function deleteNote$1(httpClient: HttpClient): DeleteNoteSignature;
|
|
36
|
+
interface DeleteNoteSignature {
|
|
37
|
+
/**
|
|
38
|
+
* Deletes a note.
|
|
39
|
+
* @param - Note ID.
|
|
40
|
+
*/
|
|
41
|
+
(noteId: string): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
declare function queryNotes$1(httpClient: HttpClient): QueryNotesSignature;
|
|
44
|
+
interface QueryNotesSignature {
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.
|
|
47
|
+
*
|
|
48
|
+
* <blockquote class="important">
|
|
49
|
+
*
|
|
50
|
+
* __Important:__
|
|
51
|
+
* 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.
|
|
52
|
+
*
|
|
53
|
+
* </blockquote>
|
|
54
|
+
*
|
|
55
|
+
* By default, notes are sorted by created date in descending order.
|
|
56
|
+
*
|
|
57
|
+
* 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.
|
|
58
|
+
*
|
|
59
|
+
* 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).
|
|
60
|
+
*/
|
|
61
|
+
(options?: QueryNotesOptions): NotesQueryBuilder;
|
|
62
|
+
}
|
|
63
|
+
declare const onNoteCreated$1: EventDefinition<NoteCreatedEnvelope, "wix.crm.notes.v2.note_created">;
|
|
64
|
+
declare const onNoteDeleted$1: EventDefinition<NoteDeletedEnvelope, "wix.crm.notes.v2.note_deleted">;
|
|
65
|
+
declare const onNoteUpdated$1: EventDefinition<NoteUpdatedEnvelope, "wix.crm.notes.v2.note_updated">;
|
|
66
|
+
|
|
67
|
+
declare const createNote: MaybeContext<BuildRESTFunction<typeof createNote$1> & typeof createNote$1>;
|
|
68
|
+
declare const getNote: MaybeContext<BuildRESTFunction<typeof getNote$1> & typeof getNote$1>;
|
|
69
|
+
declare const updateNote: MaybeContext<BuildRESTFunction<typeof updateNote$1> & typeof updateNote$1>;
|
|
70
|
+
declare const deleteNote: MaybeContext<BuildRESTFunction<typeof deleteNote$1> & typeof deleteNote$1>;
|
|
71
|
+
declare const queryNotes: MaybeContext<BuildRESTFunction<typeof queryNotes$1> & typeof queryNotes$1>;
|
|
72
|
+
/**
|
|
73
|
+
* Triggered when a note is created.
|
|
74
|
+
*/
|
|
75
|
+
declare const onNoteCreated: BuildEventDefinition<typeof onNoteCreated$1>;
|
|
76
|
+
/**
|
|
77
|
+
* Triggered when a note is deleted.
|
|
78
|
+
*/
|
|
79
|
+
declare const onNoteDeleted: BuildEventDefinition<typeof onNoteDeleted$1>;
|
|
80
|
+
/**
|
|
81
|
+
* Triggered when a note is updated.
|
|
82
|
+
*/
|
|
83
|
+
declare const onNoteUpdated: BuildEventDefinition<typeof onNoteUpdated$1>;
|
|
84
|
+
|
|
85
|
+
export { Note, NoteCreatedEnvelope, NoteDeletedEnvelope, NoteUpdatedEnvelope, NotesQueryBuilder, QueryNotesOptions, UpdateNote, createNote, deleteNote, getNote, onNoteCreated, onNoteDeleted, onNoteUpdated, queryNotes, updateNote };
|