@scryme/chat 2.13.4 → 2.15.1

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.js CHANGED
@@ -225,7 +225,7 @@ var ScrymeSDK = /** @class */ (function () {
225
225
  // If the user provided options, we merge them with our default request config.
226
226
  if (args.length >= arity && typeof args[args.length - 1] === 'object') {
227
227
  userOptions = args[args.length - 1];
228
- newArgs[args.length - 1] = __assign(__assign({}, userOptions), { baseURL: config.baseURL, headers: __assign(__assign({}, config.headers), userOptions.headers) });
228
+ newArgs[args.length - 1] = __assign(__assign({}, userOptions), { baseURL: config.baseURL, headers: __assign(__assign({}, config.headers), userOptions === null || userOptions === void 0 ? void 0 : userOptions.headers) });
229
229
  }
230
230
  else {
231
231
  // Otherwise, we pad missing parameters with undefined and append our config as the options object.
@@ -472,12 +472,66 @@ var ScrymeSDK = /** @class */ (function () {
472
472
  /**
473
473
  * Sends a new message to a channel.
474
474
  * @param channelId Unique identifier of the target channel.
475
- * @param options Optional request config override. Note that standard message data (like text content) can be passed inside options.data.
475
+ * @param data The message content string or structured CreateMessageDto object.
476
+ * @param options Optional request config override.
476
477
  * @returns The created message exactly from the endpoint.
477
478
  */
478
- create: function (channelId, options) { return __awaiter(_this, void 0, void 0, function () {
479
+ create: function (channelId, data, options) { return __awaiter(_this, void 0, void 0, function () {
480
+ var payload;
481
+ return __generator(this, function (_a) {
482
+ payload = typeof data === 'string' ? { content: data } : data;
483
+ return [2 /*return*/, this.raw.channelsControllerCreateMessage(channelId, __assign(__assign({}, options), { data: payload }))];
484
+ });
485
+ }); },
486
+ /**
487
+ * Updates the content of a previously sent message in a channel.
488
+ * @param channelId Unique identifier of the channel containing the message.
489
+ * @param messageId Unique identifier of the message to update.
490
+ * @param data The new content payload.
491
+ * @param options Optional request config override.
492
+ * @returns The updated message details exactly from the endpoint.
493
+ */
494
+ update: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
495
+ return __generator(this, function (_a) {
496
+ return [2 /*return*/, this.raw.channelsControllerUpdateMessage(channelId, messageId, data, options)];
497
+ });
498
+ }); },
499
+ /**
500
+ * Permanently deletes a message in a channel.
501
+ * @param channelId Unique identifier of the channel containing the message.
502
+ * @param messageId Unique identifier of the message to delete.
503
+ * @param options Optional request config override.
504
+ * @returns Success status indicating that the message was deleted exactly from the endpoint.
505
+ */
506
+ delete: function (channelId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
479
507
  return __generator(this, function (_a) {
480
- return [2 /*return*/, this.raw.channelsControllerCreateMessage(channelId, options)];
508
+ return [2 /*return*/, this.raw.channelsControllerDeleteMessage(channelId, messageId, options)];
509
+ });
510
+ }); },
511
+ /**
512
+ * Adds a reaction (emoji) to a message in a channel.
513
+ * @param channelId Unique identifier of the channel containing the message.
514
+ * @param messageId Unique identifier of the message.
515
+ * @param data Object containing the target emoji character.
516
+ * @param options Optional request config override.
517
+ * @returns The reaction response returned exactly from the endpoint.
518
+ */
519
+ addReaction: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
520
+ return __generator(this, function (_a) {
521
+ return [2 /*return*/, this.raw.channelsControllerAddReaction(channelId, messageId, data, options)];
522
+ });
523
+ }); },
524
+ /**
525
+ * Removes a reaction (emoji) from a message in a channel.
526
+ * @param channelId Unique identifier of the channel containing the message.
527
+ * @param messageId Unique identifier of the message.
528
+ * @param emoji The emoji character to remove.
529
+ * @param options Optional request config override.
530
+ * @returns The reaction removal response returned exactly from the endpoint.
531
+ */
532
+ removeReaction: function (channelId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
533
+ return __generator(this, function (_a) {
534
+ return [2 /*return*/, this.raw.channelsControllerRemoveReaction(channelId, messageId, emoji, options)];
481
535
  });
482
536
  }); },
483
537
  },
@@ -488,14 +542,15 @@ var ScrymeSDK = /** @class */ (function () {
488
542
  });
