Skip to content

Commit 8db72f3

Browse files
committed
ci: regenerated with OpenAPI Doc 0.3.0, Speakeay CLI 1.47.2
1 parent dbad093 commit 8db72f3

File tree

14 files changed

+188
-96
lines changed

14 files changed

+188
-96
lines changed

RELEASES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,4 +558,12 @@ Based on:
558558
- OpenAPI Doc 0.3.0 https://docs.speakeasyapi.dev/openapi.yaml
559559
- Speakeasy CLI 1.47.1 (2.39.2) https://github.com/speakeasy-api/speakeasy
560560
### Releases
561-
- [NPM v1.33.1] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.33.1 - .
561+
- [NPM v1.33.1] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.33.1 - .
562+
563+
## 2023-06-14 00:10:44
564+
### Changes
565+
Based on:
566+
- OpenAPI Doc 0.3.0 https://docs.speakeasyapi.dev/openapi.yaml
567+
- Speakeasy CLI 1.47.2 (2.39.8) https://github.com/speakeasy-api/speakeasy
568+
### Releases
569+
- [NPM v1.33.2] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.33.2 - .

gen.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ configVersion: 1.0.0
22
management:
33
docChecksum: 2bba3b8f9d211b02569b3f9aff0d34b4
44
docVersion: 0.3.0
5-
speakeasyVersion: 1.47.1
6-
generationVersion: 2.39.2
5+
speakeasyVersion: 1.47.2
6+
generationVersion: 2.39.8
77
generation:
88
sdkClassName: speakeasy
99
singleTagPerOp: false
1010
telemetryEnabled: true
1111
typescript:
12-
version: 1.33.1
12+
version: 1.33.2
1313
author: Speakeasy
1414
maxMethodParams: 0
1515
packageName: '@speakeasy-api/speakeasy-client-sdk-typescript'

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@speakeasy-api/speakeasy-client-sdk-typescript",
3-
"version": "1.33.1",
3+
"version": "1.33.2",
44
"author": "Speakeasy",
55
"scripts": {
66
"prepare": "tsc --build"

src/internal/utils/retries.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,13 @@ export class RetryConfig {
2828
backoff?: BackoffStrategy;
2929
retryConnectionErrors: boolean;
3030

31-
constructor(strategy: string, retryConnectionErrors = true) {
31+
constructor(
32+
strategy: string,
33+
backoff?: BackoffStrategy,
34+
retryConnectionErrors = true
35+
) {
3236
this.strategy = strategy;
37+
this.backoff = backoff;
3338
this.retryConnectionErrors = retryConnectionErrors;
3439
}
3540
}
@@ -50,6 +55,8 @@ class PermanentError extends Error {
5055
constructor(inner: unknown) {
5156
super("Permanent error");
5257
this.inner = inner;
58+
59+
Object.setPrototypeOf(this, PermanentError.prototype);
5360
}
5461
}
5562

@@ -59,6 +66,8 @@ class TemporaryError extends Error {
5966
constructor(res: AxiosResponse<any, any>) {
6067
super("Temporary error");
6168
this.res = res;
69+
70+
Object.setPrototypeOf(this, TemporaryError.prototype);
6271
}
6372
}
6473

src/sdk/apiendpoints.ts

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class ApiEndpoints {
5656
url: url,
5757
method: "delete",
5858
headers: headers,
59+
responseType: "arraybuffer",
5960
...config,
6061
});
6162

@@ -70,12 +71,13 @@ export class ApiEndpoints {
7071
contentType: contentType,
7172
rawResponse: httpRes,
7273
});
74+
const decodedRes = new TextDecoder().decode(httpRes?.data);
7375
switch (true) {
7476
case httpRes?.status == 200:
7577
break;
7678
default:
7779
if (utils.matchContentType(contentType, `application/json`)) {
78-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
80+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
7981
}
8082
break;
8183
}
@@ -122,6 +124,7 @@ export class ApiEndpoints {
122124
url: url,
123125
method: "get",
124126
headers: headers,
127+
responseType: "arraybuffer",
125128
...config,
126129
});
127130

@@ -136,15 +139,19 @@ export class ApiEndpoints {
136139
contentType: contentType,
137140
rawResponse: httpRes,
138141
});
142+
const decodedRes = new TextDecoder().decode(httpRes?.data);
139143
switch (true) {
140144
case httpRes?.status == 200:
141145
if (utils.matchContentType(contentType, `application/json`)) {
142-
res.apiEndpoint = utils.objectToClass(httpRes?.data, shared.ApiEndpoint);
146+
res.apiEndpoint = utils.objectToClass(
147+
JSON.parse(decodedRes),
148+
shared.ApiEndpoint
149+
);
143150
}
144151
break;
145152
default:
146153
if (utils.matchContentType(contentType, `application/json`)) {
147-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
154+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
148155
}
149156
break;
150157
}
@@ -191,6 +198,7 @@ export class ApiEndpoints {
191198
url: url,
192199
method: "get",
193200
headers: headers,
201+
responseType: "arraybuffer",
194202
...config,
195203
});
196204

@@ -206,18 +214,19 @@ export class ApiEndpoints {
206214
contentType: contentType,
207215
rawResponse: httpRes,
208216
});
217+
const decodedRes = new TextDecoder().decode(httpRes?.data);
209218
switch (true) {
210219
case httpRes?.status == 200:
211220
if (utils.matchContentType(contentType, `application/json`)) {
212221
res.generateOpenApiSpecDiff = utils.objectToClass(
213-
httpRes?.data,
222+
JSON.parse(decodedRes),
214223
shared.GenerateOpenApiSpecDiff
215224
);
216225
}
217226
break;
218227
default:
219228
if (utils.matchContentType(contentType, `application/json`)) {
220-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
229+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
221230
}
222231
break;
223232
}
@@ -263,6 +272,7 @@ export class ApiEndpoints {
263272
url: url,
264273
method: "get",
265274
headers: headers,
275+
responseType: "arraybuffer",
266276
...config,
267277
});
268278

