@doist/twist-sdk 2.1.3 → 2.2.0

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 (47) hide show
  1. package/dist/cjs/authentication.js +5 -5
  2. package/dist/cjs/batch-builder.js +2 -2
  3. package/dist/cjs/clients/add-comment-helper.js +35 -0
  4. package/dist/cjs/clients/channels-client.js +14 -14
  5. package/dist/cjs/clients/comments-client.js +8 -21
  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 +54 -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/testUtils/msw-setup.js +1 -1
  17. package/dist/cjs/{rest-client.js → transport/fetch-with-retry.js} +108 -153
  18. package/dist/cjs/transport/http-client.js +108 -0
  19. package/dist/cjs/transport/http-dispatcher.js +128 -0
  20. package/dist/cjs/types/requests.js +3 -1
  21. package/dist/esm/authentication.js +1 -1
  22. package/dist/esm/batch-builder.js +1 -1
  23. package/dist/esm/clients/add-comment-helper.js +32 -0
  24. package/dist/esm/clients/channels-client.js +1 -1
  25. package/dist/esm/clients/comments-client.js +3 -16
  26. package/dist/esm/clients/conversation-messages-client.js +1 -1
  27. package/dist/esm/clients/conversations-client.js +1 -1
  28. package/dist/esm/clients/groups-client.js +1 -1
  29. package/dist/esm/clients/inbox-client.js +1 -1
  30. package/dist/esm/clients/reactions-client.js +1 -1
  31. package/dist/esm/clients/search-client.js +1 -1
  32. package/dist/esm/clients/threads-client.js +35 -2
  33. package/dist/esm/clients/users-client.js +1 -1
  34. package/dist/esm/clients/workspace-users-client.js +1 -1
  35. package/dist/esm/clients/workspaces-client.js +1 -1
  36. package/dist/esm/testUtils/msw-setup.js +1 -1
  37. package/dist/esm/{rest-client.js → transport/fetch-with-retry.js} +108 -150
  38. package/dist/esm/transport/http-client.js +103 -0
  39. package/dist/esm/transport/http-dispatcher.js +91 -0
  40. package/dist/esm/types/requests.js +2 -0
  41. package/dist/types/clients/add-comment-helper.d.ts +14 -0
  42. package/dist/types/clients/threads-client.d.ts +57 -2
  43. package/dist/types/transport/fetch-with-retry.d.ts +4 -0
  44. package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -4
  45. package/dist/types/transport/http-dispatcher.d.ts +3 -0
  46. package/dist/types/types/requests.d.ts +18 -0
  47. package/package.json +1 -1
@@ -53,7 +53,7 @@ exports.getAuthorizationUrl = getAuthorizationUrl;
53
53
  exports.getAuthToken = getAuthToken;
54
54
  exports.revokeAuthToken = revokeAuthToken;
55
55
  var uuid_1 = require("uuid");
56
- var rest_client_1 = require("./rest-client");
56
+ var http_client_1 = require("./transport/http-client");
57
57
  var errors_1 = require("./types/errors");
