import { NonNullablePaths } from '@wix/sdk-types'; interface ContactAttachment extends ContactAttachmentMediaOneOf { /** Image details when the attachment type is `IMAGE`. */ image?: string; /** Document details when the attachment type is `OTHER`. */ document?: string; /** * Attachment ID. * @readonly * @format GUID */ _id?: string; /** * Details of the preview image reduced size when the attachment is of type `IMAGE`. * @readonly */ previewImage?: string; /** * Name of the attachment file. * @readonly */ fileName?: string; /** * Mime type of the attachment. See [supported mime types](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types). * @readonly */ mimeType?: string; /** * Type of the attachment. * @readonly */ attachmentType?: AttachmentTypeWithLiterals; } /** @oneof */ interface ContactAttachmentMediaOneOf { /** Image details when the attachment type is `IMAGE`. */ image?: string; /** Document details when the attachment type is `OTHER`. */ document?: string; } declare enum AttachmentType { /** Unknown attachment type. */ UNKNOWN = "UNKNOWN", /** Attachment is an image file. */ IMAGE = "IMAGE", /** Attachment is a document or any non-image file type. */ OTHER = "OTHER" } /** @enumType */ type AttachmentTypeWithLiterals = AttachmentType | 'UNKNOWN' | 'IMAGE' | 'OTHER'; interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; } /** @oneof */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } interface Empty { } interface CrmAttachmentUploadedEvent { attachment?: CrmAttachment; /** @format GUID */ uploadJobId?: string; } interface CrmAttachment { /** * @readonly * @format GUID */ _id?: string | null; revision?: string | null; /** @readonly */ _createdDate?: Date | null; /** @readonly */ _updatedDate?: Date | null; /** @readonly */ source?: AttachmentSource; metadata?: AttachmentMetadata; media?: AttachmentMedia; /** * Inferred by the media type * @readonly */ attachmentType?: CrmAttachmentAttachmentTypeWithLiterals; } interface AttachmentSource { appId?: string; } interface AttachmentMetadata { /** * Entity type e.g: INVOICES * @minLength 2 * @maxLength 50 */ entityType?: string | null; /** * Id of the entity, e.g: invoice id * @minLength 1 * @maxLength 50 */ entityId?: string | null; /** @format GUID */ contactId?: string | null; /** * @minLength 1 * @maxLength 50 */ externalId?: string | null; } interface AttachmentMedia extends AttachmentMediaMediaOneOf { image?: string; document?: string; /** @readonly */ previewImage?: string; /** @minLength 1 */ fileName?: string; /** * @minLength 1 * @maxLength 100 */ mimeType?: string; } /** @oneof */ interface AttachmentMediaMediaOneOf { image?: string; document?: string; } declare enum CrmAttachmentAttachmentType { UNKNOWN = "UNKNOWN", DOCUMENT = "DOCUMENT", IMAGE = "IMAGE" } /** @enumType */ type CrmAttachmentAttachmentTypeWithLiterals = CrmAttachmentAttachmentType | 'UNKNOWN' | 'DOCUMENT' | 'IMAGE'; interface CreateDemoAttachmentRequest { /** * The contact id whose demo attachment is being created * @format GUID */ contactId?: string; /** The type of the demo contact */ demoContactType?: DemoContactTypeWithLiterals; } declare enum DemoContactType { KAT = "KAT", DAN = "DAN" } /** @enumType */ type DemoContactTypeWithLiterals = DemoContactType | 'KAT' | 'DAN'; interface CreateDemoAttachmentResponse { /** The created attachment */ attachment?: ContactAttachment; } interface GenerateAttachmentUploadUrlRequest { /** * ID of the contact for whom the attachment is being uploaded. * @format GUID */ contactId: string; /** * File name of the attachment including the extension, for example, `contact-cv.pdf`. * @minLength 1 * @maxLength 260 */ fileName: string; /** * Mime type of the attachment file, for example, `application/pdf`. * See [supported mime types](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types). * @minLength 1 * @maxLength 255 */ mimeType: string; } interface GenerateAttachmentUploadUrlResponse { /** * The URL for uploading a file as an attachment to the contact. * @format WEB_URL */ uploadUrl?: string; } interface ListAttachmentsRequest { /** * Contact ID for the attachments to be listed. * @format GUID */ contactId: string; /** Allow paginating, default: limit = 100 and offset = 0 */ paging?: Paging; } interface Paging { /** * Number of items to return. * * Default: `100` * Max: `100` * @max 100 */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } interface ListAttachmentsResponse { /** List of attachments for the specified contact. */ attachments?: ContactAttachment[]; /** Metadata for the paginated results. */ metadata?: PagingMetadata; } interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. */ total?: number | null; /** Whether the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; } interface DeleteAttachmentRequest { /** * Contact ID for the attachment to delete. * @format GUID */ contactId: string; /** * Attachment ID to delete. * @format GUID */ attachmentId: string; } interface DeleteAttachmentResponse { } interface GetAttachmentRequest { /** * Contact ID for the attachment to retrieve. * @format GUID */ contactId: string; /** * Attachment ID to retrieve. * @format GUID */ attachmentId: string; } interface GetAttachmentResponse { /** The requested attachment. */ attachment?: ContactAttachment; } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface IdentificationData extends IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; /** @readonly */ identityType?: WebhookIdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * ID of a site visitor that has not logged in to the site. * @format GUID */ anonymousVisitorId?: string; /** * ID of a site visitor that has logged in to the site. * @format GUID */ memberId?: string; /** * ID of a Wix user (site owner, contributor, etc.). * @format GUID */ wixUserId?: string; /** * ID of an app. * @format GUID */ appId?: string; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; interface AccountInfo { /** * ID of the Wix account associated with the event. * @format GUID */ accountId?: string | null; /** * ID of the parent Wix account. Only included when accountId belongs to a child account. * @format GUID */ parentAccountId?: string | null; /** * ID of the Wix site associated with the event. Only included when the event is tied to a specific site. * @format GUID */ siteId?: string | null; } interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** Event ID. With this ID you can easily spot duplicated events and ignore them. */ _id?: string; /** * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities. * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`. */ entityFqdn?: string; /** * Event action name, placed at the top level to make it easier for users to dispatch messages. * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`. */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * 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. * 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. */ entityEventSequence?: string | null; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface AttachmentCreatedEnvelope { entity: ContactAttachment; metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @permissionScope Manage Members and Contacts - all permissions * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS * @permissionId CONTACTS_ATTACHMENTS.VIEW * @webhook * @eventType wix.contacts.v4.attachment_created * @slug created */ declare function onAttachmentCreated(handler: (event: AttachmentCreatedEnvelope) => void | Promise): void; interface AttachmentDeletedEnvelope { metadata: EventMetadata; } /** @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @permissionScope Manage Members and Contacts - all permissions * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS * @permissionId CONTACTS_ATTACHMENTS.VIEW * @webhook * @eventType wix.contacts.v4.attachment_deleted * @slug deleted */ declare function onAttachmentDeleted(handler: (event: AttachmentDeletedEnvelope) => void | Promise): void; /** * Generates an upload URL for uploading a file as an attachment to a specified contact. * * To learn how to use the generated upload URL in the response to upload an attachment file, * see the [Upload API](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api). * @param contactId - ID of the contact for whom the attachment is being uploaded. * @param fileName - File name of the attachment including the extension, for example, `contact-cv.pdf`. * @public * @requiredField contactId * @requiredField fileName * @requiredField options * @requiredField options.mimeType * @permissionId CONTACTS_ATTACHMENTS.MODIFY * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GenerateAttachmentUploadUrl */ declare function generateAttachmentUploadUrl(contactId: string, fileName: string, options: NonNullablePaths): Promise>; interface GenerateAttachmentUploadUrlOptions { /** * Mime type of the attachment file, for example, `application/pdf`. * See [supported mime types](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types). * @minLength 1 * @maxLength 255 */ mimeType: string; } /** * Retrieves a list of attachments associated with a specified contact. * @param contactId - Contact ID for the attachments to be listed. * @public * @requiredField contactId * @permissionId CONTACTS_ATTACHMENTS.VIEW * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.ListAttachments */ declare function listAttachments(contactId: string, options?: ListAttachmentsOptions): Promise>; interface ListAttachmentsOptions { /** Allow paginating, default: limit = 100 and offset = 0 */ paging?: Paging; } /** * Deletes the specified attachment from the specified contact. * @public * @requiredField identifiers * @requiredField identifiers.attachmentId * @requiredField identifiers.contactId * @permissionId CONTACTS_ATTACHMENTS.MODIFY * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.DeleteAttachment */ declare function deleteAttachment(identifiers: NonNullablePaths): Promise; interface DeleteAttachmentIdentifiers { /** * Contact ID for the attachment to delete. * @format GUID */ contactId: string; /** * Attachment ID to delete. * @format GUID */ attachmentId: string; } /** * Retrieves the specified attachment for the specified contact. * @public * @requiredField identifiers * @requiredField identifiers.attachmentId * @requiredField identifiers.contactId * @permissionId CONTACTS_ATTACHMENTS.VIEW * @applicableIdentity APP * @returns The requested attachment. * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GetAttachment */ declare function getAttachment(identifiers: NonNullablePaths): Promise>; interface GetAttachmentIdentifiers { /** * Contact ID for the attachment to retrieve. * @format GUID */ contactId: string; /** * Attachment ID to retrieve. * @format GUID */ attachmentId: string; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AttachmentCreatedEnvelope, type AttachmentDeletedEnvelope, type AttachmentMedia, type AttachmentMediaMediaOneOf, type AttachmentMetadata, type AttachmentSource, AttachmentType, type AttachmentTypeWithLiterals, type BaseEventMetadata, type ContactAttachment, type ContactAttachmentMediaOneOf, type CreateDemoAttachmentRequest, type CreateDemoAttachmentResponse, type CrmAttachment, CrmAttachmentAttachmentType, type CrmAttachmentAttachmentTypeWithLiterals, type CrmAttachmentUploadedEvent, type DeleteAttachmentIdentifiers, type DeleteAttachmentRequest, type DeleteAttachmentResponse, DemoContactType, type DemoContactTypeWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GenerateAttachmentUploadUrlOptions, type GenerateAttachmentUploadUrlRequest, type GenerateAttachmentUploadUrlResponse, type GetAttachmentIdentifiers, type GetAttachmentRequest, type GetAttachmentResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListAttachmentsOptions, type ListAttachmentsRequest, type ListAttachmentsResponse, type MessageEnvelope, type Paging, type PagingMetadata, type RestoreInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, deleteAttachment, generateAttachmentUploadUrl, getAttachment, listAttachments, onAttachmentCreated, onAttachmentDeleted };