@@ -278,18 +288,16 @@ export class ApiEndpoints {
278288
contentType: contentType,
279289
rawResponse: httpRes,
280290
});
291+
const decodedRes = new TextDecoder().decode(httpRes?.data);
281292
switch (true) {
282293
case httpRes?.status == 200:
283294
if (utils.matchContentType(contentType, `application/octet-stream`)) {
284-
const resBody: string = JSON.stringify(httpRes?.data, null, 0);
285-
const out: Uint8Array = new Uint8Array(resBody.length);
286-
for (let i = 0; i < resBody.length; i++) out[i] = resBody.charCodeAt(i);
287-
res.postmanCollection = out;
295+
res.postmanCollection = httpRes?.data;
288296
}
289297
break;
290298
default:
291299
if (utils.matchContentType(contentType, `application/json`)) {
292-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
300+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
293301
}
294302
break;
295303
}
@@ -328,6 +336,7 @@ export class ApiEndpoints {
328336
url: url,
329337
method: "get",
330338
headers: headers,
339+
responseType: "arraybuffer",
331340
...config,
332341
});
333342

@@ -343,21 +352,22 @@ export class ApiEndpoints {
343352
contentType: contentType,
344353
rawResponse: httpRes,
345354
});
355+
const decodedRes = new TextDecoder().decode(httpRes?.data);
346356
switch (true) {
347357
case httpRes?.status == 200:
348358
if (utils.matchContentType(contentType, `application/json`)) {
349359
res.apiEndpoints = [];
350360
const resFieldDepth: number = utils.getResFieldDepth(res);
351361
res.apiEndpoints = utils.objectToClass(
352-
httpRes?.data,
362+
JSON.parse(decodedRes),
353363
shared.ApiEndpoint,
354364
resFieldDepth
355365
);
356366
}
357367
break;
358368
default:
359369
if (utils.matchContentType(contentType, `application/json`)) {
360-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
370+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
361371
}
362372
break;
363373
}
@@ -400,6 +410,7 @@ export class ApiEndpoints {
400410
url: url,
401411
method: "get",
402412
headers: headers,
413+
responseType: "arraybuffer",
403414
...config,
404415
});
405416

@@ -415,21 +426,22 @@ export class ApiEndpoints {
415426
contentType: contentType,
416427
rawResponse: httpRes,
417428
});
429+
const decodedRes = new TextDecoder().decode(httpRes?.data);
418430
switch (true) {
419431
case httpRes?.status == 200:
420432
if (utils.matchContentType(contentType, `application/json`)) {
421433
res.apiEndpoints = [];
422434
const resFieldDepth: number = utils.getResFieldDepth(res);
423435
res.apiEndpoints = utils.objectToClass(
424-
httpRes?.data,
436+
JSON.parse(decodedRes),
425437
shared.ApiEndpoint,
426438
resFieldDepth
427439
);
428440
}
429441
break;
430442
default:
431443
if (utils.matchContentType(contentType, `application/json`)) {
432-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
444+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
433445
}
434446
break;
435447
}
@@ -472,6 +484,7 @@ export class ApiEndpoints {
472484
url: url,
473485
method: "get",
474486
headers: headers,
487+
responseType: "arraybuffer",
475488
...config,
476489
});
477490

@@ -486,15 +499,19 @@ export class ApiEndpoints {
486499
contentType: contentType,
487500
rawResponse: httpRes,
488501
});
502+
const decodedRes = new TextDecoder().decode(httpRes?.data);
489503
switch (true) {
490504
case httpRes?.status == 200:
491505
if (utils.matchContentType(contentType, `application/json`)) {
492-
res.apiEndpoint = utils.objectToClass(httpRes?.data, shared.ApiEndpoint);
506+
res.apiEndpoint = utils.objectToClass(
507+
JSON.parse(decodedRes),
508+
shared.ApiEndpoint
509+
);
493510
}
494511
break;
495512
default:
496513
if (utils.matchContentType(contentType, `application/json`)) {
497-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
514+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
498515
}
499516
break;
500517
}
@@ -552,6 +569,7 @@ export class ApiEndpoints {
552569
url: url,
553570
method: "put",
554571
headers: headers,
572+
responseType: "arraybuffer",
555573
data: reqBody,
556574
...config,
557575
});
@@ -567,15 +585,19 @@ export class ApiEndpoints {
567585
contentType: contentType,
568586
rawResponse: httpRes,
569587
});
588+
const decodedRes = new TextDecoder().decode(httpRes?.data);
570589
switch (true) {
571590
case httpRes?.status == 200:
572591
if (utils.matchContentType(contentType, `application/json`)) {
573-
res.apiEndpoint = utils.objectToClass(httpRes?.data, shared.ApiEndpoint);
592+
res.apiEndpoint = utils.objectToClass(
593+
JSON.parse(decodedRes),
594+
shared.ApiEndpoint
595+
);
574596
}
575597
break;
576598
default:
577599
if (utils.matchContentType(contentType, `application/json`)) {
578-
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
600+
res.error = utils.objectToClass(JSON.parse(decodedRes), shared.ErrorT);
579601
}
580602
break;
581603
}

0 commit comments

Comments
 (0)