489
543
  Object.defineProperty(ScrymeSDK.prototype, "message", {
490
544
  /**
491
- * Operations for modifying, reacting to, or deleting existing channel messages.
545
+ * Operations for modifying, reacting to, or deleting existing messages (both channel & direct messages).
546
+ * Automatically intercepts direct messages starting with 'dm-' and routes them correctly.
492
547
  */
493
548
  get: function () {
494
549
  var _this = this;
495
550
  return {
496
551
  /**
497
552
  * Updates the content of a previously sent message.
498
- * @param channelId Unique identifier of the channel containing the message.
553
+ * @param channelId Unique identifier of the channel or DM conversation containing the message.
499
554
  * @param messageId Unique identifier of the message to update.
500
555
  * @param data The new content payload.
501
556
  * @param options Optional request config override.
@@ -503,24 +558,30 @@ var ScrymeSDK = /** @class */ (function () {
503
558
  */
504
559
  update: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
505
560
  return __generator(this, function (_a) {
561
+ if (channelId.startsWith('dm-')) {
562
+ return [2 /*return*/, this.raw.dmsControllerUpdateMessage(channelId, messageId, data, options)];
563
+ }
506
564
  return [2 /*return*/, this.raw.channelsControllerUpdateMessage(channelId, messageId, data, options)];
507
565
  });
508
566
  }); },
509
567
  /**
510
568
  * Permanently deletes a message.
511
- * @param channelId Unique identifier of the channel containing the message.
569
+ * @param channelId Unique identifier of the channel or DM conversation containing the message.
512
570
  * @param messageId Unique identifier of the message to delete.
513
571
  * @param options Optional request config override.
514
572
  * @returns Success status indicating that the message was deleted exactly from the endpoint.
515
573
  */
516
574
  delete: function (channelId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
517
575
  return __generator(this, function (_a) {
576
+ if (channelId.startsWith('dm-')) {
577
+ return [2 /*return*/, this.raw.dmsControllerDeleteMessage(channelId, messageId, options)];
578
+ }
518
579
  return [2 /*return*/, this.raw.channelsControllerDeleteMessage(channelId, messageId, options)];
519
580
  });
520
581
  }); },
521
582
  /**
522
583
  * Adds a reaction (emoji) to a message.
523
- * @param channelId Unique identifier of the channel containing the message.
584
+ * @param channelId Unique identifier of the channel or DM conversation containing the message.
524
585
  * @param messageId Unique identifier of the message.
525
586
  * @param data Object containing the target emoji character.
526
587
  * @param options Optional request config override.
@@ -528,12 +589,15 @@ var ScrymeSDK = /** @class */ (function () {
528
589
  */
529
590
  addReaction: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
530
591
  return __generator(this, function (_a) {
592
+ if (channelId.startsWith('dm-')) {
593
+ return [2 /*return*/, this.raw.dmsControllerAddReaction(channelId, messageId, data, options)];
594
+ }
531
595
  return [2 /*return*/, this.raw.channelsControllerAddReaction(channelId, messageId, data, options)];
532
596
  });
533
597
  }); },
534
598
  /**
535
599
  * Removes a reaction (emoji) from a message.
536
- * @param channelId Unique identifier of the channel containing the message.
600
+ * @param channelId Unique identifier of the channel or DM conversation containing the message.
537
601
  * @param messageId Unique identifier of the message.
538
602
  * @param emoji The emoji character to remove.
539
603
  * @param options Optional request config override.
@@ -541,6 +605,9 @@ var ScrymeSDK = /** @class */ (function () {
541
605
  */
542
606
  removeReaction: function (channelId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
543
607
  return __generator(this, function (_a) {
608
+ if (channelId.startsWith('dm-')) {
609
+ return [2 /*return*/, this.raw.dmsControllerRemoveReaction(channelId, messageId, emoji, options)];
610
+ }
544
611
  return [2 /*return*/, this.raw.channelsControllerRemoveReaction(channelId, messageId, emoji, options)];
545
612
  });
546
613
  }); },
