@typespec/http-server-csharp 0.58.0-alpha.2 → 0.58.0-alpha.20-dev.0

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.
Files changed (78) hide show
  1. package/README.md +69 -6
  2. package/cmd/hscs.js +2 -0
  3. package/dist/src/cli/cli.d.ts +2 -0
  4. package/dist/src/cli/cli.d.ts.map +1 -0
  5. package/dist/src/cli/cli.js +173 -0
  6. package/dist/src/cli/cli.js.map +1 -0
  7. package/dist/src/{attributes.d.ts → lib/attributes.d.ts} +1 -1
  8. package/dist/src/lib/attributes.d.ts.map +1 -0
  9. package/dist/src/{attributes.js → lib/attributes.js} +113 -35
  10. package/dist/src/lib/attributes.js.map +1 -0
  11. package/dist/src/lib/boilerplate.d.ts +6 -0
  12. package/dist/src/lib/boilerplate.d.ts.map +1 -0
  13. package/dist/src/{boilerplate.js → lib/boilerplate.js} +253 -66
  14. package/dist/src/lib/boilerplate.js.map +1 -0
  15. package/dist/src/lib/doc.d.ts +5 -0
  16. package/dist/src/lib/doc.d.ts.map +1 -0
  17. package/dist/src/lib/doc.js +237 -0
  18. package/dist/src/lib/doc.js.map +1 -0
  19. package/dist/src/lib/index.d.ts.map +1 -0
  20. package/dist/src/lib/index.js.map +1 -0
  21. package/dist/src/{interfaces.d.ts → lib/interfaces.d.ts} +58 -4
  22. package/dist/src/lib/interfaces.d.ts.map +1 -0
  23. package/dist/src/{interfaces.js → lib/interfaces.js} +100 -27
  24. package/dist/src/lib/interfaces.js.map +1 -0
  25. package/dist/src/{lib.d.ts → lib/lib.d.ts} +54 -1
  26. package/dist/src/lib/lib.d.ts.map +1 -0
  27. package/dist/src/lib/lib.js +146 -0
  28. package/dist/src/lib/lib.js.map +1 -0
  29. package/dist/src/lib/project.d.ts +5 -0
  30. package/dist/src/lib/project.d.ts.map +1 -0
  31. package/dist/src/lib/project.js +101 -0
  32. package/dist/src/lib/project.js.map +1 -0
  33. package/dist/src/lib/scaffolding.d.ts +22 -0
  34. package/dist/src/lib/scaffolding.d.ts.map +1 -0
  35. package/dist/src/lib/scaffolding.js +461 -0
  36. package/dist/src/lib/scaffolding.js.map +1 -0
  37. package/dist/src/lib/service.d.ts.map +1 -0
  38. package/dist/src/lib/service.js +1188 -0
  39. package/dist/src/lib/service.js.map +1 -0
  40. package/dist/src/lib/testing/index.d.ts.map +1 -0
  41. package/dist/src/{testing → lib/testing}/index.js +1 -0
  42. package/dist/src/lib/testing/index.js.map +1 -0
  43. package/dist/src/{type-helpers.d.ts → lib/type-helpers.d.ts} +5 -1
  44. package/dist/src/lib/type-helpers.d.ts.map +1 -0
  45. package/dist/src/{type-helpers.js → lib/type-helpers.js} +31 -0
  46. package/dist/src/lib/type-helpers.js.map +1 -0
  47. package/dist/src/lib/utils.d.ts +114 -0
  48. package/dist/src/lib/utils.d.ts.map +1 -0
  49. package/dist/src/lib/utils.js +1557 -0
  50. package/dist/src/lib/utils.js.map +1 -0
  51. package/package.json +49 -27
  52. package/dist/src/attributes.d.ts.map +0 -1
  53. package/dist/src/attributes.js.map +0 -1
  54. package/dist/src/boilerplate.d.ts +0 -4
  55. package/dist/src/boilerplate.d.ts.map +0 -1
  56. package/dist/src/boilerplate.js.map +0 -1
  57. package/dist/src/index.d.ts.map +0 -1
  58. package/dist/src/index.js.map +0 -1
  59. package/dist/src/interfaces.d.ts.map +0 -1
  60. package/dist/src/interfaces.js.map +0 -1
  61. package/dist/src/lib.d.ts.map +0 -1
  62. package/dist/src/lib.js +0 -60
  63. package/dist/src/lib.js.map +0 -1
  64. package/dist/src/service.d.ts.map +0 -1
  65. package/dist/src/service.js +0 -829
  66. package/dist/src/service.js.map +0 -1
  67. package/dist/src/testing/index.d.ts.map +0 -1
  68. package/dist/src/testing/index.js.map +0 -1
  69. package/dist/src/type-helpers.d.ts.map +0 -1
  70. package/dist/src/type-helpers.js.map +0 -1
  71. package/dist/src/utils.d.ts +0 -48
  72. package/dist/src/utils.d.ts.map +0 -1
  73. package/dist/src/utils.js +0 -628
  74. package/dist/src/utils.js.map +0 -1
  75. /package/dist/src/{index.d.ts → lib/index.d.ts} +0 -0
  76. /package/dist/src/{index.js → lib/index.js} +0 -0
  77. /package/dist/src/{service.d.ts → lib/service.d.ts} +0 -0
  78. /package/dist/src/{testing → lib/testing}/index.d.ts +0 -0
