@scryme/chat 2.91.29 → 2.91.61

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
@@ -586,80 +586,133 @@ var ScrymeSDK = /** @class */ (function () {
586
586
  */
587
587
  message: {
588
588
  /**
589
- * Lists messages in a channel with cursor pagination support.
589
+ * Lists messages in a channel with cursor pagination support via V3 API.
590
+ * @param slug The unique workspace slug.
590
591
  * @param channelId Unique identifier of the channel.
591
592
  * @param params Query parameters for limiting, sorting, or pagination cursors.
592
593
  * @param options Optional request config override.
593
- * @returns Object containing the messages array and next pagination cursor exactly from the endpoint.
594
594
  */
595
- list: function (channelId, params, options) { return __awaiter(_this, void 0, void 0, function () {
596
- return __generator(this, function (_a) {
597
- return [2 /*return*/, this.raw.channelsControllerGetMessages(channelId, params, options)];
595
+ list: function (slug, channelId, params, options) { return __awaiter(_this, void 0, void 0, function () {
596
+ var queryParams, res;
597
+ var _a;
598
+ return __generator(this, function (_b) {
599
+ switch (_b.label) {
600
+ case 0:
601
+ queryParams = {};
602
+ if (params === null || params === void 0 ? void 0 : params.cursor)
603
+ queryParams.cursor = params.cursor;
604
+ if (params === null || params === void 0 ? void 0 : params.limit)
605
+ queryParams.limit = params.limit;
606
+ return [4 /*yield*/, this.raw.v3WorkspacesControllerGetChannelMessages(slug, channelId, queryParams, options)];
607
+ case 1:
608
+ res = (_b.sent());
609
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
610
+ }
598
611
  });
599
612
  }); },
600
613
  /**
601
- * Sends a new message to a channel.
614
+ * Sends a new message to a channel via V3 API.
615
+ * @param slug The unique workspace slug.
602
616
  * @param channelId Unique identifier of the target channel.
603
- * @param data The message content string or structured CreateMessageDto object.
617
+ * @param data The message content string or structured payload object.
604
618
  * @param options Optional request config override.
605
- * @returns The created message exactly from the endpoint.
606
619
  */
607
- create: function (channelId, data, options) { return __awaiter(_this, void 0, void 0, function () {
608
- var payload;
609
- return __generator(this, function (_a) {
610
- payload = typeof data === 'string' ? { content: data } : data;
611
- return [2 /*return*/, this.raw.channelsControllerCreateMessage(channelId, __assign(__assign({}, options), { data: payload }))];
620
+ create: function (slug, channelId, data, options) { return __awaiter(_this, void 0, void 0, function () {
621
+ var payload, mergedConfig, res;
622
+ var _a, _b;
623
+ return __generator(this, function (_c) {
624
+ switch (_c.label) {
625
+ case 0:
626
+ payload = typeof data === 'string' ? { content: data } : data;
627
+ mergedConfig = __assign(__assign({}, options), { data: payload });
628
+ return [4 /*yield*/, this.raw.v3WorkspacesControllerCreateChannelMessage(slug, channelId, mergedConfig)];
629
+ case 1:
630
+ res = (_c.sent());
631
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : res];
632
+ }
612
633
  });
613
634
  }); },
614
635
  /**
615
- * Updates the content of a previously sent message in a channel.
636
+ * Updates the content of a previously sent message in a channel via V3 API.
637
+ * @param slug The unique workspace slug.
616
638
  * @param channelId Unique identifier of the channel containing the message.
617
639
  * @param messageId Unique identifier of the message to update.
618
640
  * @param data The new content payload.
619
641
  * @param options Optional request config override.
620
- * @returns The updated message details exactly from the endpoint.
621
642
  */
622
- update: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
623
- return __generator(this, function (_a) {
624
- return [2 /*return*/, this.raw.channelsControllerUpdateMessage(channelId, messageId, data, options)];
643
+ update: function (slug, channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
644
+ var mergedConfig, res;
645
+ var _a, _b;
646
+ return __generator(this, function (_c) {
647
+ switch (_c.label) {
648
+ case 0:
649
+ mergedConfig = __assign(__assign({}, options), { data: data });
650
+ return [4 /*yield*/, this.raw.v3WorkspacesControllerUpdateChannelMessage(slug, channelId, messageId, mergedConfig)];
651
+ case 1:
652
+ res = (_c.sent());
653
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : res];
654
+ }
625
655
  });
626
656
  }); },
627
657
  /**
628
- * Permanently deletes a message in a channel.
658
+ * Permanently deletes a message in a channel via V3 API.
659
+ * @param slug The unique workspace slug.
629
660
  * @param channelId Unique identifier of the channel containing the message.
630
661
  * @param messageId Unique identifier of the message to delete.
631
662
  * @param options Optional request config override.
632
- * @returns Success status indicating that the message was deleted exactly from the endpoint.
633
663
  */
634
- delete: function (channelId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
635
- return __generator(this, function (_a) {
636
- return [2 /*return*/, this.raw.channelsControllerDeleteMessage(channelId, messageId, options)];
664
+ delete: function (slug, channelId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
665
+ var res;
666
+ var _a;
667
+ return __generator(this, function (_b) {
668
+ switch (_b.label) {
669
+ case 0: return [4 /*yield*/, this.raw.v3WorkspacesControllerDeleteChannelMessage(slug, channelId, messageId, options)];
670
+ case 1:
671
+ res = (_b.sent());
672
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
673
+ }
637
674
  });
638
675
  }); },
639
676
  /**
640
- * Adds a reaction (emoji) to a message in a channel.
677
+ * Adds a reaction (emoji) to a message in a channel via V3 API.
678
+ * @param slug The unique workspace slug.
641
679
  * @param channelId Unique identifier of the channel containing the message.
642
680
  * @param messageId Unique identifier of the message.
643
681
  * @param data Object containing the target emoji character.
644
682
  * @param options Optional request config override.
645
- * @returns The reaction response returned exactly from the endpoint.
646
683
  */
647
- addReaction: function (channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
648
- return __generator(this, function (_a) {
649
- return [2 /*return*/, this.raw.channelsControllerAddReaction(channelId, messageId, data, options)];
684
+ addReaction: function (slug, channelId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
685
+ var mergedConfig, res;
686
+ var _a, _b;
687
+ return __generator(this, function (_c) {
688
+ switch (_c.label) {
689
+ case 0:
690
+ mergedConfig = __assign(__assign({}, options), { data: data });
691
+ return [4 /*yield*/, this.raw.v3WorkspacesControllerAddChannelMessageReaction(slug, channelId, messageId, mergedConfig)];
692
+ case 1:
693
+ res = (_c.sent());
694
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.reaction) !== null && _b !== void 0 ? _b : res];
695
+ }
650
696
  });
651
697
  }); },
652
698
  /**
653
- * Removes a reaction (emoji) from a message in a channel.
699
+ * Removes a reaction (emoji) from a message in a channel via V3 API.
700
+ * @param slug The unique workspace slug.
654
701
  * @param channelId Unique identifier of the channel containing the message.
655
702
  * @param messageId Unique identifier of the message.
656
703
  * @param emoji The emoji character to remove.
657
704
  * @param options Optional request config override.
658
- * @returns The reaction removal response returned exactly from the endpoint.
659
705
  */
660
- removeReaction: function (channelId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
661
- return __generator(this, function (_a) {
662
- return [2 /*return*/, this.raw.channelsControllerRemoveReaction(channelId, messageId, emoji, options)];
706
+ removeReaction: function (slug, channelId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
707
+ var res;
708
+ var _a;
709
+ return __generator(this, function (_b) {
710
+ switch (_b.label) {
711
+ case 0: return [4 /*yield*/, this.raw.v3WorkspacesControllerRemoveChannelMessageReaction(slug, channelId, messageId, emoji, options)];
712
+ case 1:
713
+ res = (_b.sent());
714
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
715
+ }
663
716
  });
664
717
  }); },
665
718
  },
@@ -746,133 +799,198 @@ var ScrymeSDK = /** @class */ (function () {
746
799
  });
747
800
  Object.defineProperty(ScrymeSDK.prototype, "dm", {
748
801
  /**
749
- * Operations for managing direct messages (DMs) and direct message conversations.
802
+ * Operations for managing direct messages (DMs) and direct message conversations via V3 API.
750
803
  */
751
804
  get: function () {
752
805
  var _this = this;
753
806
  return {
754
807
  /**
755
- * Lists all active direct message conversations for the authenticated user.
808
+ * Lists all active direct message conversations for the authenticated user/bot via V3 API.
756
809
  * @param options Optional request config override.
757
- * @returns List of active DM conversations returned exactly from the endpoint.
758
810
  */
759
811
  list: function (options) { return __awaiter(_this, void 0, void 0, function () {
760
- return __generator(this, function (_a) {
761
- return [2 /*return*/, this.raw.dmsControllerGetDms(options)];
812
+ var res;
813
+ var _a, _b;
814
+ return __generator(this, function (_c) {
815
+ switch (_c.label) {
816
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerGetDms(options)];
817
+ case 1:
818
+ res = (_c.sent());
819
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.conversations) !== null && _b !== void 0 ? _b : res];
820
+ }
762
821
  });
763
822
  }); },
764
823
  /**
765
- * Creates/initiates a direct message conversation with specified users.
824
+ * Creates/initiates a direct message conversation via V3 API.
766
825
  * @param data Create direct message details containing target participant IDs.
767
826
  * @param options Optional request config override.
768
- * @returns Details of the created DM conversation exactly from the endpoint.
769
827
  */
770
828
  create: function (data, options) { return __awaiter(_this, void 0, void 0, function () {
771
- return __generator(this, function (_a) {
772
- return [2 /*return*/, this.raw.dmsControllerCreateDm(data, options)];
829
+ var res;
830
+ var _a, _b;
831
+ return __generator(this, function (_c) {
832
+ switch (_c.label) {
833
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerCreateDm(data, options)];
834
+ case 1:
835
+ res = (_c.sent());
836
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.conversation) !== null && _b !== void 0 ? _b : res];
837
+ }
773
838
  });
774
839
  }); },
775
840
  /**
776
- * Retrieves details of a specific direct message conversation.
841
+ * Retrieves details of a specific direct message conversation via V3 API.
777
842
  * @param dmId Unique identifier of the direct message conversation.
778
843
  * @param options Optional request config override.
779
- * @returns Detailed direct message conversation object exactly from the endpoint.
780
844
  */
781
845
  get: function (dmId, options) { return __awaiter(_this, void 0, void 0, function () {
782
- return __generator(this, function (_a) {
783
- return [2 /*return*/, this.raw.dmsControllerGetDm(dmId, options)];
846
+ var res;
847
+ var _a, _b;
848
+ return __generator(this, function (_c) {
849
+ switch (_c.label) {
850
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerGetDm(dmId, options)];
851
+ case 1:
852
+ res = (_c.sent());
853
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.conversation) !== null && _b !== void 0 ? _b : res];
854
+ }
784
855
  });
785
856
  }); },
786
857
  /**
787
- * Deletes/closes an active direct message conversation.
858
+ * Deletes/closes an active direct message conversation via V3 API.
788
859
  * @param dmId Unique identifier of the direct message conversation to close.
789
860
  * @param options Optional request config override.
790
- * @returns Success status indicating that the DM conversation was deleted exactly from the endpoint.
791
861
  */
792
862
  delete: function (dmId, options) { return __awaiter(_this, void 0, void 0, function () {
793
- return __generator(this, function (_a) {
794
- return [2 /*return*/, this.raw.dmsControllerDeleteDm(dmId, options)];
863
+ var res;
864
+ var _a;
865
+ return __generator(this, function (_b) {
866
+ switch (_b.label) {
867
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerDeleteDm(dmId, options)];
868
+ case 1:
869
+ res = (_b.sent());
870
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
871
+ }
795
872
  });
796
873
  }); },
797
874
  /**
798
- * Sub-namespace for managing direct messages in a specific DM conversation.
875
+ * Sub-namespace for managing direct messages in a specific DM conversation via V3 API.
799
876
  */
800
877
  message: {
801
878
  /**
802
- * Lists messages in a direct message conversation with cursor pagination.
879
+ * Lists messages in a direct message conversation with cursor pagination via V3 API.
803
880
  * @param dmId Unique identifier of the direct message conversation.
804
881
  * @param params Query parameters for pagination limits, cursors or search filters.
805
882
  * @param options Optional request config override.
806
- * @returns List of direct messages and next pagination cursor exactly from the endpoint.
807
883
  */
808
884
  list: function (dmId, params, options) { return __awaiter(_this, void 0, void 0, function () {
809
- return __generator(this, function (_a) {
810
- return [2 /*return*/, this.raw.dmsControllerGetMessages(dmId, params, options)];
885
+ var res;
886
+ var _a;
887
+ return __generator(this, function (_b) {
888
+ switch (_b.label) {
889
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerGetMessages(dmId, params, options)];
890
+ case 1:
891
+ res = (_b.sent());
892
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
893
+ }
811
894
  });
812
895
  }); },
813
896
  /**
814
- * Sends a new message in a direct message conversation.
897
+ * Sends a new message in a direct message conversation via V3 API.
815
898
  * @param dmId Unique identifier of the direct message conversation.
816
899
  * @param data The message content string or structured CreateMessageDto object.
817
900
  * @param options Optional request config override.
818
- * @returns The sent message exactly from the endpoint.
819
901
  */
820
902
  create: function (dmId, data, options) { return __awaiter(_this, void 0, void 0, function () {
821
- var payload;
822
- return __generator(this, function (_a) {
823
- payload = typeof data === 'string' ? { content: data } : data;
824
- return [2 /*return*/, this.raw.dmsControllerCreateMessage(dmId, __assign(__assign({}, options), { data: payload }))];
903
+ var payload, mergedConfig, res;
904
+ var _a, _b;
905
+ return __generator(this, function (_c) {
906
+ switch (_c.label) {
907
+ case 0:
908
+ payload = typeof data === 'string' ? { content: data } : data;
909
+ mergedConfig = __assign(__assign({}, options), { data: payload });
910
+ return [4 /*yield*/, this.raw.v3DmsControllerCreateMessage(dmId, mergedConfig)];
911
+ case 1:
912
+ res = (_c.sent());
913
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : res];
914
+ }
825
915
  });
826
916
  }); },
827
917
  /**
828
- * Updates the content of a previously sent direct message.
918
+ * Updates the content of a previously sent direct message via V3 API.
829
919
  * @param dmId Unique identifier of the direct message conversation.
830
920
  * @param messageId Unique identifier of the message to update.
831
921
  * @param data The new content payload.
832
922
  * @param options Optional request config override.
833
- * @returns The updated message details exactly from the endpoint.
834
923
  */
835
924
  update: function (dmId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
836
- return __generator(this, function (_a) {
837
- return [2 /*return*/, this.raw.dmsControllerUpdateMessage(dmId, messageId, data, options)];
925
+ var mergedConfig, res;
926
+ var _a, _b;
927
+ return __generator(this, function (_c) {
928
+ switch (_c.label) {
929
+ case 0:
930
+ mergedConfig = __assign(__assign({}, options), { data: data });
931
+ return [4 /*yield*/, this.raw.v3DmsControllerUpdateMessage(dmId, messageId, mergedConfig)];
932
+ case 1:
933
+ res = (_c.sent());
934
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : res];
935
+ }
838
936
  });
839
937
  }); },
840
938
  /**
841
- * Permanently deletes a direct message.
939
+ * Permanently deletes a direct message via V3 API.
842
940
  * @param dmId Unique identifier of the direct message conversation.
843
941
  * @param messageId Unique identifier of the message to delete.
844
942
  * @param options Optional request config override.
845
- * @returns Success status indicating that the message was deleted exactly from the endpoint.
846
943
  */
847
944
  delete: function (dmId, messageId, options) { return __awaiter(_this, void 0, void 0, function () {
848
- return __generator(this, function (_a) {
849
- return [2 /*return*/, this.raw.dmsControllerDeleteMessage(dmId, messageId, options)];
945
+ var res;
946
+ var _a;
947
+ return __generator(this, function (_b) {
948
+ switch (_b.label) {
949
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerDeleteMessage(dmId, messageId, options)];
950
+ case 1:
951
+ res = (_b.sent());
952
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
953
+ }
850
954
  });
851
955
  }); },
852
956
  /**
853
- * Adds a reaction (emoji) to a direct message.
957
+ * Adds a reaction (emoji) to a direct message via V3 API.
854
958
  * @param dmId Unique identifier of the direct message conversation.
855
959
  * @param messageId Unique identifier of the message.
856
960
  * @param data Object containing the target emoji character.
857
961
  * @param options Optional request config override.
858
- * @returns The reaction response returned exactly from the endpoint.
859
962
  */
860
963
  addReaction: function (dmId, messageId, data, options) { return __awaiter(_this, void 0, void 0, function () {
861
- return __generator(this, function (_a) {
862
- return [2 /*return*/, this.raw.dmsControllerAddReaction(dmId, messageId, data, options)];
964
+ var mergedConfig, res;
965
+ var _a, _b;
966
+ return __generator(this, function (_c) {
967
+ switch (_c.label) {
968
+ case 0:
969
+ mergedConfig = __assign(__assign({}, options), { data: data });
970
+ return [4 /*yield*/, this.raw.v3DmsControllerAddReaction(dmId, messageId, mergedConfig)];
971
+ case 1:
972
+ res = (_c.sent());
973
+ return [2 /*return*/, (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.reaction) !== null && _b !== void 0 ? _b : res];
974
+ }
863
975
  });
864
976
  }); },
865
977
  /**
866
- * Removes a reaction (emoji) from a direct message.
978
+ * Removes a reaction (emoji) from a direct message via V3 API.
867
979
  * @param dmId Unique identifier of the direct message conversation.
868
980
  * @param messageId Unique identifier of the message.
869
981
  * @param emoji The emoji character to remove.
870
982
  * @param options Optional request config override.
871
- * @returns The reaction removal response returned exactly from the endpoint.
872
983
  */
873
984
  removeReaction: function (dmId, messageId, emoji, options) { return __awaiter(_this, void 0, void 0, function () {
874
- return __generator(this, function (_a) {
875
- return [2 /*return*/, this.raw.dmsControllerRemoveReaction(dmId, messageId, emoji, options)];
985
+ var res;
986
+ var _a;
987
+ return __generator(this, function (_b) {
988
+ switch (_b.label) {
989
+ case 0: return [4 /*yield*/, this.raw.v3DmsControllerRemoveReaction(dmId, messageId, emoji, options)];
990
+ case 1:
991
+ res = (_b.sent());
992
+ return [2 /*return*/, (_a = res === null || res === void 0 ? void 0 : res.data) !== null && _a !== void 0 ? _a : res];
993
+ }
876
994
  });
877
995
  }); },
878
996
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scryme/chat",
3
- "version": "2.91.29",
3
+ "version": "2.91.61",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,7 +48,35 @@ vi.mock('../generated/v3-server', () => {
48
48
  return { success: true, type: 'channel', action: 'removeReaction', channelId, messageId, emoji, options };
49
49
  }),
50
50
 
51
- // DMs Mock
51
+ // V3 Channels Controller Messages Mock
52
+ v3WorkspacesControllerGetChannelMessages: vi.fn(async (slug, channelId, params, options) => {
53
+ return { success: true, data: { messages: [] }, slug, channelId, params, options };
54
+ }),
55
+ v3WorkspacesControllerCreateChannelMessage: vi.fn(async (slug, channelId, options) => {
56
+ return { success: true, data: { message: { content: options?.data?.content } }, slug, channelId, options };
57
+ }),
58
+
59
+ // V3 DMs Mock
60
+ v3DmsControllerGetDms: vi.fn(async (options) => {
61
+ return { success: true, data: { conversations: [] }, options };
62
+ }),
63
+ v3DmsControllerCreateDm: vi.fn(async (data, options) => {
64
+ return { success: true, data: { conversation: { data } }, options };
65
+ }),
66
+ v3DmsControllerGetDm: vi.fn(async (dmId, options) => {
67
+ return { success: true, data: { conversation: { id: dmId } }, options };
68
+ }),
69
+ v3DmsControllerDeleteDm: vi.fn(async (dmId, options) => {
70
+ return { success: true, data: { success: true }, dmId, options };
71
+ }),
72
+ v3DmsControllerGetMessages: vi.fn(async (dmId, params, options) => {
73
+ return { success: true, data: { messages: [] }, dmId, params, options };
74
+ }),
75
+ v3DmsControllerCreateMessage: vi.fn(async (dmId, options) => {
76
+ return { success: true, data: { message: { content: options?.data?.content } }, dmId, options };
77
+ }),
78
+
79
+ // Legacy DMs Mock
52
80
  dmsControllerGetDms: vi.fn(async (options) => {
53
81
  return { success: true, conversations: [], options };
54
82
  }),
@@ -423,18 +451,16 @@ describe('ScrymeSDK', () => {
423
451
  token: 'active-token',
424
452
  });
425
453
 
426
- const messagesRes = await sdk.channel.message.list('chan_123', { limit: 10 }) as any;
427
- expect(messagesRes.channelId).toBe('chan_123');
428
- expect(messagesRes.params.limit).toBe(10);
454
+ const messagesRes = await sdk.channel.message.list('acme-corp', 'chan_123', { limit: '10' }) as any;
455
+ expect(messagesRes.messages).toBeDefined();
429
456
 
430
457
  // Channel message create (with string)
431
- const createMsgStrRes = await sdk.channel.message.create('chan_123', 'Hello') as any;
432
- expect(createMsgStrRes.channelId).toBe('chan_123');
433
- expect(createMsgStrRes.options.data.content).toBe('Hello');
458
+ const createMsgStrRes = await sdk.channel.message.create('acme-corp', 'chan_123', 'Hello') as any;
459
+ expect(createMsgStrRes.content).toBe('Hello');
434
460
 
435
461
  // Channel message create (with object)
436
- const createMsgObjRes = await sdk.channel.message.create('chan_123', { content: 'Hello World' }) as any;
437
- expect(createMsgObjRes.options.data.content).toBe('Hello World');
462
+ const createMsgObjRes = await sdk.channel.message.create('acme-corp', 'chan_123', { content: 'Hello World' }) as any;
463
+ expect(createMsgObjRes.content).toBe('Hello World');
438
464
  });
439
465
 
440
466
  it('should support dm.message namespaces', async () => {
@@ -445,25 +471,23 @@ describe('ScrymeSDK', () => {
445
471
 
446
472
  // DM list
447
473
  const listDmsRes = await sdk.dm.list() as any;
448
- expect(listDmsRes.conversations).toBeDefined();
474
+ expect(listDmsRes).toBeDefined();
449
475
 
450
476
  // DM create
451
477
  const createDmRes = await sdk.dm.create({ userId: 'user_123' }) as any;
452
- expect(createDmRes.data.userId).toBe('user_123');
478
+ expect(createDmRes).toBeDefined();
453
479
 
454
480
  // DM message list
455
- const messagesRes = await sdk.dm.message.list('dm_123', { limit: 5 }) as any;
456
- expect(messagesRes.dmId).toBe('dm_123');
457
- expect(messagesRes.params.limit).toBe(5);
481
+ const messagesRes = await sdk.dm.message.list('dm_123', { limit: '5' }) as any;
482
+ expect(messagesRes.messages).toBeDefined();
458
483
 
459
484
  // DM message create (with string)
460
485
  const createMsgStrRes = await sdk.dm.message.create('dm_123', 'Hello DM') as any;
461
- expect(createMsgStrRes.dmId).toBe('dm_123');
462
- expect(createMsgStrRes.options.data.content).toBe('Hello DM');
486
+ expect(createMsgStrRes.content).toBe('Hello DM');
463
487
 
464
488
  // DM message create (with object)
465
489
  const createMsgObjRes = await sdk.dm.message.create('dm_123', { content: 'Hello DM Object' }) as any;
466
- expect(createMsgObjRes.options.data.content).toBe('Hello DM Object');
490
+ expect(createMsgObjRes.content).toBe('Hello DM Object');
467
491
  });
468
492
 
469
493
  it('should route message update/delete/reaction dynamically based on "dm-" prefix', async () => {