58
58
  /**
59
59
  * OAuth scopes for the Twist API.
@@ -170,7 +170,7 @@ function getAuthToken(args, options) {
170
170
  ? "".concat(options.baseUrl, "/oauth/token")
171
171
  : 'https://twist.com/oauth/token';
172
172
  payload = __assign({ clientId: args.clientId, clientSecret: args.clientSecret, code: args.code, grantType: 'authorization_code' }, (args.redirectUri && { redirectUri: args.redirectUri }));
173
- return [4 /*yield*/, (0, rest_client_1.request)({
173
+ return [4 /*yield*/, (0, http_client_1.request)({
174
174
  httpMethod: 'POST',
175
175
  baseUri: tokenUrl,
176
176
  relativePath: '',
@@ -179,7 +179,7 @@ function getAuthToken(args, options) {
179
179
  })];
180
180
  case 1:
181
181
  response = _b.sent();
182
- 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)) {
183
183
  throw new errors_1.TwistRequestError('Authentication token exchange failed.', response.status, response.data);
184
184
  }
185
185
  return [2 /*return*/, response.data];
@@ -196,7 +196,7 @@ function revokeAuthToken(args, options) {
196
196
  revokeUrl = (options === null || options === void 0 ? void 0 : options.baseUrl)
197
197
  ? "".concat(options.baseUrl, "/oauth/revoke")
198
198
  : 'https://twist.com/oauth/revoke';
199
- return [4 /*yield*/, (0, rest_client_1.request)({
199
+ return [4 /*yield*/, (0, http_client_1.request)({
200
200
  httpMethod: 'POST',
201
201
  baseUri: revokeUrl,
202
202
  relativePath: '',
@@ -209,7 +209,7 @@ function revokeAuthToken(args, options) {
209
209
  })];
210
210
  case 1:
211
211
  response = _a.sent();
212
- return [2 /*return*/, (0, rest_client_1.isSuccess)(response)];
212
+ return [2 /*return*/, (0, http_client_1.isSuccess)(response)];
213
213
  }
214
214
  });
215
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;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.addCommentRequest = addCommentRequest;
15
+ var endpoints_1 = require("../consts/endpoints");
16
+ var http_client_1 = require("../transport/http-client");
17
+ var entities_1 = require("../types/entities");
18
+ function addCommentRequest(context, params, options) {
19
+ var method = 'POST';
20
+ var url = "".concat(endpoints_1.ENDPOINT_COMMENTS, "/add");
21
+ var payload = (options === null || options === void 0 ? void 0 : options.threadAction)
22
+ ? __assign(__assign({}, params), { threadAction: options.threadAction }) : params;
23
+ var schema = entities_1.CommentSchema;
24
+ if (options === null || options === void 0 ? void 0 : options.batch) {
25
+ return { method: method, url: url, params: payload, schema: schema };
26
+ }
27
+ return (0, http_client_1.request)({
28
+ httpMethod: method,
29
+ baseUri: context.baseUri,
30
+ relativePath: url,
31
+ apiToken: context.apiToken,
32
+ payload: payload,
33
+ customFetch: context.customFetch,
34
+ }).then(function (response) { return schema.parse(response.data); });
35
+ }
@@ -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,8 +18,9 @@ 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
+ var add_comment_helper_1 = require("./add-comment-helper");
23
24
  var base_client_1 = require("./base-client");
24
25
  /**
25
26
  * Client for interacting with Twist comment endpoints.
@@ -42,7 +43,7 @@ var CommentsClient = /** @class */ (function (_super) {
42
43
  if (options === null || options === void 0 ? void 0 : options.batch) {
43
44
  return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.CommentSchema) };
44
45
  }
45
- return (0, rest_client_1.request)({
46
+ return (0, http_client_1.request)({
46
47
  httpMethod: method,
47
48
  baseUri: this.getBaseUri(),
48
49
  relativePath: url,
@@ -60,7 +61,7 @@ var CommentsClient = /** @class */ (function (_super) {
60
61
  if (options === null || options === void 0 ? void 0 : options.batch) {
61
62
  return { method: method, url: url, params: params, schema: wrappedSchema };
62
63
  }
63
- return (0, rest_client_1.request)({
64
+ return (0, http_client_1.request)({
64
65
  httpMethod: method,
65
66
  baseUri: this.getBaseUri(),
66
67
  relativePath: url,
@@ -70,21 +71,7 @@ var CommentsClient = /** @class */ (function (_super) {
70
71
  }).then(function (response) { return wrappedSchema.parse(response.data); });
71
72
  };
72
73
  CommentsClient.prototype.createComment = function (args, options) {
73
- var method = 'POST';
74
- var url = "".concat(endpoints_1.ENDPOINT_COMMENTS, "/add");
75
- var params = args;
76
- var schema = entities_1.CommentSchema;
77
- if (options === null || options === void 0 ? void 0 : options.batch) {
78
- return { method: method, url: url, params: params, schema: schema };
79
- }
80
- return (0, rest_client_1.request)({
81
- httpMethod: method,
82
- baseUri: this.getBaseUri(),
83
- relativePath: url,
84
- apiToken: this.apiToken,
85
- payload: params,
86
- customFetch: this.customFetch,
87
- }).then(function (response) { return schema.parse(response.data); });
74
+ return (0, add_comment_helper_1.addCommentRequest)({ baseUri: this.getBaseUri(), apiToken: this.apiToken, customFetch: this.customFetch }, args, options);
88
75
  };
89
76
  CommentsClient.prototype.updateComment = function (args, options) {
90
77
  var method = 'POST';
@@ -94,7 +81,7 @@ var CommentsClient = /** @class */ (function (_super) {
94
81
  if (options === null || options === void 0 ? void 0 : options.batch) {
95
82
  return { method: method, url: url, params: params, schema: schema };
96
83
  }
97
- return (0, rest_client_1.request)({
84
+ return (0, http_client_1.request)({
98
85
  httpMethod: method,
99
86
  baseUri: this.getBaseUri(),
100
87
  relativePath: url,
@@ -110,7 +97,7 @@ var CommentsClient = /** @class */ (function (_super) {
110
97
  if (options === null || options === void 0 ? void 0 : options.batch) {
111
98
  return { method: method, url: url, params: params };
112
99
  }
113
- return (0, rest_client_1.request)({
100
+ return (0, http_client_1.request)({
114
101
  httpMethod: method,
115
102
  baseUri: this.getBaseUri(),
116
103
  relativePath: url,
@@ -129,7 +116,7 @@ var CommentsClient = /** @class */ (function (_super) {
129
116
  if (options === null || options === void 0 ? void 0 : options.batch) {
130
117
  return { method: method, url: url, params: params };
131
118
  }
132
- return (0, rest_client_1.request)({
119
+ return (0, http_client_1.request)({
133
120
  httpMethod: method,
134
121
  baseUri: this.getBaseUri(),
135
122
  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,
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.InboxClient = 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 InboxClient = /** @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.InboxThreadSchema) };
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,
@@ -62,7 +62,7 @@ var InboxClient = /** @class */ (function (_super) {
62
62
  if (options === null || options === void 0 ? void 0 : options.batch) {
63
63
  return { method: method, url: url, params: params };
64
64
  }
65
- return (0, rest_client_1.request)({
65
+ return (0, http_client_1.request)({
66
66
  httpMethod: method,
67
67
  baseUri: this.getBaseUri(),
68
68
  relativePath: url,
@@ -78,7 +78,7 @@ var InboxClient = /** @class */ (function (_super) {
78
78
  if (options === null || options === void 0 ? void 0 : options.batch) {
79
79
  return { method: method, url: url, params: params };
80
80
  }
81
- return (0, rest_client_1.request)({
81
+ return (0, http_client_1.request)({
82
82
  httpMethod: method,
83
83
  baseUri: this.getBaseUri(),
84
84
  relativePath: url,
@@ -94,7 +94,7 @@ var InboxClient = /** @class */ (function (_super) {
94
94
  if (options === null || options === void 0 ? void 0 : options.batch) {
95
95
  return { method: method, url: url, params: params };
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 InboxClient = /** @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,
@@ -134,7 +134,7 @@ var InboxClient = /** @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,