@@ -0,0 +1,146 @@
1
+ import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
2
+ import { CollectionType, resolveCollectionType } from "./interfaces.js";
3
+ const EmitterOptionsSchema = {
4
+ type: "object",
5
+ additionalProperties: false,
6
+ properties: {
7
+ "skip-format": {
8
+ type: "boolean",
9
+ nullable: true,
10
+ description: "Skips formatting of generated C# Types. By default, C# files are formatted using 'dotnet format'.",
11
+ },
12
+ "output-type": {
13
+ type: "string",
14
+ enum: ["models", "all"],
15
+ nullable: true,
16
+ default: "all",
17
+ description: "Chooses which service artifacts to emit. choices include 'models' or 'all' artifacts.",
18
+ },
19
+ "emit-mocks": {
20
+ type: "string",
21
+ enum: ["mocks-and-project-files", "mocks-only", "none"],
22
+ nullable: true,
23
+ default: "none",
24
+ description: "Emits mock implementations of business logic, setup code, and project files, enabling the service to respond to requests before a real implementation is provided",
25
+ },
26
+ "use-swaggerui": {
27
+ type: "boolean",
28
+ nullable: true,
29
+ default: false,
30
+ description: "Configure a Swagger UI endpoint in the development configuration",
31
+ },
32
+ "openapi-path": {
33
+ type: "string",
34
+ nullable: true,
35
+ default: null,
36
+ description: "Use openapi at the given path for generating SwaggerUI endpoints. By default, this will be 'openapi/openapi.yaml' if the 'use-swaggerui' option is enabled. ",
37
+ },
38
+ overwrite: {
39
+ type: "boolean",
40
+ nullable: true,
41
+ default: false,
42
+ description: "When generating mock and project files, overwrite any existing files with the same name.",
43
+ },
44
+ "project-name": {
45
+ type: "string",
46
+ nullable: true,
47
+ default: "ServiceProject",
48
+ description: "The name of the generated project.",
49
+ },
50
+ "http-port": {
51
+ type: "number",
52
+ nullable: true,
53
+ description: "The service http port when hosting the project locally.",
54
+ },
55
+ "https-port": {
56
+ type: "number",
57
+ nullable: true,
58
+ description: "The service https port when hosting the project locally.",
59
+ },
60
+ "collection-type": {
61
+ type: "string",
62
+ enum: ["array", "enumerable"],
63
+ nullable: true,
64
+ default: "array",
65
+ description: "Specifies the collection type to use: 'array' or 'enumerable'. The default is 'array'.",
66
+ },
67
+ },
68
+ required: [],
69
+ };
70
+ export const $lib = createTypeSpecLibrary({
71
+ name: "@typespec/http-server-csharp",
72
+ capabilities: {
73
+ dryRun: true,
74
+ },
75
+ diagnostics: {
76
+ "invalid-identifier": {
77
+ severity: "warning",
78
+ messages: {
79
+ default: paramMessage `Invalid identifier '${"identifier"}' in ${"location"}`,
80
+ },
81
+ },
82
+ "anonymous-model": {
83
+ severity: "warning",
84
+ messages: {
85
+ default: paramMessage `Inline models use generated names in emitted code. Consider defining each model with an explicit name. This model will be named '${"emittedName"}' in emitted code`,
86
+ },
87
+ },
88
+ "missing-type-parent": {
89
+ severity: "warning",
90
+ messages: {
91
+ default: paramMessage `No parent found for ${"type"} ${"name"} `,
92
+ },
93
+ },
94
+ "no-numeric": {
95
+ severity: "warning",
96
+ messages: {
97
+ default: paramMessage `Type '${"sourceType"}' is an imprecise type that does not map directly to a single numeric type, using '${"targetType"}' as the safest c# numeric type. Please specify a more precise numeric type, like 'int32' or 'float64'`,
98
+ },
99
+ },
100
+ "unrecognized-scalar": {
101
+ severity: "warning",
102
+ messages: {
103
+ default: paramMessage `Scalar type ${"typeName"} is not a recognized scalar type. Please use or extend a built-in scalar type.`,
104
+ },
105
+ },
106
+ "invalid-intrinsic": {
107
+ severity: "error",
108
+ messages: {
109
+ default: paramMessage `Intrinsic type ${"typeName"} is not valid in this context. Please use a model, enum, union, scalar, or the unknown type`,
110
+ },
111
+ },
112
+ "invalid-interpolation": {
113
+ severity: "warning",
114
+ messages: {
115
+ default: paramMessage `StringTemplate types should only reference literal-valued constants, enum members, or literal-valued model properties. The interpolated value will not contain one or more referenced elements in generated code.`,
116
+ },
117
+ },
118
+ "get-request-body": {
119
+ severity: "warning",
120
+ messages: {
121
+ default: paramMessage `Get operations should not have request bodies. Generating an operation and interface without parameters, your business logic will use HttpContext to interpret Request properties.`,
122
+ },
123
+ },
124
+ },
125
+ emitter: {
126
+ options: EmitterOptionsSchema,
127
+ },
128
+ });
129
+ export const { reportDiagnostic, createStateSymbol, getTracer } = $lib;
130
+ export class CSharpServiceOptions {
131
+ static instance;
132
+ collectionType;
133
+ constructor() {
134
+ this.collectionType = CollectionType.Array;
135
+ }
136
+ static getInstance() {
137
+ if (!CSharpServiceOptions.instance) {
138
+ CSharpServiceOptions.instance = new CSharpServiceOptions();
139
+ }
140
+ return CSharpServiceOptions.instance;
141
+ }
142
+ initialize(options) {
143
+ this.collectionType = resolveCollectionType(options["collection-type"]);
144
+ }
145
+ }
146
+ //# sourceMappingURL=lib.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/lib/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAyBxE,MAAM,oBAAoB,GAAgD;IACxE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,oGAAoG;SACvG;QACD,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC;YACvB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,WAAW,EACT,uFAAuF;SAC1F;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,yBAAyB,EAAE,YAAY,EAAE,MAAM,CAAC;YACvD,QAAQ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,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CAAC;YACnC,oBAAoB,CAAC,QAAQ,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7D,CAAC;QACD,OAAO,oBAAoB,CAAC,QAAQ,CAAC;IACvC,CAAC;IAEM,UAAU,CAAC,OAAuC;QACvD,IAAI,CAAC,cAAc,GAAG,qBAAqB,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC1E,CAAC;CACF"}
@@ -0,0 +1,5 @@
1
+ import { AssetEmitter } from "@typespec/asset-emitter";
2
+ import { LibrarySourceFile } from "./interfaces.js";
3
+ import { CSharpServiceEmitterOptions } from "./lib.js";
4
+ export declare function getProjectHelpers(emitter: AssetEmitter<string, CSharpServiceEmitterOptions>, projectName: string, useSwaggerUI: boolean, httpPort: number, httpsPort: number): LibrarySourceFile[];
5
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAEvD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,2BAA2B,CAAC,EAC1D,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,OAAO,EACrB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,iBAAiB,EAAE,CAgCrB"}
@@ -0,0 +1,101 @@
1
+ import { LibrarySourceFile } from "./interfaces.js";
2
+ export function getProjectHelpers(emitter, projectName, useSwaggerUI, httpPort, httpsPort) {
3
+ const result = [
4
+ new LibrarySourceFile({
5
+ filename: `${projectName}.csproj`,
6
+ emitter: emitter,
7
+ getContents: () => getProjectFile(useSwaggerUI),
8
+ path: ".",
9
+ conditional: true,
10
+ }),
11
+ new LibrarySourceFile({
12
+ filename: "appsettings.json",
13
+ emitter: emitter,
14
+ getContents: getAppSettings,
15
+ path: ".",
16
+ conditional: true,
17
+ }),
18
+ new LibrarySourceFile({
19
+ filename: "appsettings.Development.json",
20
+ emitter: emitter,
21
+ getContents: getDeveloperAppSettings,
22
+ path: ".",
23
+ conditional: true,
24
+ }),
25
+ new LibrarySourceFile({
26
+ filename: "launchSettings.json",
27
+ emitter: emitter,
28
+ getContents: () => getLaunchSettings(httpPort, httpsPort),
29
+ path: "Properties",
30
+ conditional: true,
31
+ }),
32
+ ];
33
+ return result;
34
+ }
35
+ function getProjectFile(useSwaggerUI) {
36
+ return `<Project Sdk="Microsoft.NET.Sdk.Web">
37
+
38
+ <PropertyGroup>
39
+ <TargetFramework>net9.0</TargetFramework>
40
+ <Nullable>enable</Nullable>
41
+ <ImplicitUsings>enable</ImplicitUsings>
42
+ </PropertyGroup>
43
+
44
+ ${useSwaggerUI
45
+ ? ` <ItemGroup>
46
+ <PackageReference Include="SwashBuckle.AspNetCore" Version="7.3.1" />
47
+ </ItemGroup>`
48
+ : ""}
49
+
50
+ </Project>
51
+ `;
52
+ }
53
+ function getAppSettings() {
54
+ return `{
55
+ "Logging": {
56
+ "LogLevel": {
57
+ "Default": "Information",
58
+ "Microsoft.AspNetCore": "Warning"
59
+ }
60
+ },
61
+ "AllowedHosts": "*"
62
+ }
63
+ `;
64
+ }
65
+ function getDeveloperAppSettings() {
66
+ return `{
67
+ "Logging": {
68
+ "LogLevel": {
69
+ "Default": "Information",
70
+ "Microsoft.AspNetCore": "Warning"
71
+ }
72
+ }
73
+ }
74
+ `;
75
+ }
76
+ function getLaunchSettings(httpPort, httpsPort) {
77
+ return `{
78
+ "$schema": "https://json.schemastore.org/launchsettings.json",
79
+ "profiles": {
80
+ "https": {
81
+ "commandName": "Project",
82
+ "dotnetRunMessages": true,
83
+ "launchBrowser": true,
84
+ "applicationUrl": "https://localhost:${httpsPort};http://localhost:${httpPort}",
85
+ "environmentVariables": {
86
+ "ASPNETCORE_ENVIRONMENT": "Development"
87
+ }
88
+ },
89
+ "http": {
90
+ "commandName": "Project",
91
+ "dotnetRunMessages": true,
92
+ "launchBrowser": true,
93
+ "applicationUrl": "http://localhost:${httpPort}",
94
+ "environmentVariables": {
95
+ "ASPNETCORE_ENVIRONMENT": "Development"
96
+ }
97
+ }
98
+ }
99
+ }`;
100
+ }
101
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,MAAM,UAAU,iBAAiB,CAC/B,OAA0D,EAC1D,WAAmB,EACnB,YAAqB,EACrB,QAAgB,EAChB,SAAiB;IAEjB,MAAM,MAAM,GAAwB;QAClC,IAAI,iBAAiB,CAAC;YACpB,QAAQ,EAAE,GAAG,WAAW,SAAS;YACjC,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,YAAY,CAAC;YAC/C,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,IAAI;SAClB,CAAC;QACF,IAAI,iBAAiB,CAAC;YACpB,QAAQ,EAAE,kBAAkB;YAC5B,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,IAAI;SAClB,CAAC;QACF,IAAI,iBAAiB,CAAC;YACpB,QAAQ,EAAE,8BAA8B;YACxC,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,GAAG;YACT,WAAW,EAAE,IAAI;SAClB,CAAC;QACF,IAAI,iBAAiB,CAAC;YACpB,QAAQ,EAAE,qBAAqB;YAC/B,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,GAAG,EAAE,CAAC,iBAAiB,CAAC,QAAQ,EAAE,SAAS,CAAC;YACzD,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,IAAI;SAClB,CAAC;KACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AACD,SAAS,cAAc,CAAC,YAAqB;IAC3C,OAAO;;;;;;;;EASP,YAAY;QACV,CAAC,CAAC;;eAES;QACX,CAAC,CAAC,EACN;;;CAGC,CAAC;AACF,CAAC;AACD,SAAS,cAAc;IACrB,OAAO;;;;;;;;;CASR,CAAC;AACF,CAAC;AAED,SAAS,uBAAuB;IAC9B,OAAO;;;;;;;;CAQR,CAAC;AACF,CAAC;AAED,SAAS,iBAAiB,CAAC,QAAgB,EAAE,SAAiB;IAC5D,OAAO;;;;;;;+CAOsC,SAAS,qBAAqB,QAAQ;;;;;;;;;8CASvC,QAAQ;;;;;;IAMlD,CAAC;AACL,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { AssetEmitter } from "@typespec/asset-emitter";
2
+ import { CSharpCollectionType, CSharpType, LibrarySourceFile } from "./interfaces.js";
3
+ import { CSharpServiceEmitterOptions } from "./lib.js";
4
+ export interface BusinessLogicImplementation {
5
+ namespace: string;
6
+ interfaceName: string;
7
+ usings: string[];
8
+ className: string;
9
+ methods: BusinessLogicMethod[];
10
+ }
11
+ export interface BusinessLogicMethod {
12
+ methodName: string;
13
+ methodParams: string;
14
+ returnTypeName: string;
15
+ returnType: CSharpType | CSharpCollectionType;
16
+ instantiatedReturnType?: string;
17
+ }
18
+ export type BusinessLogicRegistrations = Map<string, BusinessLogicImplementation>;
19
+ export type BusinessLogicRegistration = [string, BusinessLogicImplementation];
20
+ export declare function getScaffoldingHelpers(emitter: AssetEmitter<string, CSharpServiceEmitterOptions>, useSwagger: boolean, openApiPath: string, hasMockRegistration: boolean): LibrarySourceFile[];
21
+ export declare function getBusinessLogicImplementations(emitter: AssetEmitter<string, Record<string, never>>, registrations: BusinessLogicRegistrations, useSwagger: boolean, openApiPath: string): LibrarySourceFile[];
22
+ //# sourceMappingURL=scaffolding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