export 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 */ _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 * ([REST](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/crm/attachments/supported-mime-types)). * @readonly */ mimeType?: string; /** * Type of the attachment. * @readonly */ attachmentType?: AttachmentType; } /** @oneof */ export interface ContactAttachmentMediaOneOf { /** Image details when the attachment type is `IMAGE`. */ image?: string; /** Document details when the attachment type is `OTHER`. */ document?: string; } export 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" } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export 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; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface Empty { } export interface MediaFileUploadedEvent { fileId?: string; path?: string; mimeType?: string; acl?: string | null; size?: string | null; dateCreated?: Date | null; dateUpdated?: Date | null; } export interface CrmAttachmentUploadedEvent { attachment?: CrmAttachment; uploadJobId?: string; } export interface CrmAttachment { /** @readonly */ _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?: CrmAttachmentAttachmentType; } export interface AttachmentSource { appId?: string; } export interface AttachmentMetadata { /** Entity type e.g: INVOICES */ entityType?: string | null; /** Id of the entity, e.g: invoice id */ entityId?: string | null; contactId?: string | null; externalId?: string | null; } export interface AttachmentMedia extends AttachmentMediaMediaOneOf { image?: string; document?: string; /** @readonly */ previewImage?: string; fileName?: string; mimeType?: string; } /** @oneof */ export interface AttachmentMediaMediaOneOf { image?: string; document?: string; } export declare enum CrmAttachmentAttachmentType { UNKNOWN = "UNKNOWN", DOCUMENT = "DOCUMENT", IMAGE = "IMAGE" } export interface CreateDemoAttachmentRequest { /** The contact id whose demo attachment is being created */ contactId?: string; /** The type of the demo contact */ demoContactType?: DemoContactType; } export declare enum DemoContactType { KAT = "KAT", DAN = "DAN" } export interface CreateDemoAttachmentResponse { /** The created attachment */ attachment?: ContactAttachment; } export interface GenerateAttachmentUploadUrlRequest { /** ID of the contact for whom the attachment is being uploaded. */ contactId: string; /** File name of the attachment including the extension, for example, `contact-cv.pdf`. */ fileName: string; /** * Mime type of the attachment file, for example, `application/pdf`. * See supported mime types ([REST](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types)| * [SDK](https://dev.wix.com/docs/sdk/backend-modules/crm/attachments/supported-mime-types)). */ mimeType: string; } export interface GenerateAttachmentUploadUrlResponse { /** The URL for uploading a file as an attachment to the contact. */ uploadUrl?: string; } export interface ListAttachmentsRequest { /** Contact ID for the attachments to be listed. */ contactId: string; /** Allow paginating, default: limit = 100 and offset = 0 */ paging?: Paging; } export interface Paging { /** * Number of items to return. * * Default: `100` * Max: `100` */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface ListAttachmentsResponse { /** List of attachments for the specified contact. */ attachments?: ContactAttachment[]; /** Metadata for the paginated results. */ metadata?: PagingMetadata; } export 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; } export interface DeleteAttachmentRequest { /** Contact ID for the attachment to delete. */ contactId: string; /** Attachment ID to delete. */ attachmentId: string; } export interface DeleteAttachmentResponse { } export interface GetAttachmentRequest { /** Contact ID for the attachment to retrieve. */ contactId: string; /** Attachment ID to retrieve. */ attachmentId: string; } export interface GetAttachmentResponse { /** The requested attachment. */ attachment?: ContactAttachment; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface GenerateAttachmentUploadUrlResponseNonNullableFields { uploadUrl: string; uploadId: string; } export interface ContactAttachmentNonNullableFields { image: string; document: string; _id: string; previewImage: string; fileName: string; mimeType: string; attachmentType: AttachmentType; mediaPath: string; } export interface ListAttachmentsResponseNonNullableFields { attachments: ContactAttachmentNonNullableFields[]; } export interface GetAttachmentResponseNonNullableFields { attachment?: ContactAttachmentNonNullableFields; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export interface EventMetadata extends BaseEventMetadata { /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } export interface AttachmentCreatedEnvelope { entity: ContactAttachment; metadata: EventMetadata; } /** @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @permissionId CONTACTS_ATTACHMENTS.VIEW * @webhook * @eventType wix.contacts.v4.attachment_created */ export declare function onAttachmentCreated(handler: (event: AttachmentCreatedEnvelope) => void | Promise): void; export interface AttachmentDeletedEnvelope { metadata: EventMetadata; } /** @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @permissionId CONTACTS_ATTACHMENTS.VIEW * @webhook * @eventType wix.contacts.v4.attachment_deleted */ export 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 ([SDK](https://dev.wix.com/docs/sdk/backend-modules/media/files/upload-api) | [REST](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 * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GenerateAttachmentUploadUrl */ export declare function generateAttachmentUploadUrl(contactId: string, fileName: string, options: GenerateAttachmentUploadUrlOptions): Promise; export interface GenerateAttachmentUploadUrlOptions { /** * Mime type of the attachment file, for example, `application/pdf`. * See supported mime types ([REST](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types)| * [SDK](https://dev.wix.com/docs/sdk/backend-modules/crm/attachments/supported-mime-types)). */ 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 * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.ListAttachments */ export declare function listAttachments(contactId: string, options?: ListAttachmentsOptions): Promise; export 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 * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @applicableIdentity APP * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.DeleteAttachment */ export declare function deleteAttachment(identifiers: DeleteAttachmentIdentifiers): Promise; export interface DeleteAttachmentIdentifiers { /** Contact ID for the attachment to delete. */ contactId: string; /** Attachment ID to delete. */ attachmentId: string; } /** * Retrieves the specified attachment for the specified contact. * @public * @requiredField identifiers * @requiredField identifiers.attachmentId * @requiredField identifiers.contactId * @permissionId CONTACTS_ATTACHMENTS.VIEW * @permissionScope Manage Contact Attachments * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS * @applicableIdentity APP * @returns The requested attachment. * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GetAttachment */ export declare function getAttachment(identifiers: GetAttachmentIdentifiers): Promise; export interface GetAttachmentIdentifiers { /** Contact ID for the attachment to retrieve. */ contactId: string; /** Attachment ID to retrieve. */ attachmentId: string; }