@opens/gateways 1.16.10 → 1.16.12
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/campaigns/contracts/index.d.mts +6 -2
- package/dist/campaigns/contracts/index.d.ts +6 -2
- package/dist/customer-service/contracts/index.d.mts +9 -304
- package/dist/customer-service/contracts/index.d.ts +9 -304
- package/dist/customer-service/contracts/index.js.map +1 -1
- package/dist/index.d.mts +65 -18
- package/dist/index.d.ts +65 -18
- package/dist/index.js +94 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +94 -29
- 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 +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { CompanyResponse, UpdateCompanyRequest, GetSupportWidgetIdResponse, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, CompanyQueue, CompanyWithConfigsResponse, StrongPasswordOptionsResponse, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, UpdateCompanyJsonConfigRequest, CompanyBooleanConfigKey, UpdateCompanyBooleanConfigRequest, CompanyStringConfigKey, UpdateCompanyStringConfigRequest, User, ListUsersRequest, ListUsersResponse, WorkGroupListResponse, WorkGroupResponse, UserProfile, WorkGroupMembersResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse, GetUserByIdResponse, UpdateCompanyUserRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UpdateCompanyUserAvatarResponse, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, AnnouncementListFilters, AnnouncementListResponse, Announcement, CreateAnnouncementRequest, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, AnnouncementType, ActiveAnnouncementQuery, ActiveAnnouncement
|
|
3
|
-
export {
|
|
2
|
+
import { CompanyResponse, UpdateCompanyRequest, GetSupportWidgetIdResponse, UpdateSupportWidgetIdRequest, UpdateSupportWidgetIdResponse, CompanyQueue, CompanyWithConfigsResponse, StrongPasswordOptionsResponse, CompanyConfigKey, CompanyConfigResponse, CompanyJsonConfigKey, UpdateCompanyJsonConfigRequest, CompanyBooleanConfigKey, UpdateCompanyBooleanConfigRequest, CompanyStringConfigKey, UpdateCompanyStringConfigRequest, User, ListUsersRequest, ListUsersResponse, WorkGroupListResponse, WorkGroupResponse, UserProfile, WorkGroupMembersResponse, GetAllUsersParams, GetAllUsersResponse, GetManagedUsersResponse, GetUserByIdResponse, UpdateCompanyUserRequest, UpdateUserPasswordRequest, UpdateUserPasswordResponse, UpdateCompanyUserAvatarResponse, GenerateTwoFactorOtpRequest, GenerateTwoFactorOtpResponse, ValidateTwoFactorOtpRequest, ValidateTwoFactorOtpResponse, AnnouncementListFilters, AnnouncementListResponse, Announcement, CreateAnnouncementRequest, UpdateAnnouncementRequest, UpdateAnnouncementStatusRequest, AnnouncementType, ActiveAnnouncementQuery, ActiveAnnouncement } from './customer-service/contracts/index.js';
|
|
3
|
+
export { AnnouncementAppearance, AnnouncementButton, AnnouncementCompany, AnnouncementPayload, AnnouncementTargetingRuleUrl, AnnouncementTargetingRules, AnnouncementVisualStatus, CompanyData, ListUsersInclude, ListUsersProfile, ListUsersStatus, ListUsersType, ManagedUser, StrongPasswordOptions, UserBond, WorkGroup, WorkGroupMember } from './customer-service/contracts/index.js';
|
|
4
4
|
import { ProviderListResponse, Config, GetProviderConfigurationsParams, ProviderConfigurationsResponse, GetProviderDisplayInfoParams, ProviderDisplayInfoResponse, GetConfigsByProviderParams, ConfigListByProviderResponse, Queue, GetMemberQueuesRequest, QueueMember, GetServiceGroupsParams, ServiceGroupsResponse, MetaTemplateConfigResponse, MetaTemplateConfigsResponse, FindOrCreateQueueRuleRequest, QueueRule, GetRootRulesRequest, RootRulesResponse } from './chat-config/contracts/index.js';
|
|
5
5
|
export { ConfigProvider, DistributionType, MetaTemplateButton, Provider, ProviderConfiguration, ProviderName, QueueListResponse, Rule, ServiceGroup, WhatsAppProviderSettings, WidgetProviderSettings } from './chat-config/contracts/index.js';
|
|
6
6
|
import { CampaignQueryParams, CampaignPaginatedResponse, Campaign, CreateCampaignRequest, PatchCampaignRequest, CampaignContactQueryParams, CampaignContactPaginatedResponse, CampaignContactResponse, CreateCampaignContactRequest, PatchCampaignContactRequest, CampaignContactsDashboardQueryParams, CampaignContactsDashboardData, CampaignUser, CampaignWorkGroupQueryParams, CampaignWorkGroupPaginatedResponse, CreateCampaignWorkGroupRequest, CampaignWorkGroup, CampaignCompanyQueryParams, CampaignCompanyPaginatedResponse, CampaignCompanyResponse, EnableCampaignCompanyRequest, CampaignAccessResponse } from './campaigns/contracts/index.js';
|
|
7
|
-
export { CampaignAccessReason, CampaignContactCampaignStatus, CampaignContactDispatchStatus, CampaignContactFilter, CampaignContactLikeQueryOperators, CampaignContactQueryOperators, CampaignContactQueryValue, CampaignContactSortDirection, CampaignContactSortParams, CampaignContactsDashboardChannelPerformance, CampaignContactsDashboardEvolutionItem, CampaignContactsDashboardExactQueryOperators, CampaignContactsDashboardFunnelItem, CampaignContactsDashboardInterval, CampaignContactsDashboardMetrics, CampaignContactsDashboardQueryValue, CampaignContactsDashboardRangeQueryOperators, CampaignContactsDashboardStatusDistribution, CampaignContactsDashboardStatusMetrics, CampaignContactsDashboardSummary, CampaignContactsDashboardTopCampaign, CampaignProvider, CampaignRetryConfig, CampaignSchedule, CampaignStatus, WhatsAppPayload, WhatsAppTemplateComponent } from './campaigns/contracts/index.js';
|
|
7
|
+
export { CampaignAccessReason, CampaignContactCampaignStatus, CampaignContactDispatchStatus, CampaignContactFilter, CampaignContactLikeQueryOperators, CampaignContactQueryOperators, CampaignContactQueryValue, CampaignContactSortDirection, CampaignContactSortParams, CampaignContactsDashboardChannelPerformance, CampaignContactsDashboardEvolutionItem, CampaignContactsDashboardExactQueryOperators, CampaignContactsDashboardFunnelItem, CampaignContactsDashboardInterval, CampaignContactsDashboardMetrics, CampaignContactsDashboardQueryValue, CampaignContactsDashboardRangeQueryOperators, CampaignContactsDashboardStatusDistribution, CampaignContactsDashboardStatusMetrics, CampaignContactsDashboardSummary, CampaignContactsDashboardTopCampaign, CampaignNameLikeQueryOperators, CampaignProvider, CampaignRetryConfig, CampaignSchedule, CampaignStatus, WhatsAppPayload, WhatsAppTemplateComponent } from './campaigns/contracts/index.js';
|
|
8
8
|
import { GetConfigTemplatesParams, GetConfigTemplatesResponse, FlowReadiness, FlowCatalogParams, FlowCatalogResponse, FlowDefinition } from './chat-adapter/contracts/index.js';
|
|
9
9
|
export { ConfigTemplatesPaging, FlowCatalogItem, MessageTemplate, MessageTemplateComponent } from './chat-adapter/contracts/index.js';
|
|
10
10
|
import { GetPresignedUrlRequest, UploadPresignedUrlResponse, AudioConvertResponse, GetAttachmentByIdRequest, AttachmentByIdResponse } from './assets/contracts/index.js';
|
|
@@ -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
|
/**
|
|
@@ -225,20 +227,6 @@ declare class CustomerServiceGateway {
|
|
|
225
227
|
* @returns The active announcements for the widget.
|
|
226
228
|
*/
|
|
227
229
|
findActiveAnnouncements(query: ActiveAnnouncementQuery): Promise<ActiveAnnouncement[]>;
|
|
228
|
-
/**
|
|
229
|
-
* Submits one response to a survey announcement.
|
|
230
|
-
* @param announcementId - The unique identifier of the survey announcement.
|
|
231
|
-
* @param payload - The subject identifier and validated survey answers.
|
|
232
|
-
* @returns The persisted survey response.
|
|
233
|
-
*/
|
|
234
|
-
submitSurveyResponse(announcementId: string, payload: CreateSurveyResponseRequest): Promise<SurveyResponse>;
|
|
235
|
-
/**
|
|
236
|
-
* Retrieves paginated responses for a survey announcement.
|
|
237
|
-
* @param announcementId - The unique identifier of the survey announcement.
|
|
238
|
-
* @param query - Pagination options for the administrative list.
|
|
239
|
-
* @returns Paginated survey responses.
|
|
240
|
-
*/
|
|
241
|
-
findSurveyResponses(announcementId: string, query?: SurveyResponseListFilters): Promise<SurveyResponseListResponse>;
|
|
242
230
|
}
|
|
243
231
|
|
|
244
232
|
/**
|
|
@@ -828,6 +816,60 @@ declare class AccessHubGateway {
|
|
|
828
816
|
getCompanyResources(params: GetCompanyResourcesParams): Promise<CompanyResource[]>;
|
|
829
817
|
}
|
|
830
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
|
+
|
|
831
873
|
/**
|
|
832
874
|
* Maps service identifiers to their corresponding gateway types.
|
|
833
875
|
* Used by the `gateway()` function to infer the correct return type
|
|
@@ -850,6 +892,7 @@ type GatewayMap = {
|
|
|
850
892
|
cases: CasesGateway;
|
|
851
893
|
rh: RhGateway;
|
|
852
894
|
'access-hub': AccessHubGateway;
|
|
895
|
+
notifications: NotificationsGateway;
|
|
853
896
|
};
|
|
854
897
|
/**
|
|
855
898
|
* Parameters required to configure the SDK client.
|
|
@@ -901,6 +944,9 @@ interface GatewayClientParams {
|
|
|
901
944
|
accessHub?: {
|
|
902
945
|
baseUrl: string;
|
|
903
946
|
};
|
|
947
|
+
notifications?: {
|
|
948
|
+
baseUrl: string;
|
|
949
|
+
};
|
|
904
950
|
};
|
|
905
951
|
}
|
|
906
952
|
|
|
@@ -918,6 +964,7 @@ declare const SERVICE_GATEWAYS: {
|
|
|
918
964
|
readonly CASES: "cases";
|
|
919
965
|
readonly RH: "rh";
|
|
920
966
|
readonly ACCESS_HUB: "access-hub";
|
|
967
|
+
readonly NOTIFICATIONS: "notifications";
|
|
921
968
|
};
|
|
922
969
|
type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];
|
|
923
970
|
|
|
@@ -944,4 +991,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
944
991
|
*/
|
|
945
992
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
946
993
|
|
|
947
|
-
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,
|
|
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
|
@@ -388,32 +388,6 @@ var CustomerServiceGateway = class {
|
|
|
388
388
|
});
|
|
389
389
|
return data;
|
|
390
390
|
}
|
|
391
|
-
/**
|
|
392
|
-
* Submits one response to a survey announcement.
|
|
393
|
-
* @param announcementId - The unique identifier of the survey announcement.
|
|
394
|
-
* @param payload - The subject identifier and validated survey answers.
|
|
395
|
-
* @returns The persisted survey response.
|
|
396
|
-
*/
|
|
397
|
-
async submitSurveyResponse(announcementId, payload) {
|
|
398
|
-
const { data } = await this.httpClient.post(
|
|
399
|
-
`${this.baseUrl}/announcements/${announcementId}/responses`,
|
|
400
|
-
payload
|
|
401
|
-
);
|
|
402
|
-
return data;
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* Retrieves paginated responses for a survey announcement.
|
|
406
|
-
* @param announcementId - The unique identifier of the survey announcement.
|
|
407
|
-
* @param query - Pagination options for the administrative list.
|
|
408
|
-
* @returns Paginated survey responses.
|
|
409
|
-
*/
|
|
410
|
-
async findSurveyResponses(announcementId, query) {
|
|
411
|
-
const { data } = await this.httpClient.get(
|
|
412
|
-
`${this.baseUrl}/announcements/admin/${announcementId}/responses`,
|
|
413
|
-
{ params: query }
|
|
414
|
-
);
|
|
415
|
-
return data;
|
|
416
|
-
}
|
|
417
391
|
};
|
|
418
392
|
|
|
419
393
|
// src/chat-config/index.ts
|
|
@@ -1447,6 +1421,88 @@ var AccessHubGateway = class {
|
|
|
1447
1421
|
}
|
|
1448
1422
|
};
|
|
1449
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
|
+
|
|
1450
1506
|
// src/@common/client.ts
|
|
1451
1507
|
var import_axios = __toESM(require("axios"));
|
|
1452
1508
|
var SDKGateways = class {
|
|
@@ -1463,7 +1519,8 @@ var SDKGateways = class {
|
|
|
1463
1519
|
cases;
|
|
1464
1520
|
rh;
|
|
1465
1521
|
accessHub;
|
|
1466
|
-
|
|
1522
|
+
notifications;
|
|
1523
|
+
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub, notifications) {
|
|
1467
1524
|
this.customerService = customerService;
|
|
1468
1525
|
this.chatConfig = chatConfig;
|
|
1469
1526
|
this.campaigns = campaigns;
|
|
@@ -1477,6 +1534,7 @@ var SDKGateways = class {
|
|
|
1477
1534
|
this.cases = cases;
|
|
1478
1535
|
this.rh = rh;
|
|
1479
1536
|
this.accessHub = accessHub;
|
|
1537
|
+
this.notifications = notifications;
|
|
1480
1538
|
}
|
|
1481
1539
|
};
|
|
1482
1540
|
function createClient(params) {
|
|
@@ -1498,6 +1556,7 @@ function createClient(params) {
|
|
|
1498
1556
|
const cases = params.services.cases ? new CasesGateway(httpClient, params.services.cases.baseUrl) : null;
|
|
1499
1557
|
const rh = params.services.rh ? new RhGateway(httpClient, params.services.rh.baseUrl) : null;
|
|
1500
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;
|
|
1501
1560
|
return new SDKGateways(
|
|
1502
1561
|
customerService,
|
|
1503
1562
|
chatConfig,
|
|
@@ -1511,7 +1570,8 @@ function createClient(params) {
|
|
|
1511
1570
|
calls,
|
|
1512
1571
|
cases,
|
|
1513
1572
|
rh,
|
|
1514
|
-
accessHub
|
|
1573
|
+
accessHub,
|
|
1574
|
+
notifications
|
|
1515
1575
|
);
|
|
1516
1576
|
}
|
|
1517
1577
|
|
|
@@ -1529,7 +1589,8 @@ var SERVICE_GATEWAYS = {
|
|
|
1529
1589
|
CALLS: "calls",
|
|
1530
1590
|
CASES: "cases",
|
|
1531
1591
|
RH: "rh",
|
|
1532
|
-
ACCESS_HUB: "access-hub"
|
|
1592
|
+
ACCESS_HUB: "access-hub",
|
|
1593
|
+
NOTIFICATIONS: "notifications"
|
|
1533
1594
|
};
|
|
1534
1595
|
|
|
1535
1596
|
// src/index.ts
|
|
@@ -1598,6 +1659,10 @@ function gateway(service) {
|
|
|
1598
1659
|
if (!sdk.client.accessHub)
|
|
1599
1660
|
throw new Error(`Service 'access-hub' is not configured. Provide its baseUrl in configure().`);
|
|
1600
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;
|
|
1601
1666
|
default:
|
|
1602
1667
|
throw new Error(`Unknown service gateway: ${service}`);
|
|
1603
1668
|
}
|