@opens/gateways 1.16.7 → 1.16.8
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.d.mts +62 -1
- package/dist/index.d.ts +62 -1
- package/dist/index.js +94 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -3
- package/dist/index.mjs.map +1 -1
- package/dist/notifications/contracts/index.d.mts +160 -0
- package/dist/notifications/contracts/index.d.ts +160 -0
- package/dist/notifications/contracts/index.js +19 -0
- package/dist/notifications/contracts/index.js.map +1 -0
- package/dist/notifications/contracts/index.mjs +1 -0
- package/dist/notifications/contracts/index.mjs.map +1 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,8 @@ import { GetCommentHistoryRequest, CommentHistoryPage, CasePermissions, UpdateCa
|
|
|
23
23
|
export { CaseListItem, CasePermissionsValue, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, ListCasesCursor, TimeEntryCursor } from './cases/contracts/index.mjs';
|
|
24
24
|
import { GetAccessPackagesParams, PaginatedResult, AccessPackage, GetCompanyAccessPackagesParams, CompanyAccessPackageItem, CreateCompanyAccessPackagePayload, UpdateCompanyAccessPackagePayload, GetCompanyResourcesParams, CompanyResource } from './access-hub/contracts/index.mjs';
|
|
25
25
|
export { AccessGroup, AccessPackageGroup } from './access-hub/contracts/index.mjs';
|
|
26
|
+
import { GetSystemNotificationsParams, GetSystemNotificationsResponse, GetUserDevicesParams, GetUserDevicesResponse, RegisterUserDeviceRequest, RegisterUserDeviceResponse, DeleteUserDeviceResponse, GetUserPreferencesParams, UserPreference, CreateUserPreferenceRequest, DeleteUserPreferenceParams, DeleteUserPreferenceResponse } from './notifications/contracts/index.mjs';
|
|
27
|
+
export { DeviceType, SystemNotification, SystemNotificationType, UserDevice, UserPreferenceDevice, UserPreferenceSystemNotification } from './notifications/contracts/index.mjs';
|
|
26
28
|
export { Event } from './rh/contracts/index.mjs';
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -814,6 +816,60 @@ declare class AccessHubGateway {
|
|
|
814
816
|
getCompanyResources(params: GetCompanyResourcesParams): Promise<CompanyResource[]>;
|
|
815
817
|
}
|
|
816
818
|
|
|
819
|
+
/**
|
|
820
|
+
* Gateway for interacting with the Notifications API.
|
|
821
|
+
*/
|
|
822
|
+
declare class NotificationsGateway {
|
|
823
|
+
private readonly httpClient;
|
|
824
|
+
private readonly baseUrl;
|
|
825
|
+
constructor(httpClient: AxiosInstance, baseUrl: string);
|
|
826
|
+
/**
|
|
827
|
+
* Returns the catalog of available system notifications with their types and metadata.
|
|
828
|
+
* @param params - Optional filters by type slug or type ID.
|
|
829
|
+
* @returns A list of system notifications and the total count.
|
|
830
|
+
*/
|
|
831
|
+
getSystemNotifications(params?: GetSystemNotificationsParams): Promise<GetSystemNotificationsResponse>;
|
|
832
|
+
/**
|
|
833
|
+
* Lists push notification devices registered for the authenticated user.
|
|
834
|
+
* @param params - Optional filters, pagination and service-token context.
|
|
835
|
+
* @returns A list of user devices and the total count.
|
|
836
|
+
*/
|
|
837
|
+
getUserDevices(params?: GetUserDevicesParams): Promise<GetUserDevicesResponse>;
|
|
838
|
+
/**
|
|
839
|
+
* Registers or updates a push notification token for a user device.
|
|
840
|
+
* Idempotent via findOrCreate on deviceToken.
|
|
841
|
+
* @param payload - Device token and either deviceSlug or deviceId.
|
|
842
|
+
* @returns The registered device summary.
|
|
843
|
+
*/
|
|
844
|
+
registerUserDevice(payload: RegisterUserDeviceRequest): Promise<RegisterUserDeviceResponse>;
|
|
845
|
+
/**
|
|
846
|
+
* Deletes a registered user device and its notification token.
|
|
847
|
+
* @param id - UUID of the user device record.
|
|
848
|
+
* @returns Confirmation of deletion.
|
|
849
|
+
*/
|
|
850
|
+
deleteUserDevice(id: string): Promise<DeleteUserDeviceResponse>;
|
|
851
|
+
/**
|
|
852
|
+
* Lists active notification preferences for the user, optionally filtered by device.
|
|
853
|
+
* @param params - Optional filters and service-token context.
|
|
854
|
+
* @returns A list of user preferences.
|
|
855
|
+
*/
|
|
856
|
+
getUserPreferences(params?: GetUserPreferencesParams): Promise<UserPreference[]>;
|
|
857
|
+
/**
|
|
858
|
+
* Creates or activates a notification preference for a user device.
|
|
859
|
+
* Idempotent via findOrCreate on the user/device/notification combination.
|
|
860
|
+
* @param payload - Device ID and either systemNotificationSlug or systemNotificationId.
|
|
861
|
+
* @returns The created or existing preference.
|
|
862
|
+
*/
|
|
863
|
+
createUserPreference(payload: CreateUserPreferenceRequest): Promise<UserPreference>;
|
|
864
|
+
/**
|
|
865
|
+
* Deletes a notification preference by its ID.
|
|
866
|
+
* @param id - UUID of the preference in `user_notification_preferences`.
|
|
867
|
+
* @param params - Optional companyId/userId for Service Token context.
|
|
868
|
+
* @returns Confirmation of deletion.
|
|
869
|
+
*/
|
|
870
|
+
deleteUserPreference(id: string, params?: DeleteUserPreferenceParams): Promise<DeleteUserPreferenceResponse>;
|
|
871
|
+
}
|
|
872
|
+
|
|
817
873
|
/**
|
|
818
874
|
* Maps service identifiers to their corresponding gateway types.
|
|
819
875
|
* Used by the `gateway()` function to infer the correct return type
|
|
@@ -836,6 +892,7 @@ type GatewayMap = {
|
|
|
836
892
|
cases: CasesGateway;
|
|
837
893
|
rh: RhGateway;
|
|
838
894
|
'access-hub': AccessHubGateway;
|
|
895
|
+
notifications: NotificationsGateway;
|
|
839
896
|
};
|
|
840
897
|
/**
|
|
841
898
|
* Parameters required to configure the SDK client.
|
|
@@ -887,6 +944,9 @@ interface GatewayClientParams {
|
|
|
887
944
|
accessHub?: {
|
|
888
945
|
baseUrl: string;
|
|
889
946
|
};
|
|
947
|
+
notifications?: {
|
|
948
|
+
baseUrl: string;
|
|
949
|
+
};
|
|
890
950
|
};
|
|
891
951
|
}
|
|
892
952
|
|
|
@@ -904,6 +964,7 @@ declare const SERVICE_GATEWAYS: {
|
|
|
904
964
|
readonly CASES: "cases";
|
|
905
965
|
readonly RH: "rh";
|
|
906
966
|
readonly ACCESS_HUB: "access-hub";
|
|
967
|
+
readonly NOTIFICATIONS: "notifications";
|
|
907
968
|
};
|
|
908
969
|
type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];
|
|
909
970
|
|
|
@@ -930,4 +991,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
930
991
|
*/
|
|
931
992
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
932
993
|
|
|
933
|
-
export { AccessPackage, ActiveAnnouncement, ActiveAnnouncementQuery, Announcement, AnnouncementListFilters, AnnouncementListResponse, AnnouncementType, AttachmentByIdResponse, AudioConvertResponse, AutomationPartner, AutomationPartnerAction, CallEndpoint, CallReportCompanyUsageRequest, CallReportCompanyUsageResponse, Campaign, CampaignAccessResponse, CampaignCompanyPaginatedResponse, CampaignCompanyQueryParams, CampaignCompanyResponse, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignContactsDashboardData, CampaignContactsDashboardQueryParams, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CancelInvitationRequest, CaseFeedByActionItem, CasePermissions, CaseTimeEntry, ChatWebserviceCompanyUsageRequest, ChatWebserviceCompanyUsageResponse, CloneCaseRequest, ClonedCase, CommentHistoryPage, CompanyAccessPackageItem, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, CompanyQueue, CompanyResource, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, Config, ConfigListByProviderResponse, ContactCategoryResponse, ContactHistoryResponse, ContactPhoneSearchResponse, ContactResponse, CreateAnnouncementRequest, CreateAutomationPartnerRequest, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, CreateCompanyAccessPackagePayload, CreateIntegrationActionRequest, CreateIntegrationFieldRequest, CreateIntegrationPartnerRequest, CreateTimeEntryRequest, CreateWebhookRequest$1 as CreateWebhookRequest, DeleteIntegrationActionParams, DeleteIntegrationFieldParams, DeleteIntegrationPartnerParams, DeleteTimeEntryRequest, EnableCampaignCompanyRequest, FindOrCreateContactRequest, FindOrCreateQueueRuleRequest, FlowCatalogParams, FlowCatalogResponse, FlowDefinition, FlowReadiness, ForwardMessageRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAccessPackagesParams, GetAllUsersParams, GetAllUsersResponse, GetAttachmentByIdRequest, GetAutomationPartnerRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, GetCompanyAccessPackagesParams, GetCompanyResourcesParams, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetContactPhonesParams, GetInitialContextRequest, GetInitialContextResponse, GetIntegrationHooksCatalogRequest, GetIntegrationPartnersByCompanyRequest, GetManagedUsersResponse, GetMemberQueuesRequest, GetMessagesByCursorRequest, GetMessagesByCursorResponse, GetPresignedUrlRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRoomByIdRequest, GetRootRulesRequest, GetServiceGroupsParams, GetSupportWidgetIdResponse, GetUserByIdResponse, GetWebhooksByCompanyRequest$1 as GetWebhooksByCompanyRequest, HookCatalogItem, IntegrationAction, IntegrationField, IntegrationPartner, InvitationResponse, ListAutomationActionsRequest, ListAutomationPartnersRequest, ListCasesRequest, ListCasesResponse, ListContactHistoryRequest, ListInvitationsRequest, ListLiveUserRoomsRequest, ListTimeEntriesPage, ListTimeEntriesRequest, ListUsersRequest, ListUsersResponse, LiveUserRoomResponse, MarkMessagesAsReadRequest, MarkMessagesAsReadResponse, MessageResponse, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PaginatedResult, PatchCampaignContactRequest, PatchCampaignRequest, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, Queue, QueueMember, QueueRule, ReplyInvitationRequest, RoomMemberResponse, RoomResponse, RootRulesResponse, SERVICE_GATEWAYS, SERVICE_GATEWAYS as SERVICE_GATEWAYS_TYPE, SendAttachmentMessageResponse, SendMessageRequest, ServiceGroupsResponse, StrongPasswordOptionsResponse, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCasePermissionsRequest, UpdateCompanyAccessPackagePayload, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateIntegrationActionParams, UpdateIntegrationFieldParams, UpdateMemberInRoomRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateTimeEntryRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UploadPresignedUrlResponse, User, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|
|
994
|
+
export { AccessPackage, ActiveAnnouncement, ActiveAnnouncementQuery, Announcement, AnnouncementListFilters, AnnouncementListResponse, AnnouncementType, AttachmentByIdResponse, AudioConvertResponse, AutomationPartner, AutomationPartnerAction, CallEndpoint, CallReportCompanyUsageRequest, CallReportCompanyUsageResponse, Campaign, CampaignAccessResponse, CampaignCompanyPaginatedResponse, CampaignCompanyQueryParams, CampaignCompanyResponse, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignContactsDashboardData, CampaignContactsDashboardQueryParams, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CancelInvitationRequest, CaseFeedByActionItem, CasePermissions, CaseTimeEntry, ChatWebserviceCompanyUsageRequest, ChatWebserviceCompanyUsageResponse, CloneCaseRequest, ClonedCase, CommentHistoryPage, CompanyAccessPackageItem, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, CompanyQueue, CompanyResource, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, Config, ConfigListByProviderResponse, ContactCategoryResponse, ContactHistoryResponse, ContactPhoneSearchResponse, ContactResponse, CreateAnnouncementRequest, CreateAutomationPartnerRequest, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, CreateCompanyAccessPackagePayload, CreateIntegrationActionRequest, CreateIntegrationFieldRequest, CreateIntegrationPartnerRequest, CreateTimeEntryRequest, CreateUserPreferenceRequest, CreateWebhookRequest$1 as CreateWebhookRequest, DeleteIntegrationActionParams, DeleteIntegrationFieldParams, DeleteIntegrationPartnerParams, DeleteTimeEntryRequest, DeleteUserDeviceResponse, DeleteUserPreferenceParams, DeleteUserPreferenceResponse, EnableCampaignCompanyRequest, FindOrCreateContactRequest, FindOrCreateQueueRuleRequest, FlowCatalogParams, FlowCatalogResponse, FlowDefinition, FlowReadiness, ForwardMessageRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAccessPackagesParams, GetAllUsersParams, GetAllUsersResponse, GetAttachmentByIdRequest, GetAutomationPartnerRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, GetCompanyAccessPackagesParams, GetCompanyResourcesParams, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetContactPhonesParams, GetInitialContextRequest, GetInitialContextResponse, GetIntegrationHooksCatalogRequest, GetIntegrationPartnersByCompanyRequest, GetManagedUsersResponse, GetMemberQueuesRequest, GetMessagesByCursorRequest, GetMessagesByCursorResponse, GetPresignedUrlRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRoomByIdRequest, GetRootRulesRequest, GetServiceGroupsParams, GetSupportWidgetIdResponse, GetSystemNotificationsParams, GetSystemNotificationsResponse, GetUserByIdResponse, GetUserDevicesParams, GetUserDevicesResponse, GetUserPreferencesParams, GetWebhooksByCompanyRequest$1 as GetWebhooksByCompanyRequest, HookCatalogItem, IntegrationAction, IntegrationField, IntegrationPartner, InvitationResponse, ListAutomationActionsRequest, ListAutomationPartnersRequest, ListCasesRequest, ListCasesResponse, ListContactHistoryRequest, ListInvitationsRequest, ListLiveUserRoomsRequest, ListTimeEntriesPage, ListTimeEntriesRequest, ListUsersRequest, ListUsersResponse, LiveUserRoomResponse, MarkMessagesAsReadRequest, MarkMessagesAsReadResponse, MessageResponse, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PaginatedResult, PatchCampaignContactRequest, PatchCampaignRequest, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, Queue, QueueMember, QueueRule, RegisterUserDeviceRequest, RegisterUserDeviceResponse, ReplyInvitationRequest, RoomMemberResponse, RoomResponse, RootRulesResponse, SERVICE_GATEWAYS, SERVICE_GATEWAYS as SERVICE_GATEWAYS_TYPE, SendAttachmentMessageResponse, SendMessageRequest, ServiceGroupsResponse, StrongPasswordOptionsResponse, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCasePermissionsRequest, UpdateCompanyAccessPackagePayload, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateIntegrationActionParams, UpdateIntegrationFieldParams, UpdateMemberInRoomRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateTimeEntryRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UploadPresignedUrlResponse, User, UserPreference, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ import { GetCommentHistoryRequest, CommentHistoryPage, CasePermissions, UpdateCa
|
|
|
23
23
|
export { CaseListItem, CasePermissionsValue, CommentHistoryChangeType, CommentHistoryCursor, CommentHistoryEntry, ListCasesCursor, TimeEntryCursor } from './cases/contracts/index.js';
|
|
24
24
|
import { GetAccessPackagesParams, PaginatedResult, AccessPackage, GetCompanyAccessPackagesParams, CompanyAccessPackageItem, CreateCompanyAccessPackagePayload, UpdateCompanyAccessPackagePayload, GetCompanyResourcesParams, CompanyResource } from './access-hub/contracts/index.js';
|
|
25
25
|
export { AccessGroup, AccessPackageGroup } from './access-hub/contracts/index.js';
|
|
26
|
+
import { GetSystemNotificationsParams, GetSystemNotificationsResponse, GetUserDevicesParams, GetUserDevicesResponse, RegisterUserDeviceRequest, RegisterUserDeviceResponse, DeleteUserDeviceResponse, GetUserPreferencesParams, UserPreference, CreateUserPreferenceRequest, DeleteUserPreferenceParams, DeleteUserPreferenceResponse } from './notifications/contracts/index.js';
|
|
27
|
+
export { DeviceType, SystemNotification, SystemNotificationType, UserDevice, UserPreferenceDevice, UserPreferenceSystemNotification } from './notifications/contracts/index.js';
|
|
26
28
|
export { Event } from './rh/contracts/index.js';
|
|
27
29
|
|
|
28
30
|
/**
|
|
@@ -814,6 +816,60 @@ declare class AccessHubGateway {
|
|
|
814
816
|
getCompanyResources(params: GetCompanyResourcesParams): Promise<CompanyResource[]>;
|
|
815
817
|
}
|
|
816
818
|
|
|
819
|
+
/**
|
|
820
|
+
* Gateway for interacting with the Notifications API.
|
|
821
|
+
*/
|
|
822
|
+
declare class NotificationsGateway {
|
|
823
|
+
private readonly httpClient;
|
|
824
|
+
private readonly baseUrl;
|
|
825
|
+
constructor(httpClient: AxiosInstance, baseUrl: string);
|
|
826
|
+
/**
|
|
827
|
+
* Returns the catalog of available system notifications with their types and metadata.
|
|
828
|
+
* @param params - Optional filters by type slug or type ID.
|
|
829
|
+
* @returns A list of system notifications and the total count.
|
|
830
|
+
*/
|
|
831
|
+
getSystemNotifications(params?: GetSystemNotificationsParams): Promise<GetSystemNotificationsResponse>;
|
|
832
|
+
/**
|
|
833
|
+
* Lists push notification devices registered for the authenticated user.
|
|
834
|
+
* @param params - Optional filters, pagination and service-token context.
|
|
835
|
+
* @returns A list of user devices and the total count.
|
|
836
|
+
*/
|
|
837
|
+
getUserDevices(params?: GetUserDevicesParams): Promise<GetUserDevicesResponse>;
|
|
838
|
+
/**
|
|
839
|
+
* Registers or updates a push notification token for a user device.
|
|
840
|
+
* Idempotent via findOrCreate on deviceToken.
|
|
841
|
+
* @param payload - Device token and either deviceSlug or deviceId.
|
|
842
|
+
* @returns The registered device summary.
|
|
843
|
+
*/
|
|
844
|
+
registerUserDevice(payload: RegisterUserDeviceRequest): Promise<RegisterUserDeviceResponse>;
|
|
845
|
+
/**
|
|
846
|
+
* Deletes a registered user device and its notification token.
|
|
847
|
+
* @param id - UUID of the user device record.
|
|
848
|
+
* @returns Confirmation of deletion.
|
|
849
|
+
*/
|
|
850
|
+
deleteUserDevice(id: string): Promise<DeleteUserDeviceResponse>;
|
|
851
|
+
/**
|
|
852
|
+
* Lists active notification preferences for the user, optionally filtered by device.
|
|
853
|
+
* @param params - Optional filters and service-token context.
|
|
854
|
+
* @returns A list of user preferences.
|
|
855
|
+
*/
|
|
856
|
+
getUserPreferences(params?: GetUserPreferencesParams): Promise<UserPreference[]>;
|
|
857
|
+
/**
|
|
858
|
+
* Creates or activates a notification preference for a user device.
|
|
859
|
+
* Idempotent via findOrCreate on the user/device/notification combination.
|
|
860
|
+
* @param payload - Device ID and either systemNotificationSlug or systemNotificationId.
|
|
861
|
+
* @returns The created or existing preference.
|
|
862
|
+
*/
|
|
863
|
+
createUserPreference(payload: CreateUserPreferenceRequest): Promise<UserPreference>;
|
|
864
|
+
/**
|
|
865
|
+
* Deletes a notification preference by its ID.
|
|
866
|
+
* @param id - UUID of the preference in `user_notification_preferences`.
|
|
867
|
+
* @param params - Optional companyId/userId for Service Token context.
|
|
868
|
+
* @returns Confirmation of deletion.
|
|
869
|
+
*/
|
|
870
|
+
deleteUserPreference(id: string, params?: DeleteUserPreferenceParams): Promise<DeleteUserPreferenceResponse>;
|
|
871
|
+
}
|
|
872
|
+
|
|
817
873
|
/**
|
|
818
874
|
* Maps service identifiers to their corresponding gateway types.
|
|
819
875
|
* Used by the `gateway()` function to infer the correct return type
|
|
@@ -836,6 +892,7 @@ type GatewayMap = {
|
|
|
836
892
|
cases: CasesGateway;
|
|
837
893
|
rh: RhGateway;
|
|
838
894
|
'access-hub': AccessHubGateway;
|
|
895
|
+
notifications: NotificationsGateway;
|
|
839
896
|
};
|
|
840
897
|
/**
|
|
841
898
|
* Parameters required to configure the SDK client.
|
|
@@ -887,6 +944,9 @@ interface GatewayClientParams {
|
|
|
887
944
|
accessHub?: {
|
|
888
945
|
baseUrl: string;
|
|
889
946
|
};
|
|
947
|
+
notifications?: {
|
|
948
|
+
baseUrl: string;
|
|
949
|
+
};
|
|
890
950
|
};
|
|
891
951
|
}
|
|
892
952
|
|
|
@@ -904,6 +964,7 @@ declare const SERVICE_GATEWAYS: {
|
|
|
904
964
|
readonly CASES: "cases";
|
|
905
965
|
readonly RH: "rh";
|
|
906
966
|
readonly ACCESS_HUB: "access-hub";
|
|
967
|
+
readonly NOTIFICATIONS: "notifications";
|
|
907
968
|
};
|
|
908
969
|
type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];
|
|
909
970
|
|
|
@@ -930,4 +991,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
930
991
|
*/
|
|
931
992
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
932
993
|
|
|
933
|
-
export { AccessPackage, ActiveAnnouncement, ActiveAnnouncementQuery, Announcement, AnnouncementListFilters, AnnouncementListResponse, AnnouncementType, AttachmentByIdResponse, AudioConvertResponse, AutomationPartner, AutomationPartnerAction, CallEndpoint, CallReportCompanyUsageRequest, CallReportCompanyUsageResponse, Campaign, CampaignAccessResponse, CampaignCompanyPaginatedResponse, CampaignCompanyQueryParams, CampaignCompanyResponse, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignContactsDashboardData, CampaignContactsDashboardQueryParams, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CancelInvitationRequest, CaseFeedByActionItem, CasePermissions, CaseTimeEntry, ChatWebserviceCompanyUsageRequest, ChatWebserviceCompanyUsageResponse, CloneCaseRequest, ClonedCase, CommentHistoryPage, CompanyAccessPackageItem, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, CompanyQueue, CompanyResource, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, Config, ConfigListByProviderResponse, ContactCategoryResponse, ContactHistoryResponse, ContactPhoneSearchResponse, ContactResponse, CreateAnnouncementRequest, CreateAutomationPartnerRequest, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, CreateCompanyAccessPackagePayload, CreateIntegrationActionRequest, CreateIntegrationFieldRequest, CreateIntegrationPartnerRequest, CreateTimeEntryRequest, CreateWebhookRequest$1 as CreateWebhookRequest, DeleteIntegrationActionParams, DeleteIntegrationFieldParams, DeleteIntegrationPartnerParams, DeleteTimeEntryRequest, EnableCampaignCompanyRequest, FindOrCreateContactRequest, FindOrCreateQueueRuleRequest, FlowCatalogParams, FlowCatalogResponse, FlowDefinition, FlowReadiness, ForwardMessageRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAccessPackagesParams, GetAllUsersParams, GetAllUsersResponse, GetAttachmentByIdRequest, GetAutomationPartnerRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, GetCompanyAccessPackagesParams, GetCompanyResourcesParams, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetContactPhonesParams, GetInitialContextRequest, GetInitialContextResponse, GetIntegrationHooksCatalogRequest, GetIntegrationPartnersByCompanyRequest, GetManagedUsersResponse, GetMemberQueuesRequest, GetMessagesByCursorRequest, GetMessagesByCursorResponse, GetPresignedUrlRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRoomByIdRequest, GetRootRulesRequest, GetServiceGroupsParams, GetSupportWidgetIdResponse, GetUserByIdResponse, GetWebhooksByCompanyRequest$1 as GetWebhooksByCompanyRequest, HookCatalogItem, IntegrationAction, IntegrationField, IntegrationPartner, InvitationResponse, ListAutomationActionsRequest, ListAutomationPartnersRequest, ListCasesRequest, ListCasesResponse, ListContactHistoryRequest, ListInvitationsRequest, ListLiveUserRoomsRequest, ListTimeEntriesPage, ListTimeEntriesRequest, ListUsersRequest, ListUsersResponse, LiveUserRoomResponse, MarkMessagesAsReadRequest, MarkMessagesAsReadResponse, MessageResponse, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PaginatedResult, PatchCampaignContactRequest, PatchCampaignRequest, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, Queue, QueueMember, QueueRule, ReplyInvitationRequest, RoomMemberResponse, RoomResponse, RootRulesResponse, SERVICE_GATEWAYS, SERVICE_GATEWAYS as SERVICE_GATEWAYS_TYPE, SendAttachmentMessageResponse, SendMessageRequest, ServiceGroupsResponse, StrongPasswordOptionsResponse, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCasePermissionsRequest, UpdateCompanyAccessPackagePayload, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateIntegrationActionParams, UpdateIntegrationFieldParams, UpdateMemberInRoomRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateTimeEntryRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UploadPresignedUrlResponse, User, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|
|
994
|
+
export { AccessPackage, ActiveAnnouncement, ActiveAnnouncementQuery, Announcement, AnnouncementListFilters, AnnouncementListResponse, AnnouncementType, AttachmentByIdResponse, AudioConvertResponse, AutomationPartner, AutomationPartnerAction, CallEndpoint, CallReportCompanyUsageRequest, CallReportCompanyUsageResponse, Campaign, CampaignAccessResponse, CampaignCompanyPaginatedResponse, CampaignCompanyQueryParams, CampaignCompanyResponse, CampaignContactPaginatedResponse, CampaignContactQueryParams, CampaignContactResponse, CampaignContactsDashboardData, CampaignContactsDashboardQueryParams, CampaignPaginatedResponse, CampaignQueryParams, CampaignUser, CampaignWorkGroup, CampaignWorkGroupPaginatedResponse, CampaignWorkGroupQueryParams, CancelInvitationRequest, CaseFeedByActionItem, CasePermissions, CaseTimeEntry, ChatWebserviceCompanyUsageRequest, ChatWebserviceCompanyUsageResponse, CloneCaseRequest, ClonedCase, CommentHistoryPage, CompanyAccessPackageItem, CompanyBooleanConfigKey, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, CompanyQueue, CompanyResource, CompanyResponse, CompanyStringConfigKey, CompanyWithConfigsResponse, Config, ConfigListByProviderResponse, ContactCategoryResponse, ContactHistoryResponse, ContactPhoneSearchResponse, ContactResponse, CreateAnnouncementRequest, CreateAutomationPartnerRequest, CreateCampaignContactRequest, CreateCampaignRequest, CreateCampaignWorkGroupRequest, CreateCompanyAccessPackagePayload, CreateIntegrationActionRequest, CreateIntegrationFieldRequest, CreateIntegrationPartnerRequest, CreateTimeEntryRequest, CreateUserPreferenceRequest, CreateWebhookRequest$1 as CreateWebhookRequest, DeleteIntegrationActionParams, DeleteIntegrationFieldParams, DeleteIntegrationPartnerParams, DeleteTimeEntryRequest, DeleteUserDeviceResponse, DeleteUserPreferenceParams, DeleteUserPreferenceResponse, EnableCampaignCompanyRequest, FindOrCreateContactRequest, FindOrCreateQueueRuleRequest, FlowCatalogParams, FlowCatalogResponse, FlowDefinition, FlowReadiness, ForwardMessageRequest, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, GetAccessPackagesParams, GetAllUsersParams, GetAllUsersResponse, GetAttachmentByIdRequest, GetAutomationPartnerRequest, GetCaseFeedByActionsRequest, GetCommentHistoryRequest, GetCompanyAccessPackagesParams, GetCompanyResourcesParams, GetConfigTemplatesParams, GetConfigTemplatesResponse, GetConfigsByProviderParams, GetContactPhonesParams, GetInitialContextRequest, GetInitialContextResponse, GetIntegrationHooksCatalogRequest, GetIntegrationPartnersByCompanyRequest, GetManagedUsersResponse, GetMemberQueuesRequest, GetMessagesByCursorRequest, GetMessagesByCursorResponse, GetPresignedUrlRequest, GetProviderConfigurationsParams, GetProviderDisplayInfoParams, GetRoomByIdRequest, GetRootRulesRequest, GetServiceGroupsParams, GetSupportWidgetIdResponse, GetSystemNotificationsParams, GetSystemNotificationsResponse, GetUserByIdResponse, GetUserDevicesParams, GetUserDevicesResponse, GetUserPreferencesParams, GetWebhooksByCompanyRequest$1 as GetWebhooksByCompanyRequest, HookCatalogItem, IntegrationAction, IntegrationField, IntegrationPartner, InvitationResponse, ListAutomationActionsRequest, ListAutomationPartnersRequest, ListCasesRequest, ListCasesResponse, ListContactHistoryRequest, ListInvitationsRequest, ListLiveUserRoomsRequest, ListTimeEntriesPage, ListTimeEntriesRequest, ListUsersRequest, ListUsersResponse, LiveUserRoomResponse, MarkMessagesAsReadRequest, MarkMessagesAsReadResponse, MessageResponse, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, PaginatedResult, PatchCampaignContactRequest, PatchCampaignRequest, ProviderConfigurationsResponse, ProviderDisplayInfoResponse, ProviderListResponse, Queue, QueueMember, QueueRule, RegisterUserDeviceRequest, RegisterUserDeviceResponse, ReplyInvitationRequest, RoomMemberResponse, RoomResponse, RootRulesResponse, SERVICE_GATEWAYS, SERVICE_GATEWAYS as SERVICE_GATEWAYS_TYPE, SendAttachmentMessageResponse, SendMessageRequest, ServiceGroupsResponse, StrongPasswordOptionsResponse, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, UpdateCasePermissionsRequest, UpdateCompanyAccessPackagePayload, UpdateCompanyBooleanConfigRequest, UpdateCompanyJsonConfigRequest, UpdateCompanyRequest, UpdateCompanyStringConfigRequest, UpdateCompanyUserAvatarResponse, UpdateCompanyUserRequest, UpdateIntegrationActionParams, UpdateIntegrationFieldParams, UpdateMemberInRoomRequest, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, UpdateTimeEntryRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UploadPresignedUrlResponse, User, UserPreference, UserProfile, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, WorkGroupListResponse, WorkGroupMembersResponse, WorkGroupResponse, configure, gateway };
|
package/dist/index.js
CHANGED
|
@@ -1421,6 +1421,88 @@ var AccessHubGateway = class {
|
|
|
1421
1421
|
}
|
|
1422
1422
|
};
|
|
1423
1423
|
|
|
1424
|
+
// src/notifications/index.ts
|
|
1425
|
+
var NotificationsGateway = class {
|
|
1426
|
+
constructor(httpClient, baseUrl) {
|
|
1427
|
+
this.httpClient = httpClient;
|
|
1428
|
+
this.baseUrl = baseUrl;
|
|
1429
|
+
}
|
|
1430
|
+
httpClient;
|
|
1431
|
+
baseUrl;
|
|
1432
|
+
/**
|
|
1433
|
+
* Returns the catalog of available system notifications with their types and metadata.
|
|
1434
|
+
* @param params - Optional filters by type slug or type ID.
|
|
1435
|
+
* @returns A list of system notifications and the total count.
|
|
1436
|
+
*/
|
|
1437
|
+
async getSystemNotifications(params) {
|
|
1438
|
+
const { data } = await this.httpClient.get(
|
|
1439
|
+
`${this.baseUrl}/notification/system-notifications`,
|
|
1440
|
+
{ params }
|
|
1441
|
+
);
|
|
1442
|
+
return data;
|
|
1443
|
+
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Lists push notification devices registered for the authenticated user.
|
|
1446
|
+
* @param params - Optional filters, pagination and service-token context.
|
|
1447
|
+
* @returns A list of user devices and the total count.
|
|
1448
|
+
*/
|
|
1449
|
+
async getUserDevices(params) {
|
|
1450
|
+
const { data } = await this.httpClient.get(`${this.baseUrl}/user/devices`, { params });
|
|
1451
|
+
return data;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* Registers or updates a push notification token for a user device.
|
|
1455
|
+
* Idempotent via findOrCreate on deviceToken.
|
|
1456
|
+
* @param payload - Device token and either deviceSlug or deviceId.
|
|
1457
|
+
* @returns The registered device summary.
|
|
1458
|
+
*/
|
|
1459
|
+
async registerUserDevice(payload) {
|
|
1460
|
+
const { data } = await this.httpClient.post(`${this.baseUrl}/user/devices`, payload);
|
|
1461
|
+
return data;
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Deletes a registered user device and its notification token.
|
|
1465
|
+
* @param id - UUID of the user device record.
|
|
1466
|
+
* @returns Confirmation of deletion.
|
|
1467
|
+
*/
|
|
1468
|
+
async deleteUserDevice(id) {
|
|
1469
|
+
const { data } = await this.httpClient.delete(`${this.baseUrl}/user/devices/${id}`);
|
|
1470
|
+
return data;
|
|
1471
|
+
}
|
|
1472
|
+
/**
|
|
1473
|
+
* Lists active notification preferences for the user, optionally filtered by device.
|
|
1474
|
+
* @param params - Optional filters and service-token context.
|
|
1475
|
+
* @returns A list of user preferences.
|
|
1476
|
+
*/
|
|
1477
|
+
async getUserPreferences(params) {
|
|
1478
|
+
const { data } = await this.httpClient.get(`${this.baseUrl}/user/preferences`, { params });
|
|
1479
|
+
return data;
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Creates or activates a notification preference for a user device.
|
|
1483
|
+
* Idempotent via findOrCreate on the user/device/notification combination.
|
|
1484
|
+
* @param payload - Device ID and either systemNotificationSlug or systemNotificationId.
|
|
1485
|
+
* @returns The created or existing preference.
|
|
1486
|
+
*/
|
|
1487
|
+
async createUserPreference(payload) {
|
|
1488
|
+
const { data } = await this.httpClient.post(`${this.baseUrl}/user/preferences`, payload);
|
|
1489
|
+
return data;
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Deletes a notification preference by its ID.
|
|
1493
|
+
* @param id - UUID of the preference in `user_notification_preferences`.
|
|
1494
|
+
* @param params - Optional companyId/userId for Service Token context.
|
|
1495
|
+
* @returns Confirmation of deletion.
|
|
1496
|
+
*/
|
|
1497
|
+
async deleteUserPreference(id, params) {
|
|
1498
|
+
const { data } = await this.httpClient.delete(
|
|
1499
|
+
`${this.baseUrl}/user/preferences/${id}`,
|
|
1500
|
+
{ params }
|
|
1501
|
+
);
|
|
1502
|
+
return data;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
|
|
1424
1506
|
// src/@common/client.ts
|
|
1425
1507
|
var import_axios = __toESM(require("axios"));
|
|
1426
1508
|
var SDKGateways = class {
|
|
@@ -1437,7 +1519,8 @@ var SDKGateways = class {
|
|
|
1437
1519
|
cases;
|
|
1438
1520
|
rh;
|
|
1439
1521
|
accessHub;
|
|
1440
|
-
|
|
1522
|
+
notifications;
|
|
1523
|
+
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub, notifications) {
|
|
1441
1524
|
this.customerService = customerService;
|
|
1442
1525
|
this.chatConfig = chatConfig;
|
|
1443
1526
|
this.campaigns = campaigns;
|
|
@@ -1451,6 +1534,7 @@ var SDKGateways = class {
|
|
|
1451
1534
|
this.cases = cases;
|
|
1452
1535
|
this.rh = rh;
|
|
1453
1536
|
this.accessHub = accessHub;
|
|
1537
|
+
this.notifications = notifications;
|
|
1454
1538
|
}
|
|
1455
1539
|
};
|
|
1456
1540
|
function createClient(params) {
|
|
@@ -1472,6 +1556,7 @@ function createClient(params) {
|
|
|
1472
1556
|
const cases = params.services.cases ? new CasesGateway(httpClient, params.services.cases.baseUrl) : null;
|
|
1473
1557
|
const rh = params.services.rh ? new RhGateway(httpClient, params.services.rh.baseUrl) : null;
|
|
1474
1558
|
const accessHub = params.services.accessHub ? new AccessHubGateway(httpClient, params.services.accessHub.baseUrl) : null;
|
|
1559
|
+
const notifications = params.services.notifications ? new NotificationsGateway(httpClient, params.services.notifications.baseUrl) : null;
|
|
1475
1560
|
return new SDKGateways(
|
|
1476
1561
|
customerService,
|
|
1477
1562
|
chatConfig,
|
|
@@ -1485,7 +1570,8 @@ function createClient(params) {
|
|
|
1485
1570
|
calls,
|
|
1486
1571
|
cases,
|
|
1487
1572
|
rh,
|
|
1488
|
-
accessHub
|
|
1573
|
+
accessHub,
|
|
1574
|
+
notifications
|
|
1489
1575
|
);
|
|
1490
1576
|
}
|
|
1491
1577
|
|
|
@@ -1503,7 +1589,8 @@ var SERVICE_GATEWAYS = {
|
|
|
1503
1589
|
CALLS: "calls",
|
|
1504
1590
|
CASES: "cases",
|
|
1505
1591
|
RH: "rh",
|
|
1506
|
-
ACCESS_HUB: "access-hub"
|
|
1592
|
+
ACCESS_HUB: "access-hub",
|
|
1593
|
+
NOTIFICATIONS: "notifications"
|
|
1507
1594
|
};
|
|
1508
1595
|
|
|
1509
1596
|
// src/index.ts
|
|
@@ -1572,6 +1659,10 @@ function gateway(service) {
|
|
|
1572
1659
|
if (!sdk.client.accessHub)
|
|
1573
1660
|
throw new Error(`Service 'access-hub' is not configured. Provide its baseUrl in configure().`);
|
|
1574
1661
|
return sdk.client.accessHub;
|
|
1662
|
+
case SERVICE_GATEWAYS.NOTIFICATIONS:
|
|
1663
|
+
if (!sdk.client.notifications)
|
|
1664
|
+
throw new Error(`Service 'notifications' is not configured. Provide its baseUrl in configure().`);
|
|
1665
|
+
return sdk.client.notifications;
|
|
1575
1666
|
default:
|
|
1576
1667
|
throw new Error(`Unknown service gateway: ${service}`);
|
|
1577
1668
|
}
|