@doist/twist-sdk 2.1.2 → 2.1.4

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.
Files changed (58) hide show
  1. package/dist/cjs/authentication.js +90 -5
  2. package/dist/cjs/batch-builder.js +2 -2
  3. package/dist/cjs/clients/base-client.js +2 -1
  4. package/dist/cjs/clients/channels-client.js +14 -14
  5. package/dist/cjs/clients/comments-client.js +7 -7
  6. package/dist/cjs/clients/conversation-messages-client.js +6 -6
  7. package/dist/cjs/clients/conversations-client.js +16 -16
  8. package/dist/cjs/clients/groups-client.js +10 -10
  9. package/dist/cjs/clients/inbox-client.js +7 -7
  10. package/dist/cjs/clients/reactions-client.js +4 -4
  11. package/dist/cjs/clients/search-client.js +4 -4
  12. package/dist/cjs/clients/threads-client.js +21 -21
  13. package/dist/cjs/clients/users-client.js +15 -15
  14. package/dist/cjs/clients/workspace-users-client.js +11 -11
  15. package/dist/cjs/clients/workspaces-client.js +8 -8
  16. package/dist/cjs/consts/endpoints.js +3 -2
  17. package/dist/cjs/testUtils/msw-setup.js +1 -1
  18. package/dist/cjs/{rest-client.js → transport/fetch-with-retry.js} +108 -153
  19. package/dist/cjs/transport/http-client.js +108 -0
  20. package/dist/cjs/transport/http-dispatcher.js +128 -0
  21. package/dist/cjs/types/api-version.js +6 -0
  22. package/dist/cjs/types/entities.js +4 -4
  23. package/dist/cjs/types/http.js +2 -0
  24. package/dist/cjs/types/index.js +1 -0
  25. package/dist/esm/authentication.js +85 -1
  26. package/dist/esm/batch-builder.js +1 -1
  27. package/dist/esm/clients/base-client.js +2 -1
  28. package/dist/esm/clients/channels-client.js +1 -1
  29. package/dist/esm/clients/comments-client.js +1 -1
  30. package/dist/esm/clients/conversation-messages-client.js +1 -1
  31. package/dist/esm/clients/conversations-client.js +1 -1
  32. package/dist/esm/clients/groups-client.js +1 -1
  33. package/dist/esm/clients/inbox-client.js +1 -1
  34. package/dist/esm/clients/reactions-client.js +1 -1
  35. package/dist/esm/clients/search-client.js +1 -1
  36. package/dist/esm/clients/threads-client.js +1 -1
  37. package/dist/esm/clients/users-client.js +1 -1
  38. package/dist/esm/clients/workspace-users-client.js +1 -1
  39. package/dist/esm/clients/workspaces-client.js +1 -1
  40. package/dist/esm/consts/endpoints.js +3 -2
  41. package/dist/esm/testUtils/msw-setup.js +1 -1
  42. package/dist/esm/{rest-client.js → transport/fetch-with-retry.js} +108 -150
  43. package/dist/esm/transport/http-client.js +103 -0
  44. package/dist/esm/transport/http-dispatcher.js +91 -0
  45. package/dist/esm/types/api-version.js +5 -1
  46. package/dist/esm/types/entities.js +1 -1
  47. package/dist/esm/types/http.js +1 -1
  48. package/dist/esm/types/index.js +1 -0
  49. package/dist/types/authentication.d.ts +5 -1
  50. package/dist/types/consts/endpoints.d.ts +2 -2
  51. package/dist/types/transport/fetch-with-retry.d.ts +4 -0
  52. package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -4
  53. package/dist/types/transport/http-dispatcher.d.ts +3 -0
  54. package/dist/types/types/api-version.d.ts +3 -1
  55. package/dist/types/types/entities.d.ts +25 -0
  56. package/dist/types/types/http.d.ts +2 -1
  57. package/dist/types/types/index.d.ts +1 -0
  58. package/package.json +1 -1
@@ -47,13 +47,98 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.TWIST_SCOPES = void 0;
50
51
  exports.getAuthStateParameter = getAuthStateParameter;
51
52
  exports.getAuthorizationUrl = getAuthorizationUrl;
52
53
  exports.getAuthToken = getAuthToken;
53
54
  exports.revokeAuthToken = revokeAuthToken;
54
55
  var uuid_1 = require("uuid");
55
- var rest_client_1 = require("./rest-client");
56
+ var http_client_1 = require("./transport/http-client");
56
57
  var errors_1 = require("./types/errors");
