@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.
- package/dist/cjs/authentication.js +5 -5
- package/dist/cjs/batch-builder.js +2 -2
- package/dist/cjs/clients/add-comment-helper.js +35 -0
- package/dist/cjs/clients/channels-client.js +14 -14
- package/dist/cjs/clients/comments-client.js +8 -21
- 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 +54 -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/cjs/types/requests.js +3 -1
- package/dist/esm/authentication.js +1 -1
- package/dist/esm/batch-builder.js +1 -1
- package/dist/esm/clients/add-comment-helper.js +32 -0
- package/dist/esm/clients/channels-client.js +1 -1
- package/dist/esm/clients/comments-client.js +3 -16
- 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 +35 -2
- 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/esm/types/requests.js +2 -0
- package/dist/types/clients/add-comment-helper.d.ts +14 -0
- package/dist/types/clients/threads-client.d.ts +57 -2
- 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/dist/types/types/requests.d.ts +18 -0
- package/package.json +1 -1
|
@@ -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,
|
|
@@ -14,12 +14,35 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
29
|
+
var t = {};
|
|
30
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
31
|
+
t[p] = s[p];
|
|
32
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
33
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
34
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
35
|
+
t[p[i]] = s[p[i]];
|
|
36
|
+
}
|
|
37
|
+
return t;
|
|
38
|
+
};
|
|
17
39
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
40
|
exports.ThreadsClient = void 0;
|
|
19
41
|
var zod_1 = require("zod");
|
|
20
42
|
var endpoints_1 = require("../consts/endpoints");
|
|
21
|
-
var
|
|
43
|
+
var http_client_1 = require("../transport/http-client");
|
|
22
44
|
var entities_1 = require("../types/entities");
|
|
45
|
+
var add_comment_helper_1 = require("./add-comment-helper");
|
|
23
46
|
var base_client_1 = require("./base-client");
|
|
24
47
|
/**
|
|
25
48
|
* Client for interacting with Twist thread endpoints.
|
|
@@ -36,7 +59,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
36
59
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
37
60
|
return { method: method, url: url, params: params, schema: zod_1.z.array(entities_1.ThreadSchema) };
|
|
38
61
|
}
|
|
39
|
-
return (0,
|
|
62
|
+
return (0, http_client_1.request)({
|
|
40
63
|
httpMethod: method,
|
|
41
64
|
baseUri: this.getBaseUri(),
|
|
42
65
|
relativePath: url,
|
|
@@ -53,7 +76,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
53
76
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
54
77
|
return { method: method, url: url, params: params, schema: schema };
|
|
55
78
|
}
|
|
56
|
-
return (0,
|
|
79
|
+
return (0, http_client_1.request)({
|
|
57
80
|
httpMethod: method,
|
|
58
81
|
baseUri: this.getBaseUri(),
|
|
59
82
|
relativePath: url,
|
|
@@ -70,7 +93,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
70
93
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
71
94
|
return { method: method, url: url, params: params, schema: schema };
|
|
72
95
|
}
|
|
73
|
-
return (0,
|
|
96
|
+
return (0, http_client_1.request)({
|
|
74
97
|
httpMethod: method,
|
|
75
98
|
baseUri: this.getBaseUri(),
|
|
76
99
|
relativePath: url,
|
|
@@ -87,7 +110,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
87
110
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
88
111
|
return { method: method, url: url, params: params, schema: schema };
|
|
89
112
|
}
|
|
90
|
-
return (0,
|
|
113
|
+
return (0, http_client_1.request)({
|
|
91
114
|
httpMethod: method,
|
|
92
115
|
baseUri: this.getBaseUri(),
|
|
93
116
|
relativePath: url,
|
|
@@ -103,7 +126,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
103
126
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
104
127
|
return { method: method, url: url, params: params };
|
|
105
128
|
}
|
|
106
|
-
return (0,
|
|
129
|
+
return (0, http_client_1.request)({
|
|
107
130
|
httpMethod: method,
|
|
108
131
|
baseUri: this.getBaseUri(),
|
|
109
132
|
relativePath: url,
|
|
@@ -119,7 +142,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
119
142
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
120
143
|
return { method: method, url: url, params: params };
|
|
121
144
|
}
|
|
122
|
-
return (0,
|
|
145
|
+
return (0, http_client_1.request)({
|
|
123
146
|
httpMethod: method,
|
|
124
147
|
baseUri: this.getBaseUri(),
|
|
125
148
|
relativePath: url,
|
|
@@ -135,7 +158,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
135
158
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
136
159
|
return { method: method, url: url, params: params };
|
|
137
160
|
}
|
|
138
|
-
return (0,
|
|
161
|
+
return (0, http_client_1.request)({
|
|
139
162
|
httpMethod: method,
|
|
140
163
|
baseUri: this.getBaseUri(),
|
|
141
164
|
relativePath: url,
|
|
@@ -151,7 +174,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
151
174
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
152
175
|
return { method: method, url: url, params: params };
|
|
153
176
|
}
|
|
154
|
-
return (0,
|
|
177
|
+
return (0, http_client_1.request)({
|
|
155
178
|
httpMethod: method,
|
|
156
179
|
baseUri: this.getBaseUri(),
|
|
157
180
|
relativePath: url,
|
|
@@ -167,7 +190,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
167
190
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
168
191
|
return { method: method, url: url, params: params };
|
|
169
192
|
}
|
|
170
|
-
return (0,
|
|
193
|
+
return (0, http_client_1.request)({
|
|
171
194
|
httpMethod: method,
|
|
172
195
|
baseUri: this.getBaseUri(),
|
|
173
196
|
relativePath: url,
|
|
@@ -183,7 +206,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
183
206
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
184
207
|
return { method: method, url: url, params: params };
|
|
185
208
|
}
|
|
186
|
-
return (0,
|
|
209
|
+
return (0, http_client_1.request)({
|
|
187
210
|
httpMethod: method,
|
|
188
211
|
baseUri: this.getBaseUri(),
|
|
189
212
|
relativePath: url,
|
|
@@ -199,7 +222,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
199
222
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
200
223
|
return { method: method, url: url, params: params };
|
|
201
224
|
}
|
|
202
|
-
return (0,
|
|
225
|
+
return (0, http_client_1.request)({
|
|
203
226
|
httpMethod: method,
|
|
204
227
|
baseUri: this.getBaseUri(),
|
|
205
228
|
relativePath: url,
|
|
@@ -215,7 +238,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
215
238
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
216
239
|
return { method: method, url: url, params: params };
|
|
217
240
|
}
|
|
218
|
-
return (0,
|
|
241
|
+
return (0, http_client_1.request)({
|
|
219
242
|
httpMethod: method,
|
|
220
243
|
baseUri: this.getBaseUri(),
|
|
221
244
|
relativePath: url,
|
|
@@ -231,7 +254,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
231
254
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
232
255
|
return { method: method, url: url, params: params };
|
|
233
256
|
}
|
|
234
|
-
return (0,
|
|
257
|
+
return (0, http_client_1.request)({
|
|
235
258
|
httpMethod: method,
|
|
236
259
|
baseUri: this.getBaseUri(),
|
|
237
260
|
relativePath: url,
|
|
@@ -247,7 +270,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
247
270
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
248
271
|
return { method: method, url: url, params: params };
|
|
249
272
|
}
|
|
250
|
-
return (0,
|
|
273
|
+
return (0, http_client_1.request)({
|
|
251
274
|
httpMethod: method,
|
|
252
275
|
baseUri: this.getBaseUri(),
|
|
253
276
|
relativePath: url,
|
|
@@ -263,7 +286,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
263
286
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
264
287
|
return { method: method, url: url, params: params };
|
|
265
288
|
}
|
|
266
|
-
return (0,
|
|
289
|
+
return (0, http_client_1.request)({
|
|
267
290
|
httpMethod: method,
|
|
268
291
|
baseUri: this.getBaseUri(),
|
|
269
292
|
relativePath: url,
|
|
@@ -286,7 +309,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
286
309
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
287
310
|
return { method: method, url: url, params: params };
|
|
288
311
|
}
|
|
289
|
-
return (0,
|
|
312
|
+
return (0, http_client_1.request)({
|
|
290
313
|
httpMethod: method,
|
|
291
314
|
baseUri: this.getBaseUri(),
|
|
292
315
|
relativePath: url,
|
|
@@ -302,7 +325,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
302
325
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
303
326
|
return { method: method, url: url, params: params };
|
|
304
327
|
}
|
|
305
|
-
return (0,
|
|
328
|
+
return (0, http_client_1.request)({
|
|
306
329
|
httpMethod: method,
|
|
307
330
|
baseUri: this.getBaseUri(),
|
|
308
331
|
relativePath: url,
|
|
@@ -318,7 +341,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
318
341
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
319
342
|
return { method: method, url: url, params: params };
|
|
320
343
|
}
|
|
321
|
-
return (0,
|
|
344
|
+
return (0, http_client_1.request)({
|
|
322
345
|
httpMethod: method,
|
|
323
346
|
baseUri: this.getBaseUri(),
|
|
324
347
|
relativePath: url,
|
|
@@ -335,7 +358,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
335
358
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
336
359
|
return { method: method, url: url, params: params, schema: schema };
|
|
337
360
|
}
|
|
338
|
-
return (0,
|
|
361
|
+
return (0, http_client_1.request)({
|
|
339
362
|
httpMethod: method,
|
|
340
363
|
baseUri: this.getBaseUri(),
|
|
341
364
|
relativePath: url,
|
|
@@ -352,7 +375,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
352
375
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
353
376
|
return { method: method, url: url, params: params, schema: schema };
|
|
354
377
|
}
|
|
355
|
-
return (0,
|
|
378
|
+
return (0, http_client_1.request)({
|
|
356
379
|
httpMethod: method,
|
|
357
380
|
baseUri: this.getBaseUri(),
|
|
358
381
|
relativePath: url,
|
|
@@ -361,6 +384,16 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
361
384
|
customFetch: this.customFetch,
|
|
362
385
|
}).then(function (response) { return schema.parse(response.data); });
|
|
363
386
|
};
|
|
387
|
+
ThreadsClient.prototype.closeThread = function (args, options) {
|
|
388
|
+
return this.addCommentWithAction(args, 'close', options);
|
|
389
|
+
};
|
|
390
|
+
ThreadsClient.prototype.reopenThread = function (args, options) {
|
|
391
|
+
return this.addCommentWithAction(args, 'reopen', options);
|
|
392
|
+
};
|
|
393
|
+
ThreadsClient.prototype.addCommentWithAction = function (args, threadAction, options) {
|
|
394
|
+
var id = args.id, rest = __rest(args, ["id"]);
|
|
395
|
+
return (0, add_comment_helper_1.addCommentRequest)({ baseUri: this.getBaseUri(), apiToken: this.apiToken, customFetch: this.customFetch }, __assign({ threadId: id }, rest), __assign(__assign({}, options), { threadAction: threadAction }));
|
|
396
|
+
};
|
|
364
397
|
return ThreadsClient;
|
|
365
398
|
}(base_client_1.BaseClient));
|
|
366
399
|
exports.ThreadsClient = ThreadsClient;
|
|
@@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.UsersClient = 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
|
/**
|
|
@@ -36,7 +36,7 @@ var UsersClient = /** @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: schema };
|
|
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,
|
|
@@ -51,7 +51,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
51
51
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
52
52
|
return { method: method, url: url };
|
|
53
53
|
}
|
|
54
|
-
return (0,
|
|
54
|
+
return (0, http_client_1.request)({
|
|
55
55
|
httpMethod: method,
|
|
56
56
|
baseUri: this.getBaseUri(),
|
|
57
57
|
relativePath: url,
|
|
@@ -67,7 +67,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
67
67
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
68
68
|
return { method: method, url: url, schema: schema };
|
|
69
69
|
}
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, http_client_1.request)({
|
|
71
71
|
httpMethod: method,
|
|
72
72
|
baseUri: this.getBaseUri(),
|
|
73
73
|
relativePath: url,
|
|
@@ -84,7 +84,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
84
84
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
85
85
|
return { method: method, url: url, params: params, schema: schema };
|
|
86
86
|
}
|
|
87
|
-
return (0,
|
|
87
|
+
return (0, http_client_1.request)({
|
|
88
88
|
httpMethod: method,
|
|
89
89
|
baseUri: this.getBaseUri(),
|
|
90
90
|
relativePath: url,
|
|
@@ -101,7 +101,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
101
101
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
102
102
|
return { method: method, url: url, params: params, schema: schema };
|
|
103
103
|
}
|
|
104
|
-
return (0,
|
|
104
|
+
return (0, http_client_1.request)({
|
|
105
105
|
httpMethod: method,
|
|
106
106
|
baseUri: this.getBaseUri(),
|
|
107
107
|
relativePath: url,
|
|
@@ -117,7 +117,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
117
117
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
118
118
|
return { method: method, url: url, schema: schema };
|
|
119
119
|
}
|
|
120
|
-
return (0,
|
|
120
|
+
return (0, http_client_1.request)({
|
|
121
121
|
httpMethod: method,
|
|
122
122
|
baseUri: this.getBaseUri(),
|
|
123
123
|
relativePath: url,
|
|
@@ -133,7 +133,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
133
133
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
134
134
|
return { method: method, url: url, params: params };
|
|
135
135
|
}
|
|
136
|
-
return (0,
|
|
136
|
+
return (0, http_client_1.request)({
|
|
137
137
|
httpMethod: method,
|
|
138
138
|
baseUri: this.getBaseUri(),
|
|
139
139
|
relativePath: url,
|
|
@@ -149,7 +149,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
149
149
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
150
150
|
return { method: method, url: url, params: params };
|
|
151
151
|
}
|
|
152
|
-
return (0,
|
|
152
|
+
return (0, http_client_1.request)({
|
|
153
153
|
httpMethod: method,
|
|
154
154
|
baseUri: this.getBaseUri(),
|
|
155
155
|
relativePath: url,
|
|
@@ -165,7 +165,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
165
165
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
166
166
|
return { method: method, url: url, params: params };
|
|
167
167
|
}
|
|
168
|
-
return (0,
|
|
168
|
+
return (0, http_client_1.request)({
|
|
169
169
|
httpMethod: method,
|
|
170
170
|
baseUri: this.getBaseUri(),
|
|
171
171
|
relativePath: url,
|
|
@@ -181,7 +181,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
181
181
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
182
182
|
return { method: method, url: url, params: params };
|
|
183
183
|
}
|
|
184
|
-
return (0,
|
|
184
|
+
return (0, http_client_1.request)({
|
|
185
185
|
httpMethod: method,
|
|
186
186
|
baseUri: this.getBaseUri(),
|
|
187
187
|
relativePath: url,
|
|
@@ -198,7 +198,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
198
198
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
199
199
|
return { method: method, url: url, params: params, schema: schema };
|
|
200
200
|
}
|
|
201
|
-
return (0,
|
|
201
|
+
return (0, http_client_1.request)({
|
|
202
202
|
httpMethod: method,
|
|
203
203
|
baseUri: this.getBaseUri(),
|
|
204
204
|
relativePath: url,
|
|
@@ -213,7 +213,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
213
213
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
214
214
|
return { method: method, url: url };
|
|
215
215
|
}
|
|
216
|
-
return (0,
|
|
216
|
+
return (0, http_client_1.request)({
|
|
217
217
|
httpMethod: method,
|
|
218
218
|
baseUri: this.getBaseUri(),
|
|
219
219
|
relativePath: url,
|
|
@@ -228,7 +228,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
228
228
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
229
229
|
return { method: method, url: url };
|
|
230
230
|
}
|
|
231
|
-
return (0,
|
|
231
|
+
return (0, http_client_1.request)({
|
|
232
232
|
httpMethod: method,
|
|
233
233
|
baseUri: this.getBaseUri(),
|
|
234
234
|
relativePath: url,
|
|
@@ -244,7 +244,7 @@ var UsersClient = /** @class */ (function (_super) {
|
|
|
244
244
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
245
245
|
return { method: method, url: url, params: params };
|
|
246
246
|
}
|
|
247
|
-
return (0,
|
|
247
|
+
return (0, http_client_1.request)({
|
|
248
248
|
httpMethod: method,
|
|
249
249
|
baseUri: this.getBaseUri(),
|
|
250
250
|
relativePath: url,
|
|
@@ -16,7 +16,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.WorkspaceUsersClient = void 0;
|
|
19
|
-
var
|
|
19
|
+
var http_client_1 = require("../transport/http-client");
|
|
20
20
|
var entities_1 = require("../types/entities");
|
|
21
21
|
var base_client_1 = require("./base-client");
|
|
22
22
|
/**
|
|
@@ -34,7 +34,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
34
34
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
35
35
|
return { method: method, url: url, params: params };
|
|
36
36
|
}
|
|
37
|
-
return (0,
|
|
37
|
+
return (0, http_client_1.request)({
|
|
38
38
|
httpMethod: method,
|
|
39
39
|
baseUri: this.getBaseUri('v4'),
|
|
40
40
|
relativePath: url,
|
|
@@ -50,7 +50,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
50
50
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
51
51
|
return { method: method, url: url, params: params };
|
|
52
52
|
}
|
|
53
|
-
return (0,
|
|
53
|
+
return (0, http_client_1.request)({
|
|
54
54
|
httpMethod: method,
|
|
55
55
|
baseUri: this.getBaseUri('v4'),
|
|
56
56
|
relativePath: url,
|
|
@@ -67,7 +67,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
67
67
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
68
68
|
return { method: method, url: url, params: params, schema: schema };
|
|
69
69
|
}
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, http_client_1.request)({
|
|
71
71
|
httpMethod: method,
|
|
72
72
|
baseUri: this.getBaseUri('v4'),
|
|
73
73
|
relativePath: url,
|
|
@@ -84,7 +84,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
84
84
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
85
85
|
return { method: method, url: url, params: params, schema: schema };
|
|
86
86
|
}
|
|
87
|
-
return (0,
|
|
87
|
+
return (0, http_client_1.request)({
|
|
88
88
|
httpMethod: method,
|
|
89
89
|
baseUri: this.getBaseUri('v4'),
|
|
90
90
|
relativePath: url,
|
|
@@ -100,7 +100,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
100
100
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
101
101
|
return { method: method, url: url, params: params };
|
|
102
102
|
}
|
|
103
|
-
return (0,
|
|
103
|
+
return (0, http_client_1.request)({
|
|
104
104
|
httpMethod: method,
|
|
105
105
|
baseUri: this.getBaseUri('v4'),
|
|
106
106
|
relativePath: url,
|
|
@@ -116,7 +116,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
116
116
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
117
117
|
return { method: method, url: url, params: params };
|
|
118
118
|
}
|
|
119
|
-
return (0,
|
|
119
|
+
return (0, http_client_1.request)({
|
|
120
120
|
httpMethod: method,
|
|
121
121
|
baseUri: this.getBaseUri('v4'),
|
|
122
122
|
relativePath: url,
|
|
@@ -139,7 +139,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
139
139
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
140
140
|
return { method: method, url: url, params: params, schema: schema };
|
|
141
141
|
}
|
|
142
|
-
return (0,
|
|
142
|
+
return (0, http_client_1.request)({
|
|
143
143
|
httpMethod: method,
|
|
144
144
|
baseUri: this.getBaseUri('v4'),
|
|
145
145
|
relativePath: url,
|
|
@@ -161,7 +161,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
161
161
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
162
162
|
return { method: method, url: url, params: params, schema: schema };
|
|
163
163
|
}
|
|
164
|
-
return (0,
|
|
164
|
+
return (0, http_client_1.request)({
|
|
165
165
|
httpMethod: method,
|
|
166
166
|
baseUri: this.getBaseUri('v4'),
|
|
167
167
|
relativePath: url,
|
|
@@ -181,7 +181,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
181
181
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
182
182
|
return { method: method, url: url, params: params };
|
|
183
183
|
}
|
|
184
|
-
return (0,
|
|
184
|
+
return (0, http_client_1.request)({
|
|
185
185
|
httpMethod: method,
|
|
186
186
|
baseUri: this.getBaseUri('v4'),
|
|
187
187
|
relativePath: url,
|
|
@@ -201,7 +201,7 @@ var WorkspaceUsersClient = /** @class */ (function (_super) {
|
|
|
201
201
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
202
202
|
return { method: method, url: url, params: params };
|
|
203
203
|
}
|
|
204
|
-
return (0,
|
|
204
|
+
return (0, http_client_1.request)({
|
|
205
205
|
httpMethod: method,
|
|
206
206
|
baseUri: this.getBaseUri('v4'),
|
|
207
207
|
relativePath: url,
|
|
@@ -17,7 +17,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.WorkspacesClient = 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
|
/**
|
|
@@ -34,7 +34,7 @@ var WorkspacesClient = /** @class */ (function (_super) {
|
|
|
34
34
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
35
35
|
return { method: method, url: url };
|
|
36
36
|
}
|
|
37
|
-
return (0,
|
|
37
|
+
return (0, http_client_1.request)({
|
|
38
38
|
httpMethod: method,
|
|
39
39
|
baseUri: this.getBaseUri(),
|
|
40
40
|
relativePath: url,
|
|
@@ -51,7 +51,7 @@ var WorkspacesClient = /** @class */ (function (_super) {
|
|
|
51
51
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
52
52
|
return { method: method, url: url, params: params, schema: schema };
|
|
53
53
|
}
|
|
54
|
-
return (0,
|
|
54
|
+
return (0, http_client_1.request)({
|
|
55
55
|
httpMethod: method,
|
|
56
56
|
baseUri: this.getBaseUri(),
|
|
57
57
|
relativePath: url,
|
|
@@ -67,7 +67,7 @@ var WorkspacesClient = /** @class */ (function (_super) {
|
|
|
67
67
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
68
68
|
return { method: method, url: url, schema: schema };
|
|
69
69
|
}
|
|
70
|
-
return (0,
|
|
70
|
+
return (0, http_client_1.request)({
|
|
71
71
|
httpMethod: method,
|
|
72
72
|
baseUri: this.getBaseUri(),
|
|
73
73
|
relativePath: url,
|
|
@@ -86,7 +86,7 @@ var WorkspacesClient = /** @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,
|
|
@@ -103,7 +103,7 @@ var WorkspacesClient = /** @class */ (function (_super) {
|
|
|
103
103
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
104
104
|
return { method: method, url: url, params: params, schema: schema };
|
|
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 WorkspacesClient = /** @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 WorkspacesClient = /** @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,
|
|
@@ -7,7 +7,7 @@ var vitest_1 = require("vitest");
|
|
|
7
7
|
exports.server = (0, node_1.setupServer)();
|
|
8
8
|
// Start server before all tests
|
|
9
9
|
(0, vitest_1.beforeAll)(function () {
|
|
10
|
-
// Only warn on unhandled requests instead of error, since
|
|
10
|
+
// Only warn on unhandled requests instead of error, since transport/http-client.test.ts
|
|
11
11
|
// uses direct fetch mocking which bypasses MSW
|
|
12
12
|
exports.server.listen({ onUnhandledRequest: 'warn' });
|
|
13
13
|
});
|