@opens/gateways 1.11.5 → 1.11.6

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/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/customer-service/index.ts","../src/chat-config/index.ts","../src/campaigns/index.ts","../src/chat-adapter/index.ts","../src/assets/index.ts","../src/contact-list/index.ts","../src/integrations/index.ts","../src/@common/client.ts","../src/@common/enums.ts"],"sourcesContent":["import { createClient, SDKGatewaysInterface, GatewayClientParams, GatewayMap } from './@common/client';\nimport { SERVICE_GATEWAYS } from './@common/enums';\n\nclass SDK {\n client: SDKGatewaysInterface | null = null;\n\n configure(params: GatewayClientParams) {\n this.client = createClient(params);\n }\n}\nconst sdk = new SDK();\n\n/**\n * Initializes the SDK with the required configuration parameters.\n * Must be called before using {@link gateway}.\n */\nexport const configure = (params: GatewayClientParams) => {\n sdk.configure(params);\n};\n\n/**\n * Returns the gateway instance for the specified service.\n *\n * @typeParam T - A service identifier key from {@link GatewayMap}.\n * @param service - The service identifier (e.g. `SERVICE_GATEWAYS.CUSTOMER_SERVICE`).\n * @returns The corresponding gateway instance with all its methods.\n * @throws {Error} If the SDK has not been configured via {@link configure}.\n * @throws {Error} If an unknown service identifier is provided.\n *\n * @example\n * ```ts\n * configure({ axiosClient, apiToken: '...', services: { customerService: { baseUrl: '...' } } });\n * const customer = gateway('customer-service');\n * const company = await customer.getCompanyById('123');\n * ```\n */\nexport function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];\nexport function gateway(service: SERVICE_GATEWAYS) {\n if (!sdk.client)\n throw new Error(\n 'SDK not configured. Please call configure() with the appropriate parameters before using the SDK.',\n );\n\n switch (service) {\n case SERVICE_GATEWAYS.CUSTOMER_SERVICE:\n if (!sdk.client.customerService)\n throw new Error(`Service 'customer-service' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.customerService;\n case SERVICE_GATEWAYS.CHAT_CONFIG:\n if (!sdk.client.chatConfig)\n throw new Error(`Service 'chat-config' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.chatConfig;\n case SERVICE_GATEWAYS.CAMPAIGNS:\n if (!sdk.client.campaigns)\n throw new Error(`Service 'campaigns' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.campaigns;\n case SERVICE_GATEWAYS.CHAT_ADAPTER:\n if (!sdk.client.chatAdapter)\n throw new Error(`Service 'chat-adapter' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.chatAdapter;\n case SERVICE_GATEWAYS.ASSETS:\n if (!sdk.client.assets)\n throw new Error(`Service 'assets' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.assets;\n case SERVICE_GATEWAYS.CONTACT_LIST:\n if (!sdk.client.contactList)\n throw new Error(`Service 'contact-list' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.contactList;\n case SERVICE_GATEWAYS.INTEGRATIONS:\n if (!sdk.client.integrations)\n throw new Error(`Service 'integrations' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.integrations;\n default:\n throw new Error(`Unknown service gateway: ${service}`);\n }\n}\n\nexport * from './campaigns/contracts';\nexport * from './chat-config/contracts';\nexport * from './customer-service/contracts';\nexport * from './chat-adapter/contracts';\nexport * from './assets/contracts';\nexport * from './contact-list/contracts';\nexport * from './integrations/contracts';\n","import type { AxiosInstance } from 'axios';\nimport type { CompanyResponse } from './contracts/company';\nimport type {\n WorkGroupListResponse,\n WorkGroupMembersResponse,\n WorkGroupResponse,\n} from './contracts/work-group';\nimport type {\n GetAllUsersParams,\n GetAllUsersResponse,\n GetManagedUsersResponse,\n} from './contracts/user';\n\n/**\n * Gateway for interacting with the Customer Service API.\n */\nexport class CustomerServiceGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves a company by its unique identifier.\n * @param companyId - The unique identifier of the company.\n * @returns The company data wrapped in a {@link CompanyResponse}.\n */\n async getCompanyById(companyId: string): Promise<CompanyResponse> {\n const { data } = await this.httpClient.get<CompanyResponse>(`${this.baseUrl}/companies/search/${companyId}`);\n return data;\n }\n\n /**\n * Retrieves all work groups for a company.\n * @param companyId - The unique identifier of the company.\n * @returns The work groups for the given company.\n */\n async getWorkGroups(companyId: string): Promise<WorkGroupListResponse> {\n const { data } = await this.httpClient.get<WorkGroupListResponse>(\n `${this.baseUrl}/companies/work-groups`,\n { params: { company_id: companyId } },\n );\n return data;\n }\n\n /**\n * Retrieves a work group by its unique identifier.\n * @param workGroupId - The unique identifier of the work group.\n * @param companyId - The unique identifier of the company (optional, sent as query parameter).\n * @returns The work group data wrapped in a {@link WorkGroupResponse}.\n */\n async getWorkGroupById(workGroupId: string, companyId?: string): Promise<WorkGroupResponse> {\n const params = companyId ? { company_id: companyId } : undefined;\n const { data } = await this.httpClient.get<WorkGroupResponse>(\n `${this.baseUrl}/companies/work-groups/${workGroupId}`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves the members of a work group by its identifier.\n * @param groupId - The unique identifier of the work group.\n * @param companyId - The unique identifier of the company (optional, sent as query parameter).\n * @param profile - Filter members by profile (optional).\n * @returns The members of the work group.\n */\n async getWorkGroupMembers(\n groupId: string,\n companyId?: string,\n profile?: string[],\n ): Promise<WorkGroupMembersResponse> {\n const params: { company_id?: string; profile?: string[] } = {};\n if (companyId) params.company_id = companyId;\n if (profile) params.profile = profile;\n const { data } = await this.httpClient.get<WorkGroupMembersResponse>(\n `${this.baseUrl}/bonds/work-groups/${groupId}`,\n { params },\n );\n return data;\n }\n\n async getAllUsers(params?: GetAllUsersParams): Promise<GetAllUsersResponse> {\n const { data } = await this.httpClient.get<GetAllUsersResponse>(\n `${this.baseUrl}/companies/users`,\n { params },\n );\n return data;\n }\n\n async getManagedUsers(managerId: string): Promise<GetManagedUsersResponse> {\n const { data } = await this.httpClient.get<GetManagedUsersResponse>(\n `${this.baseUrl}/users/managed/${managerId}`,\n );\n return data;\n }\n}\n\nexport type { CompanyResponse, CompanyData } from './contracts/company';\nexport type {\n WorkGroup,\n WorkGroupMember,\n WorkGroupMembersResponse,\n WorkGroupListResponse,\n WorkGroupResponse,\n} from './contracts/work-group';\nexport type {\n User,\n GetAllUsersParams,\n GetAllUsersResponse,\n ManagedUser,\n GetManagedUsersResponse,\n} from './contracts/user';","import type { AxiosInstance } from 'axios';\nimport type { ProviderListResponse } from './contracts/provider';\nimport type { ConfigListByProviderResponse, GetConfigsByProviderParams } from './contracts/config';\nimport type { Queue, QueueListResponse } from './contracts/queues';\nimport type { MetaTemplateConfigResponse, MetaTemplateConfigsResponse } from './contracts/meta-template';\nimport type {\n FindOrCreateQueueRuleRequest,\n GetRootRulesRequest,\n RootRulesResponse,\n Rule,\n QueueRule,\n} from './contracts/rule';\n\n/**\n * Gateway for interacting with the Chat Config API.\n */\nexport class ChatConfigGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves all available providers.\n * @returns The list of providers.\n */\n async getProviders(): Promise<ProviderListResponse> {\n const { data } = await this.httpClient.get<ProviderListResponse>(`${this.baseUrl}/providers`);\n return data;\n }\n\n /**\n * Retrieves configurations filtered by provider.\n * @param providerId - The unique identifier of the provider.\n * @param params - Optional query parameters for filtering configurations.\n * @returns The configurations for the given provider.\n */\n async getConfigsByProvider(\n providerId: string,\n params?: GetConfigsByProviderParams,\n ): Promise<ConfigListByProviderResponse> {\n const { data } = await this.httpClient.get<ConfigListByProviderResponse>(\n `${this.baseUrl}/config/provider/${providerId}`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves a queue by its ID.\n * @param queueId - The unique identifier of the queue.\n * @returns The queue data.\n */\n async getQueueById(queueId: string): Promise<Queue> {\n const { data } = await this.httpClient.get<Queue>(`${this.baseUrl}/queue/${queueId}`);\n return data;\n }\n\n async getQueues(): Promise<Queue[]> {\n const { data } = await this.httpClient.get<Queue[]>(`${this.baseUrl}/queues`);\n return data;\n }\n\n /**\n * Retrieves a Meta template configuration by its ID.\n * @param templateId - The unique identifier of the template.\n * @returns The Meta template configuration.\n */\n async getMetaTemplateById(templateId: string): Promise<MetaTemplateConfigResponse> {\n const { data } = await this.httpClient.get<MetaTemplateConfigResponse>(\n `${this.baseUrl}/meta-templates-config/${templateId}`,\n );\n return data;\n }\n\n /**\n * Retrieves template configurations associated with a configuration ID.\n * @param configId - The configuration identifier.\n * @returns The list of template configurations.\n */\n async getTemplateConfigsByConfigId(configId: string): Promise<MetaTemplateConfigsResponse> {\n const { data } = await this.httpClient.get<MetaTemplateConfigsResponse>(\n `${this.baseUrl}/meta-templates-config/config/${configId}`,\n );\n return data;\n }\n\n /**\n * Finds an existing queue rule or creates a new one if it does not exist.\n * @param payload - The payload containing companyId, queueId, and configId.\n * @returns The found or created queue rule.\n */\n async findOrCreateQueueRule(payload: FindOrCreateQueueRuleRequest): Promise<QueueRule> {\n const { data } = await this.httpClient.put<QueueRule>(`${this.baseUrl}/rules/queue/find-or-create`, payload);\n return data;\n }\n\n /**\n * @param params - The company and pagination parameters.\n * @returns The paginated initial service rules.\n */\n async getRootRules(params: GetRootRulesRequest): Promise<RootRulesResponse> {\n const { data } = await this.httpClient.get<RootRulesResponse>(`${this.baseUrl}/rules/paginated`, {\n params: {\n archiveStatus: 'unarchived',\n companyId: params.companyId,\n offset: params.offset,\n limit: params.limit,\n name: params?.name,\n isRoot: true,\n },\n });\n return data;\n }\n}\n\nexport type { Queue, QueueMember, DistributionType, QueueListResponse } from './contracts/queues';\nexport type { ProviderListResponse, Provider } from './contracts/provider';\nexport type {\n ConfigListByProviderResponse,\n Config,\n ConfigProvider,\n GetConfigsByProviderParams,\n} from './contracts/config';\nexport type {\n MetaTemplateButton,\n MetaTemplateConfigResponse,\n MetaTemplateConfigsResponse,\n} from './contracts/meta-template';\nexport type { FindOrCreateQueueRuleRequest, QueueRule, RootRulesResponse, Rule } from './contracts/rule';\n","import type { AxiosInstance } from 'axios';\nimport type {\n Campaign,\n CampaignPaginatedResponse,\n CampaignQueryParams,\n CreateCampaignRequest,\n PatchCampaignRequest,\n CampaignUser,\n} from './contracts/campaign';\nimport type {\n CampaignContactPaginatedResponse,\n CampaignContactQueryParams,\n CampaignContactResponse,\n CreateCampaignContactRequest,\n PatchCampaignContactRequest,\n} from './contracts/campaign-contacts';\nimport type {\n CampaignContactsDashboardData,\n CampaignContactsDashboardQueryParams,\n} from './contracts/campaign-contacts-dashboard';\nimport type {\n CampaignWorkGroup,\n CampaignWorkGroupPaginatedResponse,\n CampaignWorkGroupQueryParams,\n CreateCampaignWorkGroupRequest,\n} from './contracts/work-group';\n\n/**\n * Gateway for interacting with the Campaigns API.\n */\nexport class CampaignsGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves a paginated list of campaigns.\n * @param query - Optional query parameters for filtering and pagination.\n * @returns The paginated campaigns response.\n */\n async find(query?: CampaignQueryParams): Promise<CampaignPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignPaginatedResponse>(`${this.baseUrl}/campaigns`, {\n params: query,\n });\n return data;\n }\n\n /**\n * Retrieves a campaign by its unique identifier.\n * @param id - The unique identifier of the campaign.\n * @returns The campaign data.\n */\n async get(id: string): Promise<Campaign> {\n const { data } = await this.httpClient.get<Campaign>(`${this.baseUrl}/campaigns/${id}`);\n return data;\n }\n\n /**\n * Creates a new campaign.\n * @param payload - The campaign data to create.\n * @returns The created campaign.\n */\n async create(payload: CreateCampaignRequest): Promise<Campaign> {\n const { data } = await this.httpClient.post<Campaign>(`${this.baseUrl}/campaigns`, payload);\n return data;\n }\n\n /**\n * Partially updates an existing campaign.\n * @param id - The unique identifier of the campaign.\n * @param payload - The fields to update.\n * @returns The updated campaign.\n */\n async patch(id: string, payload: PatchCampaignRequest): Promise<Campaign> {\n const { data } = await this.httpClient.patch<Campaign>(`${this.baseUrl}/campaigns/${id}`, payload);\n return data;\n }\n\n /**\n * Removes a campaign by its unique identifier.\n * @param id - The unique identifier of the campaign.\n * @returns The removed campaign.\n */\n async remove(id: string): Promise<Campaign> {\n const { data } = await this.httpClient.delete<Campaign>(`${this.baseUrl}/campaigns/${id}`);\n return data;\n }\n\n /**\n * Retrieves a paginated list of campaign contacts.\n * @param query - Optional query parameters for filtering and pagination.\n * @returns The paginated campaign contacts response.\n */\n async findCampaignContacts(query?: CampaignContactQueryParams): Promise<CampaignContactPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignContactPaginatedResponse>(`${this.baseUrl}/campaign-contacts`, {\n params: query,\n });\n return data;\n }\n\n /**\n * Retrieves a campaign contact by its unique identifier.\n * @param id - The unique identifier of the campaign contact.\n * @returns The campaign contact data.\n */\n async getCampaignContacts(id: string): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.get<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts/${id}`);\n return data;\n }\n\n /**\n * Creates a new campaign contact.\n * @param payload - The campaign contact data to create.\n * @returns The created campaign contact.\n */\n async createCampaignContact(payload: CreateCampaignContactRequest): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.post<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts`, payload);\n return data;\n }\n\n /**\n * Adds multiple contacts to a campaign in a single request.\n * @param payload - The list of campaign contacts to create.\n * @returns The created campaign contacts.\n */\n async addContactsToCampaign(payload: CreateCampaignContactRequest[]): Promise<CampaignContactResponse[]> {\n const { data } = await this.httpClient.post<CampaignContactResponse[]>(\n `${this.baseUrl}/campaign-contacts`,\n payload,\n );\n return data;\n }\n\n /**\n * Partially updates an existing campaign contact.\n * @param id - The unique identifier of the campaign contact.\n * @param payload - The fields to update.\n * @returns The updated campaign contact.\n */\n async patchCampaignContact(id: string, payload: PatchCampaignContactRequest): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.patch<CampaignContactResponse>(\n `${this.baseUrl}/campaign-contacts/${id}`,\n payload,\n );\n return data;\n }\n\n /**\n * Removes a campaign contact by its unique identifier.\n * @param id - The unique identifier of the campaign contact.\n * @returns The removed campaign contact.\n */\n async removeCampaignContact(id: string): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.delete<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts/${id}`);\n return data;\n }\n\n async getContactsDashboardData(\n query: CampaignContactsDashboardQueryParams,\n ): Promise<CampaignContactsDashboardData> {\n const { data } = await this.httpClient.get<CampaignContactsDashboardData>(\n `${this.baseUrl}/campaign-contacts-dashboard`,\n {\n params: query,\n },\n );\n return data;\n }\n\n async getUsers() {\n const { data } = await this.httpClient.get<CampaignUser[]>(`${this.baseUrl}/users`);\n return data;\n }\n\n async listWorkGroups(query?: CampaignWorkGroupQueryParams): Promise<CampaignWorkGroupPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignWorkGroupPaginatedResponse>(`${this.baseUrl}/work-groups`, {\n params: query,\n });\n return data;\n }\n\n async createWorkGroup(payload: CreateCampaignWorkGroupRequest): Promise<CampaignWorkGroup> {\n const { data } = await this.httpClient.post<CampaignWorkGroup>(`${this.baseUrl}/work-groups`, payload);\n return data;\n }\n\n async deleteWorkGroup(id: string): Promise<CampaignWorkGroup> {\n const { data } = await this.httpClient.delete<CampaignWorkGroup>(`${this.baseUrl}/work-groups/${id}`);\n return data;\n }\n}\n\nexport type {\n Campaign,\n CampaignPaginatedResponse,\n CampaignQueryParams,\n CampaignRetryConfig,\n CampaignStatus,\n CampaignProvider,\n WhatsAppPayload,\n WhatsAppTemplateComponent,\n CampaignContactFilter,\n CampaignSchedule,\n CreateCampaignRequest,\n PatchCampaignRequest,\n CampaignUser,\n} from './contracts/campaign';\nexport type {\n CampaignContactCampaignStatus,\n CampaignContactDispatchStatus,\n CampaignContactLikeQueryOperators,\n CampaignContactPaginatedResponse,\n CampaignContactQueryOperators,\n CampaignContactQueryParams,\n CampaignContactQueryValue,\n CampaignContactResponse,\n CampaignContactSortDirection,\n CampaignContactSortParams,\n CreateCampaignContactRequest,\n PatchCampaignContactRequest,\n} from './contracts/campaign-contacts';\nexport type {\n CampaignContactsDashboardChannelPerformance,\n CampaignContactsDashboardData,\n CampaignContactsDashboardExactQueryOperators,\n CampaignContactsDashboardEvolutionItem,\n CampaignContactsDashboardFunnelItem,\n CampaignContactsDashboardInterval,\n CampaignContactsDashboardMetrics,\n CampaignContactsDashboardQueryParams,\n CampaignContactsDashboardQueryValue,\n CampaignContactsDashboardRangeQueryOperators,\n CampaignContactsDashboardStatusDistribution,\n CampaignContactsDashboardStatusMetrics,\n CampaignContactsDashboardSummary,\n CampaignContactsDashboardTopCampaign,\n} from './contracts/campaign-contacts-dashboard';\nexport type {\n CampaignWorkGroup,\n CampaignWorkGroupPaginatedResponse,\n CampaignWorkGroupQueryParams,\n CreateCampaignWorkGroupRequest,\n} from './contracts/work-group';\n","import type { AxiosInstance } from 'axios';\nimport type { GetConfigTemplatesResponse, GetConfigTemplatesParams } from './contracts/chat-adapter';\n\n/**\n * Gateway for interacting with the Chat Adapter API.\n */\nexport class ChatAdapterGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves message templates associated with a configuration.\n * @param configId - The unique identifier of the configuration.\n * @param params - Optional query parameters for filtering and pagination.\n * @returns A promise that resolves to the template list response.\n */\n async getConfigTemplates(configId: string, params?: GetConfigTemplatesParams): Promise<GetConfigTemplatesResponse> {\n const { data } = await this.httpClient.get<GetConfigTemplatesResponse>(\n `${this.baseUrl}/message-templates/${configId}`,\n { params },\n );\n return data;\n }\n}\n\nexport type {\n GetConfigTemplatesResponse,\n GetConfigTemplatesParams,\n MessageTemplate,\n MessageTemplateComponent,\n ConfigTemplatesPaging,\n} from './contracts/chat-adapter';\n","import type { AxiosInstance } from 'axios';\nimport type { GetPresignedUrlRequest, UploadPresignedUrlResponse, AudioConvertResponse, GetAttachmentByIdRequest, AttachmentByIdResponse } from './contracts/assets';\n\n/**\n * Gateway for interacting with the Assets API.\n */\nexport class AssetsGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n /**\n * Retrieves a presigned URL to upload a file to the Assets API.\n * @param params - The configuration options and parameters for the presigned URL.\n * @returns The presigned URL details wrapped in a {@link UploadPresignedUrlResponse}.\n */\n async getPresignedUrl(params: GetPresignedUrlRequest): Promise<UploadPresignedUrlResponse> {\n const { data } = await this.httpClient.get<UploadPresignedUrlResponse>(`${this.baseUrl}/uploads/presigned-url`, {\n params,\n });\n return data;\n }\n\n /**\n * Converts an audio file to M4A format via the Assets API.\n * @param params - The audio file to convert.\n * @param params.file - The audio file to upload for conversion.\n * @returns The converted audio response with base64-encoded data, mimetype, extension and filename.\n */\n async convertAudioToM4A(formData: any): Promise<AudioConvertResponse> {\n const { data } = await this.httpClient.post<AudioConvertResponse>(\n `${this.baseUrl}/whatsapp/audio-convert`,\n formData,\n {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n },\n );\n return data;\n }\n\n /**\n * Fetches an attachment by its file ID or storage key.\n *\n * When `key` is provided, the path is built from the key directly and no\n * `x-bucket-provider` header is sent. Otherwise, `fileId` and `provider` are\n * used to build the path and the provider header respectively.\n *\n * @param params - The parameters identifying the attachment.\n * @returns A signed URL to access the attachment.\n */\n async getAttachmentById(params: GetAttachmentByIdRequest): Promise<AttachmentByIdResponse> {\n const path = params.key\n ? `/uploads/${encodeURIComponent(params.key)}`\n : `/uploads/${encodeURIComponent(params.fileId!)}`;\n\n const axiosParams: Record<string, string> = {};\n\n if (params.download) axiosParams.download = 'true';\n if (params.filename) axiosParams.filename = params.filename;\n const headers: Record<string, string> = {};\n if (!params.key && params.provider) headers['x-bucket-provider'] = params.provider!;\n\n const { data } = await this.httpClient.get<AttachmentByIdResponse>(`${this.baseUrl}${path}`, {\n params: axiosParams,\n headers,\n });\n return data;\n }\n}\n\nexport type {\n GetPresignedUrlRequest,\n UploadPresignedUrlResponse,\n IUploadPresignedUrlResponse,\n AudioConvertResponse,\n GetAttachmentByIdRequest,\n AttachmentByIdResponse,\n} from './contracts/assets';\n","import type { AxiosInstance } from 'axios';\nimport type {\n ContactPhoneSearchResponse,\n GetContactPhonesParams,\n ContactCategoryResponse,\n} from './contracts/contact-phone';\n\n/**\n * Gateway for interacting with the Contact List API.\n */\nexport class ContactListGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Searches for contact phones with optional filtering and pagination.\n * @param params - The query parameters for the search.\n * @returns The paginated contact phones response.\n */\n async getContactsPhones(params: GetContactPhonesParams): Promise<ContactPhoneSearchResponse> {\n const { data } = await this.httpClient.get<ContactPhoneSearchResponse>(\n `${this.baseUrl}/contact/phone/search`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves all contact categories.\n * @returns An array of contact categories.\n */\n async getCategoryList(): Promise<ContactCategoryResponse[]> {\n const { data } = await this.httpClient.get<ContactCategoryResponse[]>(\n `${this.baseUrl}/contact/category`,\n );\n return data;\n }\n}\n\nexport type {\n ContactPhoneSearchResponse,\n GetContactPhonesParams,\n ContactPhoneResponse,\n ContactCategoryResponse,\n} from './contracts/contact-phone';\n","import type { AxiosInstance } from 'axios';\nimport type {\n CreateIntegrationActionRequest,\n CreateIntegrationFieldRequest,\n CreateIntegrationPartnerRequest,\n DeleteIntegrationActionParams,\n DeleteIntegrationFieldParams,\n DeleteIntegrationPartnerParams,\n GetIntegrationHooksCatalogRequest,\n GetIntegrationPartnersByCompanyRequest,\n HookCatalogItem,\n IntegrationAction,\n IntegrationField,\n IntegrationPartner,\n UpdateIntegrationActionParams,\n UpdateIntegrationActionRequest,\n UpdateIntegrationFieldParams,\n UpdateIntegrationFieldRequest,\n} from './contracts';\n\n/**\n * Gateway for interacting with the Integrations API.\n */\nexport class IntegrationsGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves all integration partners configured for a company.\n * @param companyId - The company identifier.\n * @returns The integration partners configured for the company.\n */\n async getPartnersByCompany({ companyId, name }: GetIntegrationPartnersByCompanyRequest): Promise<IntegrationPartner[]> {\n const { data } = await this.httpClient.get<IntegrationPartner[]>(`${this.baseUrl}/partner/company/${companyId}`, {\n params: name ? { name } : undefined,\n });\n return data;\n }\n\n /**\n * Retrieves the hook catalog, optionally scoped by module.\n * @param module - The optional module identifier used by the Integrations API filter.\n * @returns The hook catalog items, filtered by module when provided.\n */\n async getHooksCatalog({ module }: GetIntegrationHooksCatalogRequest = {}): Promise<HookCatalogItem[]> {\n const { data } = await this.httpClient.get<HookCatalogItem[]>(`${this.baseUrl}/hooks`, {\n params: module ? { module } : undefined,\n });\n return data;\n }\n\n /**\n * Creates an integration partner.\n * @param payload - The partner creation payload.\n * @returns The created integration partner.\n */\n async createPartner(payload: CreateIntegrationPartnerRequest): Promise<IntegrationPartner> {\n const { data } = await this.httpClient.post<IntegrationPartner>(`${this.baseUrl}/partner`, payload);\n return data;\n }\n\n /**\n * Deletes an integration partner.\n * @param partnerId - The partner identifier.\n * @returns A promise that resolves when the partner is deleted.\n */\n async deletePartner({ partnerId }: DeleteIntegrationPartnerParams): Promise<void> {\n await this.httpClient.delete(`${this.baseUrl}/partner/${partnerId}`);\n }\n\n /**\n * Creates an integration action.\n * @param payload - The action creation payload.\n * @returns The created integration action.\n */\n async createAction(payload: CreateIntegrationActionRequest): Promise<IntegrationAction> {\n const { data } = await this.httpClient.post<IntegrationAction>(`${this.baseUrl}/action`, {\n ...payload,\n actionName: payload.actionName ?? payload.hook,\n });\n return data;\n }\n\n /**\n * Updates an integration action.\n * @param actionId - The action identifier.\n * @param payload - The action update payload.\n * @returns The updated integration action.\n */\n async updateAction({ actionId, payload }: UpdateIntegrationActionParams): Promise<IntegrationAction> {\n const { data } = await this.httpClient.patch<IntegrationAction>(`${this.baseUrl}/action/${actionId}`, payload);\n return data;\n }\n\n /**\n * Creates an integration action field/header.\n * @param payload - The field creation payload.\n * @returns The created integration field.\n */\n async createField(payload: CreateIntegrationFieldRequest): Promise<IntegrationField> {\n const { data } = await this.httpClient.post<IntegrationField>(`${this.baseUrl}/field`, payload);\n return data;\n }\n\n /**\n * Updates an integration action field/header.\n * @param fieldId - The field identifier.\n * @param payload - The field update payload.\n * @returns The updated integration field response.\n */\n async updateField({ fieldId, payload }: UpdateIntegrationFieldParams): Promise<IntegrationField | number[]> {\n const { data } = await this.httpClient.put<IntegrationField | number[]>(`${this.baseUrl}/field/${fieldId}`, payload);\n return data;\n }\n\n /**\n * Deletes an integration action field/header.\n * @param fieldId - The field identifier.\n * @returns A promise that resolves when the field is deleted.\n */\n async deleteField({ fieldId }: DeleteIntegrationFieldParams): Promise<void> {\n await this.httpClient.delete(`${this.baseUrl}/field/${fieldId}`);\n }\n\n /**\n * Deletes an integration action.\n * @param actionId - The action identifier.\n * @returns A promise that resolves when the action is deleted.\n */\n async deleteAction({ actionId }: DeleteIntegrationActionParams): Promise<void> {\n await this.httpClient.delete(`${this.baseUrl}/action/${actionId}`);\n }\n}\n\nexport type {\n CreateIntegrationActionRequest,\n CreateIntegrationFieldRequest,\n CreateIntegrationPartnerRequest,\n DeleteIntegrationActionParams,\n DeleteIntegrationFieldParams,\n DeleteIntegrationPartnerParams,\n GetIntegrationHooksCatalogRequest,\n GetIntegrationPartnersByCompanyRequest,\n HookCatalogItem,\n IntegrationAction,\n IntegrationField,\n IntegrationPartner,\n UpdateIntegrationActionParams,\n UpdateIntegrationActionRequest,\n UpdateIntegrationFieldParams,\n UpdateIntegrationFieldRequest,\n} from './contracts';\n","import { CustomerServiceGateway } from '../customer-service';\nimport { ChatConfigGateway } from '../chat-config';\nimport { CampaignsGateway } from '../campaigns';\nimport { ChatAdapterGateway } from '../chat-adapter';\nimport { AssetsGateway } from '../assets';\nimport { ContactListGateway } from '../contact-list';\nimport { IntegrationsGateway } from '../integrations';\nimport axios, { AxiosInstance } from 'axios';\n\n/**\n * Maps service identifiers to their corresponding gateway types.\n * Used by the `gateway()` function to infer the correct return type\n * based on the service name passed as argument.\n *\n * When adding a new service, add an entry here with the service\n * identifier as the key and the gateway class as the value.\n */\nexport type GatewayMap = {\n 'customer-service': CustomerServiceGateway;\n 'chat-config': ChatConfigGateway;\n 'campaigns': CampaignsGateway;\n 'chat-adapter': ChatAdapterGateway;\n 'assets': AssetsGateway;\n 'contact-list': ContactListGateway;\n 'integrations': IntegrationsGateway;\n};\n\nexport interface SDKGatewaysInterface {\n customerService: CustomerServiceGateway | null;\n chatConfig: ChatConfigGateway | null;\n campaigns: CampaignsGateway | null;\n chatAdapter: ChatAdapterGateway | null;\n assets: AssetsGateway | null;\n contactList: ContactListGateway | null;\n integrations: IntegrationsGateway | null;\n}\n\nclass SDKGateways {\n customerService: CustomerServiceGateway | null;\n chatConfig: ChatConfigGateway | null;\n campaigns: CampaignsGateway | null;\n chatAdapter: ChatAdapterGateway | null;\n assets: AssetsGateway | null;\n contactList: ContactListGateway | null;\n integrations: IntegrationsGateway | null;\n constructor(\n customerService: CustomerServiceGateway | null,\n chatConfig: ChatConfigGateway | null,\n campaigns: CampaignsGateway | null,\n chatAdapter: ChatAdapterGateway | null,\n assets: AssetsGateway | null,\n contactList: ContactListGateway | null,\n integrations: IntegrationsGateway | null,\n ) {\n this.customerService = customerService;\n this.chatConfig = chatConfig;\n this.campaigns = campaigns;\n this.chatAdapter = chatAdapter;\n this.assets = assets;\n this.contactList = contactList;\n this.integrations = integrations;\n }\n}\n\n/**\n * Parameters required to configure the SDK client.\n * Each service configuration is optional, only provide the services you need.\n */\nexport interface GatewayClientParams {\n /** An Axios instance used as the HTTP client for all gateway requests (optional). */\n axiosClient?: AxiosInstance;\n /** API token used for authentication across all services. */\n apiToken: string;\n /** Configuration for each service gateway. Only the services you configure will be available. */\n services: {\n customerService?: {\n baseUrl: string;\n };\n chatConfig?: {\n baseUrl: string;\n };\n campaigns?: {\n baseUrl: string;\n };\n chatAdapter?: {\n baseUrl: string;\n };\n assets?: {\n baseUrl: string;\n };\n contactList?: {\n baseUrl: string;\n };\n integrations?: {\n baseUrl: string;\n };\n };\n}\n\n/**\n * Creates an SDKGateways instance with all service gateways initialized\n * using the provided configuration parameters.\n * Services without configuration will be set to null and will throw\n * an error if accessed via `gateway()`.\n */\nexport function createClient(params: GatewayClientParams) {\n const httpClient = params.axiosClient || axios.create({\n headers: {\n Authorization: `Bearer ${params.apiToken}`,\n },\n });\n const customerService = params.services.customerService\n ? new CustomerServiceGateway(httpClient, params.services.customerService.baseUrl)\n : null;\n const chatConfig = params.services.chatConfig\n ? new ChatConfigGateway(httpClient, params.services.chatConfig.baseUrl)\n : null;\n const campaigns = params.services.campaigns\n ? new CampaignsGateway(httpClient, params.services.campaigns.baseUrl)\n : null;\n const chatAdapter = params.services.chatAdapter\n ? new ChatAdapterGateway(httpClient, params.services.chatAdapter.baseUrl)\n : null;\n const assets = params.services.assets\n ? new AssetsGateway(httpClient, params.services.assets.baseUrl)\n : null;\n const contactList = params.services.contactList\n ? new ContactListGateway(httpClient, params.services.contactList.baseUrl)\n : null;\n const integrations = params.services.integrations\n ? new IntegrationsGateway(httpClient, params.services.integrations.baseUrl)\n : null;\n return new SDKGateways(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations);\n}\n","export const SERVICE_GATEWAYS = {\n CUSTOMER_SERVICE: 'customer-service',\n CHAT_CONFIG: 'chat-config',\n CAMPAIGNS: 'campaigns',\n CHAT_ADAPTER: 'chat-adapter',\n ASSETS: 'assets',\n CONTACT_LIST: 'contact-list',\n INTEGRATIONS: 'integrations',\n} as const;\n\nexport type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBO,IAAM,yBAAN,MAA6B;AAAA,EAClC,YACmB,YACA,SACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,MAAM,eAAe,WAA6C;AAChE,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,WAAW,IAAqB,GAAG,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E,YAAM,IAAI,MAAM,4BAA4B,OAAO,EAAE;AAAA,EACzD;AACF;","names":["module","axios"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/customer-service/index.ts","../src/chat-config/index.ts","../src/campaigns/index.ts","../src/chat-adapter/index.ts","../src/assets/index.ts","../src/contact-list/index.ts","../src/chat-webservice/index.ts","../src/call-report/index.ts","../src/@common/client.ts","../src/@common/enums.ts"],"sourcesContent":["import { createClient, SDKGatewaysInterface, GatewayClientParams, GatewayMap } from './@common/client';\nimport { SERVICE_GATEWAYS } from './@common/enums';\n\nclass SDK {\n client: SDKGatewaysInterface | null = null;\n\n configure(params: GatewayClientParams) {\n this.client = createClient(params);\n }\n}\nconst sdk = new SDK();\n\n/**\n * Initializes the SDK with the required configuration parameters.\n * Must be called before using {@link gateway}.\n */\nexport const configure = (params: GatewayClientParams) => {\n sdk.configure(params);\n};\n\n/**\n * Returns the gateway instance for the specified service.\n *\n * @typeParam T - A service identifier key from {@link GatewayMap}.\n * @param service - The service identifier (e.g. `SERVICE_GATEWAYS.CUSTOMER_SERVICE`).\n * @returns The corresponding gateway instance with all its methods.\n * @throws {Error} If the SDK has not been configured via {@link configure}.\n * @throws {Error} If an unknown service identifier is provided.\n *\n * @example\n * ```ts\n * configure({ axiosClient, apiToken: '...', services: { customerService: { baseUrl: '...' } } });\n * const customer = gateway('customer-service');\n * const company = await customer.getCompanyById('123');\n * ```\n */\nexport function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];\nexport function gateway(service: SERVICE_GATEWAYS) {\n if (!sdk.client)\n throw new Error(\n 'SDK not configured. Please call configure() with the appropriate parameters before using the SDK.',\n );\n\n switch (service) {\n case SERVICE_GATEWAYS.CUSTOMER_SERVICE:\n if (!sdk.client.customerService)\n throw new Error(`Service 'customer-service' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.customerService;\n case SERVICE_GATEWAYS.CHAT_CONFIG:\n if (!sdk.client.chatConfig)\n throw new Error(`Service 'chat-config' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.chatConfig;\n case SERVICE_GATEWAYS.CAMPAIGNS:\n if (!sdk.client.campaigns)\n throw new Error(`Service 'campaigns' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.campaigns;\n case SERVICE_GATEWAYS.CHAT_ADAPTER:\n if (!sdk.client.chatAdapter)\n throw new Error(`Service 'chat-adapter' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.chatAdapter;\n case SERVICE_GATEWAYS.ASSETS:\n if (!sdk.client.assets)\n throw new Error(`Service 'assets' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.assets;\n case SERVICE_GATEWAYS.CONTACT_LIST:\n if (!sdk.client.contactList)\n throw new Error(`Service 'contact-list' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.contactList;\n case SERVICE_GATEWAYS.CHAT_WEBSERVICE:\n if (!sdk.client.chatWebservice)\n throw new Error(`Service 'chat-webservice' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.chatWebservice;\n case SERVICE_GATEWAYS.CALL_REPORT:\n if (!sdk.client.callReport)\n throw new Error(`Service 'call-report' is not configured. Provide its baseUrl in configure().`);\n return sdk.client.callReport;\n default:\n throw new Error(`Unknown service gateway: ${service}`);\n }\n}\n\nexport * from './campaigns/contracts';\nexport * from './chat-config/contracts';\nexport * from './customer-service/contracts';\nexport * from './chat-adapter/contracts';\nexport * from './assets/contracts';\nexport * from './contact-list/contracts';\nexport * from './chat-webservice/contracts';\nexport * from './call-report/contracts';\n","import type { AxiosInstance } from 'axios';\nimport type { CompanyResponse } from './contracts/company';\nimport type {\n WorkGroupListResponse,\n WorkGroupMembersResponse,\n WorkGroupResponse,\n} from './contracts/work-group';\nimport type {\n GetAllUsersParams,\n GetAllUsersResponse,\n GetManagedUsersResponse,\n} from './contracts/user';\n\n/**\n * Gateway for interacting with the Customer Service API.\n */\nexport class CustomerServiceGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves a company by its unique identifier.\n * @param companyId - The unique identifier of the company.\n * @returns The company data wrapped in a {@link CompanyResponse}.\n */\n async getCompanyById(companyId: string): Promise<CompanyResponse> {\n const { data } = await this.httpClient.get<CompanyResponse>(`${this.baseUrl}/companies/search/${companyId}`);\n return data;\n }\n\n /**\n * Retrieves all work groups for a company.\n * @param companyId - The unique identifier of the company.\n * @returns The work groups for the given company.\n */\n async getWorkGroups(companyId: string): Promise<WorkGroupListResponse> {\n const { data } = await this.httpClient.get<WorkGroupListResponse>(\n `${this.baseUrl}/companies/work-groups`,\n { params: { company_id: companyId } },\n );\n return data;\n }\n\n /**\n * Retrieves a work group by its unique identifier.\n * @param workGroupId - The unique identifier of the work group.\n * @param companyId - The unique identifier of the company (optional, sent as query parameter).\n * @returns The work group data wrapped in a {@link WorkGroupResponse}.\n */\n async getWorkGroupById(workGroupId: string, companyId?: string): Promise<WorkGroupResponse> {\n const params = companyId ? { company_id: companyId } : undefined;\n const { data } = await this.httpClient.get<WorkGroupResponse>(\n `${this.baseUrl}/companies/work-groups/${workGroupId}`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves the members of a work group by its identifier.\n * @param groupId - The unique identifier of the work group.\n * @param companyId - The unique identifier of the company (optional, sent as query parameter).\n * @param profile - Filter members by profile (optional).\n * @returns The members of the work group.\n */\n async getWorkGroupMembers(\n groupId: string,\n companyId?: string,\n profile?: string[],\n ): Promise<WorkGroupMembersResponse> {\n const params: { company_id?: string; profile?: string[] } = {};\n if (companyId) params.company_id = companyId;\n if (profile) params.profile = profile;\n const { data } = await this.httpClient.get<WorkGroupMembersResponse>(\n `${this.baseUrl}/bonds/work-groups/${groupId}`,\n { params },\n );\n return data;\n }\n\n async getAllUsers(params?: GetAllUsersParams): Promise<GetAllUsersResponse> {\n const { data } = await this.httpClient.get<GetAllUsersResponse>(\n `${this.baseUrl}/companies/users`,\n { params },\n );\n return data;\n }\n\n async getManagedUsers(managerId: string): Promise<GetManagedUsersResponse> {\n const { data } = await this.httpClient.get<GetManagedUsersResponse>(\n `${this.baseUrl}/users/managed/${managerId}`,\n );\n return data;\n }\n}\n\nexport type { CompanyResponse, CompanyData } from './contracts/company';\nexport type {\n WorkGroup,\n WorkGroupMember,\n WorkGroupMembersResponse,\n WorkGroupListResponse,\n WorkGroupResponse,\n} from './contracts/work-group';\nexport type {\n User,\n GetAllUsersParams,\n GetAllUsersResponse,\n ManagedUser,\n GetManagedUsersResponse,\n} from './contracts/user';","import type { AxiosInstance } from 'axios';\nimport type { ProviderListResponse } from './contracts/provider';\nimport type { ConfigListByProviderResponse, GetConfigsByProviderParams } from './contracts/config';\nimport type { Queue, QueueListResponse, QueueMember, GetMemberQueuesRequest } from './contracts/queues';\nimport type { MetaTemplateConfigResponse, MetaTemplateConfigsResponse } from './contracts/meta-template';\nimport type {\n FindOrCreateQueueRuleRequest,\n GetRootRulesRequest,\n RootRulesResponse,\n Rule,\n QueueRule,\n} from './contracts/rule';\n\n/**\n * Gateway for interacting with the Chat Config API.\n */\nexport class ChatConfigGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves all available providers.\n * @returns The list of providers.\n */\n async getProviders(): Promise<ProviderListResponse> {\n const { data } = await this.httpClient.get<ProviderListResponse>(`${this.baseUrl}/providers`);\n return data;\n }\n\n /**\n * Retrieves configurations filtered by provider.\n * @param providerId - The unique identifier of the provider.\n * @param params - Optional query parameters for filtering configurations.\n * @returns The configurations for the given provider.\n */\n async getConfigsByProvider(\n providerId: string,\n params?: GetConfigsByProviderParams,\n ): Promise<ConfigListByProviderResponse> {\n const { data } = await this.httpClient.get<ConfigListByProviderResponse>(\n `${this.baseUrl}/config/provider/${providerId}`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves a queue by its ID.\n * @param queueId - The unique identifier of the queue.\n * @returns The queue data.\n */\n async getQueueById(queueId: string): Promise<Queue> {\n const { data } = await this.httpClient.get<Queue>(`${this.baseUrl}/queue/${queueId}`);\n return data;\n }\n\n async getQueues(): Promise<Queue[]> {\n const { data } = await this.httpClient.get<Queue[]>(`${this.baseUrl}/queues`);\n return data;\n }\n\n /**\n * Lists queue memberships for a member.\n * @param params - The member identifier and optional association filter.\n * @returns The queue memberships for the given member.\n */\n async getMemberQueues(params: GetMemberQueuesRequest): Promise<QueueMember[]> {\n const { data } = await this.httpClient.get<QueueMember[]>(`${this.baseUrl}/queue-members`, { params });\n return data;\n }\n\n /**\n * Retrieves a Meta template configuration by its ID.\n * @param templateId - The unique identifier of the template.\n * @returns The Meta template configuration.\n */\n async getMetaTemplateById(templateId: string): Promise<MetaTemplateConfigResponse> {\n const { data } = await this.httpClient.get<MetaTemplateConfigResponse>(\n `${this.baseUrl}/meta-templates-config/${templateId}`,\n );\n return data;\n }\n\n /**\n * Retrieves template configurations associated with a configuration ID.\n * @param configId - The configuration identifier.\n * @returns The list of template configurations.\n */\n async getTemplateConfigsByConfigId(configId: string): Promise<MetaTemplateConfigsResponse> {\n const { data } = await this.httpClient.get<MetaTemplateConfigsResponse>(\n `${this.baseUrl}/meta-templates-config/config/${configId}`,\n );\n return data;\n }\n\n /**\n * Finds an existing queue rule or creates a new one if it does not exist.\n * @param payload - The payload containing companyId, queueId, and configId.\n * @returns The found or created queue rule.\n */\n async findOrCreateQueueRule(payload: FindOrCreateQueueRuleRequest): Promise<QueueRule> {\n const { data } = await this.httpClient.put<QueueRule>(`${this.baseUrl}/rules/queue/find-or-create`, payload);\n return data;\n }\n\n /**\n * @param params - The company and pagination parameters.\n * @returns The paginated initial service rules.\n */\n async getRootRules(params: GetRootRulesRequest): Promise<RootRulesResponse> {\n const { data } = await this.httpClient.get<RootRulesResponse>(`${this.baseUrl}/rules/paginated`, {\n params: {\n archiveStatus: 'unarchived',\n companyId: params.companyId,\n offset: params.offset,\n limit: params.limit,\n name: params?.name,\n isRoot: true,\n },\n });\n return data;\n }\n}\n\nexport type {\n Queue,\n QueueMember,\n GetMemberQueuesRequest,\n DistributionType,\n QueueListResponse,\n} from './contracts/queues';\nexport type { ProviderListResponse, Provider } from './contracts/provider';\nexport type {\n ConfigListByProviderResponse,\n Config,\n ConfigProvider,\n GetConfigsByProviderParams,\n} from './contracts/config';\nexport type {\n MetaTemplateButton,\n MetaTemplateConfigResponse,\n MetaTemplateConfigsResponse,\n} from './contracts/meta-template';\nexport type { FindOrCreateQueueRuleRequest, QueueRule, RootRulesResponse, Rule } from './contracts/rule';\n","import type { AxiosInstance } from 'axios';\nimport type {\n Campaign,\n CampaignPaginatedResponse,\n CampaignQueryParams,\n CreateCampaignRequest,\n PatchCampaignRequest,\n CampaignUser,\n} from './contracts/campaign';\nimport type {\n CampaignContactPaginatedResponse,\n CampaignContactQueryParams,\n CampaignContactResponse,\n CreateCampaignContactRequest,\n PatchCampaignContactRequest,\n} from './contracts/campaign-contacts';\nimport type {\n CampaignContactsDashboardData,\n CampaignContactsDashboardQueryParams,\n} from './contracts/campaign-contacts-dashboard';\nimport type {\n CampaignWorkGroup,\n CampaignWorkGroupPaginatedResponse,\n CampaignWorkGroupQueryParams,\n CreateCampaignWorkGroupRequest,\n} from './contracts/work-group';\n\n/**\n * Gateway for interacting with the Campaigns API.\n */\nexport class CampaignsGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves a paginated list of campaigns.\n * @param query - Optional query parameters for filtering and pagination.\n * @returns The paginated campaigns response.\n */\n async find(query?: CampaignQueryParams): Promise<CampaignPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignPaginatedResponse>(`${this.baseUrl}/campaigns`, {\n params: query,\n });\n return data;\n }\n\n /**\n * Retrieves a campaign by its unique identifier.\n * @param id - The unique identifier of the campaign.\n * @returns The campaign data.\n */\n async get(id: string): Promise<Campaign> {\n const { data } = await this.httpClient.get<Campaign>(`${this.baseUrl}/campaigns/${id}`);\n return data;\n }\n\n /**\n * Creates a new campaign.\n * @param payload - The campaign data to create.\n * @returns The created campaign.\n */\n async create(payload: CreateCampaignRequest): Promise<Campaign> {\n const { data } = await this.httpClient.post<Campaign>(`${this.baseUrl}/campaigns`, payload);\n return data;\n }\n\n /**\n * Partially updates an existing campaign.\n * @param id - The unique identifier of the campaign.\n * @param payload - The fields to update.\n * @returns The updated campaign.\n */\n async patch(id: string, payload: PatchCampaignRequest): Promise<Campaign> {\n const { data } = await this.httpClient.patch<Campaign>(`${this.baseUrl}/campaigns/${id}`, payload);\n return data;\n }\n\n /**\n * Removes a campaign by its unique identifier.\n * @param id - The unique identifier of the campaign.\n * @returns The removed campaign.\n */\n async remove(id: string): Promise<Campaign> {\n const { data } = await this.httpClient.delete<Campaign>(`${this.baseUrl}/campaigns/${id}`);\n return data;\n }\n\n /**\n * Retrieves a paginated list of campaign contacts.\n * @param query - Optional query parameters for filtering and pagination.\n * @returns The paginated campaign contacts response.\n */\n async findCampaignContacts(query?: CampaignContactQueryParams): Promise<CampaignContactPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignContactPaginatedResponse>(`${this.baseUrl}/campaign-contacts`, {\n params: query,\n });\n return data;\n }\n\n /**\n * Retrieves a campaign contact by its unique identifier.\n * @param id - The unique identifier of the campaign contact.\n * @returns The campaign contact data.\n */\n async getCampaignContacts(id: string): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.get<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts/${id}`);\n return data;\n }\n\n /**\n * Creates a new campaign contact.\n * @param payload - The campaign contact data to create.\n * @returns The created campaign contact.\n */\n async createCampaignContact(payload: CreateCampaignContactRequest): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.post<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts`, payload);\n return data;\n }\n\n /**\n * Adds multiple contacts to a campaign in a single request.\n * @param payload - The list of campaign contacts to create.\n * @returns The created campaign contacts.\n */\n async addContactsToCampaign(payload: CreateCampaignContactRequest[]): Promise<CampaignContactResponse[]> {\n const { data } = await this.httpClient.post<CampaignContactResponse[]>(\n `${this.baseUrl}/campaign-contacts`,\n payload,\n );\n return data;\n }\n\n /**\n * Partially updates an existing campaign contact.\n * @param id - The unique identifier of the campaign contact.\n * @param payload - The fields to update.\n * @returns The updated campaign contact.\n */\n async patchCampaignContact(id: string, payload: PatchCampaignContactRequest): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.patch<CampaignContactResponse>(\n `${this.baseUrl}/campaign-contacts/${id}`,\n payload,\n );\n return data;\n }\n\n /**\n * Removes a campaign contact by its unique identifier.\n * @param id - The unique identifier of the campaign contact.\n * @returns The removed campaign contact.\n */\n async removeCampaignContact(id: string): Promise<CampaignContactResponse> {\n const { data } = await this.httpClient.delete<CampaignContactResponse>(`${this.baseUrl}/campaign-contacts/${id}`);\n return data;\n }\n\n async getContactsDashboardData(\n query: CampaignContactsDashboardQueryParams,\n ): Promise<CampaignContactsDashboardData> {\n const { data } = await this.httpClient.get<CampaignContactsDashboardData>(\n `${this.baseUrl}/campaign-contacts-dashboard`,\n {\n params: query,\n },\n );\n return data;\n }\n\n async getUsers() {\n const { data } = await this.httpClient.get<CampaignUser[]>(`${this.baseUrl}/users`);\n return data;\n }\n\n async listWorkGroups(query?: CampaignWorkGroupQueryParams): Promise<CampaignWorkGroupPaginatedResponse> {\n const { data } = await this.httpClient.get<CampaignWorkGroupPaginatedResponse>(`${this.baseUrl}/work-groups`, {\n params: query,\n });\n return data;\n }\n\n async createWorkGroup(payload: CreateCampaignWorkGroupRequest): Promise<CampaignWorkGroup> {\n const { data } = await this.httpClient.post<CampaignWorkGroup>(`${this.baseUrl}/work-groups`, payload);\n return data;\n }\n\n async deleteWorkGroup(id: string): Promise<CampaignWorkGroup> {\n const { data } = await this.httpClient.delete<CampaignWorkGroup>(`${this.baseUrl}/work-groups/${id}`);\n return data;\n }\n}\n\nexport type {\n Campaign,\n CampaignPaginatedResponse,\n CampaignQueryParams,\n CampaignRetryConfig,\n CampaignStatus,\n CampaignProvider,\n WhatsAppPayload,\n WhatsAppTemplateComponent,\n CampaignContactFilter,\n CampaignSchedule,\n CreateCampaignRequest,\n PatchCampaignRequest,\n CampaignUser,\n} from './contracts/campaign';\nexport type {\n CampaignContactCampaignStatus,\n CampaignContactDispatchStatus,\n CampaignContactLikeQueryOperators,\n CampaignContactPaginatedResponse,\n CampaignContactQueryOperators,\n CampaignContactQueryParams,\n CampaignContactQueryValue,\n CampaignContactResponse,\n CampaignContactSortDirection,\n CampaignContactSortParams,\n CreateCampaignContactRequest,\n PatchCampaignContactRequest,\n} from './contracts/campaign-contacts';\nexport type {\n CampaignContactsDashboardChannelPerformance,\n CampaignContactsDashboardData,\n CampaignContactsDashboardExactQueryOperators,\n CampaignContactsDashboardEvolutionItem,\n CampaignContactsDashboardFunnelItem,\n CampaignContactsDashboardInterval,\n CampaignContactsDashboardMetrics,\n CampaignContactsDashboardQueryParams,\n CampaignContactsDashboardQueryValue,\n CampaignContactsDashboardRangeQueryOperators,\n CampaignContactsDashboardStatusDistribution,\n CampaignContactsDashboardStatusMetrics,\n CampaignContactsDashboardSummary,\n CampaignContactsDashboardTopCampaign,\n} from './contracts/campaign-contacts-dashboard';\nexport type {\n CampaignWorkGroup,\n CampaignWorkGroupPaginatedResponse,\n CampaignWorkGroupQueryParams,\n CreateCampaignWorkGroupRequest,\n} from './contracts/work-group';\n","import type { AxiosInstance } from 'axios';\nimport type { GetConfigTemplatesResponse, GetConfigTemplatesParams } from './contracts/chat-adapter';\n\n/**\n * Gateway for interacting with the Chat Adapter API.\n */\nexport class ChatAdapterGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Retrieves message templates associated with a configuration.\n * @param configId - The unique identifier of the configuration.\n * @param params - Optional query parameters for filtering and pagination.\n * @returns A promise that resolves to the template list response.\n */\n async getConfigTemplates(configId: string, params?: GetConfigTemplatesParams): Promise<GetConfigTemplatesResponse> {\n const { data } = await this.httpClient.get<GetConfigTemplatesResponse>(\n `${this.baseUrl}/message-templates/${configId}`,\n { params },\n );\n return data;\n }\n}\n\nexport type {\n GetConfigTemplatesResponse,\n GetConfigTemplatesParams,\n MessageTemplate,\n MessageTemplateComponent,\n ConfigTemplatesPaging,\n} from './contracts/chat-adapter';\n","import type { AxiosInstance } from 'axios';\nimport type { GetPresignedUrlRequest, UploadPresignedUrlResponse, AudioConvertResponse, GetAttachmentByIdRequest, AttachmentByIdResponse } from './contracts/assets';\n\n/**\n * Gateway for interacting with the Assets API.\n */\nexport class AssetsGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n /**\n * Retrieves a presigned URL to upload a file to the Assets API.\n * @param params - The configuration options and parameters for the presigned URL.\n * @returns The presigned URL details wrapped in a {@link UploadPresignedUrlResponse}.\n */\n async getPresignedUrl(params: GetPresignedUrlRequest): Promise<UploadPresignedUrlResponse> {\n const { data } = await this.httpClient.get<UploadPresignedUrlResponse>(`${this.baseUrl}/uploads/presigned-url`, {\n params,\n });\n return data;\n }\n\n /**\n * Converts an audio file to M4A format via the Assets API.\n * @param params - The audio file to convert.\n * @param params.file - The audio file to upload for conversion.\n * @returns The converted audio response with base64-encoded data, mimetype, extension and filename.\n */\n async convertAudioToM4A(formData: any): Promise<AudioConvertResponse> {\n const { data } = await this.httpClient.post<AudioConvertResponse>(\n `${this.baseUrl}/whatsapp/audio-convert`,\n formData,\n {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n },\n );\n return data;\n }\n\n /**\n * Fetches an attachment by its file ID or storage key.\n *\n * When `key` is provided, the path is built from the key directly and no\n * `x-bucket-provider` header is sent. Otherwise, `fileId` and `provider` are\n * used to build the path and the provider header respectively.\n *\n * @param params - The parameters identifying the attachment.\n * @returns A signed URL to access the attachment.\n */\n async getAttachmentById(params: GetAttachmentByIdRequest): Promise<AttachmentByIdResponse> {\n const path = params.key\n ? `/uploads/${encodeURIComponent(params.key)}`\n : `/uploads/${encodeURIComponent(params.fileId!)}`;\n\n const axiosParams: Record<string, string> = {};\n\n if (params.download) axiosParams.download = 'true';\n if (params.filename) axiosParams.filename = params.filename;\n const headers: Record<string, string> = {};\n if (!params.key && params.provider) headers['x-bucket-provider'] = params.provider!;\n\n const { data } = await this.httpClient.get<AttachmentByIdResponse>(`${this.baseUrl}${path}`, {\n params: axiosParams,\n headers,\n });\n return data;\n }\n}\n\nexport type {\n GetPresignedUrlRequest,\n UploadPresignedUrlResponse,\n IUploadPresignedUrlResponse,\n AudioConvertResponse,\n GetAttachmentByIdRequest,\n AttachmentByIdResponse,\n} from './contracts/assets';\n","import type { AxiosInstance } from 'axios';\nimport type {\n ContactPhoneSearchResponse,\n GetContactPhonesParams,\n ContactCategoryResponse,\n} from './contracts/contact-phone';\n\n/**\n * Gateway for interacting with the Contact List API.\n */\nexport class ContactListGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Searches for contact phones with optional filtering and pagination.\n * @param params - The query parameters for the search.\n * @returns The paginated contact phones response.\n */\n async getContactsPhones(params: GetContactPhonesParams): Promise<ContactPhoneSearchResponse> {\n const { data } = await this.httpClient.get<ContactPhoneSearchResponse>(\n `${this.baseUrl}/contact/phone/search`,\n { params },\n );\n return data;\n }\n\n /**\n * Retrieves all contact categories.\n * @returns An array of contact categories.\n */\n async getCategoryList(): Promise<ContactCategoryResponse[]> {\n const { data } = await this.httpClient.get<ContactCategoryResponse[]>(\n `${this.baseUrl}/contact/category`,\n );\n return data;\n }\n}\n\nexport type {\n ContactPhoneSearchResponse,\n GetContactPhonesParams,\n ContactPhoneResponse,\n ContactCategoryResponse,\n} from './contracts/contact-phone';\n","import type { AxiosInstance } from 'axios';\nimport type {\n ListLiveUserRoomsRequest,\n LiveUserRoomResponse,\n GetRoomByIdRequest,\n RoomResponse,\n} from './contracts/room';\n\n/**\n * Gateway for interacting with the Chat Webservice API.\n */\nexport class ChatWebserviceGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Lists live rooms assigned to a user.\n * @param params - The recipient, company, and open-status filters.\n * @returns The live room entries for the user.\n */\n async listLiveUserRooms(params: ListLiveUserRoomsRequest): Promise<LiveUserRoomResponse[]> {\n const { data } = await this.httpClient.get<LiveUserRoomResponse[]>(`${this.baseUrl}/member/rooms/live`, { params });\n return data;\n }\n\n /**\n * Retrieves a chat room by its identifier.\n * @param id - The unique identifier of the room.\n * @param params - Optional query parameters for scoping and member inclusion.\n * @returns The chat room data.\n */\n async getRoomById(id: number, params: GetRoomByIdRequest = {}): Promise<RoomResponse> {\n const { data } = await this.httpClient.get<RoomResponse>(`${this.baseUrl}/room/${id}`, { params });\n return data;\n }\n}\n\nexport type {\n GetRoomByIdRequest,\n ListLiveUserRoomsRequest,\n LiveUserRoomResponse,\n RoomActiveDates,\n RoomMemberResponse,\n RoomResponse,\n RoomTagResponse,\n} from './contracts/room';\n","import type { AxiosInstance } from 'axios';\nimport type { ContactHistoryResponse, ListContactHistoryRequest } from './contracts/contact-history';\n\n/**\n * Gateway for interacting with the Call Report API.\n */\nexport class CallReportGateway {\n constructor(\n private readonly httpClient: AxiosInstance,\n private readonly baseUrl: string,\n ) {}\n\n /**\n * Lists contact interaction history across chat and CDR indexes.\n * @param params - Optional filters, pagination, and index selection.\n * @returns The paginated contact history response.\n */\n async listContactHistory(params: ListContactHistoryRequest = {}): Promise<ContactHistoryResponse> {\n const { data } = await this.httpClient.get<ContactHistoryResponse>(`${this.baseUrl}/history/index/multi`, {\n params,\n });\n return data;\n }\n}\n\nexport type {\n ContactHistoryIndex,\n ContactHistoryResponse,\n ContactHistorySortOrder,\n ContactInteractionResponse,\n InteractionCallStepResponse,\n InteractionChatStepResponse,\n InteractionMemberResponse,\n InteractionOrganizationResponse,\n ListContactHistoryRequest,\n} from './contracts/contact-history';\n","import { CustomerServiceGateway } from '../customer-service';\nimport { ChatConfigGateway } from '../chat-config';\nimport { CampaignsGateway } from '../campaigns';\nimport { ChatAdapterGateway } from '../chat-adapter';\nimport { AssetsGateway } from '../assets';\nimport { ContactListGateway } from '../contact-list';\nimport { ChatWebserviceGateway } from '../chat-webservice';\nimport { CallReportGateway } from '../call-report';\nimport axios, { AxiosInstance } from 'axios';\n\n/**\n * Maps service identifiers to their corresponding gateway types.\n * Used by the `gateway()` function to infer the correct return type\n * based on the service name passed as argument.\n *\n * When adding a new service, add an entry here with the service\n * identifier as the key and the gateway class as the value.\n */\nexport type GatewayMap = {\n 'customer-service': CustomerServiceGateway;\n 'chat-config': ChatConfigGateway;\n campaigns: CampaignsGateway;\n 'chat-adapter': ChatAdapterGateway;\n assets: AssetsGateway;\n 'contact-list': ContactListGateway;\n 'chat-webservice': ChatWebserviceGateway;\n 'call-report': CallReportGateway;\n};\n\nexport interface SDKGatewaysInterface {\n customerService: CustomerServiceGateway | null;\n chatConfig: ChatConfigGateway | null;\n campaigns: CampaignsGateway | null;\n chatAdapter: ChatAdapterGateway | null;\n assets: AssetsGateway | null;\n contactList: ContactListGateway | null;\n chatWebservice: ChatWebserviceGateway | null;\n callReport: CallReportGateway | null;\n}\n\nclass SDKGateways {\n customerService: CustomerServiceGateway | null;\n chatConfig: ChatConfigGateway | null;\n campaigns: CampaignsGateway | null;\n chatAdapter: ChatAdapterGateway | null;\n assets: AssetsGateway | null;\n contactList: ContactListGateway | null;\n chatWebservice: ChatWebserviceGateway | null;\n callReport: CallReportGateway | null;\n constructor(\n customerService: CustomerServiceGateway | null,\n chatConfig: ChatConfigGateway | null,\n campaigns: CampaignsGateway | null,\n chatAdapter: ChatAdapterGateway | null,\n assets: AssetsGateway | null,\n contactList: ContactListGateway | null,\n chatWebservice: ChatWebserviceGateway | null,\n callReport: CallReportGateway | null,\n ) {\n this.customerService = customerService;\n this.chatConfig = chatConfig;\n this.campaigns = campaigns;\n this.chatAdapter = chatAdapter;\n this.assets = assets;\n this.contactList = contactList;\n this.chatWebservice = chatWebservice;\n this.callReport = callReport;\n }\n}\n\n/**\n * Parameters required to configure the SDK client.\n * Each service configuration is optional, only provide the services you need.\n */\nexport interface GatewayClientParams {\n /** An Axios instance used as the HTTP client for all gateway requests (optional). */\n axiosClient?: AxiosInstance;\n /** API token used for authentication across all services. */\n apiToken: string;\n /** Configuration for each service gateway. Only the services you configure will be available. */\n services: {\n customerService?: {\n baseUrl: string;\n };\n chatConfig?: {\n baseUrl: string;\n };\n campaigns?: {\n baseUrl: string;\n };\n chatAdapter?: {\n baseUrl: string;\n };\n assets?: {\n baseUrl: string;\n };\n contactList?: {\n baseUrl: string;\n };\n chatWebservice?: {\n baseUrl: string;\n };\n callReport?: {\n baseUrl: string;\n };\n };\n}\n\n/**\n * Creates an SDKGateways instance with all service gateways initialized\n * using the provided configuration parameters.\n * Services without configuration will be set to null and will throw\n * an error if accessed via `gateway()`.\n */\nexport function createClient(params: GatewayClientParams) {\n const httpClient =\n params.axiosClient ||\n axios.create({\n headers: {\n Authorization: `Bearer ${params.apiToken}`,\n },\n });\n const customerService = params.services.customerService\n ? new CustomerServiceGateway(httpClient, params.services.customerService.baseUrl)\n : null;\n const chatConfig = params.services.chatConfig\n ? new ChatConfigGateway(httpClient, params.services.chatConfig.baseUrl)\n : null;\n const campaigns = params.services.campaigns\n ? new CampaignsGateway(httpClient, params.services.campaigns.baseUrl)\n : null;\n const chatAdapter = params.services.chatAdapter\n ? new ChatAdapterGateway(httpClient, params.services.chatAdapter.baseUrl)\n : null;\n const assets = params.services.assets ? new AssetsGateway(httpClient, params.services.assets.baseUrl) : null;\n const contactList = params.services.contactList\n ? new ContactListGateway(httpClient, params.services.contactList.baseUrl)\n : null;\n const chatWebservice = params.services.chatWebservice\n ? new ChatWebserviceGateway(httpClient, params.services.chatWebservice.baseUrl)\n : null;\n const callReport = params.services.callReport\n ? new CallReportGateway(httpClient, params.services.callReport.baseUrl)\n : null;\n return new SDKGateways(\n customerService,\n chatConfig,\n campaigns,\n chatAdapter,\n assets,\n contactList,\n chatWebservice,\n callReport,\n );\n}\n","export const SERVICE_GATEWAYS = {\n CUSTOMER_SERVICE: 'customer-service',\n CHAT_CONFIG: 'chat-config',\n CAMPAIGNS: 'campaigns',\n CHAT_ADAPTER: 'chat-adapter',\n ASSETS: 'assets',\n CONTACT_LIST: 'contact-list',\n CHAT_WEBSERVICE: 'chat-webservice',\n CALL_REPORT: 'call-report',\n} as const;\n\nexport type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgBO,IAAM,yBAAN,MAA6B;AAAA,EAClC,YACmB,YACA,SACjB;AAFiB;AACA;AAAA,EAChB;AAAA,EAFgB;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,MAAM,eAAe,WAA6C;AAChE,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,WAAW,IAAqB,GAAG,KAAK,OAAO,qBAAqB,SAAS,EAAE;AAC3G,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAc,WAAmD;AACrE,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,WAAW;AAAA,MACrC,GAAG,KAAK,OAAO;AAAA,MACf,EAAE,QAAQ,EAAE,YAAY,UAAU,EAAE;AAAA,IACtC;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAM,iBAAiB,aAAqB,WAAgD;AAC1F,UAAM,SAAS,YAAY,EAAE,YAAY,UAAU,IAAI;AACvD,UAAM,EAAE,KAAK,IAAI,MAAM,KAAK,WAAW;AAAA,MACrC,GAAG,KAAK,OAAO,0BAA0B,WAAW;AAAA,MACpD,EAAE,OAAO;AAAA,IACX;AACA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,oBACJ,SACA,WACA,SACmC;AACnC,UAAM,SAAsD,CAAC;AAC7D,QAAI,UAAW,QAAO,aAAa;AACnC,QAAI,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;AACjD,MAAI,CAAC,IAAI;AACP,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAEF,UAAQ,SAAS;AAAA,IACf,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,mFAAmF;AACrG,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,8EAA8E;AAChG,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,4EAA4E;AAC9F,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,+EAA+E;AACjG,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,yEAAyE;AAC3F,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,+EAA+E;AACjG,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,kFAAkF;AACpG,aAAO,IAAI,OAAO;AAAA,IACpB,KAAK,iBAAiB;AACpB,UAAI,CAAC,IAAI,OAAO;AACd,cAAM,IAAI,MAAM,8EAA8E;AAChG,aAAO,IAAI,OAAO;AAAA,IACpB;AACE,YAAM,IAAI,MAAM,4BAA4B,OAAO,EAAE;AAAA,EACzD;AACF;","names":["axios"]}
package/dist/index.mjs CHANGED
@@ -115,6 +115,15 @@ var ChatConfigGateway = class {
115
115
  const { data } = await this.httpClient.get(`${this.baseUrl}/queues`);
116
116
  return data;
117
117
  }