58
+ /**
59
+ * OAuth scopes for the Twist API.
60
+ *
61
+ * @remarks
62
+ * Request only the scopes your application needs:
63
+ *
64
+ * **User Scopes:**
65
+ * - `user:read` - Access user's personal settings
66
+ * - `user:write` - Access and update user's personal settings
67
+ *
68
+ * **Workspace Scopes:**
69
+ * - `workspaces:read` - Access teams the user is part of
70
+ * - `workspaces:write` - Access and update teams the user is part of
71
+ *
72
+ * **Channel Scopes:**
73
+ * - `channels:read` - Access channels
74
+ * - `channels:write` - Access and update channels
75
+ * - `channels:remove` - Access, update, and delete channels
76
+ *
77
+ * **Thread Scopes:**
78
+ * - `threads:read` - Access threads
79
+ * - `threads:write` - Access and update threads
80
+ * - `threads:remove` - Access, update, and delete threads
81
+ *
82
+ * **Comment Scopes:**
83
+ * - `comments:read` - Access comments
84
+ * - `comments:write` - Access and update comments
85
+ * - `comments:remove` - Access, update, and delete comments
86
+ *
87
+ * **Group Scopes:**
88
+ * - `groups:read` - Access groups
89
+ * - `groups:write` - Access and update groups
90
+ * - `groups:remove` - Access, update, and delete groups
91
+ *
92
+ * **Message Scopes:**
93
+ * - `messages:read` - Access messages
94
+ * - `messages:write` - Access and update messages
95
+ * - `messages:remove` - Access, update, and delete messages
96
+ *
97
+ * **Reaction Scopes:**
98
+ * - `reactions:read` - Access reactions
99
+ * - `reactions:write` - Access and update reactions
100
+ * - `reactions:remove` - Access, update, and delete reactions
101
+ *
102
+ * **Search Scopes:**
103
+ * - `search:read` - Search
104
+ *
105
+ * **Attachment Scopes:**
106
+ * - `attachments:read` - Access attachments
107
+ * - `attachments:write` - Access and update attachments
108
+ *
109
+ * **Notification Scopes:**
110
+ * - `notifications:read` - Read user's notifications settings
111
+ * - `notifications:write` - Read and update user's notifications settings
112
+ */
113
+ exports.TWIST_SCOPES = [
114
+ 'user:read',
115
+ 'user:write',
116
+ 'workspaces:read',
117
+ 'workspaces:write',
118
+ 'channels:read',
119
+ 'channels:write',
120
+ 'channels:remove',
121
+ 'threads:read',
122
+ 'threads:write',
123
+ 'threads:remove',
124
+ 'comments:read',
125
+ 'comments:write',
126
+ 'comments:remove',
127
+ 'groups:read',
128
+ 'groups:write',
129
+ 'groups:remove',
130
+ 'messages:read',
131
+ 'messages:write',
132
+ 'messages:remove',
133
+ 'reactions:read',
134
+ 'reactions:write',
135
+ 'reactions:remove',
136
+ 'search:read',
137
+ 'attachments:read',
138
+ 'attachments:write',
139
+ 'notifications:read',
140
+ 'notifications:write',
141
+ ];
57
142
  function getAuthStateParameter() {
58
143
  return (0, uuid_1.v4)();
59
144
  }
