@doist/twist-sdk 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/authentication.js +90 -5
- package/dist/cjs/batch-builder.js +2 -2
- package/dist/cjs/clients/base-client.js +2 -1
- 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/consts/endpoints.js +3 -2
- 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/api-version.js +6 -0
- package/dist/cjs/types/entities.js +4 -4
- package/dist/cjs/types/http.js +2 -0
- package/dist/cjs/types/index.js +1 -0
- package/dist/esm/authentication.js +85 -1
- package/dist/esm/batch-builder.js +1 -1
- package/dist/esm/clients/base-client.js +2 -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/consts/endpoints.js +3 -2
- 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/api-version.js +5 -1
- package/dist/esm/types/entities.js +1 -1
- package/dist/esm/types/http.js +1 -1
- package/dist/esm/types/index.js +1 -0
- package/dist/types/authentication.d.ts +5 -1
- package/dist/types/consts/endpoints.d.ts +2 -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/api-version.d.ts +3 -1
- package/dist/types/types/entities.d.ts +25 -0
- package/dist/types/types/http.d.ts +2 -1
- package/dist/types/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -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,
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
exports.ThreadsClient = 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 ThreadsClient = /** @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.ThreadSchema) };
|
|
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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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 ThreadsClient = /** @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,
|
|
@@ -247,7 +247,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
247
247
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
248
248
|
return { method: method, url: url, params: params };
|
|
249
249
|
}
|
|
250
|
-
return (0,
|
|
250
|
+
return (0, http_client_1.request)({
|
|
251
251
|
httpMethod: method,
|
|
252
252
|
baseUri: this.getBaseUri(),
|
|
253
253
|
relativePath: url,
|
|
@@ -263,7 +263,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
263
263
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
264
264
|
return { method: method, url: url, params: params };
|
|
265
265
|
}
|
|
266
|
-
return (0,
|
|
266
|
+
return (0, http_client_1.request)({
|
|
267
267
|
httpMethod: method,
|
|
268
268
|
baseUri: this.getBaseUri(),
|
|
269
269
|
relativePath: url,
|
|
@@ -286,7 +286,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
286
286
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
287
287
|
return { method: method, url: url, params: params };
|
|
288
288
|
}
|
|
289
|
-
return (0,
|
|
289
|
+
return (0, http_client_1.request)({
|
|
290
290
|
httpMethod: method,
|
|
291
291
|
baseUri: this.getBaseUri(),
|
|
292
292
|
relativePath: url,
|
|
@@ -302,7 +302,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
302
302
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
303
303
|
return { method: method, url: url, params: params };
|
|
304
304
|
}
|
|
305
|
-
return (0,
|
|
305
|
+
return (0, http_client_1.request)({
|
|
306
306
|
httpMethod: method,
|
|
307
307
|
baseUri: this.getBaseUri(),
|
|
308
308
|
relativePath: url,
|
|
@@ -318,7 +318,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
318
318
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
319
319
|
return { method: method, url: url, params: params };
|
|
320
320
|
}
|
|
321
|
-
return (0,
|
|
321
|
+
return (0, http_client_1.request)({
|
|
322
322
|
httpMethod: method,
|
|
323
323
|
baseUri: this.getBaseUri(),
|
|
324
324
|
relativePath: url,
|
|
@@ -335,7 +335,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
335
335
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
336
336
|
return { method: method, url: url, params: params, schema: schema };
|
|
337
337
|
}
|
|
338
|
-
return (0,
|
|
338
|
+
return (0, http_client_1.request)({
|
|
339
339
|
httpMethod: method,
|
|
340
340
|
baseUri: this.getBaseUri(),
|
|
341
341
|
relativePath: url,
|
|
@@ -352,7 +352,7 @@ var ThreadsClient = /** @class */ (function (_super) {
|
|
|
352
352
|
if (options === null || options === void 0 ? void 0 : options.batch) {
|
|
353
353
|
return { method: method, url: url, params: params, schema: schema };
|
|
354
354
|
}
|
|
355
|
-
return (0,
|
|
355
|
+
return (0, http_client_1.request)({
|
|
356
356
|
httpMethod: method,
|
|
357
357
|
baseUri: this.getBaseUri(),
|
|
358
358
|
relativePath: url,
|
|
@@ -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,
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ENDPOINT_CONVERSATION_MESSAGES = exports.ENDPOINT_SEARCH = exports.ENDPOINT_REACTIONS = exports.ENDPOINT_INBOX = exports.ENDPOINT_NOTIFICATIONS = exports.ENDPOINT_COMMENTS = exports.ENDPOINT_CONVERSATIONS = exports.ENDPOINT_GROUPS = exports.ENDPOINT_THREADS = exports.ENDPOINT_CHANNELS = exports.ENDPOINT_WORKSPACES = exports.ENDPOINT_USERS = exports.API_BASE_URI = exports.API_VERSION = void 0;
|
|
4
4
|
exports.getTwistBaseUri = getTwistBaseUri;
|
|
5
|
+
var api_version_1 = require("../types/api-version");
|
|
5
6
|
var BASE_URI = 'https://api.twist.com';
|
|
6
|
-
exports.API_VERSION =
|
|
7
|
+
exports.API_VERSION = api_version_1.DEFAULT_API_VERSION;
|
|
7
8
|
/**
|
|
8
9
|
* @deprecated Use getTwistBaseUri() instead. This constant is kept for backward compatibility.
|
|
9
10
|
*/
|
|
@@ -16,7 +17,7 @@ exports.API_BASE_URI = "/api/".concat(exports.API_VERSION, "/");
|
|
|
16
17
|
* @returns Complete base URI with trailing slash (e.g., 'https://api.twist.com/api/v3/')
|
|
17
18
|
*/
|
|
18
19
|
function getTwistBaseUri(version, domainBase) {
|
|
19
|
-
if (version === void 0) { version =
|
|
20
|
+
if (version === void 0) { version = api_version_1.DEFAULT_API_VERSION; }
|
|
20
21
|
if (domainBase === void 0) { domainBase = BASE_URI; }
|
|
21
22
|
return new URL("/api/".concat(version, "/"), domainBase).toString();
|
|
22
23
|
}
|
|
@@ -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
|
});
|