@opens/gateways 1.16.8 → 1.16.10
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/customer-service/contracts/index.d.mts +304 -9
- package/dist/customer-service/contracts/index.d.ts +304 -9
- package/dist/customer-service/contracts/index.js.map +1 -1
- package/dist/index.d.mts +17 -64
- package/dist/index.d.ts +17 -64
- package/dist/index.js +29 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/notifications/contracts/index.d.mts +0 -160
- package/dist/notifications/contracts/index.d.ts +0 -160
- package/dist/notifications/contracts/index.js +0 -19
- package/dist/notifications/contracts/index.js.map +0 -1
- package/dist/notifications/contracts/index.mjs +0 -1
- package/dist/notifications/contracts/index.mjs.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 } 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';
|
|
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, CreateSurveyResponseRequest, SurveyResponse, SurveyResponseListFilters, SurveyResponseListResponse } from './customer-service/contracts/index.js';
|
|
3
|
+
export { ActiveBannerAnnouncement, ActiveSurveyAnnouncement, AnnouncementAppearance, AnnouncementButton, AnnouncementCompany, AnnouncementPayload, AnnouncementTargetingRuleUrl, AnnouncementTargetingRules, AnnouncementVisualStatus, BannerAnnouncementPayload, CompanyData, ListUsersInclude, ListUsersProfile, ListUsersStatus, ListUsersType, ManagedUser, StrongPasswordOptions, SurveyAnnouncementPayload, SurveyAnswer, SurveyAnswerValue, SurveyAppearance, SurveyCompletion, SurveyMultipleChoiceQuestion, SurveyMultipleChoiceQuestionConfig, SurveyPlacement, SurveyQuestion, SurveyQuestionOption, SurveyRatingQuestion, SurveyRatingQuestionConfig, SurveyReactionQuestion, SurveyReactionQuestionConfig, SurveyResponseAnswer, SurveyResponseAnswerOption, SurveySingleChoiceQuestion, SurveySingleChoiceQuestionConfig, SurveyTextQuestion, SurveyTextQuestionConfig, 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';
|
|
@@ -23,8 +23,6 @@ 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';
|
|
28
26
|
export { Event } from './rh/contracts/index.js';
|
|
29
27
|
|
|
30
28
|
/**
|
|
@@ -227,6 +225,20 @@ declare class CustomerServiceGateway {
|
|
|
227
225
|
* @returns The active announcements for the widget.
|
|
228
226
|
*/
|
|
229
227
|
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>;
|
|
230
242
|
}
|
|
231
243
|
|
|
232
244
|
/**
|
|
@@ -816,60 +828,6 @@ declare class AccessHubGateway {
|
|
|
816
828
|
getCompanyResources(params: GetCompanyResourcesParams): Promise<CompanyResource[]>;
|
|
817
829
|
}
|
|
818
830
|
|
|
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
|
-
|
|
873
831
|
/**
|
|
874
832
|
* Maps service identifiers to their corresponding gateway types.
|
|
875
833
|
* Used by the `gateway()` function to infer the correct return type
|
|
@@ -892,7 +850,6 @@ type GatewayMap = {
|
|
|
892
850
|
cases: CasesGateway;
|
|
893
851
|
rh: RhGateway;
|
|
894
852
|
'access-hub': AccessHubGateway;
|
|
895
|
-
notifications: NotificationsGateway;
|
|
896
853
|
};
|
|
897
854
|
/**
|
|
898
855
|
* Parameters required to configure the SDK client.
|
|
@@ -944,9 +901,6 @@ interface GatewayClientParams {
|
|
|
944
901
|
accessHub?: {
|
|
945
902
|
baseUrl: string;
|
|
946
903
|
};
|
|
947
|
-
notifications?: {
|
|
948
|
-
baseUrl: string;
|
|
949
|
-
};
|
|
950
904
|
};
|
|
951
905
|
}
|
|
952
906
|
|
|
@@ -964,7 +918,6 @@ declare const SERVICE_GATEWAYS: {
|
|
|
964
918
|
readonly CASES: "cases";
|
|
965
919
|
readonly RH: "rh";
|
|
966
920
|
readonly ACCESS_HUB: "access-hub";
|
|
967
|
-
readonly NOTIFICATIONS: "notifications";
|
|
968
921
|
};
|
|
969
922
|
type SERVICE_GATEWAYS = (typeof SERVICE_GATEWAYS)[keyof typeof SERVICE_GATEWAYS];
|
|
970
923
|
|
|
@@ -991,4 +944,4 @@ declare const configure: (params: GatewayClientParams) => void;
|
|
|
991
944
|
*/
|
|
992
945
|
declare function gateway<T extends keyof GatewayMap>(service: T): GatewayMap[T];
|
|
993
946
|
|
|
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,
|
|
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, CreateSurveyResponseRequest, 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, SurveyResponse, SurveyResponseListFilters, SurveyResponseListResponse, 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 };
|
package/dist/index.js
CHANGED
|
@@ -388,6 +388,32 @@ 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
|
+
}
|
|
391
417
|
};
|
|
392
418
|
|
|
393
419
|
// src/chat-config/index.ts
|
|
@@ -1421,88 +1447,6 @@ var AccessHubGateway = class {
|
|
|
1421
1447
|
}
|
|
1422
1448
|
};
|
|
1423
1449
|
|
|
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
|
-
|
|
1506
1450
|
// src/@common/client.ts
|
|
1507
1451
|
var import_axios = __toESM(require("axios"));
|
|
1508
1452
|
var SDKGateways = class {
|
|
@@ -1519,8 +1463,7 @@ var SDKGateways = class {
|
|
|
1519
1463
|
cases;
|
|
1520
1464
|
rh;
|
|
1521
1465
|
accessHub;
|
|
1522
|
-
|
|
1523
|
-
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub, notifications) {
|
|
1466
|
+
constructor(customerService, chatConfig, campaigns, chatAdapter, assets, contactList, integrations, chatWebservice, callReport, calls, cases, rh, accessHub) {
|
|
1524
1467
|
this.customerService = customerService;
|
|
1525
1468
|
this.chatConfig = chatConfig;
|
|
1526
1469
|
this.campaigns = campaigns;
|
|
@@ -1534,7 +1477,6 @@ var SDKGateways = class {
|
|
|
1534
1477
|
this.cases = cases;
|
|
1535
1478
|
this.rh = rh;
|
|
1536
1479
|
this.accessHub = accessHub;
|
|
1537
|
-
this.notifications = notifications;
|
|
1538
1480
|
}
|
|
1539
1481
|
};
|
|
1540
1482
|
function createClient(params) {
|
|
@@ -1556,7 +1498,6 @@ function createClient(params) {
|
|
|
1556
1498
|
const cases = params.services.cases ? new CasesGateway(httpClient, params.services.cases.baseUrl) : null;
|
|
1557
1499
|
const rh = params.services.rh ? new RhGateway(httpClient, params.services.rh.baseUrl) : null;
|
|
1558
1500
|
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;
|
|
1560
1501
|
return new SDKGateways(
|
|
1561
1502
|
customerService,
|
|
1562
1503
|
chatConfig,
|
|
@@ -1570,8 +1511,7 @@ function createClient(params) {
|
|
|
1570
1511
|
calls,
|
|
1571
1512
|
cases,
|
|
1572
1513
|
rh,
|
|
1573
|
-
accessHub
|
|
1574
|
-
notifications
|
|
1514
|
+
accessHub
|
|
1575
1515
|
);
|
|
1576
1516
|
}
|
|
1577
1517
|
|
|
@@ -1589,8 +1529,7 @@ var SERVICE_GATEWAYS = {
|
|
|
1589
1529
|
CALLS: "calls",
|
|
1590
1530
|
CASES: "cases",
|
|
1591
1531
|
RH: "rh",
|
|
1592
|
-
ACCESS_HUB: "access-hub"
|
|
1593
|
-
NOTIFICATIONS: "notifications"
|
|
1532
|
+
ACCESS_HUB: "access-hub"
|
|
1594
1533
|
};
|
|
1595
1534
|
|
|
1596
1535
|
// src/index.ts
|
|
@@ -1659,10 +1598,6 @@ function gateway(service) {
|
|
|
1659
1598
|
if (!sdk.client.accessHub)
|
|
1660
1599
|
throw new Error(`Service 'access-hub' is not configured. Provide its baseUrl in configure().`);
|
|
1661
1600
|
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;
|
|
1666
1601
|
default:
|
|
1667
1602
|
throw new Error(`Unknown service gateway: ${service}`);
|
|
1668
1603
|
}
|