@typespec/http-client-csharp 0.1.9-alpha.20240715.3
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/constants.d.ts +7 -0
- package/dist/emitter/constants.d.ts.map +1 -0
- package/dist/emitter/constants.js +9 -0
- package/dist/emitter/constants.js.map +1 -0
- package/dist/emitter/emitter.d.ts +4 -0
- package/dist/emitter/emitter.d.ts.map +1 -0
- package/dist/emitter/emitter.js +174 -0
- package/dist/emitter/emitter.js.map +1 -0
- package/dist/emitter/index.d.ts +7 -0
- package/dist/emitter/index.d.ts.map +1 -0
- package/dist/emitter/index.js +9 -0
- package/dist/emitter/index.js.map +1 -0
- package/dist/emitter/lib/client-model-builder.d.ts +7 -0
- package/dist/emitter/lib/client-model-builder.d.ts.map +1 -0
- package/dist/emitter/lib/client-model-builder.js +236 -0
- package/dist/emitter/lib/client-model-builder.js.map +1 -0
- package/dist/emitter/lib/converter.d.ts +7 -0
- package/dist/emitter/lib/converter.d.ts.map +1 -0
- package/dist/emitter/lib/converter.js +261 -0
- package/dist/emitter/lib/converter.js.map +1 -0
- package/dist/emitter/lib/decorators.d.ts +10 -0
- package/dist/emitter/lib/decorators.d.ts.map +1 -0
- package/dist/emitter/lib/decorators.js +17 -0
- package/dist/emitter/lib/decorators.js.map +1 -0
- package/dist/emitter/lib/lib.d.ts +66 -0
- package/dist/emitter/lib/lib.d.ts.map +1 -0
- package/dist/emitter/lib/lib.js +45 -0
- package/dist/emitter/lib/lib.js.map +1 -0
- package/dist/emitter/lib/log-level.d.ts +6 -0
- package/dist/emitter/lib/log-level.d.ts.map +1 -0
- package/dist/emitter/lib/log-level.js +7 -0
- package/dist/emitter/lib/log-level.js.map +1 -0
- package/dist/emitter/lib/logger.d.ts +18 -0
- package/dist/emitter/lib/logger.d.ts.map +1 -0
- package/dist/emitter/lib/logger.js +70 -0
- package/dist/emitter/lib/logger.js.map +1 -0
- package/dist/emitter/lib/model.d.ts +20 -0
- package/dist/emitter/lib/model.d.ts.map +1 -0
- package/dist/emitter/lib/model.js +255 -0
- package/dist/emitter/lib/model.js.map +1 -0
- package/dist/emitter/lib/operation.d.ts +9 -0
- package/dist/emitter/lib/operation.d.ts.map +1 -0
- package/dist/emitter/lib/operation.js +295 -0
- package/dist/emitter/lib/operation.js.map +1 -0
- package/dist/emitter/lib/service-authentication.d.ts +4 -0
- package/dist/emitter/lib/service-authentication.d.ts.map +1 -0
- package/dist/emitter/lib/service-authentication.js +53 -0
- package/dist/emitter/lib/service-authentication.js.map +1 -0
- package/dist/emitter/lib/typespec-server.d.ts +12 -0
- package/dist/emitter/lib/typespec-server.d.ts.map +1 -0
- package/dist/emitter/lib/typespec-server.js +83 -0
- package/dist/emitter/lib/typespec-server.js.map +1 -0
- package/dist/emitter/lib/utils.d.ts +8 -0
- package/dist/emitter/lib/utils.d.ts.map +1 -0
- package/dist/emitter/lib/utils.js +53 -0
- package/dist/emitter/lib/utils.js.map +1 -0
- package/dist/emitter/options.d.ts +93 -0
- package/dist/emitter/options.d.ts.map +1 -0
- package/dist/emitter/options.js +114 -0
- package/dist/emitter/options.js.map +1 -0
- package/dist/emitter/tsdoc-metadata.json +11 -0
- package/dist/emitter/type/body-media-type.d.ts +12 -0
- package/dist/emitter/type/body-media-type.d.ts.map +1 -0
- package/dist/emitter/type/body-media-type.js +26 -0
- package/dist/emitter/type/body-media-type.js.map +1 -0
- package/dist/emitter/type/client-kind.d.ts +5 -0
- package/dist/emitter/type/client-kind.d.ts.map +1 -0
- package/dist/emitter/type/client-kind.js +8 -0
- package/dist/emitter/type/client-kind.js.map +1 -0
- package/dist/emitter/type/code-model.d.ts +12 -0
- package/dist/emitter/type/code-model.d.ts.map +1 -0
- package/dist/emitter/type/code-model.js +4 -0
- package/dist/emitter/type/code-model.js.map +1 -0
- package/dist/emitter/type/collection-format.d.ts +13 -0
- package/dist/emitter/type/collection-format.d.ts.map +1 -0
- package/dist/emitter/type/collection-format.js +22 -0
- package/dist/emitter/type/collection-format.js.map +1 -0
- package/dist/emitter/type/configuration.d.ts +21 -0
- package/dist/emitter/type/configuration.d.ts.map +1 -0
- package/dist/emitter/type/configuration.js +4 -0
- package/dist/emitter/type/configuration.js.map +1 -0
- package/dist/emitter/type/external-docs.d.ts +5 -0
- package/dist/emitter/type/external-docs.d.ts.map +1 -0
- package/dist/emitter/type/external-docs.js +4 -0
- package/dist/emitter/type/external-docs.js.map +1 -0
- package/dist/emitter/type/http-response-header.d.ts +8 -0
- package/dist/emitter/type/http-response-header.d.ts.map +1 -0
- package/dist/emitter/type/http-response-header.js +4 -0
- package/dist/emitter/type/http-response-header.js.map +1 -0
- package/dist/emitter/type/input-api-key-auth.d.ts +5 -0
- package/dist/emitter/type/input-api-key-auth.d.ts.map +1 -0
- package/dist/emitter/type/input-api-key-auth.js +4 -0
- package/dist/emitter/type/input-api-key-auth.js.map +1 -0
- package/dist/emitter/type/input-auth.d.ts +7 -0
- package/dist/emitter/type/input-auth.d.ts.map +1 -0
- package/dist/emitter/type/input-auth.js +4 -0
- package/dist/emitter/type/input-auth.js.map +1 -0
- package/dist/emitter/type/input-client.d.ts +12 -0
- package/dist/emitter/type/input-client.d.ts.map +1 -0
- package/dist/emitter/type/input-client.js +4 -0
- package/dist/emitter/type/input-client.js.map +1 -0
- package/dist/emitter/type/input-constant.d.ts +6 -0
- package/dist/emitter/type/input-constant.d.ts.map +1 -0
- package/dist/emitter/type/input-constant.js +4 -0
- package/dist/emitter/type/input-constant.js.map +1 -0
- package/dist/emitter/type/input-enum-type-value.d.ts +6 -0
- package/dist/emitter/type/input-enum-type-value.d.ts.map +1 -0
- package/dist/emitter/type/input-enum-type-value.js +4 -0
- package/dist/emitter/type/input-enum-type-value.js.map +1 -0
- package/dist/emitter/type/input-model-property.d.ts +12 -0
- package/dist/emitter/type/input-model-property.d.ts.map +1 -0
- package/dist/emitter/type/input-model-property.js +4 -0
- package/dist/emitter/type/input-model-property.js.map +1 -0
- package/dist/emitter/type/input-oauth2-auth.d.ts +4 -0
- package/dist/emitter/type/input-oauth2-auth.d.ts.map +1 -0
- package/dist/emitter/type/input-oauth2-auth.js +4 -0
- package/dist/emitter/type/input-oauth2-auth.js.map +1 -0
- package/dist/emitter/type/input-operation-parameter-kind.d.ts +9 -0
- package/dist/emitter/type/input-operation-parameter-kind.d.ts.map +1 -0
- package/dist/emitter/type/input-operation-parameter-kind.js +12 -0
- package/dist/emitter/type/input-operation-parameter-kind.js.map +1 -0
- package/dist/emitter/type/input-operation.d.ts +33 -0
- package/dist/emitter/type/input-operation.d.ts.map +1 -0
- package/dist/emitter/type/input-operation.js +4 -0
- package/dist/emitter/type/input-operation.js.map +1 -0
- package/dist/emitter/type/input-parameter.d.ts +27 -0
- package/dist/emitter/type/input-parameter.d.ts.map +1 -0
- package/dist/emitter/type/input-parameter.js +4 -0
- package/dist/emitter/type/input-parameter.js.map +1 -0
- package/dist/emitter/type/input-type-serialization-format.d.ts +15 -0
- package/dist/emitter/type/input-type-serialization-format.d.ts.map +1 -0
- package/dist/emitter/type/input-type-serialization-format.js +18 -0
- package/dist/emitter/type/input-type-serialization-format.js.map +1 -0
- package/dist/emitter/type/input-type-value.d.ts +6 -0
- package/dist/emitter/type/input-type-value.d.ts.map +1 -0
- package/dist/emitter/type/input-type-value.js +4 -0
- package/dist/emitter/type/input-type-value.js.map +1 -0
- package/dist/emitter/type/input-type.d.ts +87 -0
- package/dist/emitter/type/input-type.d.ts.map +1 -0
- package/dist/emitter/type/input-type.js +21 -0
- package/dist/emitter/type/input-type.js.map +1 -0
- package/dist/emitter/type/literal-type-context.d.ts +5 -0
- package/dist/emitter/type/literal-type-context.d.ts.map +1 -0
- package/dist/emitter/type/literal-type-context.js +4 -0
- package/dist/emitter/type/literal-type-context.js.map +1 -0
- package/dist/emitter/type/operation-final-state-via.d.ts +12 -0
- package/dist/emitter/type/operation-final-state-via.d.ts.map +1 -0
- package/dist/emitter/type/operation-final-state-via.js +36 -0
- package/dist/emitter/type/operation-final-state-via.js.map +1 -0
- package/dist/emitter/type/operation-long-running.d.ts +8 -0
- package/dist/emitter/type/operation-long-running.d.ts.map +1 -0
- package/dist/emitter/type/operation-long-running.js +4 -0
- package/dist/emitter/type/operation-long-running.js.map +1 -0
- package/dist/emitter/type/operation-paging.d.ts +8 -0
- package/dist/emitter/type/operation-paging.d.ts.map +1 -0
- package/dist/emitter/type/operation-paging.js +4 -0
- package/dist/emitter/type/operation-paging.js.map +1 -0
- package/dist/emitter/type/operation-response.d.ts +12 -0
- package/dist/emitter/type/operation-response.d.ts.map +1 -0
- package/dist/emitter/type/operation-response.js +4 -0
- package/dist/emitter/type/operation-response.js.map +1 -0
- package/dist/emitter/type/protocols.d.ts +3 -0
- package/dist/emitter/type/protocols.d.ts.map +1 -0
- package/dist/emitter/type/protocols.js +4 -0
- package/dist/emitter/type/protocols.js.map +1 -0
- package/dist/emitter/type/request-location.d.ts +12 -0
- package/dist/emitter/type/request-location.d.ts.map +1 -0
- package/dist/emitter/type/request-location.js +19 -0
- package/dist/emitter/type/request-location.js.map +1 -0
- package/dist/emitter/type/request-method.d.ts +13 -0
- package/dist/emitter/type/request-method.d.ts.map +1 -0
- package/dist/emitter/type/request-method.js +40 -0
- package/dist/emitter/type/request-method.js.map +1 -0
- package/dist/emitter/type/usage.d.ts +8 -0
- package/dist/emitter/type/usage.d.ts.map +1 -0
- package/dist/emitter/type/usage.js +11 -0
- package/dist/emitter/type/usage.js.map +1 -0
- package/dist/emitter/type/validation-type.d.ts +6 -0
- package/dist/emitter/type/validation-type.d.ts.map +1 -0
- package/dist/emitter/type/validation-type.js +9 -0
- package/dist/emitter/type/validation-type.js.map +1 -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.Generator.CSharp +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.ClientModel.deps.json +818 -0
- package/dist/generator/Microsoft.Generator.CSharp.ClientModel.dll +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.ClientModel.pdb +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.Customization.dll +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.Customization.pdb +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.Input.dll +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.Input.pdb +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.deps.json +785 -0
- package/dist/generator/Microsoft.Generator.CSharp.dll +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.pdb +0 -0
- package/dist/generator/Microsoft.Generator.CSharp.runtimeconfig.json +12 -0
- package/dist/generator/Microsoft.NET.StringTools.dll +0 -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/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/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/dist/typespec-http-client-csharp.d.ts +202 -0
- package/package.json +76 -0
|
@@ -0,0 +1,53 @@
|
|
|
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 { Logger } from "./logger.js";
|
|
4
|
+
export function processServiceAuthentication(authentication) {
|
|
5
|
+
const auth = {};
|
|
6
|
+
let scopes;
|
|
7
|
+
for (const option of authentication.options) {
|
|
8
|
+
for (const scheme of option.schemes) {
|
|
9
|
+
switch (scheme.type) {
|
|
10
|
+
case "apiKey":
|
|
11
|
+
auth.ApiKey = { Name: scheme.name };
|
|
12
|
+
break;
|
|
13
|
+
case "oauth2":
|
|
14
|
+
for (const flow of scheme.flows) {
|
|
15
|
+
if (flow.scopes) {
|
|
16
|
+
scopes ??= new Set();
|
|
17
|
+
for (const scope of flow.scopes) {
|
|
18
|
+
scopes.add(scope.value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
break;
|
|
23
|
+
case "http":
|
|
24
|
+
const schemeOrApiKeyPrefix = scheme.scheme;
|
|
25
|
+
if (schemeOrApiKeyPrefix === "basic") {
|
|
26
|
+
Logger.getInstance().warn(`{schemeOrApiKeyPrefix} auth method is currently not supported.`);
|
|
27
|
+
}
|
|
28
|
+
else if (schemeOrApiKeyPrefix === "bearer") {
|
|
29
|
+
auth.ApiKey = {
|
|
30
|
+
Name: "Authorization",
|
|
31
|
+
Prefix: "Bearer",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
auth.ApiKey = {
|
|
36
|
+
Name: "Authorization",
|
|
37
|
+
Prefix: schemeOrApiKeyPrefix,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
default:
|
|
42
|
+
throw new Error("Not supported authentication.");
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (scopes) {
|
|
47
|
+
auth.OAuth2 = {
|
|
48
|
+
Scopes: Array.from(scopes.values()),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return auth;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=service-authentication.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-authentication.js","sourceRoot":"","sources":["../../../emitter/src/lib/service-authentication.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAM/F,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,UAAU,4BAA4B,CAAC,cAA8B;IACzE,MAAM,IAAI,GAAG,EAAe,CAAC;IAC7B,IAAI,MAA+B,CAAC;IAEpC,KAAK,MAAM,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;QAC5C,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpC,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;gBACpB,KAAK,QAAQ;oBACX,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAqB,CAAC;oBACvD,MAAM;gBACR,KAAK,QAAQ;oBACX,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;wBAChC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;4BAChB,MAAM,KAAK,IAAI,GAAG,EAAU,CAAC;4BAC7B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gCAChC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;4BAC1B,CAAC;wBACH,CAAC;oBACH,CAAC;oBACD,MAAM;gBACR,KAAK,MAAM;oBACT,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;oBAC3C,IAAI,oBAAoB,KAAK,OAAO,EAAE,CAAC;wBACrC,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,CACvB,gEAAgE,CACjE,CAAC;oBACJ,CAAC;yBAAM,IAAI,oBAAoB,KAAK,QAAQ,EAAE,CAAC;wBAC7C,IAAI,CAAC,MAAM,GAAG;4BACZ,IAAI,EAAE,eAAe;4BACrB,MAAM,EAAE,QAAQ;yBACE,CAAC;oBACvB,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,MAAM,GAAG;4BACZ,IAAI,EAAE,eAAe;4BACrB,MAAM,EAAE,oBAAoB;yBACV,CAAC;oBACvB,CAAC;oBACD,MAAM;gBACR;oBACE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;SACjB,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { HttpServer } from "@typespec/http";
|
|
3
|
+
import { NetEmitterOptions } from "../options.js";
|
|
4
|
+
import { InputParameter } from "../type/input-parameter.js";
|
|
5
|
+
import { InputEnumType, InputModelType } from "../type/input-type.js";
|
|
6
|
+
export interface TypeSpecServer {
|
|
7
|
+
url: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
parameters: InputParameter[];
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveServers(context: SdkContext<NetEmitterOptions>, servers: HttpServer[], models: Map<string, InputModelType>, enums: Map<string, InputEnumType>): TypeSpecServer[];
|
|
12
|
+
//# sourceMappingURL=typespec-server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typespec-server.d.ts","sourceRoot":"","sources":["../../../emitter/src/lib/typespec-server.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAa,MAAM,uBAAuB,CAAC;AAIjF,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,UAAU,CAAC,iBAAiB,CAAC,EACtC,OAAO,EAAE,UAAU,EAAE,EACrB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,EACnC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,GAChC,cAAc,EAAE,CA4ElB"}
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { getDoc } from "@typespec/compiler";
|
|
4
|
+
import { getExtensions } from "@typespec/openapi";
|
|
5
|
+
import { InputOperationParameterKind } from "../type/input-operation-parameter-kind.js";
|
|
6
|
+
import { RequestLocation } from "../type/request-location.js";
|
|
7
|
+
import { getDefaultValue, getInputType } from "./model.js";
|
|
8
|
+
export function resolveServers(context, servers, models, enums) {
|
|
9
|
+
return servers.map((server) => {
|
|
10
|
+
const parameters = [];
|
|
11
|
+
let url = server.url;
|
|
12
|
+
const endpoint = url.replace("http://", "").replace("https://", "").split("/")[0];
|
|
13
|
+
for (const [name, prop] of server.parameters) {
|
|
14
|
+
const isEndpoint = endpoint === `{${name}}`;
|
|
15
|
+
let defaultValue = undefined;
|
|
16
|
+
const value = prop.default ? getDefaultValue(prop.default) : "";
|
|
17
|
+
const inputType = isEndpoint
|
|
18
|
+
? {
|
|
19
|
+
Kind: "url",
|
|
20
|
+
}
|
|
21
|
+
: getInputType(context, prop, models, enums);
|
|
22
|
+
if (value) {
|
|
23
|
+
defaultValue = {
|
|
24
|
+
Type: inputType,
|
|
25
|
+
Value: value,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const variable = {
|
|
29
|
+
Name: name,
|
|
30
|
+
NameInRequest: name,
|
|
31
|
+
Description: getDoc(context.program, prop),
|
|
32
|
+
Type: inputType,
|
|
33
|
+
Location: RequestLocation.Uri,
|
|
34
|
+
IsApiVersion: name.toLowerCase() === "apiversion" || name.toLowerCase() === "api-version",
|
|
35
|
+
IsResourceParameter: false,
|
|
36
|
+
IsContentType: false,
|
|
37
|
+
IsRequired: true,
|
|
38
|
+
IsEndpoint: isEndpoint,
|
|
39
|
+
SkipUrlEncoding:
|
|
40
|
+
// TODO: update this when https://github.com/Azure/typespec-azure/issues/1022 is resolved
|
|
41
|
+
getExtensions(context.program, prop).get("x-ms-skip-url-encoding") === true,
|
|
42
|
+
Explode: false,
|
|
43
|
+
Kind: InputOperationParameterKind.Client,
|
|
44
|
+
DefaultValue: defaultValue,
|
|
45
|
+
};
|
|
46
|
+
parameters.push(variable);
|
|
47
|
+
}
|
|
48
|
+
/* add default server. */
|
|
49
|
+
if (server.url && parameters.length === 0) {
|
|
50
|
+
const variable = {
|
|
51
|
+
Name: "host",
|
|
52
|
+
NameInRequest: "host",
|
|
53
|
+
Description: server.description,
|
|
54
|
+
Type: {
|
|
55
|
+
Kind: "string",
|
|
56
|
+
},
|
|
57
|
+
Location: RequestLocation.Uri,
|
|
58
|
+
IsApiVersion: false,
|
|
59
|
+
IsResourceParameter: false,
|
|
60
|
+
IsContentType: false,
|
|
61
|
+
IsRequired: true,
|
|
62
|
+
IsEndpoint: true,
|
|
63
|
+
SkipUrlEncoding: false,
|
|
64
|
+
Explode: false,
|
|
65
|
+
Kind: InputOperationParameterKind.Client,
|
|
66
|
+
DefaultValue: {
|
|
67
|
+
Type: {
|
|
68
|
+
Kind: "string",
|
|
69
|
+
},
|
|
70
|
+
Value: server.url,
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
url = `{host}`;
|
|
74
|
+
parameters.push(variable);
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
url: url,
|
|
78
|
+
description: server.description,
|
|
79
|
+
parameters,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=typespec-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typespec-server.js","sourceRoot":"","sources":["../../../emitter/src/lib/typespec-server.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAG/F,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAGxF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAQ3D,MAAM,UAAU,cAAc,CAC5B,OAAsC,EACtC,OAAqB,EACrB,MAAm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IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { Enum, EnumMember, Model, ModelProperty, Operation, Scalar } from "@typespec/compiler";
|
|
3
|
+
import { InputParameter } from "../type/input-parameter.js";
|
|
4
|
+
export declare function capitalize(str: string): string;
|
|
5
|
+
export declare function getNameForTemplate(model: Model): string;
|
|
6
|
+
export declare function getTypeName(context: SdkContext, type: Model | Enum | EnumMember | ModelProperty | Scalar | Operation): string;
|
|
7
|
+
export declare function createContentTypeOrAcceptParameter(mediaTypes: string[], name: string, nameInRequest: string): InputParameter;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../emitter/src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGX,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG/F,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAI5D,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAMvD;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,GAAG,SAAS,GACnE,MAAM,CAYR;AAED,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,EAAE,EACpB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,cAAc,CA0BhB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { getLibraryName, getSdkModel, } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { InputOperationParameterKind } from "../type/input-operation-parameter-kind.js";
|
|
3
|
+
import { RequestLocation } from "../type/request-location.js";
|
|
4
|
+
export function capitalize(str) {
|
|
5
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
6
|
+
}
|
|
7
|
+
export function getNameForTemplate(model) {
|
|
8
|
+
if (model.name !== "" && model.templateMapper && model.templateMapper.args) {
|
|
9
|
+
return model.name + model.templateMapper.args.map((it) => it.name).join("");
|
|
10
|
+
}
|
|
11
|
+
return model.name;
|
|
12
|
+
}
|
|
13
|
+
export function getTypeName(context, type) {
|
|
14
|
+
const name = getLibraryName(context, type);
|
|
15
|
+
if (type.kind !== "Model")
|
|
16
|
+
return name;
|
|
17
|
+
if (type.name === name) {
|
|
18
|
+
const templateName = getNameForTemplate(type);
|
|
19
|
+
if (templateName === "") {
|
|
20
|
+
const sdkModel = getSdkModel(context, type);
|
|
21
|
+
return sdkModel.name;
|
|
22
|
+
}
|
|
23
|
+
return templateName;
|
|
24
|
+
}
|
|
25
|
+
return name;
|
|
26
|
+
}
|
|
27
|
+
export function createContentTypeOrAcceptParameter(mediaTypes, name, nameInRequest) {
|
|
28
|
+
const isContentType = nameInRequest.toLowerCase() === "content-type";
|
|
29
|
+
const inputType = {
|
|
30
|
+
Kind: "string",
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
Name: name,
|
|
34
|
+
NameInRequest: nameInRequest,
|
|
35
|
+
Type: inputType,
|
|
36
|
+
Location: RequestLocation.Header,
|
|
37
|
+
IsApiVersion: false,
|
|
38
|
+
IsResourceParameter: false,
|
|
39
|
+
IsContentType: isContentType,
|
|
40
|
+
IsRequired: true,
|
|
41
|
+
IsEndpoint: false,
|
|
42
|
+
SkipUrlEncoding: false,
|
|
43
|
+
Explode: false,
|
|
44
|
+
Kind: InputOperationParameterKind.Constant,
|
|
45
|
+
DefaultValue: mediaTypes.length === 1
|
|
46
|
+
? {
|
|
47
|
+
Type: inputType,
|
|
48
|
+
Value: mediaTypes[0],
|
|
49
|
+
}
|
|
50
|
+
: undefined,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../emitter/src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACd,WAAW,GACZ,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAGxF,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAY;IAC7C,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,IAAI,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QAC3E,OAAO,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAE,EAAY,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,WAAW,CACzB,OAAmB,EACnB,IAAoE;IAEpE,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QACvB,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,YAAY,KAAK,EAAE,EAAE,CAAC;YACxB,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,EAAE,IAAa,CAAC,CAAC;YACrD,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,UAAoB,EACpB,IAAY,EACZ,aAAqB;IAErB,MAAM,aAAa,GAAY,aAAa,CAAC,WAAW,EAAE,KAAK,cAAc,CAAC;IAC9E,MAAM,SAAS,GAAc;QAC3B,IAAI,EAAE,QAAQ;KACf,CAAC;IACF,OAAO;QACL,IAAI,EAAE,IAAI;QACV,aAAa,EAAE,aAAa;QAC5B,IAAI,EAAE,SAAS;QACf,QAAQ,EAAE,eAAe,CAAC,MAAM;QAChC,YAAY,EAAE,KAAK;QACnB,mBAAmB,EAAE,KAAK;QAC1B,aAAa,EAAE,aAAa;QAC5B,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,KAAK;QACjB,eAAe,EAAE,KAAK;QACtB,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,2BAA2B,CAAC,QAAQ;QAC1C,YAAY,EACV,UAAU,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,CAAE;gBACC,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC;aACH;YACrB,CAAC,CAAC,SAAS;KACE,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { SdkEmitterOptions } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { EmitContext, JSONSchemaType } from "@typespec/compiler";
|
|
3
|
+
import { LoggerLevel } from "./lib/log-level.js";
|
|
4
|
+
export interface NetEmitterOptions extends SdkEmitterOptions {
|
|
5
|
+
"api-version"?: string;
|
|
6
|
+
outputFile?: string;
|
|
7
|
+
logFile?: string;
|
|
8
|
+
namespace: string;
|
|
9
|
+
"library-name": string;
|
|
10
|
+
"single-top-level-client"?: boolean;
|
|
11
|
+
skipSDKGeneration?: boolean;
|
|
12
|
+
"unreferenced-types-handling"?: "removeOrInternalize" | "internalize" | "keepAll";
|
|
13
|
+
"new-project"?: boolean;
|
|
14
|
+
"clear-output-folder"?: boolean;
|
|
15
|
+
"save-inputs"?: boolean;
|
|
16
|
+
"model-namespace"?: boolean;
|
|
17
|
+
"existing-project-folder"?: string;
|
|
18
|
+
"keep-non-overloadable-protocol-signature"?: boolean;
|
|
19
|
+
debug?: boolean;
|
|
20
|
+
"models-to-treat-empty-string-as-null"?: string[];
|
|
21
|
+
"additional-intrinsic-types-to-treat-empty-string-as-null"?: string[];
|
|
22
|
+
"methods-to-keep-client-default-value"?: string[];
|
|
23
|
+
"deserialize-null-collection-as-null-value"?: boolean;
|
|
24
|
+
logLevel?: LoggerLevel;
|
|
25
|
+
"package-dir"?: string;
|
|
26
|
+
"head-as-boolean"?: boolean;
|
|
27
|
+
flavor?: string;
|
|
28
|
+
"generate-sample-project"?: boolean;
|
|
29
|
+
"generate-test-project"?: boolean;
|
|
30
|
+
"use-model-reader-writer"?: boolean;
|
|
31
|
+
"disable-xml-docs"?: boolean;
|
|
32
|
+
"plugin-name"?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const NetEmitterOptionsSchema: JSONSchemaType<NetEmitterOptions>;
|
|
35
|
+
export declare const defaultOptions: {
|
|
36
|
+
"api-version": string;
|
|
37
|
+
outputFile: string;
|
|
38
|
+
logFile: string;
|
|
39
|
+
skipSDKGeneration: boolean;
|
|
40
|
+
"new-project": boolean;
|
|
41
|
+
"clear-output-folder": boolean;
|
|
42
|
+
"save-inputs": boolean;
|
|
43
|
+
"filter-out-core-models": boolean;
|
|
44
|
+
"generate-protocol-methods": boolean;
|
|
45
|
+
"generate-convenience-methods": boolean;
|
|
46
|
+
"package-name": undefined;
|
|
47
|
+
debug: undefined;
|
|
48
|
+
"models-to-treat-empty-string-as-null": undefined;
|
|
49
|
+
"additional-intrinsic-types-to-treat-empty-string-as-null": never[];
|
|
50
|
+
"methods-to-keep-client-default-value": undefined;
|
|
51
|
+
"deserialize-null-collection-as-null-value": undefined;
|
|
52
|
+
logLevel: LoggerLevel;
|
|
53
|
+
flavor: undefined;
|
|
54
|
+
"generate-test-project": boolean;
|
|
55
|
+
"plugin-name": string;
|
|
56
|
+
};
|
|
57
|
+
export declare function resolveOptions(context: EmitContext<NetEmitterOptions>): {
|
|
58
|
+
outputFile: string;
|
|
59
|
+
logFile: string;
|
|
60
|
+
"api-version": string;
|
|
61
|
+
namespace: string;
|
|
62
|
+
"library-name": string;
|
|
63
|
+
"single-top-level-client"?: boolean | undefined;
|
|
64
|
+
skipSDKGeneration: boolean;
|
|
65
|
+
"unreferenced-types-handling"?: "removeOrInternalize" | "internalize" | "keepAll" | undefined;
|
|
66
|
+
"new-project": boolean;
|
|
67
|
+
"clear-output-folder": boolean;
|
|
68
|
+
"save-inputs": boolean;
|
|
69
|
+
"model-namespace"?: boolean | undefined;
|
|
70
|
+
"existing-project-folder"?: string | undefined;
|
|
71
|
+
"keep-non-overloadable-protocol-signature"?: boolean | undefined;
|
|
72
|
+
debug: boolean | undefined;
|
|
73
|
+
"models-to-treat-empty-string-as-null": string[] | undefined;
|
|
74
|
+
"additional-intrinsic-types-to-treat-empty-string-as-null": string[];
|
|
75
|
+
"methods-to-keep-client-default-value": string[] | undefined;
|
|
76
|
+
"deserialize-null-collection-as-null-value": boolean | undefined;
|
|
77
|
+
logLevel: LoggerLevel;
|
|
78
|
+
"package-dir"?: string | undefined;
|
|
79
|
+
"head-as-boolean"?: boolean | undefined;
|
|
80
|
+
flavor: string | undefined;
|
|
81
|
+
"generate-sample-project"?: boolean | undefined;
|
|
82
|
+
"generate-test-project": boolean;
|
|
83
|
+
"use-model-reader-writer"?: boolean | undefined;
|
|
84
|
+
"disable-xml-docs"?: boolean | undefined;
|
|
85
|
+
"plugin-name": string;
|
|
86
|
+
"generate-protocol-methods": boolean;
|
|
87
|
+
"generate-convenience-methods": boolean;
|
|
88
|
+
"filter-out-core-models": boolean;
|
|
89
|
+
"package-name": string | undefined;
|
|
90
|
+
"flatten-union-as-enum"?: boolean | undefined;
|
|
91
|
+
};
|
|
92
|
+
export declare function resolveOutputFolder(context: EmitContext<NetEmitterOptions>): string;
|
|
93
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../emitter/src/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,oBAAoB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,6BAA6B,CAAC,EAAE,qBAAqB,GAAG,aAAa,GAAG,SAAS,CAAC;IAClF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0CAA0C,CAAC,EAAE,OAAO,CAAC;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,0DAA0D,CAAC,EAAE,MAAM,EAAE,CAAC;IACtE,sCAAsC,CAAC,EAAE,MAAM,EAAE,CAAC;IAClD,2CAA2C,CAAC,EAAE,OAAO,CAAC;IACtD,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,iBAAiB,CAyErE,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;CAqB1B,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,iBAAiB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAEnF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { resolvePath } from "@typespec/compiler";
|
|
2
|
+
import { tspOutputFileName } from "./constants.js";
|
|
3
|
+
import { LoggerLevel } from "./lib/log-level.js";
|
|
4
|
+
export const NetEmitterOptionsSchema = {
|
|
5
|
+
type: "object",
|
|
6
|
+
additionalProperties: false,
|
|
7
|
+
properties: {
|
|
8
|
+
"api-version": { type: "string", nullable: true },
|
|
9
|
+
outputFile: { type: "string", nullable: true },
|
|
10
|
+
logFile: { type: "string", nullable: true },
|
|
11
|
+
namespace: { type: "string" },
|
|
12
|
+
"library-name": { type: "string" },
|
|
13
|
+
"single-top-level-client": { type: "boolean", nullable: true },
|
|
14
|
+
skipSDKGeneration: { type: "boolean", default: false, nullable: true },
|
|
15
|
+
"unreferenced-types-handling": {
|
|
16
|
+
type: "string",
|
|
17
|
+
enum: ["removeOrInternalize", "internalize", "keepAll"],
|
|
18
|
+
nullable: true,
|
|
19
|
+
},
|
|
20
|
+
"new-project": { type: "boolean", nullable: true },
|
|
21
|
+
"clear-output-folder": { type: "boolean", nullable: true },
|
|
22
|
+
"save-inputs": { type: "boolean", nullable: true },
|
|
23
|
+
"model-namespace": { type: "boolean", nullable: true },
|
|
24
|
+
"generate-protocol-methods": { type: "boolean", nullable: true },
|
|
25
|
+
"generate-convenience-methods": { type: "boolean", nullable: true },
|
|
26
|
+
"filter-out-core-models": { type: "boolean", nullable: true },
|
|
27
|
+
"flatten-union-as-enum": { type: "boolean", nullable: true },
|
|
28
|
+
"package-name": { type: "string", nullable: true },
|
|
29
|
+
"existing-project-folder": { type: "string", nullable: true },
|
|
30
|
+
"keep-non-overloadable-protocol-signature": {
|
|
31
|
+
type: "boolean",
|
|
32
|
+
nullable: true,
|
|
33
|
+
},
|
|
34
|
+
debug: { type: "boolean", nullable: true },
|
|
35
|
+
"models-to-treat-empty-string-as-null": {
|
|
36
|
+
type: "array",
|
|
37
|
+
nullable: true,
|
|
38
|
+
items: { type: "string" },
|
|
39
|
+
},
|
|
40
|
+
"additional-intrinsic-types-to-treat-empty-string-as-null": {
|
|
41
|
+
type: "array",
|
|
42
|
+
nullable: true,
|
|
43
|
+
items: { type: "string" },
|
|
44
|
+
},
|
|
45
|
+
"methods-to-keep-client-default-value": {
|
|
46
|
+
type: "array",
|
|
47
|
+
nullable: true,
|
|
48
|
+
items: { type: "string" },
|
|
49
|
+
},
|
|
50
|
+
"deserialize-null-collection-as-null-value": {
|
|
51
|
+
type: "boolean",
|
|
52
|
+
nullable: true,
|
|
53
|
+
},
|
|
54
|
+
logLevel: {
|
|
55
|
+
type: "string",
|
|
56
|
+
enum: [LoggerLevel.INFO, LoggerLevel.DEBUG, LoggerLevel.VERBOSE],
|
|
57
|
+
nullable: true,
|
|
58
|
+
},
|
|
59
|
+
"package-dir": { type: "string", nullable: true },
|
|
60
|
+
"head-as-boolean": { type: "boolean", nullable: true },
|
|
61
|
+
flavor: { type: "string", nullable: true },
|
|
62
|
+
"generate-sample-project": {
|
|
63
|
+
type: "boolean",
|
|
64
|
+
nullable: true,
|
|
65
|
+
default: true,
|
|
66
|
+
},
|
|
67
|
+
"generate-test-project": {
|
|
68
|
+
type: "boolean",
|
|
69
|
+
nullable: true,
|
|
70
|
+
default: false,
|
|
71
|
+
},
|
|
72
|
+
"use-model-reader-writer": { type: "boolean", nullable: true },
|
|
73
|
+
"disable-xml-docs": { type: "boolean", nullable: true },
|
|
74
|
+
"plugin-name": { type: "string", nullable: true },
|
|
75
|
+
},
|
|
76
|
+
required: [],
|
|
77
|
+
};
|
|
78
|
+
export const defaultOptions = {
|
|
79
|
+
"api-version": "latest",
|
|
80
|
+
outputFile: tspOutputFileName,
|
|
81
|
+
logFile: "log.json",
|
|
82
|
+
skipSDKGeneration: false,
|
|
83
|
+
"new-project": false,
|
|
84
|
+
"clear-output-folder": false,
|
|
85
|
+
"save-inputs": false,
|
|
86
|
+
"filter-out-core-models": false,
|
|
87
|
+
"generate-protocol-methods": true,
|
|
88
|
+
"generate-convenience-methods": true,
|
|
89
|
+
"package-name": undefined,
|
|
90
|
+
debug: undefined,
|
|
91
|
+
"models-to-treat-empty-string-as-null": undefined,
|
|
92
|
+
"additional-intrinsic-types-to-treat-empty-string-as-null": [],
|
|
93
|
+
"methods-to-keep-client-default-value": undefined,
|
|
94
|
+
"deserialize-null-collection-as-null-value": undefined,
|
|
95
|
+
logLevel: LoggerLevel.INFO,
|
|
96
|
+
flavor: undefined,
|
|
97
|
+
"generate-test-project": false,
|
|
98
|
+
"plugin-name": "ClientModelPlugin",
|
|
99
|
+
};
|
|
100
|
+
export function resolveOptions(context) {
|
|
101
|
+
const emitterOptions = context.options;
|
|
102
|
+
const emitterOutputDir = context.emitterOutputDir;
|
|
103
|
+
const resolvedOptions = { ...defaultOptions, ...emitterOptions };
|
|
104
|
+
const outputFolder = resolveOutputFolder(context);
|
|
105
|
+
return {
|
|
106
|
+
...resolvedOptions,
|
|
107
|
+
outputFile: resolvePath(outputFolder, resolvedOptions.outputFile),
|
|
108
|
+
logFile: resolvePath(emitterOutputDir ?? "./tsp-output", resolvedOptions.logFile),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export function resolveOutputFolder(context) {
|
|
112
|
+
return resolvePath(context.emitterOutputDir ?? "./tsp-output");
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../emitter/src/options.ts"],"names":[],"mappings":"AACA,OAAO,EAA+B,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiCjD,MAAM,CAAC,MAAM,uBAAuB,GAAsC;IACxE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACjD,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9C,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3C,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC7B,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,yBAAyB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC9D,iBAAiB,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,E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AAU;IACnB,iBAAiB,EAAE,KAAK;IACxB,aAAa,EAAE,KAAK;IACpB,qBAAqB,EAAE,KAAK;IAC5B,aAAa,EAAE,KAAK;IACpB,wBAAwB,EAAE,KAAK;IAC/B,2BAA2B,EAAE,IAAI;IACjC,8BAA8B,EAAE,IAAI;IACpC,cAAc,EAAE,SAAS;IACzB,KAAK,EAAE,SAAS;IAChB,sCAAsC,EAAE,SAAS;IACjD,0DAA0D,EAAE,EAAE;IAC9D,sCAAsC,EAAE,SAAS;IACjD,2CAA2C,EAAE,SAAS;IACtD,QAAQ,EAAE,WAAW,CAAC,IAAI;IAC1B,MAAM,EAAE,SAAS;IACjB,uBAAuB,EAAE,KAAK;IAC9B,aAAa,EAAE,mBAAmB;CACnC,CAAC;AAEF,MAAM,UAAU,cAAc,CAAC,OAAuC;IACpE,MAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;IACvC,MAAM,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAClD,MAAM,eAAe,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,cAAc,EAAE,CAAC;IAEjE,MAAM,YAAY,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAClD,OAAO;QACL,GAAG,eAAe;QAClB,UAAU,EAAE,WAAW,CAAC,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC;QACjE,OAAO,EAAE,WAAW,CAAC,gBAAgB,IAAI,cAAc,EAAE,eAAe,CAAC,OAAO,CAAC;KAClF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAuC;IACzE,OAAO,WAAW,CAAC,OAAO,CAAC,gBAAgB,IAAI,cAAc,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.43.3"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Type } from "@typespec/compiler";
|
|
2
|
+
export declare enum BodyMediaType {
|
|
3
|
+
None = "None",
|
|
4
|
+
Binary = "Binary",
|
|
5
|
+
Form = "Form",
|
|
6
|
+
Json = "Json",
|
|
7
|
+
Multipart = "Multipart",
|
|
8
|
+
Text = "Text",
|
|
9
|
+
Xml = "Xml"
|
|
10
|
+
}
|
|
11
|
+
export declare function typeToBodyMediaType(type: Type | undefined): BodyMediaType.None | BodyMediaType.Binary | BodyMediaType.Json | BodyMediaType.Text;
|
|
12
|
+
//# sourceMappingURL=body-media-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-media-type.d.ts","sourceRoot":"","sources":["../../../emitter/src/type/body-media-type.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,uFAazD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export var BodyMediaType;
|
|
2
|
+
(function (BodyMediaType) {
|
|
3
|
+
BodyMediaType["None"] = "None";
|
|
4
|
+
BodyMediaType["Binary"] = "Binary";
|
|
5
|
+
BodyMediaType["Form"] = "Form";
|
|
6
|
+
BodyMediaType["Json"] = "Json";
|
|
7
|
+
BodyMediaType["Multipart"] = "Multipart";
|
|
8
|
+
BodyMediaType["Text"] = "Text";
|
|
9
|
+
BodyMediaType["Xml"] = "Xml";
|
|
10
|
+
})(BodyMediaType || (BodyMediaType = {}));
|
|
11
|
+
export function typeToBodyMediaType(type) {
|
|
12
|
+
if (type === undefined) {
|
|
13
|
+
return BodyMediaType.None;
|
|
14
|
+
}
|
|
15
|
+
if (type.kind === "Model") {
|
|
16
|
+
return BodyMediaType.Json;
|
|
17
|
+
}
|
|
18
|
+
else if (type.kind === "String") {
|
|
19
|
+
return BodyMediaType.Text;
|
|
20
|
+
}
|
|
21
|
+
else if (type.kind === "Scalar" && type.name === "bytes") {
|
|
22
|
+
return BodyMediaType.Binary;
|
|
23
|
+
}
|
|
24
|
+
return BodyMediaType.None;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=body-media-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"body-media-type.js","sourceRoot":"","sources":["../../../emitter/src/type/body-media-type.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,aAQX;AARD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,kCAAiB,CAAA;IACjB,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,wCAAuB,CAAA;IACvB,8BAAa,CAAA;IACb,4BAAW,CAAA;AACb,CAAC,EARW,aAAa,KAAb,aAAa,QAQxB;AAED,MAAM,UAAU,mBAAmB,CAAC,IAAsB;IACxD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO,aAAa,CAAC,IAAI,CAAC;IAC5B,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC1B,OAAO,aAAa,CAAC,IAAI,CAAC;IAC5B,CAAC;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QAClC,OAAO,aAAa,CAAC,IAAI,CAAC;IAC5B,CAAC;SAAM,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QAC3D,OAAO,aAAa,CAAC,MAAM,CAAC;IAC9B,CAAC;IACD,OAAO,aAAa,CAAC,IAAI,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-kind.d.ts","sourceRoot":"","sources":["../../../emitter/src/type/client-kind.ts"],"names":[],"mappings":"AAGA,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,iBAAiB,sBAAsB;CACxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 var ClientKind;
|
|
4
|
+
(function (ClientKind) {
|
|
5
|
+
ClientKind["SdkClient"] = "SdkClient";
|
|
6
|
+
ClientKind["SdkOperationGroup"] = "SdkOperationGroup";
|
|
7
|
+
})(ClientKind || (ClientKind = {}));
|
|
8
|
+
//# sourceMappingURL=client-kind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-kind.js","sourceRoot":"","sources":["../../../emitter/src/type/client-kind.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,qDAAuC,CAAA;AACzC,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InputAuth } from "./input-auth.js";
|
|
2
|
+
import { InputClient } from "./input-client.js";
|
|
3
|
+
import { InputEnumType, InputModelType } from "./input-type.js";
|
|
4
|
+
export interface CodeModel {
|
|
5
|
+
Name: string;
|
|
6
|
+
ApiVersions: string[];
|
|
7
|
+
Enums: InputEnumType[];
|
|
8
|
+
Models: InputModelType[];
|
|
9
|
+
Clients: InputClient[];
|
|
10
|
+
Auth?: InputAuth;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=code-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-model.d.ts","sourceRoot":"","sources":["../../../emitter/src/type/code-model.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,MAAM,EAAE,cAAc,EAAE,CAAC;IACzB,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-model.js","sourceRoot":"","sources":["../../../emitter/src/type/code-model.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum CollectionFormat {
|
|
2
|
+
CSV = "csv",
|
|
3
|
+
Simple = "simple",
|
|
4
|
+
SSV = "ssv",
|
|
5
|
+
TSV = "tsv",
|
|
6
|
+
Pipes = "pipes",
|
|
7
|
+
Multi = "multi",
|
|
8
|
+
Form = "form"
|
|
9
|
+
}
|
|
10
|
+
export declare const collectionFormatToDelimMap: {
|
|
11
|
+
[key: string]: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=collection-format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-format.d.ts","sourceRoot":"","sources":["../../../emitter/src/type/collection-format.ts"],"names":[],"mappings":"AAGA,oBAAY,gBAAgB;IAC1B,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED,eAAO,MAAM,0BAA0B,EAAE;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CASnC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 var CollectionFormat;
|
|
4
|
+
(function (CollectionFormat) {
|
|
5
|
+
CollectionFormat["CSV"] = "csv";
|
|
6
|
+
CollectionFormat["Simple"] = "simple";
|
|
7
|
+
CollectionFormat["SSV"] = "ssv";
|
|
8
|
+
CollectionFormat["TSV"] = "tsv";
|
|
9
|
+
CollectionFormat["Pipes"] = "pipes";
|
|
10
|
+
CollectionFormat["Multi"] = "multi";
|
|
11
|
+
CollectionFormat["Form"] = "form";
|
|
12
|
+
})(CollectionFormat || (CollectionFormat = {}));
|
|
13
|
+
export const collectionFormatToDelimMap = {
|
|
14
|
+
[CollectionFormat.CSV.toString()]: ",",
|
|
15
|
+
[CollectionFormat.Simple.toString()]: ",", // csv and simple are used interchangeably
|
|
16
|
+
[CollectionFormat.SSV.toString()]: " ",
|
|
17
|
+
[CollectionFormat.TSV.toString()]: "\t",
|
|
18
|
+
[CollectionFormat.Pipes.toString()]: "|",
|
|
19
|
+
[CollectionFormat.Multi.toString()]: undefined,
|
|
20
|
+
[CollectionFormat.Form.toString()]: undefined, // multi and form are used interchangeably
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=collection-format.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-format.js","sourceRoot":"","sources":["../../../emitter/src/type/collection-format.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,mCAAe,CAAA;IACf,iCAAa,CAAA;AACf,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B;AAED,MAAM,CAAC,MAAM,0BAA0B,GAEnC;IACF,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG;IACtC,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,0CAA0C;IACrF,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG;IACtC,CAAC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,EAAE,IAAI;IACvC,CAAC,gBAAgB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,GAAG;IACxC,CAAC,gBAAgB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,SAAS;IAC9C,CAAC,gBAAgB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,0CAA0C;CAC1F,CAAC"}
|