Skip to content

Commit 94e76c0

Browse files
committed
ci: regenerated with OpenAPI Doc 0.3.0, Speakeay CLI 1.19.7
1 parent 88edaa6 commit 94e76c0

File tree

14 files changed

+90
-201
lines changed

14 files changed

+90
-201
lines changed

RELEASES.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,4 +286,12 @@ Based on:
286286
- OpenAPI Doc 0.3.0 https://docs.speakeasyapi.dev/openapi.yaml
287287
- Speakeasy CLI 1.19.6 (2.17.8) https://github.com/speakeasy-api/speakeasy
288288
### Releases
289-
- [NPM v1.15.0] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.15.0 - .
289+
- [NPM v1.15.0] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.15.0 - .
290+
291+
## 2023-04-12 00:10:23
292+
### Changes
293+
Based on:
294+
- OpenAPI Doc 0.3.0 https://docs.speakeasyapi.dev/openapi.yaml
295+
- Speakeasy CLI 1.19.7 (2.17.9) https://github.com/speakeasy-api/speakeasy
296+
### Releases
297+
- [NPM v1.15.1] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/1.15.1 - .

gen.yaml

Lines changed: 4 additions & 4 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.19.6
6-
generationVersion: 2.17.8
5+
speakeasyVersion: 1.19.7
6+
generationVersion: 2.17.9
77
generation:
88
telemetryEnabled: true
99
sdkClassName: speakeasy
10-
sdkFlattening: true
10+
sdkFlattening: false
1111
singleTagPerOp: false
1212
typescript:
13-
version: 1.15.0
13+
version: 1.15.1
1414
author: Speakeasy
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.15.0",
3+
"version": "1.15.1",
44
"author": "Speakeasy",
55
"scripts": {
66
"prepare": "tsc --build"

src/internal/utils/utils.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -341,39 +341,33 @@ export function encodeAndConvertPrimitiveVal(
341341
);
342342
}
343343

