{"version":3,"sources":["../../src/contacts-v4-attachment-attachments.public.ts","../../src/contacts-v4-attachment-attachments.universal.ts","../../src/contacts-v4-attachment-attachments.http.ts","../../src/contacts-v4-attachment-attachments.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTDocumentToSDKDocument } from '@wix/sdk-runtime/transformations/document';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\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  AttachmentCreatedEnvelope,\n  AttachmentDeletedEnvelope,\n  ContactAttachment,\n  DeleteAttachmentIdentifiers,\n  GenerateAttachmentUploadUrlOptions,\n  GenerateAttachmentUploadUrlResponse,\n  GetAttachmentIdentifiers,\n  ListAttachmentsOptions,\n  ListAttachmentsResponse,\n  deleteAttachment as universalDeleteAttachment,\n  generateAttachmentUploadUrl as universalGenerateAttachmentUploadUrl,\n  getAttachment as universalGetAttachment,\n  listAttachments as universalListAttachments,\n} from './contacts-v4-attachment-attachments.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/crm' };\n\nexport function generateAttachmentUploadUrl(\n  httpClient: HttpClient\n): GenerateAttachmentUploadUrlSignature {\n  return (\n    contactId: string,\n    fileName: string,\n    options: NonNullablePaths<GenerateAttachmentUploadUrlOptions, `mimeType`, 2>\n  ) =>\n    universalGenerateAttachmentUploadUrl(\n      contactId,\n      fileName,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GenerateAttachmentUploadUrlSignature {\n  /**\n   * Generates an upload URL for uploading a file as an attachment to a specified contact.\n   *\n   * To learn how to use the generated upload URL in the response to upload an attachment file,\n   * see the [Upload API](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api).\n   * @param - ID of the contact for whom the attachment is being uploaded.\n   * @param - File name of the attachment including the extension, for example, `contact-cv.pdf`.\n   */\n  (\n    contactId: string,\n    fileName: string,\n    options: NonNullablePaths<GenerateAttachmentUploadUrlOptions, `mimeType`, 2>\n  ): Promise<\n    NonNullablePaths<GenerateAttachmentUploadUrlResponse, `uploadUrl`, 2>\n  >;\n}\n\nexport function listAttachments(\n  httpClient: HttpClient\n): ListAttachmentsSignature {\n  return (contactId: string, options?: ListAttachmentsOptions) =>\n    universalListAttachments(\n      contactId,\n      options,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface ListAttachmentsSignature {\n  /**\n   * Retrieves a list of attachments associated with a specified contact.\n   * @param - Contact ID for the attachments to be listed.\n   */\n  (contactId: string, options?: ListAttachmentsOptions): Promise<\n    NonNullablePaths<\n      ListAttachmentsResponse,\n      | `attachments`\n      | `attachments.${number}._id`\n      | `attachments.${number}.fileName`\n      | `attachments.${number}.mimeType`\n      | `attachments.${number}.attachmentType`,\n      4\n    >\n  >;\n}\n\nexport function deleteAttachment(\n  httpClient: HttpClient\n): DeleteAttachmentSignature {\n  return (\n    identifiers: NonNullablePaths<\n      DeleteAttachmentIdentifiers,\n      `attachmentId` | `contactId`,\n      2\n    >\n  ) =>\n    universalDeleteAttachment(\n      identifiers,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface DeleteAttachmentSignature {\n  /**\n   * Deletes the specified attachment from the specified contact.\n   */\n  (\n    identifiers: NonNullablePaths<\n      DeleteAttachmentIdentifiers,\n      `attachmentId` | `contactId`,\n      2\n    >\n  ): Promise<void>;\n}\n\nexport function getAttachment(httpClient: HttpClient): GetAttachmentSignature {\n  return (\n    identifiers: NonNullablePaths<\n      GetAttachmentIdentifiers,\n      `attachmentId` | `contactId`,\n      2\n    >\n  ) =>\n    universalGetAttachment(\n      identifiers,\n      // @ts-ignore\n      { httpClient }\n    );\n}\n\ninterface GetAttachmentSignature {\n  /**\n   * Retrieves the specified attachment for the specified contact.\n   * @returns The requested attachment.\n   */\n  (\n    identifiers: NonNullablePaths<\n      GetAttachmentIdentifiers,\n      `attachmentId` | `contactId`,\n      2\n    >\n  ): Promise<\n    NonNullablePaths<\n      ContactAttachment,\n      `_id` | `fileName` | `mimeType` | `attachmentType`,\n      2\n    >\n  >;\n}\n\nexport const onAttachmentCreated = EventDefinition(\n  'wix.contacts.v4.attachment_created',\n  true,\n  (event: AttachmentCreatedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTImageToSDKImage,\n          paths: [{ path: 'entity.image' }, { path: 'entity.previewImage' }],\n        },\n        {\n          transformFn: transformRESTDocumentToSDKDocument,\n          paths: [{ path: 'entity.document' }],\n        },\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [{ path: 'metadata.eventTime' }],\n        },\n      ])\n    )\n)<AttachmentCreatedEnvelope>();\nexport const onAttachmentDeleted = EventDefinition(\n  'wix.contacts.v4.attachment_deleted',\n  true,\n  (event: AttachmentDeletedEnvelope) =>\n    renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(event, [\n        {\n          transformFn: transformRESTImageToSDKImage,\n          paths: [\n            { path: 'undefined.image' },\n            { path: 'undefined.previewImage' },\n          ],\n        },\n        {\n          transformFn: transformRESTDocumentToSDKDocument,\n          paths: [{ path: 'undefined.document' }],\n        },\n        {\n          transformFn: transformRESTTimestampToSDKTimestamp,\n          paths: [{ path: 'metadata.eventTime' }],\n        },\n      ])\n    )\n)<AttachmentDeletedEnvelope>();\n\nexport {\n  AccountInfo,\n  AccountInfoMetadata,\n  ActionEvent,\n  AttachmentCreatedEnvelope,\n  AttachmentDeletedEnvelope,\n  AttachmentMedia,\n  AttachmentMediaMediaOneOf,\n  AttachmentMetadata,\n  AttachmentSource,\n  AttachmentType,\n  BaseEventMetadata,\n  ContactAttachment,\n  ContactAttachmentMediaOneOf,\n  CreateDemoAttachmentRequest,\n  CreateDemoAttachmentResponse,\n  CrmAttachment,\n  CrmAttachmentAttachmentType,\n  CrmAttachmentUploadedEvent,\n  DeleteAttachmentIdentifiers,\n  DeleteAttachmentRequest,\n  DeleteAttachmentResponse,\n  DemoContactType,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  Empty,\n  EntityCreatedEvent,\n  EntityDeletedEvent,\n  EntityUpdatedEvent,\n  EventMetadata,\n  GenerateAttachmentUploadUrlOptions,\n  GenerateAttachmentUploadUrlRequest,\n  GenerateAttachmentUploadUrlResponse,\n  GetAttachmentIdentifiers,\n  GetAttachmentRequest,\n  GetAttachmentResponse,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  ListAttachmentsOptions,\n  ListAttachmentsRequest,\n  ListAttachmentsResponse,\n  MessageEnvelope,\n  Paging,\n  PagingMetadata,\n  RestoreInfo,\n  WebhookIdentityType,\n} from './contacts-v4-attachment-attachments.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n  renameKeysFromSDKRequestToRESTRequest,\n  renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixContactsV4Attachment from './contacts-v4-attachment-attachments.http.js';\nimport { transformRESTImageToSDKImage } from '@wix/sdk-runtime/transformations/image';\nimport { transformRESTDocumentToSDKDocument } from '@wix/sdk-runtime/transformations/document';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface ContactAttachment extends ContactAttachmentMediaOneOf {\n  /** Image details when the attachment type is `IMAGE`. */\n  image?: string;\n  /** Document details when the attachment type is `OTHER`. */\n  document?: string;\n  /**\n   * Attachment ID.\n   * @readonly\n   * @format GUID\n   */\n  _id?: string;\n  /**\n   * Details of the preview image reduced size when the attachment is of type `IMAGE`.\n   * @readonly\n   */\n  previewImage?: string;\n  /**\n   * Name of the attachment file.\n   * @readonly\n   */\n  fileName?: string;\n  /**\n   * 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).\n   * @readonly\n   */\n  mimeType?: string;\n  /**\n   * Type of the attachment.\n   * @readonly\n   */\n  attachmentType?: AttachmentTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface ContactAttachmentMediaOneOf {\n  /** Image details when the attachment type is `IMAGE`. */\n  image?: string;\n  /** Document details when the attachment type is `OTHER`. */\n  document?: string;\n}\n\nexport enum AttachmentType {\n  /** Unknown attachment type. */\n  UNKNOWN = 'UNKNOWN',\n  /** Attachment is an image file. */\n  IMAGE = 'IMAGE',\n  /** Attachment is a document or any non-image file type. */\n  OTHER = 'OTHER',\n}\n\n/** @enumType */\nexport type AttachmentTypeWithLiterals =\n  | AttachmentType\n  | 'UNKNOWN'\n  | 'IMAGE'\n  | 'OTHER';\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 Empty {}\n\nexport interface CrmAttachmentUploadedEvent {\n  attachment?: CrmAttachment;\n  /** @format GUID */\n  uploadJobId?: string;\n}\n\nexport interface CrmAttachment {\n  /**\n   * @readonly\n   * @format GUID\n   */\n  _id?: string | null;\n  revision?: string | null;\n  /** @readonly */\n  _createdDate?: Date | null;\n  /** @readonly */\n  _updatedDate?: Date | null;\n  /** @readonly */\n  source?: AttachmentSource;\n  metadata?: AttachmentMetadata;\n  media?: AttachmentMedia;\n  /**\n   * Inferred by the media type\n   * @readonly\n   */\n  attachmentType?: CrmAttachmentAttachmentTypeWithLiterals;\n}\n\nexport interface AttachmentSource {\n  appId?: string;\n}\n\nexport interface AttachmentMetadata {\n  /**\n   * Entity type e.g: INVOICES\n   * @minLength 2\n   * @maxLength 50\n   */\n  entityType?: string | null;\n  /**\n   * Id of the entity, e.g: invoice id\n   * @minLength 1\n   * @maxLength 50\n   */\n  entityId?: string | null;\n  /** @format GUID */\n  contactId?: string | null;\n  /**\n   * @minLength 1\n   * @maxLength 50\n   */\n  externalId?: string | null;\n}\n\nexport interface AttachmentMedia extends AttachmentMediaMediaOneOf {\n  image?: string;\n  document?: string;\n  /** @readonly */\n  previewImage?: string;\n  /** @minLength 1 */\n  fileName?: string;\n  /**\n   * @minLength 1\n   * @maxLength 100\n   */\n  mimeType?: string;\n}\n\n/** @oneof */\nexport interface AttachmentMediaMediaOneOf {\n  image?: string;\n  document?: string;\n}\n\nexport enum CrmAttachmentAttachmentType {\n  UNKNOWN = 'UNKNOWN',\n  DOCUMENT = 'DOCUMENT',\n  IMAGE = 'IMAGE',\n}\n\n/** @enumType */\nexport type CrmAttachmentAttachmentTypeWithLiterals =\n  | CrmAttachmentAttachmentType\n  | 'UNKNOWN'\n  | 'DOCUMENT'\n  | 'IMAGE';\n\nexport interface CreateDemoAttachmentRequest {\n  /**\n   * The contact id whose demo attachment is being created\n   * @format GUID\n   */\n  contactId?: string;\n  /** The type of the demo contact */\n  demoContactType?: DemoContactTypeWithLiterals;\n}\n\nexport enum DemoContactType {\n  KAT = 'KAT',\n  DAN = 'DAN',\n}\n\n/** @enumType */\nexport type DemoContactTypeWithLiterals = DemoContactType | 'KAT' | 'DAN';\n\nexport interface CreateDemoAttachmentResponse {\n  /** The created attachment */\n  attachment?: ContactAttachment;\n}\n\nexport interface GenerateAttachmentUploadUrlRequest {\n  /**\n   * ID of the contact for whom the attachment is being uploaded.\n   * @format GUID\n   */\n  contactId: string;\n  /**\n   * File name of the attachment including the extension, for example, `contact-cv.pdf`.\n   * @minLength 1\n   * @maxLength 260\n   */\n  fileName: string;\n  /**\n   * Mime type of the attachment file, for example, `application/pdf`.\n   * See [supported mime types](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types).\n   * @minLength 1\n   * @maxLength 255\n   */\n  mimeType: string;\n}\n\nexport interface GenerateAttachmentUploadUrlResponse {\n  /**\n   * The URL for uploading a file as an attachment to the contact.\n   * @format WEB_URL\n   */\n  uploadUrl?: string;\n}\n\nexport interface ListAttachmentsRequest {\n  /**\n   * Contact ID for the attachments to be listed.\n   * @format GUID\n   */\n  contactId: string;\n  /** Allow paginating, default: limit = 100 and offset = 0 */\n  paging?: Paging;\n}\n\nexport interface Paging {\n  /**\n   * Number of items to return.\n   *\n   * Default: `100`\n   * Max: `100`\n   * @max 100\n   */\n  limit?: number | null;\n  /** Number of items to skip in the current sort order. */\n  offset?: number | null;\n}\n\nexport interface ListAttachmentsResponse {\n  /** List of attachments for the specified contact. */\n  attachments?: ContactAttachment[];\n  /** Metadata for the paginated results. */\n  metadata?: PagingMetadata;\n}\n\nexport interface PagingMetadata {\n  /** Number of items returned in the response. */\n  count?: number | null;\n  /** Offset that was requested. */\n  offset?: number | null;\n  /** Total number of items that match the query. */\n  total?: number | null;\n  /** Whether the server failed to calculate the `total` field. */\n  tooManyToCount?: boolean | null;\n}\n\nexport interface DeleteAttachmentRequest {\n  /**\n   * Contact ID for the attachment to delete.\n   * @format GUID\n   */\n  contactId: string;\n  /**\n   * Attachment ID to delete.\n   * @format GUID\n   */\n  attachmentId: string;\n}\n\nexport interface DeleteAttachmentResponse {}\n\nexport interface GetAttachmentRequest {\n  /**\n   * Contact ID for the attachment to retrieve.\n   * @format GUID\n   */\n  contactId: string;\n  /**\n   * Attachment ID to retrieve.\n   * @format GUID\n   */\n  attachmentId: string;\n}\n\nexport interface GetAttachmentResponse {\n  /** The requested attachment. */\n  attachment?: ContactAttachment;\n}\n\nexport interface MessageEnvelope {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Stringify payload. */\n  data?: string;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n  /** @readonly */\n  identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n  /**\n   * ID of a site visitor that has not logged in to the site.\n   * @format GUID\n   */\n  anonymousVisitorId?: string;\n  /**\n   * ID of a site visitor that has logged in to the site.\n   * @format GUID\n   */\n  memberId?: string;\n  /**\n   * ID of a Wix user (site owner, contributor, etc.).\n   * @format GUID\n   */\n  wixUserId?: string;\n  /**\n   * ID of an app.\n   * @format GUID\n   */\n  appId?: string;\n}\n\nexport enum WebhookIdentityType {\n  UNKNOWN = 'UNKNOWN',\n  ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n  MEMBER = 'MEMBER',\n  WIX_USER = 'WIX_USER',\n  APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n  | WebhookIdentityType\n  | 'UNKNOWN'\n  | 'ANONYMOUS_VISITOR'\n  | 'MEMBER'\n  | 'WIX_USER'\n  | 'APP';\n\nexport interface AccountInfo {\n  /**\n   * ID of the Wix account associated with the event.\n   * @format GUID\n   */\n  accountId?: string | null;\n  /**\n   * ID of the parent Wix account. Only included when accountId belongs to a child account.\n   * @format GUID\n   */\n  parentAccountId?: string | null;\n  /**\n   * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n   * @format GUID\n   */\n  siteId?: string | null;\n}\n\nexport interface BaseEventMetadata {\n  /**\n   * App instance ID.\n   * @format GUID\n   */\n  instanceId?: string | null;\n  /**\n   * Event type.\n   * @maxLength 150\n   */\n  eventType?: string;\n  /** The identification type and identity data. */\n  identity?: IdentificationData;\n  /** Details related to the account */\n  accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n  /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n  _id?: string;\n  /**\n   * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n   * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n   */\n  entityFqdn?: string;\n  /**\n   * Event action name, placed at the top level to make it easier for users to dispatch messages.\n   * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n   */\n  slug?: string;\n  /** ID of the entity associated with the event. */\n  entityId?: string;\n  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n  eventTime?: Date | null;\n  /**\n   * Whether the event was triggered as a result of a privacy regulation application\n   * (for example, GDPR).\n   */\n  triggeredByAnonymizeRequest?: boolean | null;\n  /** If present, indicates the action that triggered the event. */\n  originatedFrom?: string | null;\n  /**\n   * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n   * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n   */\n  entityEventSequence?: string | null;\n  accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n  /** ID of the Wix account associated with the event */\n  accountId: string;\n  /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n  siteId?: string;\n  /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n  parentAccountId?: string;\n}\n\nexport interface AttachmentCreatedEnvelope {\n  entity: ContactAttachment;\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Contact Attachments\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_ATTACHMENTS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.attachment_created\n * @slug created\n */\nexport declare function onAttachmentCreated(\n  handler: (event: AttachmentCreatedEnvelope) => void | Promise<void>\n): void;\n\nexport interface AttachmentDeletedEnvelope {\n  metadata: EventMetadata;\n}\n\n/** @permissionScope Manage Stores\n * @permissionScopeId SCOPE.STORES.MANAGE-STORES\n * @permissionScope Manage Events\n * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS\n * @permissionScope Manage Contact Attachments\n * @permissionScopeId SCOPE.DC-CONTACTS.MANAGE-CONTACT-ATTACHMENTS\n * @permissionScope Manage Members and Contacts - all permissions\n * @permissionScopeId SCOPE.DC-CONTACTS-MEGA.MANAGE-MEMBERS-CONTACTS\n * @permissionId CONTACTS_ATTACHMENTS.VIEW\n * @webhook\n * @eventType wix.contacts.v4.attachment_deleted\n * @slug deleted\n */\nexport declare function onAttachmentDeleted(\n  handler: (event: AttachmentDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Generates an upload URL for uploading a file as an attachment to a specified contact.\n *\n * To learn how to use the generated upload URL in the response to upload an attachment file,\n * see the [Upload API](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api).\n * @param contactId - ID of the contact for whom the attachment is being uploaded.\n * @param fileName - File name of the attachment including the extension, for example, `contact-cv.pdf`.\n * @public\n * @requiredField contactId\n * @requiredField fileName\n * @requiredField options\n * @requiredField options.mimeType\n * @permissionId CONTACTS_ATTACHMENTS.MODIFY\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GenerateAttachmentUploadUrl\n */\nexport async function generateAttachmentUploadUrl(\n  contactId: string,\n  fileName: string,\n  options: NonNullablePaths<GenerateAttachmentUploadUrlOptions, `mimeType`, 2>\n): Promise<\n  NonNullablePaths<GenerateAttachmentUploadUrlResponse, `uploadUrl`, 2>\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[3] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    contactId: contactId,\n    fileName: fileName,\n    mimeType: options?.mimeType,\n  });\n\n  const reqOpts =\n    ambassadorWixContactsV4Attachment.generateAttachmentUploadUrl(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          contactId: '$[0]',\n          fileName: '$[1]',\n          mimeType: '$[2].mimeType',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['contactId', 'fileName', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GenerateAttachmentUploadUrlOptions {\n  /**\n   * Mime type of the attachment file, for example, `application/pdf`.\n   * See [supported mime types](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/attachments/attachment-v4/supported-mime-types).\n   * @minLength 1\n   * @maxLength 255\n   */\n  mimeType: string;\n}\n\n/**\n * Retrieves a list of attachments associated with a specified contact.\n * @param contactId - Contact ID for the attachments to be listed.\n * @public\n * @requiredField contactId\n * @permissionId CONTACTS_ATTACHMENTS.VIEW\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.ListAttachments\n */\nexport async function listAttachments(\n  contactId: string,\n  options?: ListAttachmentsOptions\n): Promise<\n  NonNullablePaths<\n    ListAttachmentsResponse,\n    | `attachments`\n    | `attachments.${number}._id`\n    | `attachments.${number}.fileName`\n    | `attachments.${number}.mimeType`\n    | `attachments.${number}.attachmentType`,\n    4\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[2] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    contactId: contactId,\n    paging: options?.paging,\n  });\n\n  const reqOpts = ambassadorWixContactsV4Attachment.listAttachments(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(result.data, [\n        {\n          transformFn: transformRESTImageToSDKImage,\n          paths: [\n            { path: 'attachments.image' },\n            { path: 'attachments.previewImage' },\n          ],\n        },\n        {\n          transformFn: transformRESTDocumentToSDKDocument,\n          paths: [{ path: 'attachments.document' }],\n        },\n      ])\n    )!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: { contactId: '$[0]', paging: '$[1].paging' },\n        singleArgumentUnchanged: false,\n      },\n      ['contactId', 'options']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface ListAttachmentsOptions {\n  /** Allow paginating, default: limit = 100 and offset = 0 */\n  paging?: Paging;\n}\n\n/**\n * Deletes the specified attachment from the specified contact.\n * @public\n * @requiredField identifiers\n * @requiredField identifiers.attachmentId\n * @requiredField identifiers.contactId\n * @permissionId CONTACTS_ATTACHMENTS.MODIFY\n * @applicableIdentity APP\n * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.DeleteAttachment\n */\nexport async function deleteAttachment(\n  identifiers: NonNullablePaths<\n    DeleteAttachmentIdentifiers,\n    `attachmentId` | `contactId`,\n    2\n  >\n): Promise<void> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    contactId: identifiers?.contactId,\n    attachmentId: identifiers?.attachmentId,\n  });\n\n  const reqOpts = ambassadorWixContactsV4Attachment.deleteAttachment(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: {\n          contactId: '$[0].contactId',\n          attachmentId: '$[0].attachmentId',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['identifiers']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface DeleteAttachmentIdentifiers {\n  /**\n   * Contact ID for the attachment to delete.\n   * @format GUID\n   */\n  contactId: string;\n  /**\n   * Attachment ID to delete.\n   * @format GUID\n   */\n  attachmentId: string;\n}\n\n/**\n * Retrieves the specified attachment for the specified contact.\n * @public\n * @requiredField identifiers\n * @requiredField identifiers.attachmentId\n * @requiredField identifiers.contactId\n * @permissionId CONTACTS_ATTACHMENTS.VIEW\n * @applicableIdentity APP\n * @returns The requested attachment.\n * @fqn com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GetAttachment\n */\nexport async function getAttachment(\n  identifiers: NonNullablePaths<\n    GetAttachmentIdentifiers,\n    `attachmentId` | `contactId`,\n    2\n  >\n): Promise<\n  NonNullablePaths<\n    ContactAttachment,\n    `_id` | `fileName` | `mimeType` | `attachmentType`,\n    2\n  >\n> {\n  // @ts-ignore\n  const { httpClient, sideEffects } = arguments[1] as {\n    httpClient: HttpClient;\n    sideEffects?: any;\n  };\n\n  const payload = renameKeysFromSDKRequestToRESTRequest({\n    contactId: identifiers?.contactId,\n    attachmentId: identifiers?.attachmentId,\n  });\n\n  const reqOpts = ambassadorWixContactsV4Attachment.getAttachment(payload);\n\n  sideEffects?.onSiteCall?.();\n  try {\n    const result = await httpClient.request(reqOpts);\n    sideEffects?.onSuccess?.(result);\n\n    return renameKeysFromRESTResponseToSDKResponse(\n      transformPaths(result.data, [\n        {\n          transformFn: transformRESTImageToSDKImage,\n          paths: [\n            { path: 'attachment.image' },\n            { path: 'attachment.previewImage' },\n          ],\n        },\n        {\n          transformFn: transformRESTDocumentToSDKDocument,\n          paths: [{ path: 'attachment.document' }],\n        },\n      ])\n    )?.attachment!;\n  } catch (err: any) {\n    const transformedError = sdkTransformError(\n      err,\n      {\n        spreadPathsToArguments: {},\n        explicitPathsToArguments: {\n          contactId: '$[0].contactId',\n          attachmentId: '$[0].attachmentId',\n        },\n        singleArgumentUnchanged: false,\n      },\n      ['identifiers']\n    );\n    sideEffects?.onError?.(err);\n\n    throw transformedError;\n  }\n}\n\nexport interface GetAttachmentIdentifiers {\n  /**\n   * Contact ID for the attachment to retrieve.\n   * @format GUID\n   */\n  contactId: string;\n  /**\n   * Attachment ID to retrieve.\n   * @format GUID\n   */\n  attachmentId: string;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveComWixpressContactsAttachmentsV4ContactAttachmentsServiceV4Url(\n  opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n  const domainToMappings = {\n    'api._api_base_domain_': [\n      {\n        srcPath: '/contacts-attachments-app',\n        destPath: '',\n      },\n    ],\n    'www._base_domain_': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    'manage._base_domain_': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    'editor._base_domain_': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    'blocks._base_domain_': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    'create.editorx': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    'www.wixapis.com': [\n      {\n        srcPath: '/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    _: [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n    '*.dev.wix-code.com': [\n      {\n        srcPath: '/_api/contacts/v4/attachments',\n        destPath: '/v4/attachments',\n      },\n    ],\n  };\n\n  return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_crm_attachments';\n\n/**\n * Generates an upload URL for uploading a file as an attachment to a specified contact.\n *\n * To learn how to use the generated upload URL in the response to upload an attachment file,\n * see the [Upload API](https://dev.wix.com/docs/rest/assets/media/media-manager/files/upload-api).\n */\nexport function generateAttachmentUploadUrl(\n  payload: object\n): RequestOptionsFactory<any> {\n  function __generateAttachmentUploadUrl({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.contacts.v4.attachment',\n      method: 'POST' as any,\n      methodFqn:\n        'com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GenerateAttachmentUploadUrl',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressContactsAttachmentsV4ContactAttachmentsServiceV4Url(\n        {\n          protoPath: '/v4/attachments/{contactId}/upload-url',\n          data: payload,\n          host,\n        }\n      ),\n      data: payload,\n    };\n\n    return metadata;\n  }\n\n  return __generateAttachmentUploadUrl;\n}\n\n/** Retrieves a list of attachments associated with a specified contact. */\nexport function listAttachments(payload: object): RequestOptionsFactory<any> {\n  function __listAttachments({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.contacts.v4.attachment',\n      method: 'GET' as any,\n      methodFqn:\n        'com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.ListAttachments',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressContactsAttachmentsV4ContactAttachmentsServiceV4Url(\n        { protoPath: '/v4/attachments/{contactId}', data: payload, host }\n      ),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'attachments.image.urlExpirationDate' },\n              { path: 'attachments.document.urlExpirationDate' },\n              { path: 'attachments.previewImage.urlExpirationDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __listAttachments;\n}\n\n/** Deletes the specified attachment from the specified contact. */\nexport function deleteAttachment(payload: object): RequestOptionsFactory<any> {\n  function __deleteAttachment({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.contacts.v4.attachment',\n      method: 'DELETE' as any,\n      methodFqn:\n        'com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.DeleteAttachment',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressContactsAttachmentsV4ContactAttachmentsServiceV4Url(\n        {\n          protoPath: '/v4/attachments/{contactId}/{attachmentId}',\n          data: payload,\n          host,\n        }\n      ),\n      params: toURLSearchParams(payload),\n    };\n\n    return metadata;\n  }\n\n  return __deleteAttachment;\n}\n\n/** Retrieves the specified attachment for the specified contact. */\nexport function getAttachment(payload: object): RequestOptionsFactory<any> {\n  function __getAttachment({ host }: any) {\n    const metadata = {\n      entityFqdn: 'wix.contacts.v4.attachment',\n      method: 'GET' as any,\n      methodFqn:\n        'com.wixpress.contacts.attachments.v4.ContactAttachmentsServiceV4.GetAttachment',\n      packageName: PACKAGE_NAME,\n      migrationOptions: {\n        optInTransformResponse: true,\n      },\n      url: resolveComWixpressContactsAttachmentsV4ContactAttachmentsServiceV4Url(\n        {\n          protoPath: '/v4/attachments/{contactId}/{attachmentId}',\n          data: payload,\n          host,\n        }\n      ),\n      params: toURLSearchParams(payload),\n      transformResponse: (payload: any) =>\n        transformPaths(payload, [\n          {\n            transformFn: transformRESTTimestampToSDKTimestamp,\n            paths: [\n              { path: 'attachment.image.urlExpirationDate' },\n              { path: 'attachment.document.urlExpirationDate' },\n              { path: 'attachment.previewImage.urlExpirationDate' },\n            ],\n          },\n        ]),\n    };\n\n    return metadata;\n  }\n\n  return __getAttachment;\n}\n","import {\n  generateAttachmentUploadUrl as publicGenerateAttachmentUploadUrl,\n  listAttachments as publicListAttachments,\n  deleteAttachment as publicDeleteAttachment,\n  getAttachment as publicGetAttachment,\n} from './contacts-v4-attachment-attachments.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 { onAttachmentCreated as publicOnAttachmentCreated } from './contacts-v4-attachment-attachments.public.js';\nimport { onAttachmentDeleted as publicOnAttachmentDeleted } from './contacts-v4-attachment-attachments.public.js';\n\nexport const generateAttachmentUploadUrl: MaybeContext<\n  BuildRESTFunction<typeof publicGenerateAttachmentUploadUrl> &\n    typeof publicGenerateAttachmentUploadUrl\n> = /*#__PURE__*/ createRESTModule(publicGenerateAttachmentUploadUrl);\nexport const listAttachments: MaybeContext<\n  BuildRESTFunction<typeof publicListAttachments> & typeof publicListAttachments\n> = /*#__PURE__*/ createRESTModule(publicListAttachments);\nexport const deleteAttachment: MaybeContext<\n  BuildRESTFunction<typeof publicDeleteAttachment> &\n    typeof publicDeleteAttachment\n> = /*#__PURE__*/ createRESTModule(publicDeleteAttachment);\nexport const getAttachment: MaybeContext<\n  BuildRESTFunction<typeof publicGetAttachment> & typeof publicGetAttachment\n> = /*#__PURE__*/ createRESTModule(publicGetAttachment);\n/** */\nexport const onAttachmentCreated: BuildEventDefinition<\n  typeof publicOnAttachmentCreated\n> &\n  typeof publicOnAttachmentCreated = createEventModule(\n  publicOnAttachmentCreated\n);\n/** */\nexport const onAttachmentDeleted: BuildEventDefinition<\n  typeof publicOnAttachmentDeleted\n> &\n  typeof publicOnAttachmentDeleted = createEventModule(\n  publicOnAttachmentDeleted\n);\n\nexport {\n  AttachmentType,\n  CrmAttachmentAttachmentType,\n  DemoContactType,\n  WebhookIdentityType,\n} from './contacts-v4-attachment-attachments.universal.js';\nexport {\n  ContactAttachment,\n  ContactAttachmentMediaOneOf,\n  DomainEvent,\n  DomainEventBodyOneOf,\n  EntityCreatedEvent,\n  RestoreInfo,\n  EntityUpdatedEvent,\n  EntityDeletedEvent,\n  ActionEvent,\n  Empty,\n  CrmAttachmentUploadedEvent,\n  CrmAttachment,\n  AttachmentSource,\n  AttachmentMetadata,\n  AttachmentMedia,\n  AttachmentMediaMediaOneOf,\n  CreateDemoAttachmentRequest,\n  CreateDemoAttachmentResponse,\n  GenerateAttachmentUploadUrlRequest,\n  GenerateAttachmentUploadUrlResponse,\n  ListAttachmentsRequest,\n  Paging,\n  ListAttachmentsResponse,\n  PagingMetadata,\n  DeleteAttachmentRequest,\n  DeleteAttachmentResponse,\n  GetAttachmentRequest,\n  GetAttachmentResponse,\n  MessageEnvelope,\n  IdentificationData,\n  IdentificationDataIdOneOf,\n  AccountInfo,\n  BaseEventMetadata,\n  EventMetadata,\n  AccountInfoMetadata,\n  AttachmentCreatedEnvelope,\n  AttachmentDeletedEnvelope,\n  GenerateAttachmentUploadUrlOptions,\n  ListAttachmentsOptions,\n  DeleteAttachmentIdentifiers,\n  GetAttachmentIdentifiers,\n} from './contacts-v4-attachment-attachments.universal.js';\nexport {\n  AttachmentTypeWithLiterals,\n  CrmAttachmentAttachmentTypeWithLiterals,\n  DemoContactTypeWithLiterals,\n  WebhookIdentityTypeWithLiterals,\n} from './contacts-v4-attachment-attachments.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,sCAAAC,2CAA0C;AACnD,SAAS,gCAAAC,qCAAoC;AAC7C,SA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OAAO,CAAC,EAAE,MAAM,eAAe,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAAA,MACnE;AAAA,MACA;AAAA,QACE,aAAaC;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,kBAAkB,CAAC;AAAA,MACrC;AAAA,MACA;AAAA,QACE,aAAaC;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA6B;AACtB,IAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA,CAAC,UACCJ;AAAA,IACEC,gBAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAaC;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,kBAAkB;AAAA,UAC1B,EAAE,MAAM,yBAAyB;AAAA,QACnC;AAAA,MACF;AAAA,MACA;AAAA,QACE,aAAaC;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,MACA;AAAA,QACE,aAAaC;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAA6B;;;AGhM7B,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAS3B,IAAMC,+BAGK,iCAAiBA,4BAAiC;AAC7D,IAAMC,mBAEK,iCAAiBA,gBAAqB;AACjD,IAAMC,oBAGK,iCAAiBA,iBAAsB;AAClD,IAAMC,iBAEK,iCAAiBA,cAAmB;AAE/C,IAAMC,uBAGwB;AAAA,EACnC;AACF;AAEO,IAAMC,uBAGwB;AAAA,EACnC;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTDocumentToSDKDocument","transformRESTImageToSDKImage","transformRESTTimestampToSDKTimestamp","transformPaths","payload","transformPaths","AttachmentType","CrmAttachmentAttachmentType","DemoContactType","WebhookIdentityType","generateAttachmentUploadUrl","listAttachments","deleteAttachment","getAttachment","generateAttachmentUploadUrl","listAttachments","deleteAttachment","getAttachment","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTImageToSDKImage","transformRESTDocumentToSDKDocument","transformRESTTimestampToSDKTimestamp","generateAttachmentUploadUrl","listAttachments","deleteAttachment","getAttachment","onAttachmentCreated","onAttachmentDeleted"]}