@wix/auto_sdk_crm_notes 1.0.2 → 1.0.3
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.js.map +1 -1
- package/build/cjs/index.typings.d.ts +0 -6
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +0 -6
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +0 -6
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +0 -6
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
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 NoteUpdatedEnvelope,\n NotesQueryBuilder,\n QueryNotesOptions,\n UpdateNote,\n createNote as universalCreateNote,\n deleteNote as universalDeleteNote,\n getNote as universalGetNote,\n queryNotes as universalQueryNotes,\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 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 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 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 { HttpClient, HttpResponse, NonNullablePaths } 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}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type 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}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<NotesQueryResult>;\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 url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createNote;\n}\n\n/** Retrieves a note by ID. */\nexport function getNote(payload: object): RequestOptionsFactory<any> {\n function __getNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'GET' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.GetNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getNote;\n}\n\n/**\n * Updates a note.\n *\n * This method supports partial updates.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n */\nexport function updateNote(payload: object): RequestOptionsFactory<any> {\n function __updateNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.UpdateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{note.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateNote;\n}\n\n/** Deletes a note. */\nexport function deleteNote(payload: object): RequestOptionsFactory<any> {\n function __deleteNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.DeleteNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteNote;\n}\n\n/**\n * Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.\n *\n * <blockquote class=\"important\">\n *\n * __Important:__\n * When making the first query request without a cursor, the `contactId` field is required. For subsequent requests using cursor pagination, `contactId` becomes optional as the cursor contains the context from the previous query.\n *\n * </blockquote>\n *\n * By default, notes are sorted by created date in descending order.\n *\n * Refer to [*Notes: Supported Filters and Sorting*](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/notes/notes-v2/supported-filters-and-sorting) for a complete list of supported filters and sorting options.\n *\n * To learn about working with *Query* endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).\n */\nexport function queryNotes(payload: object): RequestOptionsFactory<any> {\n function __queryNotes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.QueryNotes',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notes.createdDate' },\n { path: 'notes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryNotes;\n}\n","import {\n createNote as publicCreateNote,\n getNote as publicGetNote,\n updateNote as publicUpdateNote,\n deleteNote as publicDeleteNote,\n queryNotes as publicQueryNotes,\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 { 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\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 publicQueryNotes> & typeof publicQueryNotes\n> = /*#__PURE__*/ createRESTModule(publicQueryNotes);\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 BaseEventMetadata,\n EventMetadata,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteUpdatedEnvelope,\n UpdateNote,\n QueryNotesOptions,\n NotesQueryResult,\n NotesQueryBuilder,\n} from './crm-notes-v2-note-notes.universal.js';\nexport {\n NoteTypeWithLiterals,\n SourceTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n QueryNotesApplicationErrors,\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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oteDeleted","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","import_rest_modules","createNote","getNote","updateNote","deleteNote","queryNotes","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 NoteUpdatedEnvelope,\n NotesQueryBuilder,\n QueryNotesOptions,\n UpdateNote,\n createNote as universalCreateNote,\n deleteNote as universalDeleteNote,\n getNote as universalGetNote,\n queryNotes as universalQueryNotes,\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 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 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 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 { HttpClient, HttpResponse, NonNullablePaths } 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}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type 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}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<NotesQueryResult>;\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 url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createNote;\n}\n\n/** Retrieves a note by ID. */\nexport function getNote(payload: object): RequestOptionsFactory<any> {\n function __getNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'GET' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.GetNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getNote;\n}\n\n/**\n * Updates a note.\n *\n * This method supports partial updates.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n */\nexport function updateNote(payload: object): RequestOptionsFactory<any> {\n function __updateNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.UpdateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{note.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateNote;\n}\n\n/** Deletes a note. */\nexport function deleteNote(payload: object): RequestOptionsFactory<any> {\n function __deleteNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.DeleteNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteNote;\n}\n\n/**\n * Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.\n *\n * <blockquote class=\"important\">\n *\n * __Important:__\n * When making the first query request without a cursor, the `contactId` field is required. For subsequent requests using cursor pagination, `contactId` becomes optional as the cursor contains the context from the previous query.\n *\n * </blockquote>\n *\n * By default, notes are sorted by created date in descending order.\n *\n * Refer to [*Notes: Supported Filters and Sorting*](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/notes/notes-v2/supported-filters-and-sorting) for a complete list of supported filters and sorting options.\n *\n * To learn about working with *Query* endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).\n */\nexport function queryNotes(payload: object): RequestOptionsFactory<any> {\n function __queryNotes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.QueryNotes',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notes.createdDate' },\n { path: 'notes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryNotes;\n}\n","import {\n createNote as publicCreateNote,\n getNote as publicGetNote,\n updateNote as publicUpdateNote,\n deleteNote as publicDeleteNote,\n queryNotes as publicQueryNotes,\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 { 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\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 publicQueryNotes> & typeof publicQueryNotes\n> = /*#__PURE__*/ createRESTModule(publicQueryNotes);\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 BaseEventMetadata,\n EventMetadata,\n NoteCreatedEnvelope,\n NoteDeletedEnvelope,\n NoteUpdatedEnvelope,\n UpdateNote,\n QueryNotesOptions,\n NotesQueryResult,\n NotesQueryBuilder,\n} from './crm-notes-v2-note-notes.universal.js';\nexport {\n NoteTypeWithLiterals,\n SourceTypeWithLiterals,\n SortOrderWithLiterals,\n WebhookIdentityTypeWithLiterals,\n QueryNotesApplicationErrors,\n} from './crm-notes-v2-note-notes.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EA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AChC,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;;;AG9KvB,IAAAC,uBAAiC;AACjC,sCAAkC;AAU3B,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,WAEK,2DAAiBA,QAAa;AACzC,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,cAEK,2DAAiBA,WAAgB;AAC5C,IAAMC,cAEK,2DAAiBA,WAAgB;AAI5C,IAAMC,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","import_rest_modules","createNote","getNote","updateNote","deleteNote","queryNotes","onNoteCreated","onNoteDeleted","onNoteUpdated"]}
|
|
@@ -403,8 +403,6 @@ interface NoteCreatedEnvelope {
|
|
|
403
403
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
404
404
|
* @permissionScope Manage Notes
|
|
405
405
|
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
406
|
-
* @permissionScope Picasso private app mega scope (site)
|
|
407
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
408
406
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
409
407
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
410
408
|
* @permissionScope Read Notes
|
|
@@ -426,8 +424,6 @@ interface NoteDeletedEnvelope {
|
|
|
426
424
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
427
425
|
* @permissionScope Manage Notes
|
|
428
426
|
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
429
|
-
* @permissionScope Picasso private app mega scope (site)
|
|
430
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
431
427
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
432
428
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
433
429
|
* @permissionScope Read Notes
|
|
@@ -450,8 +446,6 @@ interface NoteUpdatedEnvelope {
|
|
|
450
446
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.READ-MEMBERS-CONTACTS
|
|
451
447
|
* @permissionScope Manage Notes
|
|
452
448
|
* @permissionScopeId SCOPE.DC-CRM.MANAGE-NOTES
|
|
453
|
-
* @permissionScope Picasso private app mega scope (site)
|
|
454
|
-
* @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE
|
|
455
449
|
* @permissionScope Manage Members and Contacts - all permissions
|
|
456
450
|
* @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS
|
|
457
451
|
* @permissionScope Read Notes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/crm-notes-v2-note-notes.universal.ts","../../src/crm-notes-v2-note-notes.http.ts"],"sourcesContent":["export * from './src/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 { HttpClient, HttpResponse, NonNullablePaths } 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}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type 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}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 Picasso private app mega scope (site)\n * @permissionScopeId SCOPE.TEST.MEGA-PICASSO-MANAGE-SITE\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<NotesQueryResult>;\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 url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createNote;\n}\n\n/** Retrieves a note by ID. */\nexport function getNote(payload: object): RequestOptionsFactory<any> {\n function __getNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'GET' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.GetNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getNote;\n}\n\n/**\n * Updates a note.\n *\n * This method supports partial updates.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n */\nexport function updateNote(payload: object): RequestOptionsFactory<any> {\n function __updateNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.UpdateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{note.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateNote;\n}\n\n/** Deletes a note. */\nexport function deleteNote(payload: object): RequestOptionsFactory<any> {\n function __deleteNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.DeleteNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteNote;\n}\n\n/**\n * Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.\n *\n * <blockquote class=\"important\">\n *\n * __Important:__\n * When making the first query request without a cursor, the `contactId` field is required. For subsequent requests using cursor pagination, `contactId` becomes optional as the cursor contains the context from the previous query.\n *\n * </blockquote>\n *\n * By default, notes are sorted by created date in descending order.\n *\n * Refer to [*Notes: Supported Filters and Sorting*](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/notes/notes-v2/supported-filters-and-sorting) for a complete list of supported filters and sorting options.\n *\n * To learn about working with *Query* endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).\n */\nexport function queryNotes(payload: object): RequestOptionsFactory<any> {\n function __queryNotes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.QueryNotes',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notes.createdDate' },\n { path: 'notes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryNotes;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,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,qBAAiB,uCAAe,SAAS;A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E,YAAM,sBAAkB;AAAA,YACtB,wCAAe,MAAM,CAAC,CAAC;AAAA,MACzB;AAEA,aAAO;AAAA,QACL,OAAO,iBAAiB;AAAA,QACxB,gBAAgB,iBAAiB;AAAA,MACnC;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,QAAiB;AAClC,YAAM,uBAAmB,uBAAAJ,gBAAkB,KAAK;AAAA,QAC9C,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,OAAO;AAAA,QAC1C,yBAAyB;AAAA,MAC3B,CAAC;AAED,YAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,IACd,qBAAqB,CAAC;AAAA,EACxB,CAAC;AACH;","names":["createNote","deleteNote","getNote","queryNotes","updateNote","import_timestamp","import_rest_modules","payload","import_transform_paths","NoteType","SourceType","SortOrder","WebhookIdentityType","createNote","sdkTransformError","getNote","updateNote","deleteNote","queryNotes"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/crm-notes-v2-note-notes.universal.ts","../../src/crm-notes-v2-note-notes.http.ts"],"sourcesContent":["export * from './src/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 { HttpClient, HttpResponse, NonNullablePaths } 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}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type 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}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface 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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\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 * @documentationMaturity preview\n */\n hasSome: (\n propertyName: '_createdDate' | '_updatedDate',\n value: any[]\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | '_updatedDate'\n | 'contactId'\n | 'type',\n value: any\n ) => NotesQueryBuilder;\n /** @documentationMaturity preview */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\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 * @documentationMaturity preview\n */\n limit: (limit: number) => NotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => NotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<NotesQueryResult>;\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 url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createNote;\n}\n\n/** Retrieves a note by ID. */\nexport function getNote(payload: object): RequestOptionsFactory<any> {\n function __getNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'GET' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.GetNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getNote;\n}\n\n/**\n * Updates a note.\n *\n * This method supports partial updates.\n * To prevent conflicting changes, the current revision must be passed when updating the note.\n */\nexport function updateNote(payload: object): RequestOptionsFactory<any> {\n function __updateNote({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'mask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'PATCH' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.UpdateNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{note.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'note.createdDate' }, { path: 'note.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateNote;\n}\n\n/** Deletes a note. */\nexport function deleteNote(payload: object): RequestOptionsFactory<any> {\n function __deleteNote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'DELETE' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.DeleteNote',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/{noteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteNote;\n}\n\n/**\n * Retrieves a list of up to 1,000 notes given the provided filtering, paging, and sorting.\n *\n * <blockquote class=\"important\">\n *\n * __Important:__\n * When making the first query request without a cursor, the `contactId` field is required. For subsequent requests using cursor pagination, `contactId` becomes optional as the cursor contains the context from the previous query.\n *\n * </blockquote>\n *\n * By default, notes are sorted by created date in descending order.\n *\n * Refer to [*Notes: Supported Filters and Sorting*](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/notes/notes-v2/supported-filters-and-sorting) for a complete list of supported filters and sorting options.\n *\n * To learn about working with *Query* endpoints, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language) and [Sorting and Paging](https://dev.wix.com/docs/rest/articles/get-started/sorting-and-paging).\n */\nexport function queryNotes(payload: object): RequestOptionsFactory<any> {\n function __queryNotes({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.crm.notes.v2.note',\n method: 'POST' as any,\n methodFqn: 'wix.crm.notes.v2.Notes.QueryNotes',\n packageName: PACKAGE_NAME,\n url: resolveWixCrmNotesV2NotesUrl({\n protoPath: '/v2/notes/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'notes.createdDate' },\n { path: 'notes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryNotes;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,eAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6BACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,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W,CAAC;AAAA,MAClB,CAAC;AAED,mBAAa,aAAa;AAC1B,UAAI;AACF,cAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,qBAAa,YAAY,MAAM;AAC/B,eAAO;AAAA,MACT,SAAS,KAAK;AACZ,qBAAa,UAAU,GAAG;AAC1B,cAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,oBAAoB,CAAC,UAAsC;AACzD,YAAM,OAAO,CAAC,OAAO,OAAO;AAI5B,iBAAO,qEAAsC;AAAA,QAC3C,GAAG,OAAO,CAAC;AAAA,QACX,OAAO,OAAO,CAAC;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,IACA,qBAAqB,CAAC,EAAE,KAAK,MAAwC;AACnE,YAAM,sBAAkB;AAAA,YACtB,wCAAe,MAAM,CAAC,CAAC;AAAA,MACzB;AAEA,aAAO;AAAA,QACL,OAAO,iBAAiB;AAAA,QACxB,gBAAgB,iBAAiB;AAAA,MACnC;AAAA,IACF;AAAA,IACA,kBAAkB,CAAC,QAAiB;AAClC,YAAM,uBAAmB,uBAAAJ,gBAAkB,KAAK;AAAA,QAC9C,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,OAAO;AAAA,QAC1C,yBAAyB;AAAA,MAC3B,CAAC;AAED,YAAM;AAAA,IACR;AAAA,IACA,cAAc;AAAA,IACd,qBAAqB,CAAC;AAAA,EACxB,CAAC;AACH;","names":["createNote","deleteNote","getNote","queryNotes","updateNote","import_timestamp","import_rest_modules","payload","import_transform_paths","NoteType","SourceType","SortOrder","WebhookIdentityType","createNote","sdkTransformError","getNote","updateNote","deleteNote","queryNotes"]}
|