@@ -618,12 +685,66 @@ var ScrymeSDK = /** @class */ (function () {
618
685
  /**
619
686
  * Sends a new message in a direct message conversation.
620
687
  * @param dmId Unique identifier of the direct message conversation.
621
- * @param options Optional request config override. Note that content/attachments can be passed inside options.data.
688
+ * @param data The message content string or structured CreateMessageDto object.
689
+ * @param options Optional request config override.
622
690
  * @returns The sent message exactly from the endpoint.
623
691
  */
624
- create: function (dmId, options) { return __awaiter(_this, void 0, void 0, function () {
692
+ create: function (dmId, data, options) { return __awaiter(_this, void 0, void 0, function () {
693
+ var payload;
694
+ return __generator(this, function (_a) {
695
+ payload = typeof data === 'string' ? { content: data } : data;
696
+ return [2 /*return*/, this.raw.dmsControllerCreateMessage(dmId, __assign(__assign({}, options), { data: payload }))];
697
+ });
698
+ }); },
699
+ /**
700
+ * Updates the content of a previously sent direct message.
701
+ * @param dmId Unique identifier of the direct message conversation.
702
+ * @param messageId Unique identifier of the message to update.
703
+ * @param data The new content payload.
704
+ * @param options Optional request config override.
705
+ * @returns The updated message details exactly from the endpoint.
706
+ */
707
+ update: function (dmId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
708
+ return __generator(this, function (_a) {
709
+ return [2 /*return*/, this.raw.dmsControllerUpdateMessage(dmId, messageId, data, options)];
710
+ });
711
+ }); },
712
+ /**
713
+ * Permanently deletes a direct message.
714
+ * @param dmId Unique identifier of the direct message conversation.
715
+ * @param messageId Unique identifier of the message to delete.
716
+ * @param options Optional request config override.
717
+ * @returns Success status indicating that the message was deleted exactly from the endpoint.
718
+ */
719
+ delete: function (dmId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
625
720
  return __generator(this, function (_a) {
626
- return [2 /*return*/, this.raw.dmsControllerCreateMessage(dmId, options)];
721
+ return [2 /*return*/, this.raw.dmsControllerDeleteMessage(dmId, messageId, options)];
722
+ });
723
+ }); },
724
+ /**
725
+ * Adds a reaction (emoji) to a direct message.
726
+ * @param dmId Unique identifier of the direct message conversation.
727
+ * @param messageId Unique identifier of the message.
728
+ * @param data Object containing the target emoji character.
729
+ * @param options Optional request config override.
730
+ * @returns The reaction response returned exactly from the endpoint.
731
+ */
732
+ addReaction: function (dmId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
733
+ return __generator(this, function (_a) {
734
+ return [2 /*return*/, this.raw.dmsControllerAddReaction(dmId, messageId, data, options)];
735
+ });
736
+ }); },
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: function (dmId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
746
+ return __generator(this, function (_a) {
747
+ return [2 /*return*/, this.raw.dmsControllerRemoveReaction(dmId, messageId, emoji, options)];
627
748
  });
628
749
  }); },
629
750
  },
@@ -677,6 +798,317 @@ var ScrymeSDK = /** @class */ (function () {
677
798
  enumerable: false,
678
799
  configurable: true
679
800
  });
