@doist/twist-sdk 2.1.3 → 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.
- package/dist/cjs/authentication.js +5 -5
- package/dist/cjs/batch-builder.js +2 -2
- package/dist/cjs/clients/channels-client.js +14 -14
- package/dist/cjs/clients/comments-client.js +7 -7
- package/dist/cjs/clients/conversation-messages-client.js +6 -6
- package/dist/cjs/clients/conversations-client.js +16 -16
- package/dist/cjs/clients/groups-client.js +10 -10
- package/dist/cjs/clients/inbox-client.js +7 -7
- package/dist/cjs/clients/reactions-client.js +4 -4
- package/dist/cjs/clients/search-client.js +4 -4
- package/dist/cjs/clients/threads-client.js +21 -21
- package/dist/cjs/clients/users-client.js +15 -15
- package/dist/cjs/clients/workspace-users-client.js +11 -11
- package/dist/cjs/clients/workspaces-client.js +8 -8
- package/dist/cjs/testUtils/msw-setup.js +1 -1
- package/dist/cjs/{rest-client.js → transport/fetch-with-retry.js} +108 -153
- package/dist/cjs/transport/http-client.js +108 -0
- package/dist/cjs/transport/http-dispatcher.js +128 -0
- package/dist/esm/authentication.js +1 -1
- package/dist/esm/batch-builder.js +1 -1
- package/dist/esm/clients/channels-client.js +1 -1
- package/dist/esm/clients/comments-client.js +1 -1
- package/dist/esm/clients/conversation-messages-client.js +1 -1
- package/dist/esm/clients/conversations-client.js +1 -1
- package/dist/esm/clients/groups-client.js +1 -1
- package/dist/esm/clients/inbox-client.js +1 -1
- package/dist/esm/clients/reactions-client.js +1 -1
- package/dist/esm/clients/search-client.js +1 -1
- package/dist/esm/clients/threads-client.js +1 -1
- package/dist/esm/clients/users-client.js +1 -1
- package/dist/esm/clients/workspace-users-client.js +1 -1
- package/dist/esm/clients/workspaces-client.js +1 -1
- package/dist/esm/testUtils/msw-setup.js +1 -1
- package/dist/esm/{rest-client.js → transport/fetch-with-retry.js} +108 -150
- package/dist/esm/transport/http-client.js +103 -0
- package/dist/esm/transport/http-dispatcher.js +91 -0
- package/dist/types/transport/fetch-with-retry.d.ts +4 -0
- package/dist/types/{rest-client.d.ts → transport/http-client.d.ts} +1 -4
- package/dist/types/transport/http-dispatcher.d.ts +3 -0
- 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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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;
|
|
@@ -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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
137
|
+
return (0, http_client_1.request)({
|
|
138
138
|
httpMethod: method,
|
|
139
139
|
baseUri: this.getBaseUri(),
|
|
140
140
|
relativePath: url,
|
|
@@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.ReactionsClient = void 0;
|
|
19
19
|
var endpoints_1 = require("../consts/endpoints");
|
|
20
|
-
var
|
|
20
|
+
var http_client_1 = require("../transport/http-client");
|
|
21
21
|
var base_client_1 = require("./base-client");
|
|
22
22
|
/**
|
|
23
23
|
* Client for interacting with Twist reaction endpoints.
|
|
@@ -48,7 +48,7 @@ var ReactionsClient = /** @class */ (function (_super) {
|
|
|
48
48
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
49
49
|
return { method: method, url: url, params: params };
|
|
50
50
|
}
|
|
51
|
-
return (0,
|
|
51
|
+
return (0, http_client_1.request)({
|
|
52
52
|
httpMethod: method,
|
|
53
53
|
baseUri: this.getBaseUri(),
|
|
54
54
|
relativePath: url,
|
|
@@ -76,7 +76,7 @@ var ReactionsClient = /** @class */ (function (_super) {
|
|
|
76
76
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
77
77
|
return { method: method, url: url, params: params };
|
|
78
78
|
}
|
|
79
|
-
return (0,
|
|
79
|
+
return (0, http_client_1.request)({
|
|
80
80
|
httpMethod: method,
|
|
81
81
|
baseUri: this.getBaseUri(),
|
|
82
82
|
relativePath: url,
|
|
@@ -106,7 +106,7 @@ var ReactionsClient = /** @class */ (function (_super) {
|
|
|
106
106
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
107
107
|
return { method: method, url: url, params: params };
|
|
108
108
|
}
|
|
109
|
-
return (0,
|
|
109
|
+
return (0, http_client_1.request)({
|
|
110
110
|
httpMethod: method,
|
|
111
111
|
baseUri: this.getBaseUri(),
|
|
112
112
|
relativePath: url,
|
|
@@ -28,7 +28,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.SearchClient = void 0;
|
|
30
30
|
var endpoints_1 = require("../consts/endpoints");
|
|
31
|
-
var
|
|
31
|
+
var http_client_1 = require("../transport/http-client");
|
|
32
32
|
var entities_1 = require("../types/entities");
|
|
33
33
|
var base_client_1 = require("./base-client");
|
|
34
34
|
/**
|
|
@@ -63,7 +63,7 @@ var SearchClient = /** @class */ (function (_super) {
|
|
|
63
63
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
64
64
|
return { method: method, url: url, params: params };
|
|
65
65
|
}
|
|
66
|
-
return (0,
|
|
66
|
+
return (0, http_client_1.request)({
|
|
67
67
|
httpMethod: method,
|
|
68
68
|
baseUri: this.getBaseUri(),
|
|
69
69
|
relativePath: url,
|
|
@@ -86,7 +86,7 @@ var SearchClient = /** @class */ (function (_super) {
|
|
|
86
86
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
87
87
|
return { method: method, url: url, params: params };
|
|
88
88
|
}
|
|
89
|
-
return (0,
|
|
89
|
+
return (0, http_client_1.request)({
|
|
90
90
|
httpMethod: method,
|
|
91
91
|
baseUri: this.getBaseUri(),
|
|
92
92
|
relativePath: url,
|
|
@@ -109,7 +109,7 @@ var SearchClient = /** @class */ (function (_super) {
|
|
|
109
109
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
110
110
|
return { method: method, url: url, params: params };
|
|
111
111
|
}
|
|
112
|
-
return (0,
|
|
112
|
+
return (0, http_client_1.request)({
|
|
113
113
|
httpMethod: method,
|
|
114
114
|
baseUri: this.getBaseUri(),
|
|
115
115
|
relativePath: url,
|