-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support-usage-and-access * add generate orphan models options * test push code to pr * add test case for clientGeneratorCore access and usage * rename public as operation name for now * fix integration test * add modular test case and remove duplicate case * regenerate all test * regenerate rlc test * fix ci --------- Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
- Loading branch information
Showing
66 changed files
with
2,296 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import "@azure-tools/typespec-client-generator-core"; | ||
import "./main.tsp"; | ||
|
||
using Azure.ClientGenerator.Core; | ||
|
||
// Some models from routes with suppressed visibility are still desired for custom public surface. | ||
@@access(WidgetService.NonReferencedModel, Access.public); | ||
@@usage(WidgetService.NonReferencedModel, Usage.input | Usage.output); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 97 additions & 0 deletions
97
packages/typespec-ts/test/modularIntegration/azureClientGeneratorCoreAccess.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { assert } from "chai"; | ||
import { AccessClient } from "./generated/azure/clientGeneratorCore/access/src/index.js"; | ||
describe("Azure ClientGeneratorCore Access Client", () => { | ||
let client: AccessClient; | ||
|
||
beforeEach(() => { | ||
client = new AccessClient({ | ||
allowInsecureConnection: true, | ||
retryOptions: { | ||
maxRetries: 0 | ||
} | ||
}); | ||
}); | ||
|
||
it("should get no decorator in public operation", async () => { | ||
try { | ||
const result = await client.noDecoratorInPublic("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get public decorator in public operation", async () => { | ||
try { | ||
const result = await client.publicDecoratorInPublic("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get no decorator in internal operation", async () => { | ||
try { | ||
const result = await client.noDecoratorInInternal("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get internal decorator in internal operation", async () => { | ||
try { | ||
const result = await client.internalDecoratorInInternal("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get public decorator in internal operation", async () => { | ||
try { | ||
const result = await client.publicDecoratorInInternal("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get public shared model in operation", async () => { | ||
try { | ||
const result = await client.publicOperation("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get internal shared model in operation", async () => { | ||
try { | ||
const result = await client.internal("myname"); | ||
assert.equal(result.name, "myname"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get relative model in operation", async () => { | ||
try { | ||
const result = await client.operation("myname"); | ||
assert.equal(result.name, "Madge"); | ||
assert.equal(result.inner.name, "Madge"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
|
||
it("should get relative model in discriminator", async () => { | ||
try { | ||
const result = await client.discriminator("myname"); | ||
assert.equal(result.name, "Madge"); | ||
assert.equal(result.kind, "real"); | ||
} catch (err) { | ||
assert.fail(err as string); | ||
} | ||
}); | ||
}); |
Oops, something went wrong.