Skip to content

Commit 5139904

Browse files
committed
refactor enum type
1 parent 40a8926 commit 5139904

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
## CHANGELOG
22

33
## v5.0.0
4-
- Refactor SLAS helpers
5-
6-
- TODO: update SLAS helper TSdoc comments in isomorphic SDK
4+
- Enum types have been added for certain operations and types
5+
- Certain operations have had types updated for query parameters
6+
- SLAS helpers have been refactored to accept a single `options` object argument, where the properties are the old arguments
7+
- Path parameter special characters are encoded by default
78

89
## v4.2.0
910

templatesOas/apis.enum.mustache

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ export enum {{operationIdCamelCase}}{{enumName}} {
1212
}
1313
{{/stringEnums}}
1414
{{^stringEnums}}
15-
16-
export const {{operationIdCamelCase}}{{enumName}} = {
15+
export type {{operationIdCamelCase}}{{enumName}} =
1716
{{#allowableValues}}
1817
{{#enumVars}}
19-
{{{name}}}: {{{value}}}{{^-last}},{{/-last}}
18+
{{{value}}}{{^-last}} |{{/-last}}{{#-last}};{{/-last}}
2019
{{/enumVars}}
2120
{{/allowableValues}}
22-
} as const;
23-
export type {{operationIdCamelCase}}{{enumName}} = typeof {{operationIdCamelCase}}{{enumName}}[keyof typeof {{operationIdCamelCase}}{{enumName}}];
21+
2422
{{/stringEnums}}
2523
{{/isEnum}}
2624
{{/allParams}}

0 commit comments

Comments
 (0)