@@ -85,7 +170,7 @@ function getAuthToken(args, options) {
85
170
  ? "".concat(options.baseUrl, "/oauth/token")
86
171
  : 'https://twist.com/oauth/token';
87
172
  payload = __assign({ clientId: args.clientId, clientSecret: args.clientSecret, code: args.code, grantType: 'authorization_code' }, (args.redirectUri && { redirectUri: args.redirectUri }));
88
- return [4 /*yield*/, (0, rest_client_1.request)({
173
+ return [4 /*yield*/, (0, http_client_1.request)({
89
174
  httpMethod: 'POST',
90
175
  baseUri: tokenUrl,
91
176
  relativePath: '',
@@ -94,7 +179,7 @@ function getAuthToken(args, options) {
94
179
  })];
95
180
  case 1:
96
181
  response = _b.sent();
97
- if (!(0, rest_client_1.isSuccess)(response) || !((_a = response.data) === null || _a === void 0 ? void 0 : _a.accessToken)) {
182
+ if (!(0, http_client_1.isSuccess)(response) || !((_a = response.data) === null || _a === void 0 ? void 0 : _a.accessToken)) {
98
183
  throw new errors_1.TwistRequestError('Authentication token exchange failed.', response.status, response.data);
99
184
  }
100
185
  return [2 /*return*/, response.data];
@@ -111,7 +196,7 @@ function revokeAuthToken(args, options) {
111
196
  revokeUrl = (options === null || options === void 0 ? void 0 : options.baseUrl)
112
197
  ? "".concat(options.baseUrl, "/oauth/revoke")
113
198
  : 'https://twist.com/oauth/revoke';
114
- return [4 /*yield*/, (0, rest_client_1.request)({
199
+ return [4 /*yield*/, (0, http_client_1.request)({
115
200
  httpMethod: 'POST',
116
201
  baseUri: revokeUrl,
117
202
  relativePath: '',
@@ -124,7 +209,7 @@ function revokeAuthToken(args, options) {
124
209
  })];
125
210
  case 1:
126
211
  response = _a.sent();
127
- return [2 /*return*/, (0, rest_client_1.isSuccess)(response)];
212
+ return [2 /*return*/, (0, http_client_1.isSuccess)(response)];
128
213
  }
129
214
  });
130
215
  });
@@ -63,7 +63,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
63
63
  exports.BatchBuilder = void 0;
64
64
  var zod_1 = require("zod");
65
65
  var base_client_1 = require("./clients/base-client");
66
- var rest_client_1 = require("./rest-client");
66
+ var fetch_with_retry_1 = require("./transport/fetch-with-retry");
67
67
  var case_conversion_1 = require("./utils/case-conversion");
68
68
  var timestamp_conversion_1 = require("./utils/timestamp-conversion");
69
69
  /**
@@ -181,7 +181,7 @@ var BatchBuilder = /** @class */ (function (_super) {
181
181
  },
182
182
  body: formData.toString(),
183
183
  };
184
- return [4 /*yield*/, (0, rest_client_1.fetchWithRetry)(url, options, 3, this.customFetch)];
184
+ return [4 /*yield*/, (0, fetch_with_retry_1.fetchWithRetry)(url, options, 3, this.customFetch)];
185
185
  case 1:
186
186
  response = _a.sent();
187
187
  batchApiResponses = response.data;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BaseClient = void 0;
4
4
  var endpoints_1 = require("../consts/endpoints");
5
+ var api_version_1 = require("../types/api-version");
5
6
  /**
6
7
  * Base client class that provides centralized URL management and configuration
7
8
  * for all Twist API clients. Fixes the trailing slash bug and eliminates code duplication.
@@ -10,7 +11,7 @@ var BaseClient = /** @class */ (function () {
10
11
  function BaseClient(config) {
11
12
  this.apiToken = config.apiToken;
12
13
  this.baseUrl = config.baseUrl;
13
- this.defaultVersion = config.version || 'v3';
14
+ this.defaultVersion = config.version || api_version_1.DEFAULT_API_VERSION;
14
15
  this.customFetch = config.customFetch;
15
16
  }
16
17
  /**
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ChannelsClient = void 0;
19
19
  var zod_1 = require("zod");
20
20
  var endpoints_1 = require("../consts/endpoints");
21
- var rest_client_1 = require("../rest-client");
21
+ var http_client_1 = require("../transport/http-client");
22
22
  var entities_1 = require("../types/entities");
23
23
  var base_client_1 = require("./base-client");
24
24
  /**
@@ -36,7 +36,7 @@ var ChannelsClient = /** @class */ (function (_super) {
36
36
  if (options === null || options === void 0 ? void 0 : options.batch) {
37
37
  return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ChannelSchema) };
38
38
  }
39
- return (0, rest_client_1.request)({
39
+ return (0, http_client_1.request)({
40
40
  httpMethod: method,
41
41
  baseUri: this.getBaseUri(),
42
42
  relativePath: url,
@@ -53,7 +53,7 @@ var ChannelsClient = /** @class */ (function (_super) {
53
53
  if (options === null || options === void 0 ? void 0 : options.batch) {
54
54
  return { method: method, url: url, params: params, schema: schema };
55
55
  }
56
- return (0, rest_client_1.request)({
56
+ return (0, http_client_1.request)({
57
57
  httpMethod: method,
58
58
  baseUri: this.getBaseUri(),
59
59
  relativePath: url,
@@ -70,7 +70,7 @@ var ChannelsClient = /** @class */ (function (_super) {
70
70
  if (options === null || options === void 0 ? void 0 : options.batch) {
71
71
  return { method: method, url: url, params: params, schema: schema };
72
72
  }
73
- return (0, rest_client_1.request)({
73
+ return (0, http_client_1.request)({
74
74
  httpMethod: method,
75
75
  baseUri: this.getBaseUri(),
76
76
  relativePath: url,
@@ -87,7 +87,7 @@ var ChannelsClient = /** @class */ (function (_super) {
87
87
  if (options === null || options === void 0 ? void 0 : options.batch) {
88
88
  return { method: method, url: url, params: params, schema: schema };
89
89
  }
90
- return (0, rest_client_1.request)({
90
+ return (0, http_client_1.request)({
91
91
  httpMethod: method,
92
92
  baseUri: this.getBaseUri(),
93
93
  relativePath: url,
@@ -103,7 +103,7 @@ var ChannelsClient = /** @class */ (function (_super) {
103
103
  if (options === null || options === void 0 ? void 0 : options.batch) {
104
104
  return { method: method, url: url, params: params };
105
105
  }
106
- return (0, rest_client_1.request)({
106
+ return (0, http_client_1.request)({
107
107
  httpMethod: method,
108
108
  baseUri: this.getBaseUri(),
109
109
  relativePath: url,
@@ -119,7 +119,7 @@ var ChannelsClient = /** @class */ (function (_super) {
119
119
  if (options === null || options === void 0 ? void 0 : options.batch) {
120
120
  return { method: method, url: url, params: params };
121
121
  }
122
- return (0, rest_client_1.request)({
122
+ return (0, http_client_1.request)({
123
123
  httpMethod: method,
124
124
  baseUri: this.getBaseUri(),
125
125
  relativePath: url,
@@ -135,7 +135,7 @@ var ChannelsClient = /** @class */ (function (_super) {
135
135
  if (options === null || options === void 0 ? void 0 : options.batch) {
136
136
  return { method: method, url: url, params: params };
137
137
  }
138
- return (0, rest_client_1.request)({
138
+ return (0, http_client_1.request)({
139
139
  httpMethod: method,
140
140
  baseUri: this.getBaseUri(),
141
141
  relativePath: url,
@@ -151,7 +151,7 @@ var ChannelsClient = /** @class */ (function (_super) {
151
151
  if (options === null || options === void 0 ? void 0 : options.batch) {
152
152
  return { method: method, url: url, params: params };
153
153
  }
154
- return (0, rest_client_1.request)({
154
+ return (0, http_client_1.request)({
155
155
  httpMethod: method,
156
156
  baseUri: this.getBaseUri(),
157
157
  relativePath: url,
@@ -167,7 +167,7 @@ var ChannelsClient = /** @class */ (function (_super) {
167
167
  if (options === null || options === void 0 ? void 0 : options.batch) {
168
168
  return { method: method, url: url, params: params };
169
169
  }
170
- return (0, rest_client_1.request)({
170
+ return (0, http_client_1.request)({
171
171
  httpMethod: method,
172
172
  baseUri: this.getBaseUri(),
173
173
  relativePath: url,
@@ -183,7 +183,7 @@ var ChannelsClient = /** @class */ (function (_super) {
183
183
  if (options === null || options === void 0 ? void 0 : options.batch) {
184
184
  return { method: method, url: url, params: params };
185
185
  }
186
- return (0, rest_client_1.request)({
186
+ return (0, http_client_1.request)({
187
187
  httpMethod: method,
188
188
  baseUri: this.getBaseUri(),
189
189
  relativePath: url,
@@ -199,7 +199,7 @@ var ChannelsClient = /** @class */ (function (_super) {
199
199
  if (options === null || options === void 0 ? void 0 : options.batch) {
200
200
  return { method: method, url: url, params: params };
201
201
  }
202
- return (0, rest_client_1.request)({
202
+ return (0, http_client_1.request)({
203
203
  httpMethod: method,
204
204
  baseUri: this.getBaseUri(),
205
205
  relativePath: url,
@@ -215,7 +215,7 @@ var ChannelsClient = /** @class */ (function (_super) {
215
215
  if (options === null || options === void 0 ? void 0 : options.batch) {
216
216
  return { method: method, url: url, params: params };
217
217
  }
218
- return (0, rest_client_1.request)({
218
+ return (0, http_client_1.request)({
219
219
  httpMethod: method,
220
220
  baseUri: this.getBaseUri(),
221
221
  relativePath: url,
@@ -231,7 +231,7 @@ var ChannelsClient = /** @class */ (function (_super) {
231
231
  if (options === null || options === void 0 ? void 0 : options.batch) {
232
232
  return { method: method, url: url, params: params };
233
233
  }
234
- return (0, rest_client_1.request)({
234
+ return (0, http_client_1.request)({
235
235
  httpMethod: method,
236
236
  baseUri: this.getBaseUri(),
237
237
  relativePath: url,
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.CommentsClient = void 0;
19
19
  var zod_1 = require("zod");
20
20
  var endpoints_1 = require("../consts/endpoints");
21
- var rest_client_1 = require("../rest-client");
21
+ var http_client_1 = require("../transport/http-client");
22
22
  var entities_1 = require("../types/entities");
23
23
  var base_client_1 = require("./base-client");
24
24
  /**
@@ -42,7 +42,7 @@ var CommentsClient = /** @class */ (function (_super) {
42
42
  if (options === null || options === void 0 ? void 0 : options.batch) {
43
43
  return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.CommentSchema) };
44
44
  }
45
- return (0, rest_client_1.request)({
45
+ return (0, http_client_1.request)({
46
46
  httpMethod: method,
47
47
  baseUri: this.getBaseUri(),
48
48
  relativePath: url,
@@ -60,7 +60,7 @@ var CommentsClient = /** @class */ (function (_super) {
60
60
  if (options === null || options === void 0 ? void 0 : options.batch) {
61
61
  return { method: method, url: url, params: params, schema: wrappedSchema };
62
62
  }
63
- return (0, rest_client_1.request)({
63
+ return (0, http_client_1.request)({
64
64
  httpMethod: method,
65
65
  baseUri: this.getBaseUri(),
66
66
  relativePath: url,
@@ -77,7 +77,7 @@ var CommentsClient = /** @class */ (function (_super) {
77
77
  if (options === null || options === void 0 ? void 0 : options.batch) {
78
78
  return { method: method, url: url, params: params, schema: schema };
79
79
  }
80
- return (0, rest_client_1.request)({
80
+ return (0, http_client_1.request)({
81
81
  httpMethod: method,
82
82
  baseUri: this.getBaseUri(),
83
83
  relativePath: url,
@@ -94,7 +94,7 @@ var CommentsClient = /** @class */ (function (_super) {
94
94
  if (options === null || options === void 0 ? void 0 : options.batch) {
95
95
  return { method: method, url: url, params: params, schema: schema };
96
96
  }
97
- return (0, rest_client_1.request)({
97
+ return (0, http_client_1.request)({
98
98
  httpMethod: method,
99
99
  baseUri: this.getBaseUri(),
100
100
  relativePath: url,
@@ -110,7 +110,7 @@ var CommentsClient = /** @class */ (function (_super) {
110
110
  if (options === null || options === void 0 ? void 0 : options.batch) {
111
111
  return { method: method, url: url, params: params };
112
112
  }
113
- return (0, rest_client_1.request)({
113
+ return (0, http_client_1.request)({
114
114
  httpMethod: method,
115
115
  baseUri: this.getBaseUri(),
116
116
  relativePath: url,
@@ -129,7 +129,7 @@ var CommentsClient = /** @class */ (function (_super) {
129
129
  if (options === null || options === void 0 ? void 0 : options.batch) {
130
130
  return { method: method, url: url, params: params };
131
131
  }
132
- return (0, rest_client_1.request)({
132
+ return (0, http_client_1.request)({
133
133
  httpMethod: method,
134
134
  baseUri: this.getBaseUri(),
135
135
  relativePath: url,
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ConversationMessagesClient = void 0;
19
19
  var zod_1 = require("zod");
20
20
  var endpoints_1 = require("../consts/endpoints");
21
- var rest_client_1 = require("../rest-client");
21
+ var http_client_1 = require("../transport/http-client");
22
22
  var entities_1 = require("../types/entities");
23
23
  var base_client_1 = require("./base-client");
24
24
  /**
@@ -46,7 +46,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
46
46
  if (options === null || options === void 0 ? void 0 : options.batch) {
47
47
  return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ConversationMessageSchema) };
48
48
  }
49
- return (0, rest_client_1.request)({
49
+ return (0, http_client_1.request)({
50
50
  httpMethod: method,
51
51
  baseUri: this.getBaseUri(),
52
52
  relativePath: url,
@@ -65,7 +65,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
65
65
  if (options === null || options === void 0 ? void 0 : options.batch) {
66
66
  return { method: method, url: url, params: params, schema: schema };
67
67
  }
68
- return (0, rest_client_1.request)({
68
+ return (0, http_client_1.request)({
69
69
  httpMethod: method,
70
70
  baseUri: this.getBaseUri(),
71
71
  relativePath: url,
@@ -89,7 +89,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
89
89
  if (options === null || options === void 0 ? void 0 : options.batch) {
90
90
  return { method: method, url: url, params: params, schema: schema };
91
91
  }
92
- return (0, rest_client_1.request)({
92
+ return (0, http_client_1.request)({
93
93
  httpMethod: method,
94
94
  baseUri: this.getBaseUri(),
95
95
  relativePath: url,
@@ -111,7 +111,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
111
111
  if (options === null || options === void 0 ? void 0 : options.batch) {
112
112
  return { method: method, url: url, params: params, schema: schema };
113
113
  }
114
- return (0, rest_client_1.request)({
114
+ return (0, http_client_1.request)({
115
115
  httpMethod: method,
116
116
  baseUri: this.getBaseUri(),
117
117
  relativePath: url,
@@ -127,7 +127,7 @@ var ConversationMessagesClient = /** @class */ (function (_super) {
127
127
  if (options === null || options === void 0 ? void 0 : options.batch) {
128
128
  return { method: method, url: url, params: params };
129
129
  }
130
- return (0, rest_client_1.request)({
130
+ return (0, http_client_1.request)({
131
131
  httpMethod: method,
132
132
  baseUri: this.getBaseUri(),
133
133
  relativePath: url,
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.ConversationsClient = void 0;
19
19
  var zod_1 = require("zod");
20
20
  var endpoints_1 = require("../consts/endpoints");
21
- var rest_client_1 = require("../rest-client");
21
+ var http_client_1 = require("../transport/http-client");
22
22
  var entities_1 = require("../types/entities");
23
23
  var base_client_1 = require("./base-client");
24
24
  /**
@@ -36,7 +36,7 @@ var ConversationsClient = /** @class */ (function (_super) {
36
36
  if (options === null || options === void 0 ? void 0 : options.batch) {
37
37
  return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ConversationSchema) };
38
38
  }
39
- return (0, rest_client_1.request)({
39
+ return (0, http_client_1.request)({
40
40
  httpMethod: method,
41
41
  baseUri: this.getBaseUri(),
42
42
  relativePath: url,
@@ -55,7 +55,7 @@ var ConversationsClient = /** @class */ (function (_super) {
55
55
  if (options === null || options === void 0 ? void 0 : options.batch) {
56
56
  return { method: method, url: url, params: params, schema: schema };
57
57
  }
58
- return (0, rest_client_1.request)({
58
+ return (0, http_client_1.request)({
59
59
  httpMethod: method,
60
60
  baseUri: this.getBaseUri(),
61
61
  relativePath: url,
@@ -72,7 +72,7 @@ var ConversationsClient = /** @class */ (function (_super) {
72
72
  if (options === null || options === void 0 ? void 0 : options.batch) {
73
73
  return { method: method, url: url, params: params, schema: schema };
74
74
  }
75
- return (0, rest_client_1.request)({
75
+ return (0, http_client_1.request)({
76
76
  httpMethod: method,
77
77
  baseUri: this.getBaseUri(),
78
78
  relativePath: url,
@@ -91,7 +91,7 @@ var ConversationsClient = /** @class */ (function (_super) {
91
91
  if (options === null || options === void 0 ? void 0 : options.batch) {
92
92
  return { method: method, url: url, params: params, schema: schema };
93
93
  }
94
- return (0, rest_client_1.request)({
94
+ return (0, http_client_1.request)({
95
95
  httpMethod: method,
96
96
  baseUri: this.getBaseUri(),
97
97
  relativePath: url,
@@ -107,7 +107,7 @@ var ConversationsClient = /** @class */ (function (_super) {
107
107
  if (options === null || options === void 0 ? void 0 : options.batch) {
108
108
  return { method: method, url: url, params: params };
109
109
  }
110
- return (0, rest_client_1.request)({
110
+ return (0, http_client_1.request)({
111
111
  httpMethod: method,
112
112
  baseUri: this.getBaseUri(),
113
113
  relativePath: url,
@@ -123,7 +123,7 @@ var ConversationsClient = /** @class */ (function (_super) {
123
123
  if (options === null || options === void 0 ? void 0 : options.batch) {
124
124
  return { method: method, url: url, params: params };
125
125
  }
126
- return (0, rest_client_1.request)({
126
+ return (0, http_client_1.request)({
127
127
  httpMethod: method,
128
128
  baseUri: this.getBaseUri(),
129
129
  relativePath: url,
@@ -139,7 +139,7 @@ var ConversationsClient = /** @class */ (function (_super) {
139
139
  if (options === null || options === void 0 ? void 0 : options.batch) {
140
140
  return { method: method, url: url, params: params };
141
141
  }
142
- return (0, rest_client_1.request)({
142
+ return (0, http_client_1.request)({
143
143
  httpMethod: method,
144
144
  baseUri: this.getBaseUri(),
145
145
  relativePath: url,
@@ -155,7 +155,7 @@ var ConversationsClient = /** @class */ (function (_super) {
155
155
  if (options === null || options === void 0 ? void 0 : options.batch) {
156
156
  return { method: method, url: url, params: params };
157
157
  }
158
- return (0, rest_client_1.request)({
158
+ return (0, http_client_1.request)({
159
159
  httpMethod: method,
160
160
  baseUri: this.getBaseUri(),
161
161
  relativePath: url,
@@ -171,7 +171,7 @@ var ConversationsClient = /** @class */ (function (_super) {
171
171
  if (options === null || options === void 0 ? void 0 : options.batch) {
172
172
  return { method: method, url: url, params: params };
173
173
  }
174
- return (0, rest_client_1.request)({
174
+ return (0, http_client_1.request)({
175
175
  httpMethod: method,
176
176
  baseUri: this.getBaseUri(),
177
177
  relativePath: url,
@@ -187,7 +187,7 @@ var ConversationsClient = /** @class */ (function (_super) {
187
187
  if (options === null || options === void 0 ? void 0 : options.batch) {
188
188
  return { method: method, url: url, params: params };
189
189
  }
190
- return (0, rest_client_1.request)({
190
+ return (0, http_client_1.request)({
191
191
  httpMethod: method,
192
192
  baseUri: this.getBaseUri(),
193
193
  relativePath: url,
@@ -207,7 +207,7 @@ var ConversationsClient = /** @class */ (function (_super) {
207
207
  if (options === null || options === void 0 ? void 0 : options.batch) {
208
208
  return { method: method, url: url, params: params };
209
209
  }
210
- return (0, rest_client_1.request)({
210
+ return (0, http_client_1.request)({
211
211
  httpMethod: method,
212
212
  baseUri: this.getBaseUri(),
213
213
  relativePath: url,
@@ -227,7 +227,7 @@ var ConversationsClient = /** @class */ (function (_super) {
227
227
  if (options === null || options === void 0 ? void 0 : options.batch) {
228
228
  return { method: method, url: url, params: params };
229
229
  }
230
- return (0, rest_client_1.request)({
230
+ return (0, http_client_1.request)({
231
231
  httpMethod: method,
232
232
  baseUri: this.getBaseUri(),
233
233
  relativePath: url,
@@ -243,7 +243,7 @@ var ConversationsClient = /** @class */ (function (_super) {
243
243
  if (options === null || options === void 0 ? void 0 : options.batch) {
244
244
  return { method: method, url: url, params: params };
245
245
  }
246
- return (0, rest_client_1.request)({
246
+ return (0, http_client_1.request)({
247
247
  httpMethod: method,
248
248
  baseUri: this.getBaseUri(),
249
249
  relativePath: url,
@@ -262,7 +262,7 @@ var ConversationsClient = /** @class */ (function (_super) {
262
262
  if (options === null || options === void 0 ? void 0 : options.batch) {
263
263
  return { method: method, url: url, params: params, schema: schema };
264
264
  }
265
- return (0, rest_client_1.request)({
265
+ return (0, http_client_1.request)({
266
266
  httpMethod: method,
267
267
  baseUri: this.getBaseUri(),
268
268
  relativePath: url,
@@ -279,7 +279,7 @@ var ConversationsClient = /** @class */ (function (_super) {
279
279
  if (options === null || options === void 0 ? void 0 : options.batch) {
280
280
  return { method: method, url: url, params: params, schema: schema };
281
281
  }
282
- return (0, rest_client_1.request)({
282
+ return (0, http_client_1.request)({
283
283
  httpMethod: method,
284
284
  baseUri: this.getBaseUri(),
285
285
  relativePath: url,
@@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () {
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.GroupsClient = void 0;
19
19
  var endpoints_1 = require("../consts/endpoints");
20
- var rest_client_1 = require("../rest-client");
20
+ var http_client_1 = require("../transport/http-client");
21
21
  var entities_1 = require("../types/entities");
22
22
  var base_client_1 = require("./base-client");
23
23
  /**
@@ -35,7 +35,7 @@ var GroupsClient = /** @class */ (function (_super) {
35
35
  if (options === null || options === void 0 ? void 0 : options.batch) {
36
36
  return { method: method, url: url, params: params };
37
37
  }
38
- return (0, rest_client_1.request)({
38
+ return (0, http_client_1.request)({
39
39
  httpMethod: method,
40
40
  baseUri: this.getBaseUri(),
41
41
  relativePath: url,
@@ -52,7 +52,7 @@ var GroupsClient = /** @class */ (function (_super) {
52
52
  if (options === null || options === void 0 ? void 0 : options.batch) {
53
53
  return { method: method, url: url, params: params, schema: schema };
54
54
  }
55
- return (0, rest_client_1.request)({
55
+ return (0, http_client_1.request)({
56
56
  httpMethod: method,
57
57
  baseUri: this.getBaseUri(),
58
58
  relativePath: url,
@@ -69,7 +69,7 @@ var GroupsClient = /** @class */ (function (_super) {
69
69
  if (options === null || options === void 0 ? void 0 : options.batch) {
70
70
  return { method: method, url: url, params: params, schema: schema };
71
71
  }
72
- return (0, rest_client_1.request)({
72
+ return (0, http_client_1.request)({
73
73
  httpMethod: method,
74
74
  baseUri: this.getBaseUri(),
75
75
  relativePath: url,
@@ -86,7 +86,7 @@ var GroupsClient = /** @class */ (function (_super) {
86
86
  if (options === null || options === void 0 ? void 0 : options.batch) {
87
87
  return { method: method, url: url, params: params, schema: schema };
88
88
  }
89
- return (0, rest_client_1.request)({
89
+ return (0, http_client_1.request)({
90
90
  httpMethod: method,
91
91
  baseUri: this.getBaseUri(),
92
92
  relativePath: url,
@@ -102,7 +102,7 @@ var GroupsClient = /** @class */ (function (_super) {
102
102
  if (options === null || options === void 0 ? void 0 : options.batch) {
103
103
  return { method: method, url: url, params: params };
104
104
  }
105
- return (0, rest_client_1.request)({
105
+ return (0, http_client_1.request)({
106
106
  httpMethod: method,
107
107
  baseUri: this.getBaseUri(),
108
108
  relativePath: url,
@@ -118,7 +118,7 @@ var GroupsClient = /** @class */ (function (_super) {
118
118
  if (options === null || options === void 0 ? void 0 : options.batch) {
119
119
  return { method: method, url: url, params: params };
120
120
  }
121
- return (0, rest_client_1.request)({
121
+ return (0, http_client_1.request)({
122
122
  httpMethod: method,
123
123
  baseUri: this.getBaseUri(),
124
124
  relativePath: url,
@@ -134,7 +134,7 @@ var GroupsClient = /** @class */ (function (_super) {
134
134
  if (options === null || options === void 0 ? void 0 : options.batch) {
135
135
  return { method: method, url: url, params: params };
136
136
  }
137
- return (0, rest_client_1.request)({
137
+ return (0, http_client_1.request)({
138
138
  httpMethod: method,
139
139
  baseUri: this.getBaseUri(),
140
140
  relativePath: url,
@@ -150,7 +150,7 @@ var GroupsClient = /** @class */ (function (_super) {
150
150
  if (options === null || options === void 0 ? void 0 : options.batch) {
151
151
  return { method: method, url: url, params: params };
152
152
  }
153
- return (0, rest_client_1.request)({
153
+ return (0, http_client_1.request)({
154
154
  httpMethod: method,
155
155
  baseUri: this.getBaseUri(),
156
156
  relativePath: url,
@@ -166,7 +166,7 @@ var GroupsClient = /** @class */ (function (_super) {
166
166
  if (options === null || options === void 0 ? void 0 : options.batch) {
167
167
  return { method: method, url: url, params: params };
168
168
  }
169
- return (0, rest_client_1.request)({
169
+ return (0, http_client_1.request)({
170
170
  httpMethod: method,
171
171
  baseUri: this.getBaseUri(),
172
172
  relativePath: url,