344-
export function deserializeJSONResponse<T>(
345-
value: T,
346-
klass?: any,
347-
elemDepth = 0
348-
): any {
344+
export function objectToClass<T>(value: T, klass?: any, elemDepth = 0): any {
349345
if (value !== Object(value)) {
350346
return value;
351347
}
352348

353349
if (elemDepth === 0 && klass != null) {
354350
return plainToInstance(klass, value, {
355351
excludeExtraneousValues: true,
352+
exposeUnsetFields: false,
356353
}) as typeof klass;
357354
}
358355

359356
if (Array.isArray(value)) {
360-
return value.map((v) => deserializeJSONResponse(v, klass, elemDepth - 1));
357+
return value.map((v) => objectToClass(v, klass, elemDepth - 1));
361358
}
362359

363360
if (typeof value === "object" && value != null) {
364361
const copiedRecord: Record<string, any> = {};
365362
for (const key in value) {
366-
copiedRecord[key] = deserializeJSONResponse(
367-
value[key],
368-
klass,
369-
elemDepth - 1
370-
);
363+
copiedRecord[key] = objectToClass(value[key], klass, elemDepth - 1);
371364
}
372365
return copiedRecord;
373366
}
374367

375368
return plainToInstance(klass, value, {
376369
excludeExtraneousValues: true,
370+
exposeUnsetFields: false,
377371
}) as typeof klass;
378372
}
379373

src/sdk/apiendpoints.ts

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ export class ApiEndpoints {
8585
break;
8686
default:
8787
if (utils.matchContentType(contentType, `application/json`)) {
88-
res.error = utils.deserializeJSONResponse(
89-
httpRes?.data,
90-
shared.ErrorT
91-
);
88+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
9289
}
9390
break;
9491
}
@@ -147,18 +144,15 @@ export class ApiEndpoints {
147144
switch (true) {
148145
case httpRes?.status == 200:
149146
if (utils.matchContentType(contentType, `application/json`)) {
150-
res.apiEndpoint = utils.deserializeJSONResponse(
147+
res.apiEndpoint = utils.objectToClass(
151148
httpRes?.data,
152149
shared.ApiEndpoint
153150
);
154151
}
155152
break;
156153
default:
157154
if (utils.matchContentType(contentType, `application/json`)) {
158-
res.error = utils.deserializeJSONResponse(
159-
httpRes?.data,
160-
shared.ErrorT
161-
);
155+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
162156
}
163157
break;
164158
}
@@ -217,18 +211,15 @@ export class ApiEndpoints {
217211
switch (true) {
218212
case httpRes?.status == 200:
219213
if (utils.matchContentType(contentType, `application/json`)) {
220-
res.generateOpenApiSpecDiff = utils.deserializeJSONResponse(
214+
res.generateOpenApiSpecDiff = utils.objectToClass(
221215
httpRes?.data,
222216
shared.GenerateOpenApiSpecDiff
223217
);
224218
}
225219
break;
226220
default:
227221
if (utils.matchContentType(contentType, `application/json`)) {
228-
res.error = utils.deserializeJSONResponse(
229-
httpRes?.data,
230-
shared.ErrorT
231-
);
222+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
232223
}
233224
break;
234225
}
@@ -295,10 +286,7 @@ export class ApiEndpoints {
295286
break;
296287
default:
297288
if (utils.matchContentType(contentType, `application/json`)) {
298-
res.error = utils.deserializeJSONResponse(
299-
httpRes?.data,
300-
shared.ErrorT
301-
);
289+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
302290
}
303291
break;
304292
}
@@ -355,7 +343,7 @@ export class ApiEndpoints {
355343
if (utils.matchContentType(contentType, `application/json`)) {
356344
res.apiEndpoints = [];
357345
const resFieldDepth: number = utils.getResFieldDepth(res);
358-
res.apiEndpoints = utils.deserializeJSONResponse(
346+
res.apiEndpoints = utils.objectToClass(
359347
httpRes?.data,
360348
shared.ApiEndpoint,
361349
resFieldDepth
@@ -364,10 +352,7 @@ export class ApiEndpoints {
364352
break;
365353
default:
366354
if (utils.matchContentType(contentType, `application/json`)) {
367-
res.error = utils.deserializeJSONResponse(
368-
httpRes?.data,
369-
shared.ErrorT
370-
);
355+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
371356
}
372357
break;
373358
}
@@ -424,7 +409,7 @@ export class ApiEndpoints {
424409
if (utils.matchContentType(contentType, `application/json`)) {
425410
res.apiEndpoints = [];
426411
const resFieldDepth: number = utils.getResFieldDepth(res);
427-
res.apiEndpoints = utils.deserializeJSONResponse(
412+
res.apiEndpoints = utils.objectToClass(
428413
httpRes?.data,
429414
shared.ApiEndpoint,
430415
resFieldDepth
@@ -433,10 +418,7 @@ export class ApiEndpoints {
433418
break;
434419
default:
435420
if (utils.matchContentType(contentType, `application/json`)) {
436-
res.error = utils.deserializeJSONResponse(
437-
httpRes?.data,
438-
shared.ErrorT
439-
);
421+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
440422
}
441423
break;
442424
}
@@ -491,18 +473,15 @@ export class ApiEndpoints {
491473
switch (true) {
492474
case httpRes?.status == 200:
493475
if (utils.matchContentType(contentType, `application/json`)) {
494-
res.apiEndpoint = utils.deserializeJSONResponse(
476+
res.apiEndpoint = utils.objectToClass(
495477
httpRes?.data,
496478
shared.ApiEndpoint
497479
);
498480
}
499481
break;
500482
default:
501483
if (utils.matchContentType(contentType, `application/json`)) {
502-
res.error = utils.deserializeJSONResponse(
503-
httpRes?.data,
504-
shared.ErrorT
505-
);
484+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
506485
}
507486
break;
508487
}
@@ -577,18 +556,15 @@ export class ApiEndpoints {
577556
switch (true) {
578557
case httpRes?.status == 200:
579558
if (utils.matchContentType(contentType, `application/json`)) {
580-
res.apiEndpoint = utils.deserializeJSONResponse(
559+
res.apiEndpoint = utils.objectToClass(
581560
httpRes?.data,
582561
shared.ApiEndpoint
583562
);
584563
}
585564
break;
586565
default:
587566
if (utils.matchContentType(contentType, `application/json`)) {
588-
res.error = utils.deserializeJSONResponse(
589-
httpRes?.data,
590-
shared.ErrorT
591-
);
567+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
592568
}
593569
break;
594570
}

src/sdk/apis.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ export class Apis {
8585
break;
8686
default:
8787
if (utils.matchContentType(contentType, `application/json`)) {
88-
res.error = utils.deserializeJSONResponse(
89-
httpRes?.data,
90-
shared.ErrorT
91-
);
88+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
9289
}
9390
break;
9491
}
@@ -147,18 +144,15 @@ export class Apis {
147144
switch (true) {
148145
case httpRes?.status == 200:
149146
if (utils.matchContentType(contentType, `application/json`)) {
150-
res.generateOpenApiSpecDiff = utils.deserializeJSONResponse(
147+
res.generateOpenApiSpecDiff = utils.objectToClass(
151148
httpRes?.data,
152149
shared.GenerateOpenApiSpecDiff
153150
);
154151
}
155152
break;
156153
default:
157154
if (utils.matchContentType(contentType, `application/json`)) {
158-
res.error = utils.deserializeJSONResponse(
159-
httpRes?.data,
160-
shared.ErrorT
161-
);
155+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
162156
}
163157
break;
164158
}
@@ -225,10 +219,7 @@ export class Apis {
225219
break;
226220
default:
227221
if (utils.matchContentType(contentType, `application/json`)) {
228-
res.error = utils.deserializeJSONResponse(
229-
httpRes?.data,
230-
shared.ErrorT
231-
);
222+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
232223
}
233224
break;
234225
}
@@ -286,7 +277,7 @@ export class Apis {
286277
if (utils.matchContentType(contentType, `application/json`)) {
287278
res.apis = [];
288279
const resFieldDepth: number = utils.getResFieldDepth(res);
289-
res.apis = utils.deserializeJSONResponse(
280+
res.apis = utils.objectToClass(
290281
httpRes?.data,
291282
shared.Api,
292283
resFieldDepth
@@ -295,10 +286,7 @@ export class Apis {
295286
break;
296287
default:
297288
if (utils.matchContentType(contentType, `application/json`)) {
298-
res.error = utils.deserializeJSONResponse(
299-
httpRes?.data,
300-
shared.ErrorT
301-
);
289+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
302290
}
303291
break;
304292
}
@@ -355,7 +343,7 @@ export class Apis {
355343
if (utils.matchContentType(contentType, `application/json`)) {
356344
res.apis = [];
357345
const resFieldDepth: number = utils.getResFieldDepth(res);
358-
res.apis = utils.deserializeJSONResponse(
346+
res.apis = utils.objectToClass(
359347
httpRes?.data,
360348
shared.Api,
361349
resFieldDepth
@@ -364,10 +352,7 @@ export class Apis {
364352
break;
365353
default:
366354
if (utils.matchContentType(contentType, `application/json`)) {
367-
res.error = utils.deserializeJSONResponse(
368-
httpRes?.data,
369-
shared.ErrorT
370-
);
355+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
371356
}
372357
break;
373358
}
@@ -439,15 +424,12 @@ export class Apis {
439424
switch (true) {
440425
case httpRes?.status == 200:
441426
if (utils.matchContentType(contentType, `application/json`)) {
442-
res.api = utils.deserializeJSONResponse(httpRes?.data, shared.Api);
427+
res.api = utils.objectToClass(httpRes?.data, shared.Api);
443428
}
444429
break;
445430
default:
446431
if (utils.matchContentType(contentType, `application/json`)) {
447-
res.error = utils.deserializeJSONResponse(
448-
httpRes?.data,
449-
shared.ErrorT
450-
);
432+
res.error = utils.objectToClass(httpRes?.data, shared.ErrorT);
451433
}
452434
break;
453435
}

0 commit comments

Comments
 (0)