Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Const Enum to Enum #1097

Merged
merged 3 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/generators/modelsGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ const writeExtensibleChoice = (
) {
const enumName = getExtensibleEnumName(choice);
modelsIndexFile.addEnum({
isConst: true,
isConst: false,
isExported: true,
name: enumName,
docs: [
Expand Down
1 change: 1 addition & 0 deletions src/generators/static/packageFileGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ function regularAutorestPackage(
"esm/**/*.d.ts.map",
`${srcPath}/**/*.ts`,
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/appconfiguration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export interface AppConfigurationClientGetRevisionsNextHeaders {
}

/** Known values of {@link Get6ItemsItem} that the service accepts. */
export const enum KnownGet6ItemsItem {
export enum KnownGet6ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -221,7 +221,7 @@ export const enum KnownGet6ItemsItem {
export type Get6ItemsItem = string;

/** Known values of {@link Head6ItemsItem} that the service accepts. */
export const enum KnownHead6ItemsItem {
export enum KnownHead6ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -249,7 +249,7 @@ export const enum KnownHead6ItemsItem {
export type Head6ItemsItem = string;

/** Known values of {@link Get7ItemsItem} that the service accepts. */
export const enum KnownGet7ItemsItem {
export enum KnownGet7ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -277,7 +277,7 @@ export const enum KnownGet7ItemsItem {
export type Get7ItemsItem = string;

/** Known values of {@link Head7ItemsItem} that the service accepts. */
export const enum KnownHead7ItemsItem {
export enum KnownHead7ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -305,7 +305,7 @@ export const enum KnownHead7ItemsItem {
export type Head7ItemsItem = string;

/** Known values of {@link Enum4} that the service accepts. */
export const enum KnownEnum4 {
export enum KnownEnum4 {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -333,7 +333,7 @@ export const enum KnownEnum4 {
export type Enum4 = string;

/** Known values of {@link Enum5} that the service accepts. */
export const enum KnownEnum5 {
export enum KnownEnum5 {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export interface AppConfigurationClientGetRevisionsNextHeaders {
}

/** Known values of {@link Get6ItemsItem} that the service accepts. */
export const enum KnownGet6ItemsItem {
export enum KnownGet6ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -221,7 +221,7 @@ export const enum KnownGet6ItemsItem {
export type Get6ItemsItem = string;

/** Known values of {@link Head6ItemsItem} that the service accepts. */
export const enum KnownHead6ItemsItem {
export enum KnownHead6ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -249,7 +249,7 @@ export const enum KnownHead6ItemsItem {
export type Head6ItemsItem = string;

/** Known values of {@link Get7ItemsItem} that the service accepts. */
export const enum KnownGet7ItemsItem {
export enum KnownGet7ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -277,7 +277,7 @@ export const enum KnownGet7ItemsItem {
export type Get7ItemsItem = string;

/** Known values of {@link Head7ItemsItem} that the service accepts. */
export const enum KnownHead7ItemsItem {
export enum KnownHead7ItemsItem {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -305,7 +305,7 @@ export const enum KnownHead7ItemsItem {
export type Head7ItemsItem = string;

/** Known values of {@link Enum4} that the service accepts. */
export const enum KnownEnum4 {
export enum KnownEnum4 {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down Expand Up @@ -333,7 +333,7 @@ export const enum KnownEnum4 {
export type Enum4 = string;

/** Known values of {@link Enum5} that the service accepts. */
export const enum KnownEnum5 {
export enum KnownEnum5 {
Key = "key",
Label = "label",
ContentType = "content_type",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/arrayConstraints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Product {
}

/** Known values of {@link Enum0} that the service accepts. */
export const enum KnownEnum0 {
export enum KnownEnum0 {
One = "one",
Two = "two"
}
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/attestation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
4 changes: 2 additions & 2 deletions test/integration/generated/attestation/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export interface CloudErrorBody {
}

/** Known values of {@link AttestationType} that the service accepts. */
export const enum KnownAttestationType {
export enum KnownAttestationType {
/** Intel Software Guard eXtensions */
SgxEnclave = "SgxEnclave",
/** OpenEnclave extensions to SGX */
Expand All @@ -50,7 +50,7 @@ export const enum KnownAttestationType {
export type AttestationType = string;

/** Known values of {@link DataType} that the service accepts. */
export const enum KnownDataType {
export enum KnownDataType {
/** The contents of the field should be treated as binary and not interpreted by MAA. */
Binary = "Binary",
/** The contents of the field should be treated as a JSON object and may be further interpreted by MAA. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/azureReport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyArray/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
4 changes: 2 additions & 2 deletions test/integration/generated/bodyArray/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface Product {
}

/** Known values of {@link Enum0} that the service accepts. */
export const enum KnownEnum0 {
export enum KnownEnum0 {
Foo1 = "foo1",
Foo2 = "foo2",
Foo3 = "foo3"
Expand All @@ -37,7 +37,7 @@ export const enum KnownEnum0 {
export type Enum0 = string;

/** Known values of {@link Enum1} that the service accepts. */
export const enum KnownEnum1 {
export enum KnownEnum1 {
Foo1 = "foo1",
Foo2 = "foo2",
Foo3 = "foo3"
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyBoolean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyByte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyComplex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
6 changes: 3 additions & 3 deletions test/integration/generated/bodyComplex/src/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export type Cookiecuttershark = Shark & {
};

/** Known values of {@link CMYKColors} that the service accepts. */
export const enum KnownCMYKColors {
export enum KnownCMYKColors {
Cyan = "cyan",
Magenta = "Magenta",
Yellow = "YELLOW",
Expand All @@ -223,7 +223,7 @@ export const enum KnownCMYKColors {
export type CMYKColors = string;

/** Known values of {@link MyKind} that the service accepts. */
export const enum KnownMyKind {
export enum KnownMyKind {
Kind1 = "Kind1"
}

Expand All @@ -237,7 +237,7 @@ export const enum KnownMyKind {
export type MyKind = string;

/** Known values of {@link GoblinSharkColor} that the service accepts. */
export const enum KnownGoblinSharkColor {
export enum KnownGoblinSharkColor {
Pink = "pink",
Gray = "gray",
Brown = "brown",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export type Cookiecuttershark = Shark & {
};

/** Known values of {@link CMYKColors} that the service accepts. */
export const enum KnownCMYKColors {
export enum KnownCMYKColors {
Cyan = "cyan",
Magenta = "Magenta",
Yellow = "YELLOW",
Expand All @@ -223,7 +223,7 @@ export const enum KnownCMYKColors {
export type CMYKColors = string;

/** Known values of {@link MyKind} that the service accepts. */
export const enum KnownMyKind {
export enum KnownMyKind {
Kind1 = "Kind1"
}

Expand All @@ -237,7 +237,7 @@ export const enum KnownMyKind {
export type MyKind = string;

/** Known values of {@link GoblinSharkColor} that the service accepts. */
export const enum KnownGoblinSharkColor {
export enum KnownGoblinSharkColor {
Pink = "pink",
Gray = "gray",
Brown = "brown",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyDate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyDateTime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyDictionary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyDuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyFile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyFormData/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
1 change: 1 addition & 0 deletions test/integration/generated/bodyInteger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"esm/**/*.d.ts.map",
"src/**/*.ts",
"README.md",
"LICENSE",
"rollup.config.js",
"tsconfig.json",
"review/*",
Expand Down
Loading