@wix/auto_sdk_crm_notes 1.0.21 → 1.0.23
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 +1 -1
- package/build/cjs/index.js +8 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +7 -1
- package/build/cjs/index.typings.js +8 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +6 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +7 -1
- package/build/es/index.typings.mjs +6 -1
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js +8 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +7 -1
- package/build/internal/cjs/index.typings.js +8 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs +6 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +7 -1
- package/build/internal/es/index.typings.mjs +6 -1
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
|
|
2
2
|
import { Note, UpdateNote, NoteCreatedEnvelope, NoteDeletedEnvelope, NoteUpdatedEnvelope, NoteQuery, QueryNotesOptions, typedQueryNotes, NotesQueryBuilder } from './index.typings.js';
|
|
3
|
-
export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, CommonQueryWithEntityContext, CreateNoteRequest, CreateNoteResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteNoteRequest, DeleteNoteResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetNoteRequest, GetNoteResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, NoteQuerySpec, NoteSource, NoteType, NoteTypeWithLiterals, NotesQueryResult, QueryNotesApplicationErrors, QueryNotesRequest, QueryNotesResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, SourceType, SourceTypeWithLiterals, UpdateNoteRequest, UpdateNoteResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, AccountInfoMetadata, ActionEvent, BaseEventMetadata, CommonQueryWithEntityContext, CreateNoteRequest, CreateNoteResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteNoteRequest, DeleteNoteResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetNoteRequest, GetNoteResponse, IdentificationData, IdentificationDataIdOneOf, MessageEnvelope, NoteQuerySpec, NoteSource, NoteType, NoteTypeWithLiterals, NotesQueryResult, QueryNotesApplicationErrors, QueryNotesRequest, QueryNotesResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, SourceType, SourceTypeWithLiterals, UpdateNoteRequest, UpdateNoteResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createNote$1(httpClient: HttpClient): CreateNoteSignature;
|
|
6
6
|
interface CreateNoteSignature {
|
package/build/cjs/index.js
CHANGED
|
@@ -31,7 +31,8 @@ __export(index_exports, {
|
|
|
31
31
|
onNoteDeleted: () => onNoteDeleted2,
|
|
32
32
|
onNoteUpdated: () => onNoteUpdated2,
|
|
33
33
|
queryNotes: () => queryNotes4,
|
|
34
|
-
updateNote: () => updateNote4
|
|
34
|
+
updateNote: () => updateNote4,
|
|
35
|
+
utils: () => utils
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(index_exports);
|
|
37
38
|
|
|
@@ -234,6 +235,7 @@ function queryNotes(payload) {
|
|
|
234
235
|
|
|
235
236
|
// src/crm-notes-v2-note-notes.universal.ts
|
|
236
237
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
238
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
237
239
|
var NoteType = /* @__PURE__ */ ((NoteType2) => {
|
|
238
240
|
NoteType2["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
239
241
|
NoteType2["NOT_SET"] = "NOT_SET";
|
|
@@ -425,6 +427,9 @@ async function typedQueryNotes(query, options) {
|
|
|
425
427
|
throw transformedError;
|
|
426
428
|
}
|
|
427
429
|
}
|
|
430
|
+
var utils = {
|
|
431
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
432
|
+
};
|
|
428
433
|
|
|
429
434
|
// src/crm-notes-v2-note-notes.public.ts
|
|
430
435
|
function createNote3(httpClient) {
|
|
@@ -556,6 +561,7 @@ var onNoteUpdated2 = (0, import_event_definition_modules.createEventModule)(onNo
|
|
|
556
561
|
onNoteDeleted,
|
|
557
562
|
onNoteUpdated,
|
|
558
563
|
queryNotes,
|
|
559
|
-
updateNote
|
|
564
|
+
updateNote,
|
|
565
|
+
utils
|
|
560
566
|
});
|
|
561
567
|
//# sourceMappingURL=index.js.map
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/crm-notes-v2-note-notes.public.ts","../../src/crm-notes-v2-note-notes.universal.ts","../../src/crm-notes-v2-note-notes.http.ts","../../src/crm-notes-v2-note-notes.context.ts"],"sourcesContent":["export * from './src/crm-notes-v2-note-notes.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Note,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteQuery,\n NoteUpdatedEnvelope,\n NotesQueryBuilder,\n QueryNotesApplicationErrors,\n QueryNotesOptions,\n QueryNotesResponse,\n UpdateNote,\n createNote as universalCreateNote,\n deleteNote as universalDeleteNote,\n getNote as universalGetNote,\n queryNotes as universalQueryNotes,\n typedQueryNotes as universalTypedQueryNotes,\n updateNote as universalUpdateNote,\n} from './crm-notes-v2-note-notes.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/crm' };\n\nexport function createNote(httpClient: HttpClient): CreateNoteSignature {\n return (note: NonNullablePaths<Note, `contactId`, 2>) =>\n universalCreateNote(\n note,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateNoteSignature {\n /**\n * Creates a new note associated with a specific contact.\n * @param - Note to create.\n * @returns Created note.\n */\n (note: NonNullablePaths<Note, `contactId`, 2>): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function getNote(httpClient: HttpClient): GetNoteSignature {\n return (noteId: string) =>\n universalGetNote(\n noteId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetNoteSignature {\n /**\n * Retrieves a note by ID.\n * @param - Note ID.\n * @returns Retrieved note.\n */\n (noteId: string): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function updateNote(httpClient: HttpClient): UpdateNoteSignature {\n return (_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>) =>\n universalUpdateNote(\n _id,\n note,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateNoteSignature {\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 * @param - Note ID.\n * @returns Updated note.\n */\n (_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function deleteNote(httpClient: HttpClient): DeleteNoteSignature {\n return (noteId: string) =>\n universalDeleteNote(\n noteId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteNoteSignature {\n /**\n * Deletes a note.\n * @param - Note ID.\n */\n (noteId: string): Promise<void>;\n}\n\nexport function queryNotes(httpClient: HttpClient): QueryNotesSignature {\n return (options?: QueryNotesOptions) =>\n universalQueryNotes(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryNotesSignature {\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 */\n (options?: QueryNotesOptions): NotesQueryBuilder;\n}\n\nexport function typedQueryNotes(\n httpClient: HttpClient\n): TypedQueryNotesSignature {\n return (query: NoteQuery, options?: QueryNotesOptions) =>\n universalTypedQueryNotes(\n query,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryNotesSignature {\n /** */\n (query: NoteQuery, options?: QueryNotesOptions): Promise<\n NonNullablePaths<\n QueryNotesResponse,\n `notes` | `notes.${number}.type` | `notes.${number}.source.sourceType`,\n 5\n > & {\n __applicationErrorsType?: QueryNotesApplicationErrors;\n }\n >;\n}\n\nexport const onNoteCreated = EventDefinition(\n 'wix.crm.notes.v2.note_created',\n true,\n (event: NoteCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteCreatedEnvelope>();\nexport const onNoteDeleted = EventDefinition(\n 'wix.crm.notes.v2.note_deleted',\n true,\n (event: NoteDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteDeletedEnvelope>();\nexport const onNoteUpdated = EventDefinition(\n 'wix.crm.notes.v2.note_updated',\n true,\n (event: NoteUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n CreateNoteRequest,\n CreateNoteResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteNoteRequest,\n DeleteNoteResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetNoteRequest,\n GetNoteResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n Note,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteQuerySpec,\n NoteSource,\n NoteType,\n NoteUpdatedEnvelope,\n NotesQueryBuilder,\n NotesQueryResult,\n QueryNotesOptions,\n QueryNotesRequest,\n QueryNotesResponse,\n RestoreInfo,\n SortOrder,\n Sorting,\n SourceType,\n UpdateNote,\n UpdateNoteRequest,\n UpdateNoteResponse,\n WebhookIdentityType,\n} from './crm-notes-v2-note-notes.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCrmNotesV2Note from './crm-notes-v2-note-notes.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\n/** A note contains textual information associated with a contact. */\nexport interface Note {\n /**\n * Note ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the note is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the note was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the note was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Contact ID associated with the note.\n * @format GUID\n * @immutable\n */\n contactId?: string | null;\n /**\n * Note text.\n * @maxLength 2048\n */\n text?: string | null;\n /**\n * Note type for organizing notes by their purpose.\n *\n * Default: `NOT_SET`\n */\n type?: NoteTypeWithLiterals;\n /**\n * Information about who created the note.\n * @readonly\n */\n source?: NoteSource;\n}\n\nexport enum NoteType {\n /** Unknown note type. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Note doesn't have a specific classification. */\n NOT_SET = 'NOT_SET',\n /** Note is a summary of a meeting related to the contact. */\n MEETING_SUMMARY = 'MEETING_SUMMARY',\n /** Note is a summary of a call related to the contact. */\n CALL_SUMMARY = 'CALL_SUMMARY',\n}\n\n/** @enumType */\nexport type NoteTypeWithLiterals =\n | NoteType\n | 'UNKNOWN_TYPE'\n | 'NOT_SET'\n | 'MEETING_SUMMARY'\n | 'CALL_SUMMARY';\n\nexport interface NoteSource {\n /**\n * Note creator.\n * @readonly\n */\n sourceType?: SourceTypeWithLiterals;\n /**\n * App ID, if the note was created by an app.\n * @format GUID\n * @readonly\n */\n appId?: string | null;\n /**\n * User ID, if the note was created by a Wix user.\n * @format GUID\n * @readonly\n */\n userId?: string | null;\n}\n\n/** Note creator. */\nexport enum SourceType {\n UNKNOWN_SOURCE_TYPE = 'UNKNOWN_SOURCE_TYPE',\n APP = 'APP',\n USER = 'USER',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals =\n | SourceType\n | 'UNKNOWN_SOURCE_TYPE'\n | 'APP'\n | 'USER';\n\nexport interface CreateNoteRequest {\n /** Note to create. */\n note: Note;\n}\n\nexport interface CreateNoteResponse {\n /** Created note. */\n note?: Note;\n}\n\nexport interface GetNoteRequest {\n /**\n * Note ID.\n * @format GUID\n */\n noteId: string;\n}\n\nexport interface GetNoteResponse {\n /** Retrieved note. */\n note?: Note;\n}\n\nexport interface UpdateNoteRequest {\n /** Note to update. */\n note: Note;\n}\n\nexport interface UpdateNoteResponse {\n /** Updated note. */\n note?: Note;\n}\n\nexport interface DeleteNoteRequest {\n /**\n * Note ID.\n * @format GUID\n */\n noteId: string;\n}\n\nexport interface DeleteNoteResponse {}\n\nexport interface QueryNotesRequest {\n /**\n * WQL query object.\n *\n * For more information, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language).\n */\n query?: CursorQuery;\n /**\n * Contact ID to retrieve notes for. Required when not using cursor pagination.\n * @format GUID\n */\n contactId?: string | null;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null;\n}\n\nexport interface QueryNotesResponse {\n /** Retrieved notes. */\n notes?: Note[];\n /** Paging information. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null;\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type QueryNotesApplicationErrors = {\n code?: 'MISSING_CONTACT_ID';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface NoteCreatedEnvelope {\n entity: Note;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is created.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_created\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug created\n */\nexport declare function onNoteCreated(\n handler: (event: NoteCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface NoteDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is deleted.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_deleted\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug deleted\n */\nexport declare function onNoteDeleted(\n handler: (event: NoteDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface NoteUpdatedEnvelope {\n entity: Note;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is updated.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_updated\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug updated\n */\nexport declare function onNoteUpdated(\n handler: (event: NoteUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a new note associated with a specific contact.\n * @param note - Note to create.\n * @public\n * @requiredField note\n * @requiredField note.contactId\n * @permissionId CRM_NOTES.NOTE_CREATE\n * @applicableIdentity APP\n * @returns Created note.\n * @fqn wix.crm.notes.v2.Notes.CreateNote\n */\nexport async function createNote(\n note: NonNullablePaths<Note, `contactId`, 2>\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ note: note });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.createNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { note: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['note']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a note by ID.\n * @param noteId - Note ID.\n * @public\n * @requiredField noteId\n * @permissionId CRM_NOTES.NOTE_READ\n * @applicableIdentity APP\n * @returns Retrieved note.\n * @fqn wix.crm.notes.v2.Notes.GetNote\n */\nexport async function getNote(\n noteId: string\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ noteId: noteId });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.getNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { noteId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['noteId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 * @param _id - Note ID.\n * @public\n * @requiredField _id\n * @requiredField note\n * @requiredField note.revision\n * @permissionId CRM_NOTES.NOTE_UPDATE\n * @applicableIdentity APP\n * @returns Updated note.\n * @fqn wix.crm.notes.v2.Notes.UpdateNote\n */\nexport async function updateNote(\n _id: string,\n note: NonNullablePaths<UpdateNote, `revision`, 2>\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n note: { ...note, id: _id },\n });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.updateNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { note: '$[1]' },\n explicitPathsToArguments: { 'note.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'note']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateNote {\n /**\n * Note ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the note is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the note was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the note was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Contact ID associated with the note.\n * @format GUID\n * @immutable\n */\n contactId?: string | null;\n /**\n * Note text.\n * @maxLength 2048\n */\n text?: string | null;\n /**\n * Note type for organizing notes by their purpose.\n *\n * Default: `NOT_SET`\n */\n type?: NoteTypeWithLiterals;\n /**\n * Information about who created the note.\n * @readonly\n */\n source?: NoteSource;\n}\n\n/**\n * Deletes a note.\n * @param noteId - Note ID.\n * @public\n * @requiredField noteId\n * @permissionId CRM_NOTES.NOTE_DELETE\n * @applicableIdentity APP\n * @fqn wix.crm.notes.v2.Notes.DeleteNote\n */\nexport async function deleteNote(noteId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ noteId: noteId });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.deleteNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { noteId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['noteId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 * @public\n * @permissionId CRM_NOTES.NOTE_READ\n * @applicableIdentity APP\n * @fqn wix.crm.notes.v2.Notes.QueryNotes\n */\nexport function queryNotes(options?: QueryNotesOptions): NotesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Note, 'CURSOR', QueryNotesRequest, QueryNotesResponse>({\n func: async (payload: QueryNotesRequest) => {\n const reqOpts = ambassadorWixCrmNotesV2Note.queryNotes({\n ...payload,\n ...(options ?? {}),\n });\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryNotesRequest['query']) => {\n const args = [query, options] as [\n QueryNotesRequest['query'],\n QueryNotesOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryNotesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.notes,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\nexport interface QueryNotesOptions {\n /**\n * Contact ID to retrieve notes for. Required when not using cursor pagination.\n * @format GUID\n */\n contactId?: string | null | undefined;\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface NotesQueryResult extends QueryCursorResult {\n items: Note[];\n query: NotesQueryBuilder;\n next: () => Promise<NotesQueryResult>;\n prev: () => Promise<NotesQueryResult>;\n}\n\nexport interface NotesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName: '_createdDate' | '_updatedDate' | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n exists: (\n propertyName: '_createdDate' | '_updatedDate',\n value: boolean\n ) => NotesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate'>\n ) => NotesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate'>\n ) => NotesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => NotesQueryBuilder;\n find: () => Promise<NotesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.crm.notes.v2.Notes.QueryNotes\n * @requiredField query\n */\nexport async function typedQueryNotes(\n query: NoteQuery,\n options?: QueryNotesOptions\n): Promise<\n NonNullablePaths<\n QueryNotesResponse,\n `notes` | `notes.${number}.type` | `notes.${number}.source.sourceType`,\n 5\n > & {\n __applicationErrorsType?: QueryNotesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.queryNotes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface NoteQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_id'];\n operators: ['$eq', '$in'];\n sort: 'NONE';\n },\n {\n fields: ['type'];\n operators: ['$eq', '$in', '$ne', '$nin'];\n sort: 'NONE';\n },\n {\n fields: ['contactId'];\n operators: ['$eq', '$in'];\n sort: 'NONE';\n },\n {\n fields: ['_createdDate'];\n operators: '*';\n sort: 'BOTH';\n },\n {\n fields: ['_updatedDate'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Note, NoteQuerySpec>;\nexport type NoteQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Number of items to load. \n @max: 1000 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n You can get the relevant cursor token\n from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n */\n sort?: {\n /** \n Name of the field to sort by. \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n","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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 {\n createNote as publicCreateNote,\n getNote as publicGetNote,\n updateNote as publicUpdateNote,\n deleteNote as publicDeleteNote,\n queryNotes as publicQueryNotes,\n typedQueryNotes as publicTypedQueryNotes,\n} from './crm-notes-v2-note-notes.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n NoteQuery,\n NotesQueryBuilder,\n QueryNotesOptions,\n typedQueryNotes as universalTypedQueryNotes,\n} from './crm-notes-v2-note-notes.universal.js';\nimport { onNoteCreated as publicOnNoteCreated } from './crm-notes-v2-note-notes.public.js';\nimport { onNoteDeleted as publicOnNoteDeleted } from './crm-notes-v2-note-notes.public.js';\nimport { onNoteUpdated as publicOnNoteUpdated } from './crm-notes-v2-note-notes.public.js';\n\nfunction customQueryNotes(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: (options?: QueryNotesOptions) =>\n publicQueryNotes(httpClient)(options),\n typedQueryFunction: (query: NoteQuery, options?: QueryNotesOptions) =>\n publicTypedQueryNotes(httpClient)(query, options),\n hasOptionsParameter: true,\n });\n\n function overloadedQuery(\n query: NoteQuery,\n options?: QueryNotesOptions\n ): ReturnType<typeof universalTypedQueryNotes>;\n function overloadedQuery(options?: QueryNotesOptions): NotesQueryBuilder;\n function overloadedQuery(\n queryOrOptions?: NoteQuery | QueryNotesOptions,\n options?: QueryNotesOptions\n ): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createNote: MaybeContext<\n BuildRESTFunction<typeof publicCreateNote> & typeof publicCreateNote\n> = /*#__PURE__*/ createRESTModule(publicCreateNote);\nexport const getNote: MaybeContext<\n BuildRESTFunction<typeof publicGetNote> & typeof publicGetNote\n> = /*#__PURE__*/ createRESTModule(publicGetNote);\nexport const updateNote: MaybeContext<\n BuildRESTFunction<typeof publicUpdateNote> & typeof publicUpdateNote\n> = /*#__PURE__*/ createRESTModule(publicUpdateNote);\nexport const deleteNote: MaybeContext<\n BuildRESTFunction<typeof publicDeleteNote> & typeof publicDeleteNote\n> = /*#__PURE__*/ createRESTModule(publicDeleteNote);\nexport const queryNotes: MaybeContext<\n BuildRESTFunction<typeof customQueryNotes> & typeof customQueryNotes\n> = /*#__PURE__*/ createRESTModule(customQueryNotes);\n/**\n * Triggered when a note is created.\n */\nexport const onNoteCreated: BuildEventDefinition<typeof publicOnNoteCreated> &\n typeof publicOnNoteCreated = createEventModule(publicOnNoteCreated);\n/**\n * Triggered when a note is deleted.\n */\nexport const onNoteDeleted: BuildEventDefinition<typeof publicOnNoteDeleted> &\n typeof publicOnNoteDeleted = createEventModule(publicOnNoteDeleted);\n/**\n * Triggered when a note is updated.\n */\nexport const onNoteUpdated: BuildEventDefinition<typeof publicOnNoteUpdated> &\n typeof publicOnNoteUpdated = createEventModule(publicOnNoteUpdated);\n\nexport {\n NoteType,\n SourceType,\n SortOrder,\n WebhookIdentityType,\n} from './crm-notes-v2-note-notes.universal.js';\nexport {\n Note,\n NoteSource,\n CreateNoteRequest,\n CreateNoteResponse,\n GetNoteRequest,\n GetNoteResponse,\n UpdateNoteRequest,\n UpdateNoteResponse,\n DeleteNoteRequest,\n DeleteNoteResponse,\n QueryNotesRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryNotesResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteUpdatedEnvelope,\n UpdateNote,\n QueryNotesOptions,\n NotesQueryResult,\n NotesQueryBuilder,\n NoteQuerySpec,\n} from './crm-notes-v2-note-notes.universal.js';\nexport {\n NoteTypeWithLiterals,\n SourceTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n QueryNotesApplicationErrors,\n CommonQueryWithEntityContext,\n NoteQuery,\n} from './crm-notes-v2-note-notes.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,WAAW,SAA6C;AACtE,WAAS,aAAa,EAAE,KAAK,GAAQ;AACnC,UAAM,q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C,EAAE,MAAM,wBAAwB;AAAA,UAChC,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAuB;AAChB,IAAM,oBAAgB;AAAA,EAC3B;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAuB;;;AG1MvB,IAAAC,uBAAiC;AACjC,sCAAkC;AAOlC,iCAA0C;AAW1C,SAAS,iBAAiB,YAAwB;AAChD,QAAM,aAAS,sDAA0B;AAAA,IACvC,sBAAsB,CAAC,YACrBC,YAAiB,UAAU,EAAE,OAAO;AAAA,IACtC,oBAAoB,CAAC,OAAkB,YACrCC,iBAAsB,UAAU,EAAE,OAAO,OAAO;AAAA,IAClD,qBAAqB;AAAA,EACvB,CAAC;AAOD,WAAS,gBACP,gBACA,SACK;AACL,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,WAEK,2DAAiBA,QAAa;AACzC,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAML,cAEK,2DAAiB,gBAAgB;AAI5C,IAAMM,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,qBACkB,mDAAkB,aAAmB;","names":["createNote","deleteNote","getNote","onNoteCreated","onNoteDeleted","onNoteUpdated","queryNotes","updateNote","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","NoteType","SourceType","SortOrder","WebhookIdentityType","createNote","sdkTransformError","getNote","updateNote","deleteNote","queryNotes","createNote","getNote","updateNote","deleteNote","queryNotes","typedQueryNotes","import_rest_modules","queryNotes","typedQueryNotes","createNote","getNote","updateNote","deleteNote","onNoteCreated","onNoteDeleted","onNoteUpdated"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/crm-notes-v2-note-notes.public.ts","../../src/crm-notes-v2-note-notes.universal.ts","../../src/crm-notes-v2-note-notes.http.ts","../../src/crm-notes-v2-note-notes.context.ts"],"sourcesContent":["export * from './src/crm-notes-v2-note-notes.context.js';\n","import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n Note,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteQuery,\n NoteUpdatedEnvelope,\n NotesQueryBuilder,\n QueryNotesApplicationErrors,\n QueryNotesOptions,\n QueryNotesResponse,\n UpdateNote,\n createNote as universalCreateNote,\n deleteNote as universalDeleteNote,\n getNote as universalGetNote,\n queryNotes as universalQueryNotes,\n typedQueryNotes as universalTypedQueryNotes,\n updateNote as universalUpdateNote,\n} from './crm-notes-v2-note-notes.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/crm' };\n\nexport function createNote(httpClient: HttpClient): CreateNoteSignature {\n return (note: NonNullablePaths<Note, `contactId`, 2>) =>\n universalCreateNote(\n note,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateNoteSignature {\n /**\n * Creates a new note associated with a specific contact.\n * @param - Note to create.\n * @returns Created note.\n */\n (note: NonNullablePaths<Note, `contactId`, 2>): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function getNote(httpClient: HttpClient): GetNoteSignature {\n return (noteId: string) =>\n universalGetNote(\n noteId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetNoteSignature {\n /**\n * Retrieves a note by ID.\n * @param - Note ID.\n * @returns Retrieved note.\n */\n (noteId: string): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function updateNote(httpClient: HttpClient): UpdateNoteSignature {\n return (_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>) =>\n universalUpdateNote(\n _id,\n note,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateNoteSignature {\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 * @param - Note ID.\n * @returns Updated note.\n */\n (_id: string, note: NonNullablePaths<UpdateNote, `revision`, 2>): Promise<\n NonNullablePaths<Note, `type` | `source.sourceType`, 3>\n >;\n}\n\nexport function deleteNote(httpClient: HttpClient): DeleteNoteSignature {\n return (noteId: string) =>\n universalDeleteNote(\n noteId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteNoteSignature {\n /**\n * Deletes a note.\n * @param - Note ID.\n */\n (noteId: string): Promise<void>;\n}\n\nexport function queryNotes(httpClient: HttpClient): QueryNotesSignature {\n return (options?: QueryNotesOptions) =>\n universalQueryNotes(\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface QueryNotesSignature {\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 */\n (options?: QueryNotesOptions): NotesQueryBuilder;\n}\n\nexport function typedQueryNotes(\n httpClient: HttpClient\n): TypedQueryNotesSignature {\n return (query: NoteQuery, options?: QueryNotesOptions) =>\n universalTypedQueryNotes(\n query,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface TypedQueryNotesSignature {\n /** */\n (query: NoteQuery, options?: QueryNotesOptions): Promise<\n NonNullablePaths<\n QueryNotesResponse,\n `notes` | `notes.${number}.type` | `notes.${number}.source.sourceType`,\n 5\n > & {\n __applicationErrorsType?: QueryNotesApplicationErrors;\n }\n >;\n}\n\nexport const onNoteCreated = EventDefinition(\n 'wix.crm.notes.v2.note_created',\n true,\n (event: NoteCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteCreatedEnvelope>();\nexport const onNoteDeleted = EventDefinition(\n 'wix.crm.notes.v2.note_deleted',\n true,\n (event: NoteDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'undefined.createdDate' },\n { path: 'undefined.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteDeletedEnvelope>();\nexport const onNoteUpdated = EventDefinition(\n 'wix.crm.notes.v2.note_updated',\n true,\n (event: NoteUpdatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'entity.updatedDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<NoteUpdatedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n CreateNoteRequest,\n CreateNoteResponse,\n CursorPaging,\n CursorPagingMetadata,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Cursors,\n DeleteNoteRequest,\n DeleteNoteResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetNoteRequest,\n GetNoteResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n Note,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteQuerySpec,\n NoteSource,\n NoteType,\n NoteUpdatedEnvelope,\n NotesQueryBuilder,\n NotesQueryResult,\n QueryNotesOptions,\n QueryNotesRequest,\n QueryNotesResponse,\n RestoreInfo,\n SortOrder,\n Sorting,\n SourceType,\n UpdateNote,\n UpdateNoteRequest,\n UpdateNoteResponse,\n WebhookIdentityType,\n utils,\n} from './crm-notes-v2-note-notes.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCrmNotesV2Note from './crm-notes-v2-note-notes.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/** A note contains textual information associated with a contact. */\nexport interface Note {\n /**\n * Note ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the note is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the note was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the note was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Contact ID associated with the note.\n * @format GUID\n * @immutable\n */\n contactId?: string | null;\n /**\n * Note text.\n * @maxLength 2048\n */\n text?: string | null;\n /**\n * Note type for organizing notes by their purpose.\n *\n * Default: `NOT_SET`\n */\n type?: NoteTypeWithLiterals;\n /**\n * Information about who created the note.\n * @readonly\n */\n source?: NoteSource;\n}\n\nexport enum NoteType {\n /** Unknown note type. */\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n /** Note doesn't have a specific classification. */\n NOT_SET = 'NOT_SET',\n /** Note is a summary of a meeting related to the contact. */\n MEETING_SUMMARY = 'MEETING_SUMMARY',\n /** Note is a summary of a call related to the contact. */\n CALL_SUMMARY = 'CALL_SUMMARY',\n}\n\n/** @enumType */\nexport type NoteTypeWithLiterals =\n | NoteType\n | 'UNKNOWN_TYPE'\n | 'NOT_SET'\n | 'MEETING_SUMMARY'\n | 'CALL_SUMMARY';\n\nexport interface NoteSource {\n /**\n * Note creator.\n * @readonly\n */\n sourceType?: SourceTypeWithLiterals;\n /**\n * App ID, if the note was created by an app.\n * @format GUID\n * @readonly\n */\n appId?: string | null;\n /**\n * User ID, if the note was created by a Wix user.\n * @format GUID\n * @readonly\n */\n userId?: string | null;\n}\n\n/** Note creator. */\nexport enum SourceType {\n UNKNOWN_SOURCE_TYPE = 'UNKNOWN_SOURCE_TYPE',\n APP = 'APP',\n USER = 'USER',\n}\n\n/** @enumType */\nexport type SourceTypeWithLiterals =\n | SourceType\n | 'UNKNOWN_SOURCE_TYPE'\n | 'APP'\n | 'USER';\n\nexport interface CreateNoteRequest {\n /** Note to create. */\n note: Note;\n}\n\nexport interface CreateNoteResponse {\n /** Created note. */\n note?: Note;\n}\n\nexport interface GetNoteRequest {\n /**\n * Note ID.\n * @format GUID\n */\n noteId: string;\n}\n\nexport interface GetNoteResponse {\n /** Retrieved note. */\n note?: Note;\n}\n\nexport interface UpdateNoteRequest {\n /** Note to update. */\n note: Note;\n}\n\nexport interface UpdateNoteResponse {\n /** Updated note. */\n note?: Note;\n}\n\nexport interface DeleteNoteRequest {\n /**\n * Note ID.\n * @format GUID\n */\n noteId: string;\n}\n\nexport interface DeleteNoteResponse {}\n\nexport interface QueryNotesRequest {\n /**\n * WQL query object.\n *\n * For more information, see [API Query Language](https://dev.wix.com/docs/rest/articles/get-started/api-query-language).\n */\n query?: CursorQuery;\n /**\n * Contact ID to retrieve notes for. Required when not using cursor pagination.\n * @format GUID\n */\n contactId?: string | null;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /** Name of the field to sort by. */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface CursorPaging {\n /**\n * Number of items to load.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * You can get the relevant cursor token\n * from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n */\n cursor?: string | null;\n}\n\nexport interface QueryNotesResponse {\n /** Retrieved notes. */\n notes?: Note[];\n /** Paging information. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /** Cursor pointing to next page in the list of results. */\n next?: string | null;\n /** Cursor pointing to previous page in the list of results. */\n prev?: string | null;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type QueryNotesApplicationErrors = {\n code?: 'MISSING_CONTACT_ID';\n description?: string;\n data?: Record<string, any>;\n};\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface NoteCreatedEnvelope {\n entity: Note;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is created.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_created\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug created\n */\nexport declare function onNoteCreated(\n handler: (event: NoteCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface NoteDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is deleted.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_deleted\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug deleted\n */\nexport declare function onNoteDeleted(\n handler: (event: NoteDeletedEnvelope) => void | Promise<void>\n): void;\n\nexport interface NoteUpdatedEnvelope {\n entity: Note;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a note is updated.\n * @permissionScope Read Members and Contacts - all read permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS\n * @permissionScope Manage Notes\n * @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionScope Read Notes\n * @permissionScopeId SCOPE.DC-CRM.READ-NOTES\n * @permissionId CRM_NOTES.NOTE_READ\n * @webhook\n * @eventType wix.crm.notes.v2.note_updated\n * @serviceIdentifier wix.crm.notes.v2.Notes\n * @slug updated\n */\nexport declare function onNoteUpdated(\n handler: (event: NoteUpdatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates a new note associated with a specific contact.\n * @param note - Note to create.\n * @public\n * @requiredField note\n * @requiredField note.contactId\n * @permissionId CRM_NOTES.NOTE_CREATE\n * @applicableIdentity APP\n * @returns Created note.\n * @fqn wix.crm.notes.v2.Notes.CreateNote\n */\nexport async function createNote(\n note: NonNullablePaths<Note, `contactId`, 2>\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ note: note });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.createNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { note: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['note']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a note by ID.\n * @param noteId - Note ID.\n * @public\n * @requiredField noteId\n * @permissionId CRM_NOTES.NOTE_READ\n * @applicableIdentity APP\n * @returns Retrieved note.\n * @fqn wix.crm.notes.v2.Notes.GetNote\n */\nexport async function getNote(\n noteId: string\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ noteId: noteId });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.getNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { noteId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['noteId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 * @param _id - Note ID.\n * @public\n * @requiredField _id\n * @requiredField note\n * @requiredField note.revision\n * @permissionId CRM_NOTES.NOTE_UPDATE\n * @applicableIdentity APP\n * @returns Updated note.\n * @fqn wix.crm.notes.v2.Notes.UpdateNote\n */\nexport async function updateNote(\n _id: string,\n note: NonNullablePaths<UpdateNote, `revision`, 2>\n): Promise<NonNullablePaths<Note, `type` | `source.sourceType`, 3>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n note: { ...note, id: _id },\n });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.updateNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.note!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { note: '$[1]' },\n explicitPathsToArguments: { 'note.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'note']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateNote {\n /**\n * Note ID.\n * @format GUID\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the note is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the note was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the note was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * Contact ID associated with the note.\n * @format GUID\n * @immutable\n */\n contactId?: string | null;\n /**\n * Note text.\n * @maxLength 2048\n */\n text?: string | null;\n /**\n * Note type for organizing notes by their purpose.\n *\n * Default: `NOT_SET`\n */\n type?: NoteTypeWithLiterals;\n /**\n * Information about who created the note.\n * @readonly\n */\n source?: NoteSource;\n}\n\n/**\n * Deletes a note.\n * @param noteId - Note ID.\n * @public\n * @requiredField noteId\n * @permissionId CRM_NOTES.NOTE_DELETE\n * @applicableIdentity APP\n * @fqn wix.crm.notes.v2.Notes.DeleteNote\n */\nexport async function deleteNote(noteId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ noteId: noteId });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.deleteNote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { noteId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['noteId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\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 * @public\n * @permissionId CRM_NOTES.NOTE_READ\n * @applicableIdentity APP\n * @fqn wix.crm.notes.v2.Notes.QueryNotes\n */\nexport function queryNotes(options?: QueryNotesOptions): NotesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Note, 'CURSOR', QueryNotesRequest, QueryNotesResponse>({\n func: async (payload: QueryNotesRequest) => {\n const reqOpts = ambassadorWixCrmNotesV2Note.queryNotes({\n ...payload,\n ...(options ?? {}),\n });\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryNotesRequest['query']) => {\n const args = [query, options] as [\n QueryNotesRequest['query'],\n QueryNotesOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryNotesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.notes,\n pagingMetadata: transformedData?.pagingMetadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\nexport interface QueryNotesOptions {\n /**\n * Contact ID to retrieve notes for. Required when not using cursor pagination.\n * @format GUID\n */\n contactId?: string | null | undefined;\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface NotesQueryResult extends QueryCursorResult {\n items: Note[];\n query: NotesQueryBuilder;\n next: () => Promise<NotesQueryResult>;\n prev: () => Promise<NotesQueryResult>;\n}\n\nexport interface NotesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ne: (\n propertyName: '_createdDate' | '_updatedDate' | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n ge: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n gt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n le: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n */\n lt: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any\n ) => NotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n exists: (\n propertyName: '_createdDate' | '_updatedDate',\n value: boolean\n ) => NotesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n ascending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate'>\n ) => NotesQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */\n descending: (\n ...propertyNames: Array<'_createdDate' | '_updatedDate'>\n ) => NotesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record */\n skipTo: (cursor: string) => NotesQueryBuilder;\n find: () => Promise<NotesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.crm.notes.v2.Notes.QueryNotes\n * @requiredField query\n */\nexport async function typedQueryNotes(\n query: NoteQuery,\n options?: QueryNotesOptions\n): Promise<\n NonNullablePaths<\n QueryNotesResponse,\n `notes` | `notes.${number}.type` | `notes.${number}.source.sourceType`,\n 5\n > & {\n __applicationErrorsType?: QueryNotesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixCrmNotesV2Note.queryNotes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface NoteQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['_id'];\n operators: ['$eq', '$in'];\n sort: 'NONE';\n },\n {\n fields: ['type'];\n operators: ['$eq', '$in', '$ne', '$nin'];\n sort: 'NONE';\n },\n {\n fields: ['contactId'];\n operators: ['$eq', '$in'];\n sort: 'NONE';\n },\n {\n fields: ['_createdDate'];\n operators: '*';\n sort: 'BOTH';\n },\n {\n fields: ['_updatedDate'];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Note, NoteQuerySpec>;\nexport type NoteQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Number of items to load. \n @max: 1000 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n You can get the relevant cursor token\n from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object in the following format:\n `\"filter\" : {\n \"fieldName1\": \"value1\",\n \"fieldName2\":{\"$operator\":\"value2\"}\n }`\n Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n */\n sort?: {\n /** \n Name of the field to sort by. \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n ...createQueryUtils<Note, NoteQuerySpec, NoteQuery>(),\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction 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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 {\n createNote as publicCreateNote,\n getNote as publicGetNote,\n updateNote as publicUpdateNote,\n deleteNote as publicDeleteNote,\n queryNotes as publicQueryNotes,\n typedQueryNotes as publicTypedQueryNotes,\n} from './crm-notes-v2-note-notes.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { HttpClient } from '@wix/sdk-types';\nimport { createQueryOverloadRouter } from '@wix/sdk-runtime/query-method-router';\nimport {\n NoteQuery,\n NotesQueryBuilder,\n QueryNotesOptions,\n typedQueryNotes as universalTypedQueryNotes,\n} from './crm-notes-v2-note-notes.universal.js';\nimport { onNoteCreated as publicOnNoteCreated } from './crm-notes-v2-note-notes.public.js';\nimport { onNoteDeleted as publicOnNoteDeleted } from './crm-notes-v2-note-notes.public.js';\nimport { onNoteUpdated as publicOnNoteUpdated } from './crm-notes-v2-note-notes.public.js';\n\nfunction customQueryNotes(httpClient: HttpClient) {\n const router = createQueryOverloadRouter({\n builderQueryFunction: (options?: QueryNotesOptions) =>\n publicQueryNotes(httpClient)(options),\n typedQueryFunction: (query: NoteQuery, options?: QueryNotesOptions) =>\n publicTypedQueryNotes(httpClient)(query, options),\n hasOptionsParameter: true,\n });\n\n function overloadedQuery(\n query: NoteQuery,\n options?: QueryNotesOptions\n ): ReturnType<typeof universalTypedQueryNotes>;\n function overloadedQuery(options?: QueryNotesOptions): NotesQueryBuilder;\n function overloadedQuery(\n queryOrOptions?: NoteQuery | QueryNotesOptions,\n options?: QueryNotesOptions\n ): any {\n return router(...arguments);\n }\n\n return overloadedQuery;\n}\n\nexport const createNote: MaybeContext<\n BuildRESTFunction<typeof publicCreateNote> & typeof publicCreateNote\n> = /*#__PURE__*/ createRESTModule(publicCreateNote);\nexport const getNote: MaybeContext<\n BuildRESTFunction<typeof publicGetNote> & typeof publicGetNote\n> = /*#__PURE__*/ createRESTModule(publicGetNote);\nexport const updateNote: MaybeContext<\n BuildRESTFunction<typeof publicUpdateNote> & typeof publicUpdateNote\n> = /*#__PURE__*/ createRESTModule(publicUpdateNote);\nexport const deleteNote: MaybeContext<\n BuildRESTFunction<typeof publicDeleteNote> & typeof publicDeleteNote\n> = /*#__PURE__*/ createRESTModule(publicDeleteNote);\nexport const queryNotes: MaybeContext<\n BuildRESTFunction<typeof customQueryNotes> & typeof customQueryNotes\n> = /*#__PURE__*/ createRESTModule(customQueryNotes);\n/**\n * Triggered when a note is created.\n */\nexport const onNoteCreated: BuildEventDefinition<typeof publicOnNoteCreated> &\n typeof publicOnNoteCreated = createEventModule(publicOnNoteCreated);\n/**\n * Triggered when a note is deleted.\n */\nexport const onNoteDeleted: BuildEventDefinition<typeof publicOnNoteDeleted> &\n typeof publicOnNoteDeleted = createEventModule(publicOnNoteDeleted);\n/**\n * Triggered when a note is updated.\n */\nexport const onNoteUpdated: BuildEventDefinition<typeof publicOnNoteUpdated> &\n typeof publicOnNoteUpdated = createEventModule(publicOnNoteUpdated);\n\nexport {\n NoteType,\n SourceType,\n SortOrder,\n WebhookIdentityType,\n} from './crm-notes-v2-note-notes.universal.js';\nexport {\n Note,\n NoteSource,\n CreateNoteRequest,\n CreateNoteResponse,\n GetNoteRequest,\n GetNoteResponse,\n UpdateNoteRequest,\n UpdateNoteResponse,\n DeleteNoteRequest,\n DeleteNoteResponse,\n QueryNotesRequest,\n CursorQuery,\n CursorQueryPagingMethodOneOf,\n Sorting,\n CursorPaging,\n QueryNotesResponse,\n CursorPagingMetadata,\n Cursors,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteUpdatedEnvelope,\n UpdateNote,\n QueryNotesOptions,\n NotesQueryResult,\n NotesQueryBuilder,\n NoteQuerySpec,\n} from './crm-notes-v2-note-notes.universal.js';\nexport { utils } from './crm-notes-v2-note-notes.universal.js';\nexport {\n NoteTypeWithLiterals,\n SourceTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n QueryNotesApplicationErrors,\n CommonQueryWithEntityContext,\n NoteQuery,\n} from './crm-notes-v2-note-notes.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,qBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAA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AAAA,IACvC,sBAAsB,CAAC,YACrBC,YAAiB,UAAU,EAAE,OAAO;AAAA,IACtC,oBAAoB,CAAC,OAAkB,YACrCC,iBAAsB,UAAU,EAAE,OAAO,OAAO;AAAA,IAClD,qBAAqB;AAAA,EACvB,CAAC;AAOD,WAAS,gBACP,gBACA,SACK;AACL,WAAO,OAAO,GAAG,SAAS;AAAA,EAC5B;AAEA,SAAO;AACT;AAEO,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,WAEK,2DAAiBA,QAAa;AACzC,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAML,cAEK,2DAAiB,gBAAgB;AAI5C,IAAMM,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,qBACkB,mDAAkB,aAAmB;AAI7D,IAAMC,qBACkB,mDAAkB,aAAmB;","names":["createNote","deleteNote","getNote","onNoteCreated","onNoteDeleted","onNoteUpdated","queryNotes","updateNote","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","import_transform_paths","NoteType","SourceType","SortOrder","WebhookIdentityType","createNote","sdkTransformError","getNote","updateNote","deleteNote","queryNotes","createNote","getNote","updateNote","deleteNote","queryNotes","typedQueryNotes","import_rest_modules","queryNotes","typedQueryNotes","createNote","getNote","updateNote","deleteNote","onNoteCreated","onNoteDeleted","onNoteUpdated"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _wix_sdk_types from '@wix/sdk-types';
|
|
1
2
|
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
/** A note contains textual information associated with a contact. */
|
|
@@ -744,5 +745,10 @@ type NoteQuery = {
|
|
|
744
745
|
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
745
746
|
}[];
|
|
746
747
|
};
|
|
748
|
+
declare const utils: {
|
|
749
|
+
QueryBuilder: () => _wix_sdk_types.QueryBuilder<Note, NoteQuerySpec, NoteQuery>;
|
|
750
|
+
Filter: _wix_sdk_types.FilterFactory<Note, NoteQuerySpec>;
|
|
751
|
+
Sort: _wix_sdk_types.SortFactory<NoteQuerySpec>;
|
|
752
|
+
};
|
|
747
753
|
|
|
748
|
-
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type CommonQueryWithEntityContext, 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 NoteQuery, type NoteQuerySpec, 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, typedQueryNotes, updateNote };
|
|
754
|
+
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type CommonQueryWithEntityContext, 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 NoteQuery, type NoteQuerySpec, 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, typedQueryNotes, updateNote, utils };
|
|
@@ -29,7 +29,8 @@ __export(index_typings_exports, {
|
|
|
29
29
|
getNote: () => getNote2,
|
|
30
30
|
queryNotes: () => queryNotes2,
|
|
31
31
|
typedQueryNotes: () => typedQueryNotes,
|
|
32
|
-
updateNote: () => updateNote2
|
|
32
|
+
updateNote: () => updateNote2,
|
|
33
|
+
utils: () => utils
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(index_typings_exports);
|
|
35
36
|
|
|
@@ -226,6 +227,7 @@ function queryNotes(payload) {
|
|
|
226
227
|
|
|
227
228
|
// src/crm-notes-v2-note-notes.universal.ts
|
|
228
229
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
230
|
+
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
229
231
|
var NoteType = /* @__PURE__ */ ((NoteType2) => {
|
|
230
232
|
NoteType2["UNKNOWN_TYPE"] = "UNKNOWN_TYPE";
|
|
231
233
|
NoteType2["NOT_SET"] = "NOT_SET";
|
|
@@ -417,6 +419,9 @@ async function typedQueryNotes(query, options) {
|
|
|
417
419
|
throw transformedError;
|
|
418
420
|
}
|
|
419
421
|
}
|
|
422
|
+
var utils = {
|
|
423
|
+
...(0, import_query_builder_utils.createQueryUtils)()
|
|
424
|
+
};
|
|
420
425
|
// Annotate the CommonJS export names for ESM import in node:
|
|
421
426
|
0 && (module.exports = {
|
|
422
427
|
NoteType,
|
|
@@ -428,6 +433,7 @@ async function typedQueryNotes(query, options) {
|
|
|
428
433
|
getNote,
|
|
429
434
|
queryNotes,
|
|
430
435
|
typedQueryNotes,
|
|
431
|
-
updateNote
|
|
436
|
+
updateNote,
|
|
437
|
+
utils
|
|
432
438
|
});
|
|
433
439
|
//# sourceMappingURL=index.typings.js.map
|