118
+ /**
119
+ * Lists queue memberships for a member.
120
+ * @param params - The member identifier and optional association filter.
121
+ * @returns The queue memberships for the given member.
122
+ */
123
+ async getMemberQueues(params) {
124
+ const { data } = await this.httpClient.get(`${this.baseUrl}/queue-members`, { params });
125
+ return data;
126
+ }
118
127
  /**
119
128
  * Retrieves a Meta template configuration by its ID.
120
129
  * @param templateId - The unique identifier of the template.
@@ -430,8 +439,8 @@ var ContactListGateway = class {
430
439
  }
431
440
  };
432
441
 
433
- // src/integrations/index.ts
434
- var IntegrationsGateway = class {
442
+ // src/chat-webservice/index.ts
443
+ var ChatWebserviceGateway = class {
435
444
  constructor(httpClient, baseUrl) {
436
445
  this.httpClient = httpClient;
437
446
  this.baseUrl = baseUrl;
@@ -439,101 +448,45 @@ var IntegrationsGateway = class {
439
448
  httpClient;
440
449
  baseUrl;
441
450
  /**
442
- * Retrieves all integration partners configured for a company.
443
- * @param companyId - The company identifier.
444
- * @returns The integration partners configured for the company.
445
- */
446
- async getPartnersByCompany({ companyId, name }) {
447
- const { data } = await this.httpClient.get(`${this.baseUrl}/partner/company/${companyId}`, {
448
- params: name ? { name } : void 0
449
- });
450
- return data;
451
- }
452
- /**
453
- * Retrieves the hook catalog, optionally scoped by module.
454
- * @param module - The optional module identifier used by the Integrations API filter.
455
- * @returns The hook catalog items, filtered by module when provided.
451
+ * Lists live rooms assigned to a user.
452
+ * @param params - The recipient, company, and open-status filters.
453
+ * @returns The live room entries for the user.
456
454
  */