801
+ Object.defineProperty(ScrymeSDK.prototype, "webhooks", {
802
+ /**
803
+ * Operations for managing webhooks (both standard workspace webhooks and channel incoming webhooks).
804
+ */
805
+ get: function () {
806
+ var _this = this;
807
+ return {
808
+ /**
809
+ * Lists all configured webhooks for a workspace. Requires webhooks:read scope.
810
+ * @param slug The unique workspace slug.
811
+ * @param options Optional request config override.
812
+ */
813
+ list: function (slug, options) { return __awaiter(_this, void 0, void 0, function () {
814
+ return __generator(this, function (_a) {
815
+ return [2 /*return*/, this.raw.v3WebhooksControllerGetWebhooks(slug, options)];
816
+ });
817
+ }); },
818
+ /**
819
+ * Creates a new standard webhook for a workspace. Requires webhooks:write scope.
820
+ * @param slug The unique workspace slug.
821
+ * @param data Configuration options for the standard webhook.
822
+ * @param options Optional request config override.
823
+ */
824
+ create: function (slug, data, options) { return __awaiter(_this, void 0, void 0, function () {
825
+ return __generator(this, function (_a) {
826
+ return [2 /*return*/, this.raw.v3WebhooksControllerCreateWebhook(slug, data, options)];
827
+ });
828
+ }); },
829
+ /**
830
+ * Retrieves details of a specific webhook. Requires webhooks:read scope.
831
+ * @param slug The unique workspace slug.
832
+ * @param webhookId The unique webhook identifier.
833
+ * @param options Optional request config override.
834
+ */
835
+ get: function (slug, webhookId, options) { return __awaiter(_this, void 0, void 0, function () {
836
+ return __generator(this, function (_a) {
837
+ return [2 /*return*/, this.raw.v3WebhooksControllerGetWebhook(slug, webhookId, options)];
838
+ });
839
+ }); },
840
+ /**
841
+ * Updates a standard webhook for a workspace. Requires webhooks:write scope.
842
+ * @param slug The unique workspace slug.
843
+ * @param webhookId The unique webhook identifier.
844
+ * @param data Fields to update on the webhook.
845
+ * @param options Optional request config override.
846
+ */
847
+ update: function (slug, webhookId, data, options) { return __awaiter(_this, void 0, void 0, function () {
848
+ return __generator(this, function (_a) {
849
+ return [2 /*return*/, this.raw.v3WebhooksControllerUpdateWebhook(slug, webhookId, data, options)];
850
+ });
851
+ }); },
852
+ /**
853
+ * Permanently deletes a standard webhook. Requires webhooks:write scope.
854
+ * @param slug The unique workspace slug.
855
+ * @param webhookId The unique webhook identifier.
856
+ * @param options Optional request config override.
857
+ */
858
+ delete: function (slug, webhookId, options) { return __awaiter(_this, void 0, void 0, function () {
859
+ return __generator(this, function (_a) {
860
+ return [2 /*return*/, this.raw.v3WebhooksControllerDeleteWebhook(slug, webhookId, options)];
861
+ });
862
+ }); },
863
+ /**
864
+ * Sub-namespace for managing channel incoming webhooks.
865
+ */
866
+ incoming: {
867
+ /**
868
+ * Lists incoming webhooks configured for a specific channel. Requires webhooks:read scope.
869
+ * @param slug The unique workspace slug.
870
+ * @param channelId The unique channel identifier.
871
+ * @param options Optional request config override.
872
+ */
873
+ list: function (slug, channelId, options) { return __awaiter(_this, void 0, void 0, function () {
874
+ return __generator(this, function (_a) {
875
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerGetChannelWebhooks(slug, channelId, options)];
876
+ });
877
+ }); },
878
+ /**
879
+ * Creates an incoming webhook for a specific channel. Requires webhooks:write scope.
880
+ * @param slug The unique workspace slug.
881
+ * @param channelId The unique channel identifier.
882
+ * @param data Configuration options for the incoming webhook.
883
+ * @param options Optional request config override.
884
+ */
885
+ create: function (slug, channelId, data, options) { return __awaiter(_this, void 0, void 0, function () {
886
+ return __generator(this, function (_a) {
887
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerCreateChannelWebhook(slug, channelId, data, options)];
888
+ });
889
+ }); },
890
+ /**
891
+ * Retrieves details of a specific channel incoming webhook. Requires webhooks:read scope.
892
+ * @param slug The unique workspace slug.
893
+ * @param channelId The unique channel identifier.
894
+ * @param webhookId The unique webhook identifier.
895
+ * @param options Optional request config override.
896
+ */
897
+ get: function (slug, channelId, webhookId, options) { return __awaiter(_this, void 0, void 0, function () {
898
+ return __generator(this, function (_a) {
899
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerGetChannelWebhook(slug, channelId, webhookId, options)];
900
+ });
901
+ }); },
902
+ /**
903
+ * Updates a channel incoming webhook. Requires webhooks:write scope.
904
+ * @param slug The unique workspace slug.
905
+ * @param channelId The unique channel identifier.
906
+ * @param webhookId The unique webhook identifier.
907
+ * @param data Fields to update on the incoming webhook.
908
+ * @param options Optional request config override.
909
+ */
910
+ update: function (slug, channelId, webhookId, data, options) { return __awaiter(_this, void 0, void 0, function () {
911
+ return __generator(this, function (_a) {
912
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerUpdateChannelWebhook(slug, channelId, webhookId, data, options)];
913
+ });
914
+ }); },
915
+ /**
916
+ * Deletes a channel incoming webhook. Requires webhooks:write scope.
917
+ * @param slug The unique workspace slug.
918
+ * @param channelId The unique channel identifier.
919
+ * @param webhookId The unique webhook identifier.
920
+ * @param options Optional request config override.
921
+ */
922
+ delete: function (slug, channelId, webhookId, options) { return __awaiter(_this, void 0, void 0, function () {
923
+ return __generator(this, function (_a) {
924
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerDeleteChannelWebhook(slug, channelId, webhookId, options)];
925
+ });
926
+ }); },
927
+ /**
928
+ * Executes an incoming webhook using its unique url token directly. No auth headers required.
929
+ * @param token The unique webhook token from the webhook URL.
930
+ * @param data The payload payload consisting of content/attachments/metadata.
931
+ * @param options Optional request config override.
932
+ */
933
+ executeByUrlToken: function (token, data, options) { return __awaiter(_this, void 0, void 0, function () {
934
+ return __generator(this, function (_a) {
935
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerExecuteWebhookByUrlToken(token, data, options)];
936
+ });
937
+ }); },
938
+ /**
939
+ * Executes an incoming webhook by channel ID.
940
+ * @param channelId The target channel identifier.
941
+ * @param data The payload payload consisting of content/attachments/metadata.
942
+ * @param params Optional query parameters like token or signature.
943
+ * @param options Optional request config override.
944
+ */
945
+ executeByChannelId: function (channelId, data, params, options) { return __awaiter(_this, void 0, void 0, function () {
946
+ return __generator(this, function (_a) {
947
+ return [2 /*return*/, this.raw.v3ChannelIncomingWebhooksControllerExecuteWebhookByChannelId(channelId, data, params, options)];
948
+ });
949
+ }); },
950
+ },
951
+ };
952
+ },
953
+ enumerable: false,
954
+ configurable: true
955
+ });
956
+ Object.defineProperty(ScrymeSDK.prototype, "m2m", {
957
+ /**
958
+ * First-class namespace for Machine-to-Machine (M2M) operations,
959
+ * grouping V3 Enterprise M2M APIs into logical, highly cohesive spaces.
960
+ */
961
+ get: function () {
962
+ var _this = this;
963
+ return {
964
+ /**
965
+ * M2M Workspace Operations (Provisioning, Retrieval, and Lifecycle management).
966
+ */
967
+ workspace: {
968
+ /**
969
+ * Provisions a brand new tenant workspace in the organization.
970
+ * @param data Configuration payload for workspace name, slug, owner, and initial setups.
971
+ * @param options Optional request config override.
972
+ */
973
+ provision: function (data, options) { return __awaiter(_this, void 0, void 0, function () {
974
+ return __generator(this, function (_a) {
975
+ return [2 /*return*/, this.raw.v3WorkspacesControllerProvisionWorkspace(data, options)];
976
+ });
977
+ }); },
978
+ /**
979
+ * Retrieves detailed information of a specific workspace by its slug.
980
+ * @param slug The unique workspace slug.
981
+ * @param options Optional request config override.
982
+ */
983
+ get: function (slug, options) { return __awaiter(_this, void 0, void 0, function () {
984
+ return __generator(this, function (_a) {
985
+ return [2 /*return*/, this.raw.v3WorkspacesControllerGetWorkspaceBySlug(slug, options)];
986
+ });
987
+ }); },
988
+ /**
989
+ * Lists all workspaces under the organization context.
990
+ * @param options Optional request config override.
991
+ */
992
+ list: function (options) { return __awaiter(_this, void 0, void 0, function () {
993
+ return __generator(this, function (_a) {
994
+ return [2 /*return*/, this.raw.v3WorkspacesControllerGetWorkspaces(options)];
995
+ });
996
+ }); },
997
+ /**
998
+ * Updates configuration and branding metadata of a specific workspace.
999
+ * @param slug The unique workspace slug.
1000
+ * @param data Workspace update DTO.
1001
+ * @param options Optional request config override.
1002
+ */
1003
+ update: function (slug, data, options) { return __awaiter(_this, void 0, void 0, function () {
1004
+ return __generator(this, function (_a) {
1005
+ return [2 /*return*/, this.raw.v3WorkspacesControllerUpdateWorkspace(slug, data, options)];
1006
+ });
1007
+ }); },
1008
+ /**
1009
+ * Permanently deletes a specific workspace by its slug.
1010
+ * @param slug The unique workspace slug.
1011
+ * @param options Optional request config override.
1012
+ */
1013
+ delete: function (slug, options) { return __awaiter(_this, void 0, void 0, function () {
1014
+ return __generator(this, function (_a) {
1015
+ return [2 /*return*/, this.raw.v3WorkspacesControllerDeleteWorkspace(slug, options)];
1016
+ });
1017
+ }); },
1018
+ },
1019
+ /**
1020
+ * M2M Workspace Membership Operations (Adding, modifying roles, and removing workspace members).
1021
+ */
1022
+ member: {
1023
+ /**
1024
+ * Lists all members currently in a workspace.
1025
+ * @param slug The unique workspace slug.
1026
+ * @param options Optional request config override.
1027
+ */
1028
+ list: function (slug, options) { return __awaiter(_this, void 0, void 0, function () {
1029
+ return __generator(this, function (_a) {
1030
+ return [2 /*return*/, this.raw.v3WorkspacesControllerGetWorkspaceMembers(slug, options)];
1031
+ });
1032
+ }); },
1033
+ /**
1034
+ * Adds a new member to a workspace.
1035
+ * @param slug The unique workspace slug.
1036
+ * @param data Configuration containing user email and target role.
1037
+ * @param options Optional request config override.
1038
+ */
1039
+ add: function (slug, data, options) { return __awaiter(_this, void 0, void 0, function () {
1040
+ return __generator(this, function (_a) {
1041
+ return [2 /*return*/, this.raw.v3WorkspacesControllerAddWorkspaceMember(slug, data, options)];
1042
+ });
1043
+ }); },
1044
+ /**
1045
+ * Retrieves membership details of a specific workspace member.
1046
+ * @param slug The unique workspace slug.
1047
+ * @param memberId Unique ID of the workspace member (user ID).
1048
+ * @param options Optional request config override.
1049
+ */
1050
+ get: function (slug, memberId, options) { return __awaiter(_this, void 0, void 0, function () {
1051
+ return __generator(this, function (_a) {
1052
+ return [2 /*return*/, this.raw.v3WorkspacesControllerGetWorkspaceMember(slug, memberId, options)];
1053
+ });
1054
+ }); },
1055
+ /**
1056
+ * Updates the role or settings of an existing member in a workspace.
1057
+ * @param slug The unique workspace slug.
1058
+ * @param memberId Unique ID of the workspace member (user ID).
1059
+ * @param data Updated role.
1060
+ * @param options Optional request config override.
1061
+ */
1062
+ update: function (slug, memberId, data, options) { return __awaiter(_this, void 0, void 0, function () {
1063
+ return __generator(this, function (_a) {
1064
+ return [2 /*return*/, this.raw.v3WorkspacesControllerUpdateWorkspaceMember(slug, memberId, data, options)];
1065
+ });
1066
+ }); },
1067
+ /**
1068
+ * Removes a member from a workspace.
1069
+ * @param slug The unique workspace slug.
1070
+ * @param memberId Unique ID of the workspace member (user ID).
1071
+ * @param options Optional request config override.
1072
+ */
1073
+ delete: function (slug, memberId, options) { return __awaiter(_this, void 0, void 0, function () {
1074
+ return __generator(this, function (_a) {
1075
+ return [2 /*return*/, this.raw.v3WorkspacesControllerDeleteWorkspaceMember(slug, memberId, options)];
1076
+ });
1077
+ }); },
1078
+ },
1079
+ /**
1080
+ * M2M Authentication and Token Management Utilities.
1081
+ */
1082
+ auth: {
1083
+ /**
1084
+ * Explicitly exchanges Client Credentials for a V3 access token.
1085
+ * @param clientId The unique M2M Client ID.
1086
+ * @param clientSecret The secure M2M Client Secret.
1087
+ * @param options Optional request config override.
1088
+ */
1089
+ token: function (clientId, clientSecret, options) { return __awaiter(_this, void 0, void 0, function () {
1090
+ return __generator(this, function (_a) {
1091
+ return [2 /*return*/, this.raw.v3OAuthControllerGetToken({
1092
+ client_id: clientId,
1093
+ client_secret: clientSecret,
1094
+ grant_type: 'client_credentials',
1095
+ }, options)];
1096
+ });
1097
+ }); },
1098
+ /**
1099
+ * Dynamically retrieves the current cached M2M token, or proactively fetches a new one.
1100
+ */
1101
+ getOrFetchToken: function () { return __awaiter(_this, void 0, void 0, function () {
1102
+ return __generator(this, function (_a) {
1103
+ return [2 /*return*/, this.getOrFetchToken()];
1104
+ });
1105
+ }); },
1106
+ },
1107
+ };
1108
+ },
1109
+ enumerable: false,
1110
+ configurable: true
1111
+ });
680
1112
  return ScrymeSDK;
681
1113
  }());
682
1114
  export { ScrymeSDK };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scryme/chat",
3
- "version": "2.13.4",
3
+ "version": "2.15.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"