@scryme/chat 2.91.43 → 2.91.76
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/custom-instance.d.ts +22 -2
- package/dist/custom-instance.js +109 -1
- package/dist/generated/v3-client.d.ts +2438 -1441
- package/dist/generated/v3-client.js +1795 -999
- package/dist/generated/v3-server.d.ts +315 -149
- package/dist/generated/v3-server.js +451 -202
- package/dist/sdk.d.ts +49 -49
- package/dist/sdk.js +207 -81
- package/package.json +1 -1
- package/src/__tests__/sdk-error.test.ts +229 -0
- package/src/__tests__/sdk.test.ts +41 -17
- package/src/custom-instance.ts +109 -2
- package/src/generated/v3-client.ts +4467 -2471
- package/src/generated/v3-server.ts +1156 -574
- package/src/sdk.ts +149 -70
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { getSkyrmeChatAPI } from './generated/v3-server';
|
|
3
|
-
import type { V3ProvisionWorkspaceDto, V3UpdateWorkspaceDto, V3AddMemberDto, V3UpdateMemberRoleDto, CreateWorkspaceChannelDto, UpdateWorkspaceChannelDto, UpdateChannelMemberDto, V3CreateChannelDto, V3UpdateChannelDto, V3AddChannelMemberDto, V3UpdateChannelMemberDto,
|
|
3
|
+
import type { V3ProvisionWorkspaceDto, V3UpdateWorkspaceDto, V3AddMemberDto, V3UpdateMemberRoleDto, CreateWorkspaceChannelDto, UpdateWorkspaceChannelDto, UpdateChannelMemberDto, V3CreateChannelDto, V3UpdateChannelDto, V3AddChannelMemberDto, V3UpdateChannelMemberDto, ChannelsControllerUpdateMessageBody, ChannelsControllerAddReactionBody, CreateDmDto, UpdateDmMessageDto, UsersControllerSearchUsersParams, DmsControllerGetMessagesParams, CreateMessageDto, V3CreateWebhookDto, V3UpdateWebhookDto, CreateChannelIncomingWebhookDto, UpdateChannelIncomingWebhookDto, ExecuteChannelIncomingWebhookDto, V3ChannelIncomingWebhooksControllerExecuteWebhookByChannelIdParams, ChannelsControllerAddReactionResult, ChannelsControllerRemoveReactionResult, DmsControllerAddReactionBody, DmsControllerAddReactionResult, DmsControllerRemoveReactionResult, V3WebhooksControllerGetWebhooksResult, V3WebhooksControllerCreateWebhookResult, V3WebhooksControllerGetWebhookResult, V3WebhooksControllerUpdateWebhookResult, V3WebhooksControllerDeleteWebhookResult, V3ChannelIncomingWebhooksControllerGetChannelWebhooksResult, V3ChannelIncomingWebhooksControllerCreateChannelWebhookResult, V3ChannelIncomingWebhooksControllerGetChannelWebhookResult, V3ChannelIncomingWebhooksControllerUpdateChannelWebhookResult, V3ChannelIncomingWebhooksControllerDeleteChannelWebhookResult, V3ChannelIncomingWebhooksControllerExecuteWebhookByUrlTokenResult, V3ChannelIncomingWebhooksControllerExecuteWebhookByChannelIdResult, V3OAuthControllerGetTokenResult } from './generated/v3-server';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a message attachment.
|
|
6
6
|
*/
|
|
@@ -460,7 +460,7 @@ export interface AssignSupportTicketDto {
|
|
|
460
460
|
/**
|
|
461
461
|
* Options for starting a new live chat session.
|
|
462
462
|
*/
|
|
463
|
-
export interface
|
|
463
|
+
export interface SupportStartLiveChatDto {
|
|
464
464
|
/** Unique workspace identifier where live chat is initialized. */
|
|
465
465
|
workspaceId: string;
|
|
466
466
|
/** Optional metadata associated with the live chat session. */
|
|
@@ -469,7 +469,7 @@ export interface StartLiveChatDto {
|
|
|
469
469
|
/**
|
|
470
470
|
* Options for creating or updating a customer profile.
|
|
471
471
|
*/
|
|
472
|
-
export interface
|
|
472
|
+
export interface SupportCreateCustomerProfileDto {
|
|
473
473
|
/** Associated workspace identifier. */
|
|
474
474
|
workspaceId: string;
|
|
475
475
|
/** User ID of the customer. */
|
|
@@ -732,61 +732,66 @@ export declare class ScrymeSDK {
|
|
|
732
732
|
*/
|
|
733
733
|
message: {
|
|
734
734
|
/**
|
|
735
|
-
* Lists messages in a channel with cursor pagination support.
|
|
735
|
+
* Lists messages in a channel with cursor pagination support via V3 API.
|
|
736
|
+
* @param slug The unique workspace slug.
|
|
736
737
|
* @param channelId Unique identifier of the channel.
|
|
737
738
|
* @param params Query parameters for limiting, sorting, or pagination cursors.
|
|
738
739
|
* @param options Optional request config override.
|
|
739
|
-
* @returns Object containing the messages array and next pagination cursor exactly from the endpoint.
|
|
740
740
|
*/
|
|
741
|
-
list: (
|
|
741
|
+
list: (slug: string, channelId: string, params?: {
|
|
742
|
+
cursor?: string;
|
|
743
|
+
limit?: string;
|
|
744
|
+
}, options?: AxiosRequestConfig) => Promise<{
|
|
742
745
|
messages: ChannelMessage[];
|
|
743
746
|
nextCursor?: string;
|
|
744
747
|
}>;
|
|
745
748
|
/**
|
|
746
|
-
* Sends a new message to a channel.
|
|
749
|
+
* Sends a new message to a channel via V3 API.
|
|
750
|
+
* @param slug The unique workspace slug.
|
|
747
751
|
* @param channelId Unique identifier of the target channel.
|
|
748
|
-
* @param data The message content string or structured
|
|
752
|
+
* @param data The message content string or structured payload object.
|
|
749
753
|
* @param options Optional request config override.
|
|
750
|
-
* @returns The created message exactly from the endpoint.
|
|
751
754
|
*/
|
|
752
|
-
create: (channelId: string, data: CreateMessageDto | string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
755
|
+
create: (slug: string, channelId: string, data: CreateMessageDto | string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
753
756
|
/**
|
|
754
|
-
* Updates the content of a previously sent message in a channel.
|
|
757
|
+
* Updates the content of a previously sent message in a channel via V3 API.
|
|
758
|
+
* @param slug The unique workspace slug.
|
|
755
759
|
* @param channelId Unique identifier of the channel containing the message.
|
|
756
760
|
* @param messageId Unique identifier of the message to update.
|
|
757
761
|
* @param data The new content payload.
|
|
758
762
|
* @param options Optional request config override.
|
|
759
|
-
* @returns The updated message details exactly from the endpoint.
|
|
760
763
|
*/
|
|
761
|
-
update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
764
|
+
update: (slug: string, channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
762
765
|
/**
|
|
763
|
-
* Permanently deletes a message in a channel.
|
|
766
|
+
* Permanently deletes a message in a channel via V3 API.
|
|
767
|
+
* @param slug The unique workspace slug.
|
|
764
768
|
* @param channelId Unique identifier of the channel containing the message.
|
|
765
769
|
* @param messageId Unique identifier of the message to delete.
|
|
766
770
|
* @param options Optional request config override.
|
|
767
|
-
* @returns Success status indicating that the message was deleted exactly from the endpoint.
|
|
768
771
|
*/
|
|
769
|
-
delete: (channelId: string, messageId: string, options?: AxiosRequestConfig) => Promise<{
|
|
772
|
+
delete: (slug: string, channelId: string, messageId: string, options?: AxiosRequestConfig) => Promise<{
|
|
770
773
|
success: boolean;
|
|
771
774
|
}>;
|
|
772
775
|
/**
|
|
773
|
-
* Adds a reaction (emoji) to a message in a channel.
|
|
776
|
+
* Adds a reaction (emoji) to a message in a channel via V3 API.
|
|
777
|
+
* @param slug The unique workspace slug.
|
|
774
778
|
* @param channelId Unique identifier of the channel containing the message.
|
|
775
779
|
* @param messageId Unique identifier of the message.
|
|
776
780
|
* @param data Object containing the target emoji character.
|
|
777
781
|
* @param options Optional request config override.
|
|
778
|
-
* @returns The reaction response returned exactly from the endpoint.
|
|
779
782
|
*/
|
|
780
|
-
addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<
|
|
783
|
+
addReaction: (slug: string, channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<any>;
|
|
781
784
|
/**
|
|
782
|
-
* Removes a reaction (emoji) from a message in a channel.
|
|
785
|
+
* Removes a reaction (emoji) from a message in a channel via V3 API.
|
|
786
|
+
* @param slug The unique workspace slug.
|
|
783
787
|
* @param channelId Unique identifier of the channel containing the message.
|
|
784
788
|
* @param messageId Unique identifier of the message.
|
|
785
789
|
* @param emoji The emoji character to remove.
|
|
786
790
|
* @param options Optional request config override.
|
|
787
|
-
* @returns The reaction removal response returned exactly from the endpoint.
|
|
788
791
|
*/
|
|
789
|
-
removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<
|
|
792
|
+
removeReaction: (slug: string, channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<{
|
|
793
|
+
success: boolean;
|
|
794
|
+
}>;
|
|
790
795
|
};
|
|
791
796
|
};
|
|
792
797
|
/**
|
|
@@ -833,100 +838,95 @@ export declare class ScrymeSDK {
|
|
|
833
838
|
removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerRemoveReactionResult | DmsControllerRemoveReactionResult>;
|
|
834
839
|
};
|
|
835
840
|
/**
|
|
836
|
-
* Operations for managing direct messages (DMs) and direct message conversations.
|
|
841
|
+
* Operations for managing direct messages (DMs) and direct message conversations via V3 API.
|
|
837
842
|
*/
|
|
838
843
|
get dm(): {
|
|
839
844
|
/**
|
|
840
|
-
* Lists all active direct message conversations for the authenticated user.
|
|
845
|
+
* Lists all active direct message conversations for the authenticated user/bot via V3 API.
|
|
841
846
|
* @param options Optional request config override.
|
|
842
|
-
* @returns List of active DM conversations returned exactly from the endpoint.
|
|
843
847
|
*/
|
|
844
848
|
list: (options?: AxiosRequestConfig) => Promise<DmConversation[]>;
|
|
845
849
|
/**
|
|
846
|
-
* Creates/initiates a direct message conversation
|
|
850
|
+
* Creates/initiates a direct message conversation via V3 API.
|
|
847
851
|
* @param data Create direct message details containing target participant IDs.
|
|
848
852
|
* @param options Optional request config override.
|
|
849
|
-
* @returns Details of the created DM conversation exactly from the endpoint.
|
|
850
853
|
*/
|
|
851
|
-
create: (data: CreateDmDto
|
|
854
|
+
create: (data: CreateDmDto | {
|
|
855
|
+
targetUserId?: string;
|
|
856
|
+
userId?: string;
|
|
857
|
+
}, options?: AxiosRequestConfig) => Promise<DmConversation>;
|
|
852
858
|
/**
|
|
853
|
-
* Retrieves details of a specific direct message conversation.
|
|
859
|
+
* Retrieves details of a specific direct message conversation via V3 API.
|
|
854
860
|
* @param dmId Unique identifier of the direct message conversation.
|
|
855
861
|
* @param options Optional request config override.
|
|
856
|
-
* @returns Detailed direct message conversation object exactly from the endpoint.
|
|
857
862
|
*/
|
|
858
863
|
get: (dmId: string, options?: AxiosRequestConfig) => Promise<DmConversation>;
|
|
859
864
|
/**
|
|
860
|
-
* Deletes/closes an active direct message conversation.
|
|
865
|
+
* Deletes/closes an active direct message conversation via V3 API.
|
|
861
866
|
* @param dmId Unique identifier of the direct message conversation to close.
|
|
862
867
|
* @param options Optional request config override.
|
|
863
|
-
* @returns Success status indicating that the DM conversation was deleted exactly from the endpoint.
|
|
864
868
|
*/
|
|
865
869
|
delete: (dmId: string, options?: AxiosRequestConfig) => Promise<{
|
|
866
870
|
success: boolean;
|
|
867
871
|
}>;
|
|
868
872
|
/**
|
|
869
|
-
* Sub-namespace for managing direct messages in a specific DM conversation.
|
|
873
|
+
* Sub-namespace for managing direct messages in a specific DM conversation via V3 API.
|
|
870
874
|
*/
|
|
871
875
|
message: {
|
|
872
876
|
/**
|
|
873
|
-
* Lists messages in a direct message conversation with cursor pagination.
|
|
877
|
+
* Lists messages in a direct message conversation with cursor pagination via V3 API.
|
|
874
878
|
* @param dmId Unique identifier of the direct message conversation.
|
|
875
879
|
* @param params Query parameters for pagination limits, cursors or search filters.
|
|
876
880
|
* @param options Optional request config override.
|
|
877
|
-
* @returns List of direct messages and next pagination cursor exactly from the endpoint.
|
|
878
881
|
*/
|
|
879
882
|
list: (dmId: string, params?: DmsControllerGetMessagesParams, options?: AxiosRequestConfig) => Promise<{
|
|
880
883
|
messages: ChannelMessage[];
|
|
881
884
|
nextCursor?: string;
|
|
882
885
|
}>;
|
|
883
886
|
/**
|
|
884
|
-
* Sends a new message in a direct message conversation.
|
|
887
|
+
* Sends a new message in a direct message conversation via V3 API.
|
|
885
888
|
* @param dmId Unique identifier of the direct message conversation.
|
|
886
889
|
* @param data The message content string or structured CreateMessageDto object.
|
|
887
890
|
* @param options Optional request config override.
|
|
888
|
-
* @returns The sent message exactly from the endpoint.
|
|
889
891
|
*/
|
|
890
892
|
create: (dmId: string, data: CreateMessageDto | {
|
|
891
893
|
content: string;
|
|
892
894
|
} | string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
893
895
|
/**
|
|
894
|
-
* Updates the content of a previously sent direct message.
|
|
896
|
+
* Updates the content of a previously sent direct message via V3 API.
|
|
895
897
|
* @param dmId Unique identifier of the direct message conversation.
|
|
896
898
|
* @param messageId Unique identifier of the message to update.
|
|
897
899
|
* @param data The new content payload.
|
|
898
900
|
* @param options Optional request config override.
|
|
899
|
-
* @returns The updated message details exactly from the endpoint.
|
|
900
901
|
*/
|
|
901
902
|
update: (dmId: string, messageId: string, data: UpdateDmMessageDto, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
902
903
|
/**
|
|
903
|
-
* Permanently deletes a direct message.
|
|
904
|
+
* Permanently deletes a direct message via V3 API.
|
|
904
905
|
* @param dmId Unique identifier of the direct message conversation.
|
|
905
906
|
* @param messageId Unique identifier of the message to delete.
|
|
906
907
|
* @param options Optional request config override.
|
|
907
|
-
* @returns Success status indicating that the message was deleted exactly from the endpoint.
|
|
908
908
|
*/
|
|
909
909
|
delete: (dmId: string, messageId: string, options?: AxiosRequestConfig) => Promise<{
|
|
910
910
|
success: boolean;
|
|
911
911
|
}>;
|
|
912
912
|
/**
|
|
913
|
-
* Adds a reaction (emoji) to a direct message.
|
|
913
|
+
* Adds a reaction (emoji) to a direct message via V3 API.
|
|
914
914
|
* @param dmId Unique identifier of the direct message conversation.
|
|
915
915
|
* @param messageId Unique identifier of the message.
|
|
916
916
|
* @param data Object containing the target emoji character.
|
|
917
917
|
* @param options Optional request config override.
|
|
918
|
-
* @returns The reaction response returned exactly from the endpoint.
|
|
919
918
|
*/
|
|
920
|
-
addReaction: (dmId: string, messageId: string, data: DmsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<
|
|
919
|
+
addReaction: (dmId: string, messageId: string, data: DmsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<any>;
|
|
921
920
|
/**
|
|
922
|
-
* Removes a reaction (emoji) from a direct message.
|
|
921
|
+
* Removes a reaction (emoji) from a direct message via V3 API.
|
|
923
922
|
* @param dmId Unique identifier of the direct message conversation.
|
|
924
923
|
* @param messageId Unique identifier of the message.
|
|
925
924
|
* @param emoji The emoji character to remove.
|
|
926
925
|
* @param options Optional request config override.
|
|
927
|
-
* @returns The reaction removal response returned exactly from the endpoint.
|
|
928
926
|
*/
|
|
929
|
-
removeReaction: (dmId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<
|
|
927
|
+
removeReaction: (dmId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<{
|
|
928
|
+
success: boolean;
|
|
929
|
+
}>;
|
|
930
930
|
};
|
|
931
931
|
};
|
|
932
932
|
/**
|
|
@@ -1125,7 +1125,7 @@ export declare class ScrymeSDK {
|
|
|
1125
1125
|
* @param data Details for starting live chat session.
|
|
1126
1126
|
* @param options Optional request config override.
|
|
1127
1127
|
*/
|
|
1128
|
-
start: (data:
|
|
1128
|
+
start: (data: SupportStartLiveChatDto, options?: AxiosRequestConfig) => Promise<LiveChatSession>;
|
|
1129
1129
|
/**
|
|
1130
1130
|
* Ends an active live chat session.
|
|
1131
1131
|
* @param sessionId Unique session identifier.
|
|
@@ -1142,7 +1142,7 @@ export declare class ScrymeSDK {
|
|
|
1142
1142
|
* @param data Profile details including workspaceId and userId.
|
|
1143
1143
|
* @param options Optional request config override.
|
|
1144
1144
|
*/
|
|
1145
|
-
createProfile: (data:
|
|
1145
|
+
createProfile: (data: SupportCreateCustomerProfileDto, options?: AxiosRequestConfig) => Promise<CustomerProfile>;
|
|
1146
1146
|
/**
|
|
1147
1147
|
* Retrieves customer profiles in a workspace.
|
|
1148
1148
|
* @param workspaceId Unique workspace identifier.
|