@scryme/chat 0.0.1 → 2.13.3

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.
@@ -1,4 +1,6 @@
1
1
  import { AxiosRequestConfig, AxiosError } from 'axios';
2
+ export declare const setGlobalToken: (token: string | null) => void;
3
+ export declare const getGlobalToken: () => string | null;
2
4
  export declare const AXIOS_INSTANCE: import("axios").AxiosInstance;
3
5
  export declare const customInstance: <T>(config: AxiosRequestConfig, options?: AxiosRequestConfig) => Promise<T>;
4
6
  export type ErrorType<Error> = AxiosError<Error>;
@@ -37,12 +37,30 @@ var getBaseURL = function () {
37
37
  }
38
38
  return url.replace(/\/$/, '') + '/api';
39
39
  };
40
+ var globalToken = null;
41
+ export var setGlobalToken = function (token) {
42
+ globalToken = token;
43
+ };
44
+ export var getGlobalToken = function () { return globalToken; };
40
45
  export var AXIOS_INSTANCE = axios.create({
41
46
  baseURL: getBaseURL(),
42
47
  timeout: 10000,
43
48
  withCredentials: true,
44
49
  });
45
50
  AXIOS_INSTANCE.interceptors.request.use(function (config) {
51
+ if (!config.headers) {
52
+ config.headers = {};
53
+ }
54
+ // Check if an Authorization header is already present (case-insensitive)
55
+ var hasAuth = config.headers.Authorization ||
56
+ config.headers.authorization ||
57
+ config.headers['Authorization'] ||
58
+ config.headers['authorization'];
59
+ // 1. Apply global token if available and no Auth header is set yet
60
+ if (globalToken && !hasAuth) {
61
+ config.headers.Authorization = "Bearer ".concat(globalToken);
62
+ }
63
+ // 2. Check for browser-based session/bearer tokens
46
64
  if (typeof window !== 'undefined') {
47
65
  var getCookie = function (name) {
48
66
  var _a;
@@ -78,7 +96,12 @@ AXIOS_INSTANCE.interceptors.request.use(function (config) {
78
96
  window.localStorage.setItem('better-auth.session-token', token);
79
97
  }
80
98
  }
81
- if (token) {
99
+ // Re-check for Authorization header before applying browser token
100
+ var hasAuthNow = config.headers.Authorization ||
101
+ config.headers.authorization ||
102
+ config.headers['Authorization'] ||
103
+ config.headers['authorization'];
104
+ if (token && !hasAuthNow) {
82
105
  config.headers.Authorization = "Bearer ".concat(token);
83
106
  }
84
107
  }
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, ChannelsControllerGetMessagesParams, ChannelsControllerUpdateMessageBody, ChannelsControllerAddReactionBody, CreateDmDto, UsersControllerSearchUsersParams, V3WorkspacesControllerGetWorkspaces200, V3WorkspacesControllerGetWorkspaceBySlug200, V3WorkspacesControllerProvisionWorkspace201, V3WorkspacesControllerUpdateWorkspace200, V3WorkspacesControllerDeleteWorkspace200, DmsControllerGetMessagesParams } from './generated/v3-server';
3
+ import type { V3ProvisionWorkspaceDto, V3UpdateWorkspaceDto, V3AddMemberDto, V3UpdateMemberRoleDto, CreateWorkspaceChannelDto, UpdateWorkspaceChannelDto, ChannelsControllerGetMessagesParams, ChannelsControllerUpdateMessageBody, ChannelsControllerAddReactionBody, CreateDmDto, UsersControllerSearchUsersParams, DmsControllerGetMessagesParams, V3WorkspacesControllerGetWorkspacesResult, V3WorkspacesControllerGetWorkspaceBySlugResult, V3WorkspacesControllerProvisionWorkspaceResult, V3WorkspacesControllerUpdateWorkspaceResult, V3WorkspacesControllerDeleteWorkspaceResult, V3WorkspacesControllerGetWorkspaceMembersResult, V3WorkspacesControllerAddWorkspaceMemberResult, V3WorkspacesControllerGetWorkspaceMemberResult, V3WorkspacesControllerUpdateWorkspaceMemberResult, V3WorkspacesControllerDeleteWorkspaceMemberResult, ChannelsControllerGetWorkspaceChannelsResult, ChannelsControllerCreateChannelResult, ChannelsControllerGetChannelResult, ChannelsControllerUpdateChannelResult, ChannelsControllerDeleteChannelResult, ChannelsControllerGetMessagesResult, ChannelsControllerCreateMessageResult, ChannelsControllerUpdateMessageResult, ChannelsControllerDeleteMessageResult, ChannelsControllerAddReactionResult, ChannelsControllerRemoveReactionResult, DmsControllerGetDmsResult, DmsControllerCreateDmResult, DmsControllerGetDmResult, DmsControllerDeleteDmResult, DmsControllerGetMessagesResult, DmsControllerCreateMessageResult, UsersControllerGetMeResult, UsersControllerGetUserResult, UsersControllerSearchUsersResult } from './generated/v3-server';
4
4
  export interface ScrymeSDKOptions {
5
5
  baseURL?: string;
6
6
  clientId?: string;
@@ -13,6 +13,7 @@ export declare class ScrymeSDK {
13
13
  baseURL: string;
14
14
  private clientId?;
15
15
  private clientSecret?;
16
+ private syncToken;
16
17
  constructor(options?: ScrymeSDKOptions);
17
18
  /**
18
19
  * Automatically retrieves or refreshes the M2M OAuth2 Token using client_credentials
@@ -28,51 +29,51 @@ export declare class ScrymeSDK {
28
29
  */
29
30
  get raw(): ReturnType<typeof getSkyrmeChatAPI>;
30
31
  get workspace(): {
31
- list: (options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspaces200>;
32
- get: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspaceBySlug200>;
33
- create: (data: V3ProvisionWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerProvisionWorkspace201>;
34
- update: (slug: string, data: V3UpdateWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerUpdateWorkspace200>;
35
- delete: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerDeleteWorkspace200>;
32
+ list: (options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspacesResult>;
33
+ get: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspaceBySlugResult>;
34
+ create: (data: V3ProvisionWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerProvisionWorkspaceResult>;
35
+ update: (slug: string, data: V3UpdateWorkspaceDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerUpdateWorkspaceResult>;
36
+ delete: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerDeleteWorkspaceResult>;
36
37
  members: {
37
- list: (slug: string, options?: AxiosRequestConfig) => Promise<any>;
38
- add: (slug: string, data: V3AddMemberDto, options?: AxiosRequestConfig) => Promise<any>;
39
- get: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<any>;
40
- update: (slug: string, memberId: string, data: V3UpdateMemberRoleDto, options?: AxiosRequestConfig) => Promise<any>;
41
- delete: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<any>;
38
+ list: (slug: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspaceMembersResult>;
39
+ add: (slug: string, data: V3AddMemberDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerAddWorkspaceMemberResult>;
40
+ get: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerGetWorkspaceMemberResult>;
41
+ update: (slug: string, memberId: string, data: V3UpdateMemberRoleDto, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerUpdateWorkspaceMemberResult>;
42
+ delete: (slug: string, memberId: string, options?: AxiosRequestConfig) => Promise<V3WorkspacesControllerDeleteWorkspaceMemberResult>;
42
43
  };
43
44
  channels: {
44
- list: (slug: string, options?: AxiosRequestConfig) => Promise<any>;
45
- create: (slug: string, data: CreateWorkspaceChannelDto, options?: AxiosRequestConfig) => Promise<any>;
45
+ list: (slug: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerGetWorkspaceChannelsResult>;
46
+ create: (slug: string, data: CreateWorkspaceChannelDto, options?: AxiosRequestConfig) => Promise<ChannelsControllerCreateChannelResult>;
46
47
  };
47
48
  };
48
49
  get channel(): {
49
- get: (slug: string, channelId: string, options?: AxiosRequestConfig) => Promise<any>;
50
- update: (slug: string, channelId: string, data: UpdateWorkspaceChannelDto, options?: AxiosRequestConfig) => Promise<any>;
51
- delete: (slug: string, channelId: string, options?: AxiosRequestConfig) => Promise<any>;
50
+ get: (slug: string, channelId: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerGetChannelResult>;
51
+ update: (slug: string, channelId: string, data: UpdateWorkspaceChannelDto, options?: AxiosRequestConfig) => Promise<ChannelsControllerUpdateChannelResult>;
52
+ delete: (slug: string, channelId: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerDeleteChannelResult>;
52
53
  message: {
53
- list: (channelId: string, params?: ChannelsControllerGetMessagesParams, options?: AxiosRequestConfig) => Promise<any>;
54
- create: (channelId: string, options?: AxiosRequestConfig) => Promise<any>;
54
+ list: (channelId: string, params?: ChannelsControllerGetMessagesParams, options?: AxiosRequestConfig) => Promise<ChannelsControllerGetMessagesResult>;
55
+ create: (channelId: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerCreateMessageResult>;
55
56
  };
56
57
  };
57
58
  get message(): {
58
- update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<any>;
59
- delete: (channelId: string, messageId: string, options?: AxiosRequestConfig) => Promise<any>;
60
- addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<any>;
61
- removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<any>;
59
+ update: (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig) => Promise<ChannelsControllerUpdateMessageResult>;
60
+ delete: (channelId: string, messageId: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerDeleteMessageResult>;
61
+ addReaction: (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig) => Promise<ChannelsControllerAddReactionResult>;
62
+ removeReaction: (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig) => Promise<ChannelsControllerRemoveReactionResult>;
62
63
  };
63
64
  get dm(): {
64
- list: (options?: AxiosRequestConfig) => Promise<any>;
65
- create: (data: CreateDmDto, options?: AxiosRequestConfig) => Promise<any>;
66
- get: (dmId: string, options?: AxiosRequestConfig) => Promise<any>;
67
- delete: (dmId: string, options?: AxiosRequestConfig) => Promise<any>;
65
+ list: (options?: AxiosRequestConfig) => Promise<DmsControllerGetDmsResult>;
66
+ create: (data: CreateDmDto, options?: AxiosRequestConfig) => Promise<DmsControllerCreateDmResult>;
67
+ get: (dmId: string, options?: AxiosRequestConfig) => Promise<DmsControllerGetDmResult>;
68
+ delete: (dmId: string, options?: AxiosRequestConfig) => Promise<DmsControllerDeleteDmResult>;
68
69
  message: {
69
- list: (dmId: string, params?: DmsControllerGetMessagesParams, options?: AxiosRequestConfig) => Promise<any>;
70
- create: (dmId: string, options?: AxiosRequestConfig) => Promise<any>;
70
+ list: (dmId: string, params?: DmsControllerGetMessagesParams, options?: AxiosRequestConfig) => Promise<DmsControllerGetMessagesResult>;
71
+ create: (dmId: string, options?: AxiosRequestConfig) => Promise<DmsControllerCreateMessageResult>;
71
72
  };
72
73
  };
73
74
  get user(): {
74
- me: (options?: AxiosRequestConfig) => Promise<any>;
75
- get: (userId: string, options?: AxiosRequestConfig) => Promise<any>;
76
- search: (params: UsersControllerSearchUsersParams, options?: AxiosRequestConfig) => Promise<any>;
75
+ me: (options?: AxiosRequestConfig) => Promise<UsersControllerGetMeResult>;
76
+ get: (userId: string, options?: AxiosRequestConfig) => Promise<UsersControllerGetUserResult>;
77
+ search: (params: UsersControllerSearchUsersParams, options?: AxiosRequestConfig) => Promise<UsersControllerSearchUsersResult>;
77
78
  };
78
79
  }
package/dist/sdk.js CHANGED
@@ -55,6 +55,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
55
55
  return to.concat(ar || Array.prototype.slice.call(from));
56
56
  };
57
57
  import axios from 'axios';
58
+ import { setGlobalToken } from './custom-instance';
58
59
  import { getSkyrmeChatAPI } from './generated/v3-server';
59
60
  var ScrymeSDK = /** @class */ (function () {
60
61
  function ScrymeSDK(options) {
@@ -65,6 +66,9 @@ var ScrymeSDK = /** @class */ (function () {
65
66
  this.clientId = options.clientId;
66
67
  this.clientSecret = options.clientSecret;
67
68
  this.token = options.token || null;
69
+ if (this.token) {
70
+ this.syncToken(this.token);
71
+ }
68
72
  var url = options.baseURL || '';
69
73
  if (!url && typeof window !== 'undefined') {
70
74
  url = window.localStorage.getItem('CUSTOM_API_URL') || '';
@@ -82,6 +86,16 @@ var ScrymeSDK = /** @class */ (function () {
82
86
  }
83
87
  this.baseURL = url.replace(/\/$/, '');
84
88
  }
89
+ ScrymeSDK.prototype.syncToken = function (token) {
90
+ if (!token)
91
+ return;
92
+ setGlobalToken(token);
93
+ if (typeof window !== 'undefined') {
94
+ window.localStorage.setItem('bearer_token', token);
95
+ window.localStorage.setItem('better-auth.session-token', token);
96
+ window.localStorage.setItem('better-auth.session_token', token);
97
+ }
98
+ };
85
99
  /**
86
100
  * Automatically retrieves or refreshes the M2M OAuth2 Token using client_credentials
87
101
  */
@@ -111,6 +125,7 @@ var ScrymeSDK = /** @class */ (function () {
111
125
  response = _e.sent();
112
126
  if (((_a = response.data) === null || _a === void 0 ? void 0 : _a.success) && ((_c = (_b = response.data) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.access_token)) {
113
127
  this.token = response.data.data.access_token;
128
+ this.syncToken(this.token);
114
129
  if (response.data.data.expires_in) {
115
130
  // Expire 10 seconds early as a safety buffer
116
131
  this.tokenExpiresAt = Date.now() + (response.data.data.expires_in - 10) * 1000;
@@ -123,6 +138,7 @@ var ScrymeSDK = /** @class */ (function () {
123
138
  else if ((_d = response.data) === null || _d === void 0 ? void 0 : _d.access_token) {
124
139
  // Fallback in case response is not wrapped
125
140
  this.token = response.data.access_token;
141
+ this.syncToken(this.token);
126
142
  if (response.data.expires_in) {
127
143
  this.tokenExpiresAt = Date.now() + (response.data.expires_in - 10) * 1000;
128
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scryme/chat",
3
- "version": "0.0.1",
3
+ "version": "2.13.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -37,6 +37,14 @@ const getBaseURL = () => {
37
37
  return url.replace(/\/$/, '') + '/api';
38
38
  };
39
39
 
40
+ let globalToken: string | null = null;
41
+
42
+ export const setGlobalToken = (token: string | null) => {
43
+ globalToken = token;
44
+ };
45
+
46
+ export const getGlobalToken = () => globalToken;
47
+
40
48
  export const AXIOS_INSTANCE = axios.create({
41
49
  baseURL: getBaseURL(),
42
50
  timeout: 10000,
@@ -44,6 +52,23 @@ export const AXIOS_INSTANCE = axios.create({
44
52
  });
45
53
 
46
54
  AXIOS_INSTANCE.interceptors.request.use(config => {
55
+ if (!config.headers) {
56
+ config.headers = {} as any;
57
+ }
58
+
59
+ // Check if an Authorization header is already present (case-insensitive)
60
+ const hasAuth =
61
+ config.headers.Authorization ||
62
+ config.headers.authorization ||
63
+ (config.headers as any)['Authorization'] ||
64
+ (config.headers as any)['authorization'];
65
+
66
+ // 1. Apply global token if available and no Auth header is set yet
67
+ if (globalToken && !hasAuth) {
68
+ config.headers.Authorization = `Bearer ${globalToken}`;
69
+ }
70
+
71
+ // 2. Check for browser-based session/bearer tokens
47
72
  if (typeof window !== 'undefined') {
48
73
  const getCookie = (name: string) => {
49
74
  const value = `; ${document.cookie}`;
@@ -80,7 +105,14 @@ AXIOS_INSTANCE.interceptors.request.use(config => {
80
105
  }
81
106
  }
82
107
 
83
- if (token) {
108
+ // Re-check for Authorization header before applying browser token
109
+ const hasAuthNow =
110
+ config.headers.Authorization ||
111
+ config.headers.authorization ||
112
+ (config.headers as any)['Authorization'] ||
113
+ (config.headers as any)['authorization'];
114
+
115
+ if (token && !hasAuthNow) {
84
116
  config.headers.Authorization = `Bearer ${token}`;
85
117
  }
86
118
  }
package/src/sdk.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import axios, { AxiosRequestConfig } from 'axios';
2
+ import { setGlobalToken } from './custom-instance';
2
3
  import { getSkyrmeChatAPI } from './generated/v3-server';
3
4
  import type {
4
5
  V3ProvisionWorkspaceDto,
@@ -14,12 +15,37 @@ import type {
14
15
  UpdateDmMessageDto,
15
16
  MarkAsReadDto,
16
17
  UsersControllerSearchUsersParams,
17
- V3WorkspacesControllerGetWorkspaces200,
18
- V3WorkspacesControllerGetWorkspaceBySlug200,
19
- V3WorkspacesControllerProvisionWorkspace201,
20
- V3WorkspacesControllerUpdateWorkspace200,
21
- V3WorkspacesControllerDeleteWorkspace200,
22
18
  DmsControllerGetMessagesParams,
19
+ V3WorkspacesControllerGetWorkspacesResult,
20
+ V3WorkspacesControllerGetWorkspaceBySlugResult,
21
+ V3WorkspacesControllerProvisionWorkspaceResult,
22
+ V3WorkspacesControllerUpdateWorkspaceResult,
23
+ V3WorkspacesControllerDeleteWorkspaceResult,
24
+ V3WorkspacesControllerGetWorkspaceMembersResult,
25
+ V3WorkspacesControllerAddWorkspaceMemberResult,
26
+ V3WorkspacesControllerGetWorkspaceMemberResult,
27
+ V3WorkspacesControllerUpdateWorkspaceMemberResult,
28
+ V3WorkspacesControllerDeleteWorkspaceMemberResult,
29
+ ChannelsControllerGetWorkspaceChannelsResult,
30
+ ChannelsControllerCreateChannelResult,
31
+ ChannelsControllerGetChannelResult,
32
+ ChannelsControllerUpdateChannelResult,
33
+ ChannelsControllerDeleteChannelResult,
34
+ ChannelsControllerGetMessagesResult,
35
+ ChannelsControllerCreateMessageResult,
36
+ ChannelsControllerUpdateMessageResult,
37
+ ChannelsControllerDeleteMessageResult,
38
+ ChannelsControllerAddReactionResult,
39
+ ChannelsControllerRemoveReactionResult,
40
+ DmsControllerGetDmsResult,
41
+ DmsControllerCreateDmResult,
42
+ DmsControllerGetDmResult,
43
+ DmsControllerDeleteDmResult,
44
+ DmsControllerGetMessagesResult,
45
+ DmsControllerCreateMessageResult,
46
+ UsersControllerGetMeResult,
47
+ UsersControllerGetUserResult,
48
+ UsersControllerSearchUsersResult,
23
49
  } from './generated/v3-server';
24
50
 
25
51
  export interface ScrymeSDKOptions {
@@ -36,11 +62,25 @@ export class ScrymeSDK {
36
62
  private clientId?: string;
37
63
  private clientSecret?: string;
38
64
 
65
+ private syncToken(token: string | null) {
66
+ if (!token) return;
67
+ setGlobalToken(token);
68
+ if (typeof window !== 'undefined') {
69
+ window.localStorage.setItem('bearer_token', token);
70
+ window.localStorage.setItem('better-auth.session-token', token);
71
+ window.localStorage.setItem('better-auth.session_token', token);
72
+ }
73
+ }
74
+
39
75
  constructor(options: ScrymeSDKOptions = {}) {
40
76
  this.clientId = options.clientId;
41
77
  this.clientSecret = options.clientSecret;
42
78
  this.token = options.token || null;
43
79
 
80
+ if (this.token) {
81
+ this.syncToken(this.token);
82
+ }
83
+
44
84
  let url = options.baseURL || '';
45
85
  if (!url && typeof window !== 'undefined') {
46
86
  url = window.localStorage.getItem('CUSTOM_API_URL') || '';
@@ -89,6 +129,7 @@ export class ScrymeSDK {
89
129
 
90
130
  if (response.data?.success && response.data?.data?.access_token) {
91
131
  this.token = response.data.data.access_token;
132
+ this.syncToken(this.token);
92
133
  if (response.data.data.expires_in) {
93
134
  // Expire 10 seconds early as a safety buffer
94
135
  this.tokenExpiresAt = Date.now() + (response.data.data.expires_in - 10) * 1000;
@@ -99,6 +140,7 @@ export class ScrymeSDK {
99
140
  } else if (response.data?.access_token) {
100
141
  // Fallback in case response is not wrapped
101
142
  this.token = response.data.access_token;
143
+ this.syncToken(this.token);
102
144
  if (response.data.expires_in) {
103
145
  this.tokenExpiresAt = Date.now() + (response.data.expires_in - 10) * 1000;
104
146
  } else {
@@ -175,44 +217,44 @@ export class ScrymeSDK {
175
217
 
176
218
  public get workspace() {
177
219
  return {
178
- list: async (options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspaces200> => {
179
- return this.raw.v3WorkspacesControllerGetWorkspaces(options);
220
+ list: async (options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspacesResult> => {
221
+ return this.raw.v3WorkspacesControllerGetWorkspaces(options) as any;
180
222
  },
181
- get: async (slug: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspaceBySlug200> => {
182
- return this.raw.v3WorkspacesControllerGetWorkspaceBySlug(slug, options);
223
+ get: async (slug: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspaceBySlugResult> => {
224
+ return this.raw.v3WorkspacesControllerGetWorkspaceBySlug(slug, options) as any;
183
225
  },
184
- create: async (data: V3ProvisionWorkspaceDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerProvisionWorkspace201> => {
185
- return this.raw.v3WorkspacesControllerProvisionWorkspace(data, options);
226
+ create: async (data: V3ProvisionWorkspaceDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerProvisionWorkspaceResult> => {
227
+ return this.raw.v3WorkspacesControllerProvisionWorkspace(data, options) as any;
186
228
  },
187
- update: async (slug: string, data: V3UpdateWorkspaceDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerUpdateWorkspace200> => {
188
- return this.raw.v3WorkspacesControllerUpdateWorkspace(slug, data, options);
229
+ update: async (slug: string, data: V3UpdateWorkspaceDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerUpdateWorkspaceResult> => {
230
+ return this.raw.v3WorkspacesControllerUpdateWorkspace(slug, data, options) as any;
189
231
  },
190
- delete: async (slug: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerDeleteWorkspace200> => {
191
- return this.raw.v3WorkspacesControllerDeleteWorkspace(slug, options);
232
+ delete: async (slug: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerDeleteWorkspaceResult> => {
233
+ return this.raw.v3WorkspacesControllerDeleteWorkspace(slug, options) as any;
192
234
  },
193
235
  members: {
194
- list: async (slug: string, options?: AxiosRequestConfig): Promise<any> => {
195
- return this.raw.v3WorkspacesControllerGetWorkspaceMembers(slug, options);
236
+ list: async (slug: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspaceMembersResult> => {
237
+ return this.raw.v3WorkspacesControllerGetWorkspaceMembers(slug, options) as any;
196
238
  },
197
- add: async (slug: string, data: V3AddMemberDto, options?: AxiosRequestConfig): Promise<any> => {
198
- return this.raw.v3WorkspacesControllerAddWorkspaceMember(slug, data, options);
239
+ add: async (slug: string, data: V3AddMemberDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerAddWorkspaceMemberResult> => {
240
+ return this.raw.v3WorkspacesControllerAddWorkspaceMember(slug, data, options) as any;
199
241
  },
200
- get: async (slug: string, memberId: string, options?: AxiosRequestConfig): Promise<any> => {
201
- return this.raw.v3WorkspacesControllerGetWorkspaceMember(slug, memberId, options);
242
+ get: async (slug: string, memberId: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerGetWorkspaceMemberResult> => {
243
+ return this.raw.v3WorkspacesControllerGetWorkspaceMember(slug, memberId, options) as any;
202
244
  },
203
- update: async (slug: string, memberId: string, data: V3UpdateMemberRoleDto, options?: AxiosRequestConfig): Promise<any> => {
204
- return this.raw.v3WorkspacesControllerUpdateWorkspaceMember(slug, memberId, data, options);
245
+ update: async (slug: string, memberId: string, data: V3UpdateMemberRoleDto, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerUpdateWorkspaceMemberResult> => {
246
+ return this.raw.v3WorkspacesControllerUpdateWorkspaceMember(slug, memberId, data, options) as any;
205
247
  },
206
- delete: async (slug: string, memberId: string, options?: AxiosRequestConfig): Promise<any> => {
207
- return this.raw.v3WorkspacesControllerDeleteWorkspaceMember(slug, memberId, options);
248
+ delete: async (slug: string, memberId: string, options?: AxiosRequestConfig): Promise<V3WorkspacesControllerDeleteWorkspaceMemberResult> => {
249
+ return this.raw.v3WorkspacesControllerDeleteWorkspaceMember(slug, memberId, options) as any;
208
250
  },
209
251
  },
210
252
  channels: {
211
- list: async (slug: string, options?: AxiosRequestConfig): Promise<any> => {
212
- return this.raw.channelsControllerGetWorkspaceChannels(slug, options);
253
+ list: async (slug: string, options?: AxiosRequestConfig): Promise<ChannelsControllerGetWorkspaceChannelsResult> => {
254
+ return this.raw.channelsControllerGetWorkspaceChannels(slug, options) as any;
213
255
  },
214
- create: async (slug: string, data: CreateWorkspaceChannelDto, options?: AxiosRequestConfig): Promise<any> => {
215
- return this.raw.channelsControllerCreateChannel(slug, data, options);
256
+ create: async (slug: string, data: CreateWorkspaceChannelDto, options?: AxiosRequestConfig): Promise<ChannelsControllerCreateChannelResult> => {
257
+ return this.raw.channelsControllerCreateChannel(slug, data, options) as any;
216
258
  },
217
259
  },
218
260
  };
@@ -220,21 +262,21 @@ export class ScrymeSDK {
220
262
 
221
263
  public get channel() {
222
264
  return {
223
- get: async (slug: string, channelId: string, options?: AxiosRequestConfig): Promise<any> => {
224
- return this.raw.channelsControllerGetChannel(slug, channelId, options);
265
+ get: async (slug: string, channelId: string, options?: AxiosRequestConfig): Promise<ChannelsControllerGetChannelResult> => {
266
+ return this.raw.channelsControllerGetChannel(slug, channelId, options) as any;
225
267
  },
226
- update: async (slug: string, channelId: string, data: UpdateWorkspaceChannelDto, options?: AxiosRequestConfig): Promise<any> => {
227
- return this.raw.channelsControllerUpdateChannel(slug, channelId, data, options);
268
+ update: async (slug: string, channelId: string, data: UpdateWorkspaceChannelDto, options?: AxiosRequestConfig): Promise<ChannelsControllerUpdateChannelResult> => {
269
+ return this.raw.channelsControllerUpdateChannel(slug, channelId, data, options) as any;
228
270
  },
229
- delete: async (slug: string, channelId: string, options?: AxiosRequestConfig): Promise<any> => {
230
- return this.raw.channelsControllerDeleteChannel(slug, channelId, options);
271
+ delete: async (slug: string, channelId: string, options?: AxiosRequestConfig): Promise<ChannelsControllerDeleteChannelResult> => {
272
+ return this.raw.channelsControllerDeleteChannel(slug, channelId, options) as any;
231
273
  },
232
274
  message: {
233
- list: async (channelId: string, params?: ChannelsControllerGetMessagesParams, options?: AxiosRequestConfig): Promise<any> => {
234
- return this.raw.channelsControllerGetMessages(channelId, params, options);
275
+ list: async (channelId: string, params?: ChannelsControllerGetMessagesParams, options?: AxiosRequestConfig): Promise<ChannelsControllerGetMessagesResult> => {
276
+ return this.raw.channelsControllerGetMessages(channelId, params, options) as any;
235
277
  },
236
- create: async (channelId: string, options?: AxiosRequestConfig): Promise<any> => {
237
- return this.raw.channelsControllerCreateMessage(channelId, options);
278
+ create: async (channelId: string, options?: AxiosRequestConfig): Promise<ChannelsControllerCreateMessageResult> => {
279
+ return this.raw.channelsControllerCreateMessage(channelId, options) as any;
238
280
  },
239
281
  },
240
282
  };
@@ -242,41 +284,41 @@ export class ScrymeSDK {
242
284
 
243
285
  public get message() {
244
286
  return {
245
- update: async (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig): Promise<any> => {
246
- return this.raw.channelsControllerUpdateMessage(channelId, messageId, data, options);
287
+ update: async (channelId: string, messageId: string, data: ChannelsControllerUpdateMessageBody, options?: AxiosRequestConfig): Promise<ChannelsControllerUpdateMessageResult> => {
288
+ return this.raw.channelsControllerUpdateMessage(channelId, messageId, data, options) as any;
247
289
  },
248
- delete: async (channelId: string, messageId: string, options?: AxiosRequestConfig): Promise<any> => {
249
- return this.raw.channelsControllerDeleteMessage(channelId, messageId, options);
290
+ delete: async (channelId: string, messageId: string, options?: AxiosRequestConfig): Promise<ChannelsControllerDeleteMessageResult> => {
291
+ return this.raw.channelsControllerDeleteMessage(channelId, messageId, options) as any;
250
292
  },
251
- addReaction: async (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig): Promise<any> => {
252
- return this.raw.channelsControllerAddReaction(channelId, messageId, data, options);
293
+ addReaction: async (channelId: string, messageId: string, data: ChannelsControllerAddReactionBody, options?: AxiosRequestConfig): Promise<ChannelsControllerAddReactionResult> => {
294
+ return this.raw.channelsControllerAddReaction(channelId, messageId, data, options) as any;
253
295
  },
254
- removeReaction: async (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig): Promise<any> => {
255
- return this.raw.channelsControllerRemoveReaction(channelId, messageId, emoji, options);
296
+ removeReaction: async (channelId: string, messageId: string, emoji: string, options?: AxiosRequestConfig): Promise<ChannelsControllerRemoveReactionResult> => {
297
+ return this.raw.channelsControllerRemoveReaction(channelId, messageId, emoji, options) as any;
256
298
  },
257
299
  };
258
300
  }
259
301
 
260
302
  public get dm() {
261
303
  return {
262
- list: async (options?: AxiosRequestConfig): Promise<any> => {
263
- return this.raw.dmsControllerGetDms(options);
304
+ list: async (options?: AxiosRequestConfig): Promise<DmsControllerGetDmsResult> => {
305
+ return this.raw.dmsControllerGetDms(options) as any;
264
306
  },
265
- create: async (data: CreateDmDto, options?: AxiosRequestConfig): Promise<any> => {
266
- return this.raw.dmsControllerCreateDm(data, options);
307
+ create: async (data: CreateDmDto, options?: AxiosRequestConfig): Promise<DmsControllerCreateDmResult> => {
308
+ return this.raw.dmsControllerCreateDm(data, options) as any;
267
309
  },
268
- get: async (dmId: string, options?: AxiosRequestConfig): Promise<any> => {
269
- return this.raw.dmsControllerGetDm(dmId, options);
310
+ get: async (dmId: string, options?: AxiosRequestConfig): Promise<DmsControllerGetDmResult> => {
311
+ return this.raw.dmsControllerGetDm(dmId, options) as any;
270
312
  },
271
- delete: async (dmId: string, options?: AxiosRequestConfig): Promise<any> => {
272
- return this.raw.dmsControllerDeleteDm(dmId, options);
313
+ delete: async (dmId: string, options?: AxiosRequestConfig): Promise<DmsControllerDeleteDmResult> => {
314
+ return this.raw.dmsControllerDeleteDm(dmId, options) as any;
273
315
  },
274
316
  message: {
275
- list: async (dmId: string, params?: DmsControllerGetMessagesParams, options?: AxiosRequestConfig): Promise<any> => {
276
- return this.raw.dmsControllerGetMessages(dmId, params, options);
317
+ list: async (dmId: string, params?: DmsControllerGetMessagesParams, options?: AxiosRequestConfig): Promise<DmsControllerGetMessagesResult> => {
318
+ return this.raw.dmsControllerGetMessages(dmId, params, options) as any;
277
319
  },
278
- create: async (dmId: string, options?: AxiosRequestConfig): Promise<any> => {
279
- return this.raw.dmsControllerCreateMessage(dmId, options);
320
+ create: async (dmId: string, options?: AxiosRequestConfig): Promise<DmsControllerCreateMessageResult> => {
321
+ return this.raw.dmsControllerCreateMessage(dmId, options) as any;
280
322
  },
281
323
  },
282
324
  };
@@ -284,14 +326,14 @@ export class ScrymeSDK {
284
326
 
285
327
  public get user() {
286
328
  return {
287
- me: async (options?: AxiosRequestConfig): Promise<any> => {
288
- return this.raw.usersControllerGetMe(options);
329
+ me: async (options?: AxiosRequestConfig): Promise<UsersControllerGetMeResult> => {
330
+ return this.raw.usersControllerGetMe(options) as any;
289
331
  },
290
- get: async (userId: string, options?: AxiosRequestConfig): Promise<any> => {
291
- return this.raw.usersControllerGetUser(userId, options);
332
+ get: async (userId: string, options?: AxiosRequestConfig): Promise<UsersControllerGetUserResult> => {
333
+ return this.raw.usersControllerGetUser(userId, options) as any;
292
334
  },
293
- search: async (params: UsersControllerSearchUsersParams, options?: AxiosRequestConfig): Promise<any> => {
294
- return this.raw.usersControllerSearchUsers(params, options);
335
+ search: async (params: UsersControllerSearchUsersParams, options?: AxiosRequestConfig): Promise<UsersControllerSearchUsersResult> => {
336
+ return this.raw.usersControllerSearchUsers(params, options) as any;
295
337
  },
296
338
  };
297
339
  }