457
- async getHooksCatalog({ module } = {}) {
458
- const { data } = await this.httpClient.get(`${this.baseUrl}/hooks`, {
459
- params: module ? { module } : void 0
460
- });
455
+ async listLiveUserRooms(params) {
456
+ const { data } = await this.httpClient.get(`${this.baseUrl}/member/rooms/live`, { params });
461
457
  return data;
462
458
  }
463
459
  /**
464
- * Creates an integration partner.
465
- * @param payload - The partner creation payload.
466
- * @returns The created integration partner.
460
+ * Retrieves a chat room by its identifier.
461
+ * @param id - The unique identifier of the room.
462
+ * @param params - Optional query parameters for scoping and member inclusion.
463
+ * @returns The chat room data.
467
464
  */
468
- async createPartner(payload) {
469
- const { data } = await this.httpClient.post(`${this.baseUrl}/partner`, payload);
465
+ async getRoomById(id, params = {}) {
466
+ const { data } = await this.httpClient.get(`${this.baseUrl}/room/${id}`, { params });
470
467
  return data;
471
468
  }
472
- /**
473
- * Deletes an integration partner.
474
- * @param partnerId - The partner identifier.
475
- * @returns A promise that resolves when the partner is deleted.
476
- */
477
- async deletePartner({ partnerId }) {
478
- await this.httpClient.delete(`${this.baseUrl}/partner/${partnerId}`);
469
+ };
470
+
471
+ // src/call-report/index.ts
472
+ var CallReportGateway = class {
473
+ constructor(httpClient, baseUrl) {
474
+ this.httpClient = httpClient;
475
+ this.baseUrl = baseUrl;
479
476
  }
477
+ httpClient;
478
+ baseUrl;
480
479
  /**
481
- * Creates an integration action.
482
- * @param payload - The action creation payload.
483
- * @returns The created integration action.
480
+ * Lists contact interaction history across chat and CDR indexes.
481
+ * @param params - Optional filters, pagination, and index selection.
482
+ * @returns The paginated contact history response.
484
483
  */
485
- async createAction(payload) {
486
- const { data } = await this.httpClient.post(`${this.baseUrl}/action`, {
487
- ...payload,
488
- actionName: payload.actionName ?? payload.hook
484
+ async listContactHistory(params = {}) {
485
+ const { data } = await this.httpClient.get(`${this.baseUrl}/history/index/multi`, {
486
+ params
489
487
  });
490
488
  return data;
491
489
  }
492
- /**
493
- * Updates an integration action.
494
- * @param actionId - The action identifier.
495
- * @param payload - The action update payload.
496
- * @returns The updated integration action.
497
- */
498
- async updateAction({ actionId, payload }) {
499
- const { data } = await this.httpClient.patch(`${this.baseUrl}/action/${actionId}`, payload);
500
- return data;
501
- }
502
- /**
503
- * Creates an integration action field/header.
504
- * @param payload - The field creation payload.
505
- * @returns The created integration field.
506
- */
507
- async createField(payload) {
508
- const { data } = await this.httpClient.post(`${this.baseUrl}/field`, payload);
509
- return data;
510
- }
511
- /**
512
- * Updates an integration action field/header.
513
- * @param fieldId - The field identifier.
514
- * @param payload - The field update payload.
515
- * @returns The updated integration field response.
516
- */
517
- async updateField({ fieldId, payload }) {
518
- const { data } = await this.httpClient.put(`${this.baseUrl}/field/${fieldId}`, payload);
519
- return data;
520
- }
521
- /**
522
- * Deletes an integration action field/header.
523
- * @param fieldId - The field identifier.
524
- * @returns A promise that resolves when the field is deleted.
525
- */
526
- async deleteField({ fieldId }) {
527
- await this.httpClient.delete(`${this.baseUrl}/field/${fieldId}`);
528
- }
529
- /**
530
- * Deletes an integration action.
531
- * @param actionId - The action identifier.
532
- * @returns A promise that resolves when the action is deleted.
533
- */
534
- async deleteAction({ actionId }) {
535
- await this.httpClient.delete(`${this.baseUrl}/action/${actionId}`);
536
- }
537
490
  };
538
491
 
539
492
  // src/@common/client.ts
@@ -545,15 +498,17 @@ var SDKGateways = class {
545
498
  chatAdapter;
546
499
  assets;
547
500
  contactList;
548
- integrations;
549
- constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations) {
501
+ chatWebservice;
502
+ callReport;
503
+ constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, chatWebservice, callReport) {
550
504
  this.customerService = customerService;
551
505
  this.chatConfig = chatConfig;
552
506
  this.campaigns = campaigns;
553
507
  this.chatAdapter = chatAdapter;
554
508
  this.assets = assets;
555
509
  this.contactList = contactList;
556
- this.integrations = integrations;
510
+ this.chatWebservice = chatWebservice;
511
+ this.callReport = callReport;
557
512
  }
558
513
  };
559
514
  function createClient(params) {
@@ -568,8 +523,18 @@ function createClient(params) {
568
523
  const chatAdapter = params.services.chatAdapter ? new ChatAdapterGateway(httpClient, params.services.chatAdapter.baseUrl) : null;
569
524
  const assets = params.services.assets ? new AssetsGateway(httpClient, params.services.assets.baseUrl) : null;
570
525
  const contactList = params.services.contactList ? new ContactListGateway(httpClient, params.services.contactList.baseUrl) : null;
571
- const integrations = params.services.integrations ? new IntegrationsGateway(httpClient, params.services.integrations.baseUrl) : null;
572
- return new SDKGateways(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations);
526
+ const chatWebservice = params.services.chatWebservice ? new ChatWebserviceGateway(httpClient, params.services.chatWebservice.baseUrl) : null;
527
+ const callReport = params.services.callReport ? new CallReportGateway(httpClient, params.services.callReport.baseUrl) : null;
528
+ return new SDKGateways(
529
+ customerService,
530
+ chatConfig,
531
+ campaigns,
532
+ chatAdapter,
533
+ assets,
534
+ contactList,
535
+ chatWebservice,
536
+ callReport
537
+ );
573
538
  }
574
539
 
575
540
  // src/@common/enums.ts
@@ -580,7 +545,8 @@ var SERVICE_GATEWAYS = {
580
545
  CHAT_ADAPTER: "chat-adapter",
581
546
  ASSETS: "assets",
582
547
  CONTACT_LIST: "contact-list",
583
- INTEGRATIONS: "integrations"
548
+ CHAT_WEBSERVICE: "chat-webservice",
549
+ CALL_REPORT: "call-report"
584
550
  };
585
551
 
586
552
  // src/index.ts
@@ -624,10 +590,14 @@ function gateway(service) {
624
590
  if (!sdk.client.contactList)
625
591
  throw new Error(`Service 'contact-list' is not configured. Provide its baseUrl in configure().`);
626
592
  return sdk.client.contactList;
627
- case SERVICE_GATEWAYS.INTEGRATIONS:
628
- if (!sdk.client.integrations)
629
- throw new Error(`Service 'integrations' is not configured. Provide its baseUrl in configure().`);
630
- return sdk.client.integrations;
593
+ case SERVICE_GATEWAYS.CHAT_WEBSERVICE:
594
+ if (!sdk.client.chatWebservice)
595
+ throw new Error(`Service 'chat-webservice' is not configured. Provide its baseUrl in configure().`);
596
+ return sdk.client.chatWebservice;
597
+ case SERVICE_GATEWAYS.CALL_REPORT:
598
+ if (!sdk.client.callReport)
599
+ throw new Error(`Service 'call-report' is not configured. Provide its baseUrl in configure().`);
600
+ return sdk.client.callReport;
631
601
  default:
632
602
  throw new Error(`Unknown service gateway: ${service}`);
633
603
  }