@scryme/chat 2.13.4 → 2.15.2
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/sdk.d.ts +316 -17
- package/dist/sdk.js +444 -12
- package/package.json +1 -1
- package/src/__tests__/sdk.test.ts +224 -2
- package/src/sdk.ts +582 -53
package/dist/sdk.d.ts
CHANGED
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { getSkyrmeChatAPI } from './generated/v3-server';
|
|
3
|
-
import type { V3ProvisionWorkspaceDto, V3UpdateWorkspaceDto, V3AddMemberDto, V3UpdateMemberRoleDto, CreateWorkspaceChannelDto, UpdateWorkspaceChannelDto, ChannelsControllerGetMessagesParams, ChannelsControllerUpdateMessageBody, ChannelsControllerAddReactionBody, CreateDmDto, UsersControllerSearchUsersParams, DmsControllerGetMessagesParams } from './generated/v3-server';
|
|
3
|
+
import type { V3ProvisionWorkspaceDto, V3UpdateWorkspaceDto, V3AddMemberDto, V3UpdateMemberRoleDto, CreateWorkspaceChannelDto, UpdateWorkspaceChannelDto, ChannelsControllerGetMessagesParams, 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
|
+
/**
|
|
5
|
+
* Represents a message attachment.
|
|
6
|
+
*/
|
|
7
|
+
export interface MessageAttachment {
|
|
8
|
+
id: string;
|
|
9
|
+
messageId?: string | null;
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
url: string;
|
|
13
|
+
size?: string | null;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Represents a user reaction to a message.
|
|
18
|
+
*/
|
|
19
|
+
export interface MessageReaction {
|
|
20
|
+
id: string;
|
|
21
|
+
messageId: string;
|
|
22
|
+
userId: string;
|
|
23
|
+
emoji: string;
|
|
24
|
+
customEmojiId?: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
}
|
|
4
27
|
/**
|
|
5
28
|
* Represents a workspace in the Scryme platform (Enterprise M2M API V3).
|
|
6
29
|
*/
|
|
@@ -18,7 +41,7 @@ export interface V3Workspace {
|
|
|
18
41
|
/** Industry categorization of the workspace. */
|
|
19
42
|
industry?: string | null;
|
|
20
43
|
/** Custom branding configuration object. */
|
|
21
|
-
brandingConfig?:
|
|
44
|
+
brandingConfig?: Record<string, unknown> | null;
|
|
22
45
|
/** ISO timestamp when the workspace was created. */
|
|
23
46
|
createdAt: string;
|
|
24
47
|
/** ISO timestamp when the workspace was last updated. */
|
|
@@ -263,9 +286,9 @@ export interface ChannelMessage {
|
|
|
263
286
|
/** Optional identifier of the root thread message. */
|
|
264
287
|
threadId?: string | null;
|
|
265
288
|
/** Optional attachments uploaded with the message. */
|
|
266
|
-
attachments?:
|
|
289
|
+
attachments?: MessageAttachment[];
|
|
267
290
|
/** Reactions associated with this message. */
|
|
268
|
-
reactions?:
|
|
291
|
+
reactions?: MessageReaction[];
|
|
269
292
|
}
|
|
270
293
|
/**
|
|
271
294
|
* Represents a direct message conversation between users.
|
|
@@ -298,7 +321,7 @@ export interface DmConversation {
|
|
|
298
321
|
};
|
|
299
322
|
}[];
|
|
300
323
|
/** Messages belonging to this DM conversation. */
|
|
301
|
-
messages?:
|
|
324
|
+
messages?: ChannelMessage[];
|
|
302
325
|
/** Metadata count summaries for the conversation. */
|
|
303
326
|
_count?: {
|
|
304
327
|
/** Total number of messages in the conversation. */
|
|
@@ -538,28 +561,67 @@ export declare class ScrymeSDK {
|
|
|
538
561
|
/**
|
|
539
562
|
* Sends a new message to a channel.
|
|
540
563
|
* @param channelId Unique identifier of the target channel.
|
|
541
|
-
* @param
|
|
564
|
+
* @param data The message content string or structured CreateMessageDto object.
|
|
565
|
+
* @param options Optional request config override.
|
|
542
566
|
* @returns The created message exactly from the endpoint.
|
|
543
567
|
*/
|
|
544
|
-
create: (channelId: string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
568
|
+
create: (channelId: string, data: CreateMessageDto | string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
569
|
+
/**
|
|
570
|
+
* Updates the content of a previously sent message in a channel.
|
|
571
|
+
* @param channelId Unique identifier of the channel containing the message.
|
|
572
|
+
* @param messageId Unique identifier of the message to update.
|
|
573
|
+
* @param data The new content payload.
|
|
574
|
+
* @param options Optional request config override.
|
|
575
|
+
* @returns The updated message details exactly from the endpoint.
|
|
576
|
+
*/
|
|
577
|
+
update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
578
|
+
/**
|
|
579
|
+
* Permanently deletes a message in a channel.
|
|
580
|
+
* @param channelId Unique identifier of the channel containing the message.
|
|
581
|
+
* @param messageId Unique identifier of the message to delete.
|
|
582
|
+
* @param options Optional request config override.
|
|
583
|
+
* @returns Success status indicating that the message was deleted exactly from the endpoint.
|
|
584
|
+
*/
|
|
585
|
+
delete: (channelId: string, messageId: string, options?: AxiosRequestConfig) => Promise<{
|
|
586
|
+
success: boolean;
|
|
587
|
+
}>;
|
|
588
|
+
/**
|
|
589
|
+
* Adds a reaction (emoji) to a message in a channel.
|
|
590
|
+
* @param channelId Unique identifier of the channel containing the message.
|
|
591
|
+
* @param messageId Unique identifier of the message.
|
|
592
|
+
* @param data Object containing the target emoji character.
|
|
593
|
+
* @param options Optional request config override.
|
|
594
|
+
* @returns The reaction response returned exactly from the endpoint.
|
|
595
|
+
*/
|
|
596
|
+
addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<ChannelsControllerAddReactionResult>;
|
|
597
|
+
/**
|
|
598
|
+
* Removes a reaction (emoji) from a message in a channel.
|
|
599
|
+
* @param channelId Unique identifier of the channel containing the message.
|
|
600
|
+
* @param messageId Unique identifier of the message.
|
|
601
|
+
* @param emoji The emoji character to remove.
|
|
602
|
+
* @param options Optional request config override.
|
|
603
|
+
* @returns The reaction removal response returned exactly from the endpoint.
|
|
604
|
+
*/
|
|
605
|
+
removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerRemoveReactionResult>;
|
|
545
606
|
};
|
|
546
607
|
};
|
|
547
608
|
/**
|
|
548
|
-
* Operations for modifying, reacting to, or deleting existing channel messages.
|
|
609
|
+
* Operations for modifying, reacting to, or deleting existing messages (both channel & direct messages).
|
|
610
|
+
* Automatically intercepts direct messages starting with 'dm-' and routes them correctly.
|
|
549
611
|
*/
|
|
550
612
|
get message(): {
|
|
551
613
|
/**
|
|
552
614
|
* Updates the content of a previously sent message.
|
|
553
|
-
* @param channelId Unique identifier of the channel containing the message.
|
|
615
|
+
* @param channelId Unique identifier of the channel or DM conversation containing the message.
|
|
554
616
|
* @param messageId Unique identifier of the message to update.
|
|
555
617
|
* @param data The new content payload.
|
|
556
618
|
* @param options Optional request config override.
|
|
557
619
|
* @returns The updated message details exactly from the endpoint.
|
|
558
620
|
*/
|
|
559
|
-
update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
621
|
+
update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody | UpdateDmMessageDto, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
560
622
|
/**
|
|
561
623
|
* Permanently deletes a message.
|
|
562
|
-
* @param channelId Unique identifier of the channel containing the message.
|
|
624
|
+
* @param channelId Unique identifier of the channel or DM conversation containing the message.
|
|
563
625
|
* @param messageId Unique identifier of the message to delete.
|
|
564
626
|
* @param options Optional request config override.
|
|
565
627
|
* @returns Success status indicating that the message was deleted exactly from the endpoint.
|
|
@@ -569,22 +631,22 @@ export declare class ScrymeSDK {
|
|
|
569
631
|
}>;
|
|
570
632
|
/**
|
|
571
633
|
* Adds a reaction (emoji) to a message.
|
|
572
|
-
* @param channelId Unique identifier of the channel containing the message.
|
|
634
|
+
* @param channelId Unique identifier of the channel or DM conversation containing the message.
|
|
573
635
|
* @param messageId Unique identifier of the message.
|
|
574
636
|
* @param data Object containing the target emoji character.
|
|
575
637
|
* @param options Optional request config override.
|
|
576
638
|
* @returns The reaction response returned exactly from the endpoint.
|
|
577
639
|
*/
|
|
578
|
-
addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<
|
|
640
|
+
addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody | DmsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<ChannelsControllerAddReactionResult | DmsControllerAddReactionResult>;
|
|
579
641
|
/**
|
|
580
642
|
* Removes a reaction (emoji) from a message.
|
|
581
|
-
* @param channelId Unique identifier of the channel containing the message.
|
|
643
|
+
* @param channelId Unique identifier of the channel or DM conversation containing the message.
|
|
582
644
|
* @param messageId Unique identifier of the message.
|
|
583
645
|
* @param emoji The emoji character to remove.
|
|
584
646
|
* @param options Optional request config override.
|
|
585
647
|
* @returns The reaction removal response returned exactly from the endpoint.
|
|
586
648
|
*/
|
|
587
|
-
removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<
|
|
649
|
+
removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerRemoveReactionResult | DmsControllerRemoveReactionResult>;
|
|
588
650
|
};
|
|
589
651
|
/**
|
|
590
652
|
* Operations for managing direct messages (DMs) and direct message conversations.
|
|
@@ -637,10 +699,50 @@ export declare class ScrymeSDK {
|
|
|
637
699
|
/**
|
|
638
700
|
* Sends a new message in a direct message conversation.
|
|
639
701
|
* @param dmId Unique identifier of the direct message conversation.
|
|
640
|
-
* @param
|
|
702
|
+
* @param data The message content string or structured CreateMessageDto object.
|
|
703
|
+
* @param options Optional request config override.
|
|
641
704
|
* @returns The sent message exactly from the endpoint.
|
|
642
705
|
*/
|
|
643
|
-
create: (dmId: string,
|
|
706
|
+
create: (dmId: string, data: CreateMessageDto | {
|
|
707
|
+
content: string;
|
|
708
|
+
} | string, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
709
|
+
/**
|
|
710
|
+
* Updates the content of a previously sent direct message.
|
|
711
|
+
* @param dmId Unique identifier of the direct message conversation.
|
|
712
|
+
* @param messageId Unique identifier of the message to update.
|
|
713
|
+
* @param data The new content payload.
|
|
714
|
+
* @param options Optional request config override.
|
|
715
|
+
* @returns The updated message details exactly from the endpoint.
|
|
716
|
+
*/
|
|
717
|
+
update: (dmId: string, messageId: string, data: UpdateDmMessageDto, options?: AxiosRequestConfig) => Promise<ChannelMessage>;
|
|
718
|
+
/**
|
|
719
|
+
* Permanently deletes a direct message.
|
|
720
|
+
* @param dmId Unique identifier of the direct message conversation.
|
|
721
|
+
* @param messageId Unique identifier of the message to delete.
|
|
722
|
+
* @param options Optional request config override.
|
|
723
|
+
* @returns Success status indicating that the message was deleted exactly from the endpoint.
|
|
724
|
+
*/
|
|
725
|
+
delete: (dmId: string, messageId: string, options?: AxiosRequestConfig) => Promise<{
|
|
726
|
+
success: boolean;
|
|
727
|
+
}>;
|
|
728
|
+
/**
|
|
729
|
+
* Adds a reaction (emoji) to a direct message.
|
|
730
|
+
* @param dmId Unique identifier of the direct message conversation.
|
|
731
|
+
* @param messageId Unique identifier of the message.
|
|
732
|
+
* @param data Object containing the target emoji character.
|
|
733
|
+
* @param options Optional request config override.
|
|
734
|
+
* @returns The reaction response returned exactly from the endpoint.
|
|
735
|
+
*/
|
|
736
|
+
addReaction: (dmId: string, messageId: string, data: DmsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<DmsControllerAddReactionResult>;
|
|
737
|
+
/**
|
|
738
|
+
* Removes a reaction (emoji) from a direct message.
|
|
739
|
+
* @param dmId Unique identifier of the direct message conversation.
|
|
740
|
+
* @param messageId Unique identifier of the message.
|
|
741
|
+
* @param emoji The emoji character to remove.
|
|
742
|
+
* @param options Optional request config override.
|
|
743
|
+
* @returns The reaction removal response returned exactly from the endpoint.
|
|
744
|
+
*/
|
|
745
|
+
removeReaction: (dmId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<DmsControllerRemoveReactionResult>;
|
|
644
746
|
};
|
|
645
747
|
};
|
|
646
748
|
/**
|
|
@@ -669,4 +771,201 @@ export declare class ScrymeSDK {
|
|
|
669
771
|
*/
|
|
670
772
|
search: (params: UsersControllerSearchUsersParams, options?: AxiosRequestConfig) => Promise<UserProfile[]>;
|
|
671
773
|
};
|
|
774
|
+
/**
|
|
775
|
+
* Operations for managing webhooks (both standard workspace webhooks and channel incoming webhooks).
|
|
776
|
+
*/
|
|
777
|
+
get webhooks(): {
|
|
778
|
+
/**
|
|
779
|
+
* Lists all configured webhooks for a workspace. Requires webhooks:read scope.
|
|
780
|
+
* @param slug The unique workspace slug.
|
|
781
|
+
* @param options Optional request config override.
|
|
782
|
+
*/
|
|
783
|
+
list: (slug: string, options?: AxiosRequestConfig) => Promise<V3WebhooksControllerGetWebhooksResult>;
|
|
784
|
+
/**
|
|
785
|
+
* Creates a new standard webhook for a workspace. Requires webhooks:write scope.
|
|
786
|
+
* @param slug The unique workspace slug.
|
|
787
|
+
* @param data Configuration options for the standard webhook.
|
|
788
|
+
* @param options Optional request config override.
|
|
789
|
+
*/
|
|
790
|
+
create: (slug: string, data: V3CreateWebhookDto, options?: AxiosRequestConfig) => Promise<V3WebhooksControllerCreateWebhookResult>;
|
|
791
|
+
/**
|
|
792
|
+
* Retrieves details of a specific webhook. Requires webhooks:read scope.
|
|
793
|
+
* @param slug The unique workspace slug.
|
|
794
|
+
* @param webhookId The unique webhook identifier.
|
|
795
|
+
* @param options Optional request config override.
|
|
796
|
+
*/
|
|
797
|
+
get: (slug: string, webhookId: string, options?: AxiosRequestConfig) => Promise<V3WebhooksControllerGetWebhookResult>;
|
|
798
|
+
/**
|
|
799
|
+
* Updates a standard webhook for a workspace. Requires webhooks:write scope.
|
|
800
|
+
* @param slug The unique workspace slug.
|
|
801
|
+
* @param webhookId The unique webhook identifier.
|
|
802
|
+
* @param data Fields to update on the webhook.
|
|
803
|
+
* @param options Optional request config override.
|
|
804
|
+
*/
|
|
805
|
+
update: (slug: string, webhookId: string, data: V3UpdateWebhookDto, options?: AxiosRequestConfig) => Promise<V3WebhooksControllerUpdateWebhookResult>;
|
|
806
|
+
/**
|
|
807
|
+
* Permanently deletes a standard webhook. Requires webhooks:write scope.
|
|
808
|
+
* @param slug The unique workspace slug.
|
|
809
|
+
* @param webhookId The unique webhook identifier.
|
|
810
|
+
* @param options Optional request config override.
|
|
811
|
+
*/
|
|
812
|
+
delete: (slug: string, webhookId: string, options?: AxiosRequestConfig) => Promise<V3WebhooksControllerDeleteWebhookResult>;
|
|
813
|
+
/**
|
|
814
|
+
* Sub-namespace for managing channel incoming webhooks.
|
|
815
|
+
*/
|
|
816
|
+
incoming: {
|
|
817
|
+
/**
|
|
818
|
+
* Lists incoming webhooks configured for a specific channel. Requires webhooks:read scope.
|
|
819
|
+
* @param slug The unique workspace slug.
|
|
820
|
+
* @param channelId The unique channel identifier.
|
|
821
|
+
* @param options Optional request config override.
|
|
822
|
+
*/
|
|
823
|
+
list: (slug: string, channelId: string, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerGetChannelWebhooksResult>;
|
|
824
|
+
/**
|
|
825
|
+
* Creates an incoming webhook for a specific channel. Requires webhooks:write scope.
|
|
826
|
+
* @param slug The unique workspace slug.
|
|
827
|
+
* @param channelId The unique channel identifier.
|
|
828
|
+
* @param data Configuration options for the incoming webhook.
|
|
829
|
+
* @param options Optional request config override.
|
|
830
|
+
*/
|
|
831
|
+
create: (slug: string, channelId: string, data: CreateChannelIncomingWebhookDto, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerCreateChannelWebhookResult>;
|
|
832
|
+
/**
|
|
833
|
+
* Retrieves details of a specific channel incoming webhook. Requires webhooks:read scope.
|
|
834
|
+
* @param slug The unique workspace slug.
|
|
835
|
+
* @param channelId The unique channel identifier.
|
|
836
|
+
* @param webhookId The unique webhook identifier.
|
|
837
|
+
* @param options Optional request config override.
|
|
838
|
+
*/
|
|
839
|
+
get: (slug: string, channelId: string, webhookId: string, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerGetChannelWebhookResult>;
|
|
840
|
+
/**
|
|
841
|
+
* Updates a channel incoming webhook. Requires webhooks:write scope.
|
|
842
|
+
* @param slug The unique workspace slug.
|
|
843
|
+
* @param channelId The unique channel identifier.
|
|
844
|
+
* @param webhookId The unique webhook identifier.
|
|
845
|
+
* @param data Fields to update on the incoming webhook.
|
|
846
|
+
* @param options Optional request config override.
|
|
847
|
+
*/
|
|
848
|
+
update: (slug: string, channelId: string, webhookId: string, data: UpdateChannelIncomingWebhookDto, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerUpdateChannelWebhookResult>;
|
|
849
|
+
/**
|
|
850
|
+
* Deletes a channel incoming webhook. Requires webhooks:write scope.
|
|
851
|
+
* @param slug The unique workspace slug.
|
|
852
|
+
* @param channelId The unique channel identifier.
|
|
853
|
+
* @param webhookId The unique webhook identifier.
|
|
854
|
+
* @param options Optional request config override.
|
|
855
|
+
*/
|
|
856
|
+
delete: (slug: string, channelId: string, webhookId: string, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerDeleteChannelWebhookResult>;
|
|
857
|
+
/**
|
|
858
|
+
* Executes an incoming webhook using its unique url token directly. No auth headers required.
|
|
859
|
+
* @param token The unique webhook token from the webhook URL.
|
|
860
|
+
* @param data The payload payload consisting of content/attachments/metadata.
|
|
861
|
+
* @param options Optional request config override.
|
|
862
|
+
*/
|
|
863
|
+
executeByUrlToken: (token: string, data: ExecuteChannelIncomingWebhookDto, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerExecuteWebhookByUrlTokenResult>;
|
|
864
|
+
/**
|
|
865
|
+
* Executes an incoming webhook by channel ID.
|
|
866
|
+
* @param channelId The target channel identifier.
|
|
867
|
+
* @param data The payload payload consisting of content/attachments/metadata.
|
|
868
|
+
* @param params Optional query parameters like token or signature.
|
|
869
|
+
* @param options Optional request config override.
|
|
870
|
+
*/
|
|
871
|
+
executeByChannelId: (channelId: string, data: ExecuteChannelIncomingWebhookDto, params?: V3ChannelIncomingWebhooksControllerExecuteWebhookByChannelIdParams, options?: AxiosRequestConfig) => Promise<V3ChannelIncomingWebhooksControllerExecuteWebhookByChannelIdResult>;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
/**
|
|
875
|
+
* First-class namespace for Machine-to-Machine (M2M) operations,
|
|
876
|
+
* grouping V3 Enterprise M2M APIs into logical, highly cohesive spaces.
|
|
877
|
+
*/
|
|
878
|
+
get m2m(): {
|
|
879
|
+
/**
|
|
880
|
+
* M2M Workspace Operations (Provisioning, Retrieval, and Lifecycle management).
|
|
881
|
+
*/
|
|
882
|
+
workspace: {
|
|
883
|
+
/**
|
|
884
|
+
* Provisions a brand new tenant workspace in the organization.
|
|
885
|
+
* @param data Configuration payload for workspace name, slug, owner, and initial setups.
|
|
886
|
+
* @param options Optional request config override.
|
|
887
|
+
*/
|
|
888
|
+
provision: (data: V3ProvisionWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3ProvisionWorkspaceResponse>;
|
|
889
|
+
/**
|
|
890
|
+
* Retrieves detailed information of a specific workspace by its slug.
|
|
891
|
+
* @param slug The unique workspace slug.
|
|
892
|
+
* @param options Optional request config override.
|
|
893
|
+
*/
|
|
894
|
+
get: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspaceResponse>;
|
|
895
|
+
/**
|
|
896
|
+
* Lists all workspaces under the organization context.
|
|
897
|
+
* @param options Optional request config override.
|
|
898
|
+
*/
|
|
899
|
+
list: (options?: AxiosRequestConfig) => Promise<V3WorkspacesResponse>;
|
|
900
|
+
/**
|
|
901
|
+
* Updates configuration and branding metadata of a specific workspace.
|
|
902
|
+
* @param slug The unique workspace slug.
|
|
903
|
+
* @param data Workspace update DTO.
|
|
904
|
+
* @param options Optional request config override.
|
|
905
|
+
*/
|
|
906
|
+
update: (slug: string, data: V3UpdateWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3WorkspaceResponse>;
|
|
907
|
+
/**
|
|
908
|
+
* Permanently deletes a specific workspace by its slug.
|
|
909
|
+
* @param slug The unique workspace slug.
|
|
910
|
+
* @param options Optional request config override.
|
|
911
|
+
*/
|
|
912
|
+
delete: (slug: string, options?: AxiosRequestConfig) => Promise<V3DeleteWorkspaceResponse>;
|
|
913
|
+
};
|
|
914
|
+
/**
|
|
915
|
+
* M2M Workspace Membership Operations (Adding, modifying roles, and removing workspace members).
|
|
916
|
+
*/
|
|
917
|
+
member: {
|
|
918
|
+
/**
|
|
919
|
+
* Lists all members currently in a workspace.
|
|
920
|
+
* @param slug The unique workspace slug.
|
|
921
|
+
* @param options Optional request config override.
|
|
922
|
+
*/
|
|
923
|
+
list: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspaceMembersResponse>;
|
|
924
|
+
/**
|
|
925
|
+
* Adds a new member to a workspace.
|
|
926
|
+
* @param slug The unique workspace slug.
|
|
927
|
+
* @param data Configuration containing user email and target role.
|
|
928
|
+
* @param options Optional request config override.
|
|
929
|
+
*/
|
|
930
|
+
add: (slug: string, data: V3AddMemberDto, options?: AxiosRequestConfig) => Promise<V3AddWorkspaceMemberResponse>;
|
|
931
|
+
/**
|
|
932
|
+
* Retrieves membership details of a specific workspace member.
|
|
933
|
+
* @param slug The unique workspace slug.
|
|
934
|
+
* @param memberId Unique ID of the workspace member (user ID).
|
|
935
|
+
* @param options Optional request config override.
|
|
936
|
+
*/
|
|
937
|
+
get: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<V3GetWorkspaceMemberResponse>;
|
|
938
|
+
/**
|
|
939
|
+
* Updates the role or settings of an existing member in a workspace.
|
|
940
|
+
* @param slug The unique workspace slug.
|
|
941
|
+
* @param memberId Unique ID of the workspace member (user ID).
|
|
942
|
+
* @param data Updated role.
|
|
943
|
+
* @param options Optional request config override.
|
|
944
|
+
*/
|
|
945
|
+
update: (slug: string, memberId: string, data: V3UpdateMemberRoleDto, options?: AxiosRequestConfig) => Promise<V3UpdateWorkspaceMemberResponse>;
|
|
946
|
+
/**
|
|
947
|
+
* Removes a member from a workspace.
|
|
948
|
+
* @param slug The unique workspace slug.
|
|
949
|
+
* @param memberId Unique ID of the workspace member (user ID).
|
|
950
|
+
* @param options Optional request config override.
|
|
951
|
+
*/
|
|
952
|
+
delete: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<V3DeleteWorkspaceMemberResponse>;
|
|
953
|
+
};
|
|
954
|
+
/**
|
|
955
|
+
* M2M Authentication and Token Management Utilities.
|
|
956
|
+
*/
|
|
957
|
+
auth: {
|
|
958
|
+
/**
|
|
959
|
+
* Explicitly exchanges Client Credentials for a V3 access token.
|
|
960
|
+
* @param clientId The unique M2M Client ID.
|
|
961
|
+
* @param clientSecret The secure M2M Client Secret.
|
|
962
|
+
* @param options Optional request config override.
|
|
963
|
+
*/
|
|
964
|
+
token: (clientId: string, clientSecret: string, options?: AxiosRequestConfig) => Promise<V3OAuthControllerGetTokenResult>;
|
|
965
|
+
/**
|
|
966
|
+
* Dynamically retrieves the current cached M2M token, or proactively fetches a new one.
|
|
967
|
+
*/
|
|
968
|
+
getOrFetchToken: () => Promise<string | null>;
|
|
969
|
+
};
|
|
970
|
+
};
|
|
672
971
|
}
|