@azure-typespec/http-client-csharp-mgmt 1.0.0-alpha.20250409.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/emitter/emitter.d.ts +4 -0
- package/dist/emitter/emitter.d.ts.map +1 -0
- package/dist/emitter/emitter.js +77 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/emitter/index.d.ts +2 -0
- package/dist/emitter/index.d.ts.map +1 -0
- package/dist/emitter/index.js +4 -0
- package/dist/emitter/index.js.map +1 -0
- package/dist/emitter/resource-type.d.ts +2 -0
- package/dist/emitter/resource-type.d.ts.map +1 -0
- package/dist/emitter/resource-type.js +31 -0
- package/dist/emitter/resource-type.js.map +1 -0
- package/dist/emitter/sdk-context-options.d.ts +3 -0
- package/dist/emitter/sdk-context-options.d.ts.map +1 -0
- package/dist/emitter/sdk-context-options.js +23 -0
- package/dist/emitter/sdk-context-options.js.map +1 -0
- package/dist/generator/Azure.Core.dll +0 -0
- package/dist/generator/Azure.Generator.Mgmt.deps.json +998 -0
- package/dist/generator/Azure.Generator.Mgmt.dll +0 -0
- package/dist/generator/Azure.Generator.Mgmt.pdb +0 -0
- package/dist/generator/Azure.Generator.Mgmt.xml +818 -0
- package/dist/generator/Azure.Generator.dll +0 -0
- package/dist/generator/Azure.Generator.pdb +0 -0
- package/dist/generator/Azure.Generator.xml +163 -0
- package/dist/generator/Azure.ResourceManager.dll +0 -0
- package/dist/generator/CommandLine.dll +0 -0
- package/dist/generator/Humanizer.dll +0 -0
- package/dist/generator/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/dist/generator/Microsoft.Build.Framework.dll +0 -0
- package/dist/generator/Microsoft.Build.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.CSharp.Workspaces.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.Workspaces.dll +0 -0
- package/dist/generator/Microsoft.CodeAnalysis.dll +0 -0
- package/dist/generator/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/dist/generator/Microsoft.NET.StringTools.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.ClientModel.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.Input.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.dll +0 -0
- package/dist/generator/Microsoft.TypeSpec.Generator.runtimeconfig.json +12 -0
- package/dist/generator/NuGet.Common.dll +0 -0
- package/dist/generator/NuGet.Configuration.dll +0 -0
- package/dist/generator/NuGet.Frameworks.dll +0 -0
- package/dist/generator/Shared/Core/AppContextSwitchHelper.cs +42 -0
- package/dist/generator/Shared/Core/AsyncLockWithValue.cs +260 -0
- package/dist/generator/Shared/Core/AzureKeyCredentialPolicy.cs +50 -0
- package/dist/generator/Shared/Core/ClientDiagnostics.cs +73 -0
- package/dist/generator/Shared/Core/DiagnosticScope.cs +473 -0
- package/dist/generator/Shared/Core/DiagnosticScopeFactory.cs +104 -0
- package/dist/generator/Shared/Core/FixedDelayWithNoJitterStrategy.cs +26 -0
- package/dist/generator/Shared/Core/HttpMessageSanitizer.cs +198 -0
- package/dist/generator/Shared/Core/IOperationSource.cs +14 -0
- package/dist/generator/Shared/Core/NextLinkOperationImplementation.cs +690 -0
- package/dist/generator/Shared/Core/OperationFinalStateVia.cs +16 -0
- package/dist/generator/Shared/Core/OperationInternal.cs +256 -0
- package/dist/generator/Shared/Core/OperationInternalBase.cs +234 -0
- package/dist/generator/Shared/Core/OperationInternalOfT.cs +422 -0
- package/dist/generator/Shared/Core/OperationPoller.cs +114 -0
- package/dist/generator/Shared/Core/RawRequestUriBuilder.cs +192 -0
- package/dist/generator/Shared/Core/SequentialDelayStrategy.cs +38 -0
- package/dist/generator/Shared/Core/TaskExtensions.cs +313 -0
- package/dist/generator/Shared/Core/VoidValue.cs +10 -0
- package/dist/generator/System.ClientModel.dll +0 -0
- package/dist/generator/System.ComponentModel.Composition.dll +0 -0
- package/dist/generator/System.Composition.AttributedModel.dll +0 -0
- package/dist/generator/System.Composition.Convention.dll +0 -0
- package/dist/generator/System.Composition.Hosting.dll +0 -0
- package/dist/generator/System.Composition.Runtime.dll +0 -0
- package/dist/generator/System.Composition.TypedParts.dll +0 -0
- package/dist/generator/System.Configuration.ConfigurationManager.dll +0 -0
- package/dist/generator/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/System.IO.Pipelines.dll +0 -0
- package/dist/generator/System.Memory.Data.dll +0 -0
- package/dist/generator/System.Reflection.MetadataLoadContext.dll +0 -0
- package/dist/generator/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/de/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/es/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/it/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/Azure.Core.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.deps.json +998 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.pdb +0 -0
- package/dist/generator/net8.0/Azure.Generator.Mgmt.xml +818 -0
- package/dist/generator/net8.0/Azure.Generator.dll +0 -0
- package/dist/generator/net8.0/Azure.Generator.pdb +0 -0
- package/dist/generator/net8.0/Azure.Generator.xml +163 -0
- package/dist/generator/net8.0/Azure.ResourceManager.dll +0 -0
- package/dist/generator/net8.0/CommandLine.dll +0 -0
- package/dist/generator/net8.0/Humanizer.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Bcl.AsyncInterfaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Build.Framework.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Build.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.CSharp.Workspaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.CSharp.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.Workspaces.dll +0 -0
- package/dist/generator/net8.0/Microsoft.CodeAnalysis.dll +0 -0
- package/dist/generator/net8.0/Microsoft.Extensions.Logging.Abstractions.dll +0 -0
- package/dist/generator/net8.0/Microsoft.NET.StringTools.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.ClientModel.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.Input.dll +0 -0
- package/dist/generator/net8.0/Microsoft.TypeSpec.Generator.dll +0 -0
- package/dist/generator/net8.0/NuGet.Common.dll +0 -0
- package/dist/generator/net8.0/NuGet.Configuration.dll +0 -0
- package/dist/generator/net8.0/NuGet.Frameworks.dll +0 -0
- package/dist/generator/net8.0/Shared/Core/AppContextSwitchHelper.cs +42 -0
- package/dist/generator/net8.0/Shared/Core/AsyncLockWithValue.cs +260 -0
- package/dist/generator/net8.0/Shared/Core/AzureKeyCredentialPolicy.cs +50 -0
- package/dist/generator/net8.0/Shared/Core/ClientDiagnostics.cs +73 -0
- package/dist/generator/net8.0/Shared/Core/DiagnosticScope.cs +473 -0
- package/dist/generator/net8.0/Shared/Core/DiagnosticScopeFactory.cs +104 -0
- package/dist/generator/net8.0/Shared/Core/FixedDelayWithNoJitterStrategy.cs +26 -0
- package/dist/generator/net8.0/Shared/Core/HttpMessageSanitizer.cs +198 -0
- package/dist/generator/net8.0/Shared/Core/IOperationSource.cs +14 -0
- package/dist/generator/net8.0/Shared/Core/NextLinkOperationImplementation.cs +690 -0
- package/dist/generator/net8.0/Shared/Core/OperationFinalStateVia.cs +16 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternal.cs +256 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternalBase.cs +234 -0
- package/dist/generator/net8.0/Shared/Core/OperationInternalOfT.cs +422 -0
- package/dist/generator/net8.0/Shared/Core/OperationPoller.cs +114 -0
- package/dist/generator/net8.0/Shared/Core/RawRequestUriBuilder.cs +192 -0
- package/dist/generator/net8.0/Shared/Core/SequentialDelayStrategy.cs +38 -0
- package/dist/generator/net8.0/Shared/Core/TaskExtensions.cs +313 -0
- package/dist/generator/net8.0/Shared/Core/VoidValue.cs +10 -0
- package/dist/generator/net8.0/System.ClientModel.dll +0 -0
- package/dist/generator/net8.0/System.ComponentModel.Composition.dll +0 -0
- package/dist/generator/net8.0/System.Composition.AttributedModel.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Convention.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Hosting.dll +0 -0
- package/dist/generator/net8.0/System.Composition.Runtime.dll +0 -0
- package/dist/generator/net8.0/System.Composition.TypedParts.dll +0 -0
- package/dist/generator/net8.0/System.Configuration.ConfigurationManager.dll +0 -0
- package/dist/generator/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/net8.0/System.IO.Pipelines.dll +0 -0
- package/dist/generator/net8.0/System.Memory.Data.dll +0 -0
- package/dist/generator/net8.0/System.Reflection.MetadataLoadContext.dll +0 -0
- package/dist/generator/net8.0/System.Security.Cryptography.ProtectedData.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/cs/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/de/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/es/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/fr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/it/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ja/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ko/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- package/dist/generator/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/net8.0/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/pl/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/pt-BR/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/ru/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.Messages.dll +0 -0
- package/dist/generator/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/tr/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hans/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.CSharp.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.CSharp.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.Workspaces.resources.dll +0 -0
- package/dist/generator/zh-Hant/Microsoft.CodeAnalysis.resources.dll +0 -0
- package/package.json +67 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../emitter/src/emitter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAEL,oBAAoB,EAIrB,MAAM,8BAA8B,CAAC;AAatC,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,oBAAoB,CAAC,iBAOvE"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
+
import { setSDKContextOptions } from "@typespec/http-client-csharp";
|
|
4
|
+
import { $onEmit as $onAzureEmit } from "@azure-typespec/http-client-csharp";
|
|
5
|
+
import { azureSDKContextOptions } from "./sdk-context-options.js";
|
|
6
|
+
import { calculateResourceTypeFromPath } from "./resource-type.js";
|
|
7
|
+
const armResourceOperations = "Azure.ResourceManager.@armResourceOperations";
|
|
8
|
+
const armResourceRead = "Azure.ResourceManager.@armResourceRead";
|
|
9
|
+
const armResourceCreateOrUpdate = "Azure.ResourceManager.@armResourceCreateOrUpdate";
|
|
10
|
+
const singleton = "Azure.ResourceManager.@singleton";
|
|
11
|
+
const resourceMetadata = "Azure.ClientGenerator.Core.@resourceSchema";
|
|
12
|
+
export async function $onEmit(context) {
|
|
13
|
+
context.options["generator-name"] ??= "ManagementClientGenerator";
|
|
14
|
+
context.options["update-code-model"] = updateCodeModel;
|
|
15
|
+
context.options["emitter-extension-path"] ??= import.meta.url;
|
|
16
|
+
context.options["sdk-context-options"] ??= azureSDKContextOptions;
|
|
17
|
+
setSDKContextOptions(azureSDKContextOptions);
|
|
18
|
+
await $onAzureEmit(context);
|
|
19
|
+
}
|
|
20
|
+
function updateCodeModel(codeModel) {
|
|
21
|
+
for (const client of codeModel.clients) {
|
|
22
|
+
updateClient(client);
|
|
23
|
+
}
|
|
24
|
+
function updateClient(client) {
|
|
25
|
+
// TODO: we can implement this decorator in TCGC until we meet the corner case
|
|
26
|
+
// if the client has resourceMetadata decorator, it is a resource client and we don't need to add it again
|
|
27
|
+
if (client.decorators?.some((d) => d.name == resourceMetadata)) {
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// TODO: Once we have the ability to get resource hierarchy from TCGC directly, we can remove this implementation
|
|
31
|
+
// A resource client should have decorator armResourceOperations and contains either a get operation(containing armResourceRead deocrator) or a put operation(containing armResourceCreateOrUpdate decorator)
|
|
32
|
+
if (client.decorators?.some((d) => d.name == armResourceOperations) &&
|
|
33
|
+
client.operations.some((op) => op.decorators?.some((d) => d.name == armResourceRead || armResourceCreateOrUpdate))) {
|
|
34
|
+
let resourceModel = undefined;
|
|
35
|
+
let isSingleton = false;
|
|
36
|
+
let resourceType = undefined;
|
|
37
|
+
// We will try to get resource metadata from put operation firstly, if not found, we will try to get it from get operation
|
|
38
|
+
const putOperation = client.operations.find((op) => op.decorators?.some((d) => d.name == armResourceCreateOrUpdate));
|
|
39
|
+
if (putOperation) {
|
|
40
|
+
const path = putOperation.path;
|
|
41
|
+
resourceType = calculateResourceTypeFromPath(path);
|
|
42
|
+
resourceModel = putOperation.responses.filter((r) => r.bodyType)[0]
|
|
43
|
+
.bodyType;
|
|
44
|
+
isSingleton =
|
|
45
|
+
resourceModel.decorators?.some((d) => d.name == singleton) ?? false;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const getOperation = client.operations.find((op) => op.decorators?.some((d) => d.name == armResourceRead));
|
|
49
|
+
if (getOperation) {
|
|
50
|
+
const path = getOperation.path;
|
|
51
|
+
resourceType = calculateResourceTypeFromPath(path);
|
|
52
|
+
resourceModel = getOperation.responses.filter((r) => r.bodyType)[0]
|
|
53
|
+
.bodyType;
|
|
54
|
+
isSingleton =
|
|
55
|
+
resourceModel.decorators?.some((d) => d.name == singleton) ?? false;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
const resourceMetadataDecorator = {
|
|
59
|
+
name: resourceMetadata,
|
|
60
|
+
arguments: {}
|
|
61
|
+
};
|
|
62
|
+
resourceMetadataDecorator.arguments["resourceModel"] =
|
|
63
|
+
resourceModel?.crossLanguageDefinitionId;
|
|
64
|
+
resourceMetadataDecorator.arguments["isSingleton"] =
|
|
65
|
+
isSingleton.toString();
|
|
66
|
+
resourceMetadataDecorator.arguments["resourceType"] = resourceType;
|
|
67
|
+
client.decorators.push(resourceMetadataDecorator);
|
|
68
|
+
}
|
|
69
|
+
if (client.children) {
|
|
70
|
+
for (const child of client.children) {
|
|
71
|
+
updateClient(child);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return codeModel;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=emitter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../emitter/src/emitter.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAK/F,OAAO,EAKL,oBAAoB,EACrB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BA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;oBAC/B,YAAY,GAAG,6BAA6B,CAAC,IAAI,CAAC,CAAC;oBACnD,aAAa,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;yBAChE,QAA0B,CAAC;oBAC9B,WAAW;wBACT,aAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC;gBACxE,CAAC;YACH,CAAC;YAED,MAAM,yBAAyB,GAAkB;gBAC/C,IAAI,EAAE,gBAAgB;gBACtB,SAAS,EAAE,EAAE;aACd,CAAC;YACF,yBAAyB,CAAC,SAAS,CAAC,eAAe,CAAC;gBAClD,aAAa,EAAE,yBAAyB,CAAC;YAC3C,yBAAyB,CAAC,SAAS,CAAC,aAAa,CAAC;gBAChD,WAAW,CAAC,QAAQ,EAAE,CAAC;YACzB,yBAAyB,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,YAAY,CAAC;YACnE,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpC,YAAY,CAAC,KAAoB,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../emitter/src/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../emitter/src/index.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-type.d.ts","sourceRoot":"","sources":["../../emitter/src/resource-type.ts"],"names":[],"mappings":"AASA,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqBlE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
+
const ResourceGroupScopePrefix = "/subscriptions/{subscriptionId}/resourceGroups";
|
|
4
|
+
const SubscriptionScopePrefix = "/subscriptions";
|
|
5
|
+
const TenantScopePrefix = "/tenants";
|
|
6
|
+
const Providers = "/providers";
|
|
7
|
+
export function calculateResourceTypeFromPath(path) {
|
|
8
|
+
const providerIndex = path.indexOf(Providers);
|
|
9
|
+
if (providerIndex === -1) {
|
|
10
|
+
if (path.startsWith(ResourceGroupScopePrefix)) {
|
|
11
|
+
return "Microsoft.Resources/resourceGroups";
|
|
12
|
+
}
|
|
13
|
+
else if (path.startsWith(SubscriptionScopePrefix)) {
|
|
14
|
+
return "Microsoft.Resources/subscriptions";
|
|
15
|
+
}
|
|
16
|
+
else if (path.startsWith(TenantScopePrefix)) {
|
|
17
|
+
return "Microsoft.Resources/tenants";
|
|
18
|
+
}
|
|
19
|
+
throw `Path ${path} doesn't have resource type`;
|
|
20
|
+
}
|
|
21
|
+
return path
|
|
22
|
+
.substring(providerIndex + Providers.length)
|
|
23
|
+
.split("/")
|
|
24
|
+
.reduce((result, current, index) => {
|
|
25
|
+
if (index === 1 || index % 2 === 0)
|
|
26
|
+
return result === "" ? current : `${result}/${current}`;
|
|
27
|
+
else
|
|
28
|
+
return result;
|
|
29
|
+
}, "");
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=resource-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-type.js","sourceRoot":"","sources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["../../emitter/src/sdk-context-options.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAEtF,eAAO,MAAM,sBAAsB,EAAE,uBAmBpC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
// Licensed under the MIT License. See License.txt in the project root for license information.
|
|
3
|
+
export const azureSDKContextOptions = {
|
|
4
|
+
versioning: {},
|
|
5
|
+
additionalDecorators: [
|
|
6
|
+
// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-client-generator-core/README.md#usesystemtextjsonconverter
|
|
7
|
+
"Azure\\.ClientGenerator\\.Core\\.@useSystemTextJsonConverter",
|
|
8
|
+
// TODO: add this decorator to TCGC
|
|
9
|
+
"Azure\\.ClientGenerator\\.Core\\.@resourceSchema",
|
|
10
|
+
// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/README.md#armprovidernamespace
|
|
11
|
+
"Azure\\.ResourceManager\\.@armProviderNamespace",
|
|
12
|
+
// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/README.md#armresourceoperations
|
|
13
|
+
"Azure\\.ResourceManager\\.@armResourceOperations",
|
|
14
|
+
// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/README.md#armResourceRead
|
|
15
|
+
"Azure\\.ResourceManager\\.@armResourceRead",
|
|
16
|
+
// https://github.com/microsoft/typespec/blob/main/packages/rest/README.md#parentresource
|
|
17
|
+
"TypeSpec\\.Rest\\.parentResource",
|
|
18
|
+
// https://github.com/Azure/typespec-azure/blob/main/packages/typespec-azure-resource-manager/README.md#singleton
|
|
19
|
+
"Azure\\.ResourceManager\\.@singleton",
|
|
20
|
+
"Azure\\.ResourceManager\\.Private\\.@armResourceInternal"
|
|
21
|
+
]
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=sdk-context-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-context-options.js","sourceRoot":"","sources":["../../emitter/src/sdk-context-options.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAI/F,MAAM,CAAC,MAAM,sBAAsB,GAA4B;IAC7D,UAAU,EAAE,EAAE;IACd,oBAAoB,EAAE;QACpB,iIAAiI;QACjI,8DAA8D;QAC9D,mCAAmC;QACnC,kDAAkD;QAClD,4HAA4H;QAC5H,iDAAiD;QACjD,6HAA6H;QAC7H,kDAAkD;QAClD,uHAAuH;QACvH,4CAA4C;QAC5C,yFAAyF;QACzF,kCAAkC;QAClC,iHAAiH;QACjH,sCAAsC;QACtC,0DAA0D;KAC3D;CACF,CAAC"}
|
|
Binary file
|