@azure-typespec/http-client-csharp 1.0.0-alpha.20260303.1 → 1.0.0-alpha.20260303.2

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.
@@ -35,25 +35,42 @@ export async function $onEmit(context) {
35
35
  * Generates a metadata.json file containing API version information.
36
36
  *
37
37
  * The emitter automatically generates a `metadata.json` file in the `Generated/` folder.
38
- * This file contains information such as the API version and can be used for automation
39
- * purposes like building a mapping of package version to supported API version.
38
+ * This file contains information such as the API versions and can be used for automation
39
+ * purposes like building a mapping of package version to supported API versions.
40
40
  *
41
41
  * The metadata file contains content such as:
42
42
  * ```json
43
43
  * {
44
- * "apiVersion": "2024-05-01"
44
+ * "apiVersions": {
45
+ * "Azure.Service": "2024-05-01"
46
+ * }
45
47
  * }
46
48
  * ```
47
49
  *
48
- * If no API version is specified, the value will be "not-specified".
50
+ * For packages containing multiple services:
51
+ * ```json
52
+ * {
53
+ * "apiVersions": {
54
+ * "Azure.ServiceA": "2024-05-01",
55
+ * "Azure.ServiceB": "2024-06-01"
56
+ * }
57
+ * }
58
+ * ```
59
+ *
60
+ * If no API versions are specified, the value will be "not-specified".
61
+ * If the `apiVersions` property is undefined, the value will be "not-specified".
49
62
  */
50
63
  async function generateMetadataFile(context) {
51
- // Create SDK context to access the API version from the TypeSpec service definition
64
+ // Create SDK context to access the API versions from the TypeSpec service definition
52
65
  const sdkContext = await createSdkContext(context, "@azure-typespec/http-client-csharp", context.options["sdk-context-options"] ?? {});
53
- const apiVersion = sdkContext.sdkPackage.metadata.apiVersion;
54
- // Define the metadata schema we want to output
66
+ const apiVersionsMap = sdkContext.sdkPackage.metadata.apiVersions;
67
+ // Define the metadata schema we want to output.
68
+ // JSON.stringify does not natively serialize Maps, so we convert to a plain object.
69
+ // If apiVersions is undefined or empty, emit an empty object for a consistent Record<string, string> type.
55
70
  const metadata = {
56
- apiVersion: apiVersion || "not-specified"
71
+ apiVersions: apiVersionsMap && apiVersionsMap.size > 0
72
+ ? Object.fromEntries(apiVersionsMap)
73
+ : {}
57
74
  };
58
75
  const outputPath = resolvePath(context.emitterOutputDir, "metadata.json");
59
76
  await context.program.host.writeFile(outputPath, JSON.stringify(metadata, null, 2));
@@ -1 +1 @@
1
- {"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../../emitter/src/emitter.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,+FAA+F;AAE/F,OAAO,EAAe,QAAQ,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAyC;IACrE,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,sBAAsB,CAAC;IAC7D,OAAO,CAAC,OAAO,CAAC,wBAAwB,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC9D,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK;QAC7B,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,uBAAuB;KACjC,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEjE,8BAA8B;IAC9B,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC;IAC9C,MAAM,kBAAkB,GACtB,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,oBAAoB,CAAC;IAC9D,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,oBAAoB,GAAG;QAC5D,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAA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,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,KAAK,UAAU,oBAAoB,CACjC,OAAyC;IAEzC,qFAAqF;IACrF,MAAM,UAAU,GAAG,MAAM,gBAAgB,CACvC,OAAO,EACP,oCAAoC,EACpC,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAC7C,CAAC;IAEF,MAAM,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC;IAElE,gDAAgD;IAChD,oFAAoF;IACpF,2GAA2G;IAC3G,MAAM,QAAQ,GAAG;QACf,WAAW,EACT,cAAc,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC;YACvC,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,cAAc,CAAC;YACpC,CAAC,CAAC,EAAE;KACT,CAAC;IAEF,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAC1E,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAClC,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAClC,CAAC;AACJ,CAAC"}
@@ -6,9 +6,9 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v10.0": {
9
- "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.1": {
9
+ "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.2": {
10
10
  "dependencies": {
11
- "Azure.Generator": "1.0.0-alpha.20260303.1",
11
+ "Azure.Generator": "1.0.0-alpha.20260303.2",
12
12
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20260302.5",
13
13
  "System.ClientModel": "1.9.0"
14
14
  },
@@ -675,7 +675,7 @@
675
675
  }
676
676
  }
677
677
  },
678
- "Azure.Generator/1.0.0-alpha.20260303.1": {
678
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
679
679
  "dependencies": {
680
680
  "Azure.Core": "1.51.1",
681
681
  "Azure.Core.Expressions.DataFactory": "1.0.0",
@@ -685,14 +685,14 @@
685
685
  "runtime": {
686
686
  "Azure.Generator.dll": {
687
687
  "assemblyVersion": "1.0.0.0",
688
- "fileVersion": "1.0.26.15301"
688
+ "fileVersion": "1.0.26.15302"
689
689
  }
690
690
  }
691
691
  }
692
692
  }
693
693
  },
694
694
  "libraries": {
695
- "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.1": {
695
+ "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.2": {
696
696
  "type": "project",
697
697
  "serviceable": false,
698
698
  "sha512": ""
@@ -1012,7 +1012,7 @@
1012
1012
  "path": "system.security.cryptography.protecteddata/8.0.0",
1013
1013
  "hashPath": "system.security.cryptography.protecteddata.8.0.0.nupkg.sha512"
1014
1014
  },
1015
- "Azure.Generator/1.0.0-alpha.20260303.1": {
1015
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
1016
1016
  "type": "project",
1017
1017
  "serviceable": false,
1018
1018
  "sha512": ""
@@ -6,7 +6,7 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v10.0": {
9
- "Azure.Generator/1.0.0-alpha.20260303.1": {
9
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
10
10
  "dependencies": {
11
11
  "Azure.Core": "1.51.1",
12
12
  "Azure.Core.Expressions.DataFactory": "1.0.0",
@@ -679,7 +679,7 @@
679
679
  }
680
680
  },
681
681
  "libraries": {
682
- "Azure.Generator/1.0.0-alpha.20260303.1": {
682
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
683
683
  "type": "project",
684
684
  "serviceable": false,
685
685
  "sha512": ""
Binary file
Binary file
@@ -6,9 +6,9 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v10.0": {
9
- "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.1": {
9
+ "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.2": {
10
10
  "dependencies": {
11
- "Azure.Generator": "1.0.0-alpha.20260303.1",
11
+ "Azure.Generator": "1.0.0-alpha.20260303.2",
12
12
  "Microsoft.TypeSpec.Generator.ClientModel": "1.0.0-alpha.20260302.5",
13
13
  "System.ClientModel": "1.9.0"
14
14
  },
@@ -675,7 +675,7 @@
675
675
  }
676
676
  }
677
677
  },
678
- "Azure.Generator/1.0.0-alpha.20260303.1": {
678
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
679
679
  "dependencies": {
680
680
  "Azure.Core": "1.51.1",
681
681
  "Azure.Core.Expressions.DataFactory": "1.0.0",
@@ -685,14 +685,14 @@
685
685
  "runtime": {
686
686
  "Azure.Generator.dll": {
687
687
  "assemblyVersion": "1.0.0.0",
688
- "fileVersion": "1.0.26.15301"
688
+ "fileVersion": "1.0.26.15302"
689
689
  }
690
690
  }
691
691
  }
692
692
  }
693
693
  },
694
694
  "libraries": {
695
- "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.1": {
695
+ "Azure.Generator.StubLibrary/1.0.0-alpha.20260303.2": {
696
696
  "type": "project",
697
697
  "serviceable": false,
698
698
  "sha512": ""
@@ -1012,7 +1012,7 @@
1012
1012
  "path": "system.security.cryptography.protecteddata/8.0.0",
1013
1013
  "hashPath": "system.security.cryptography.protecteddata.8.0.0.nupkg.sha512"
1014
1014
  },
1015
- "Azure.Generator/1.0.0-alpha.20260303.1": {
1015
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
1016
1016
  "type": "project",
1017
1017
  "serviceable": false,
1018
1018
  "sha512": ""
@@ -6,7 +6,7 @@
6
6
  "compilationOptions": {},
7
7
  "targets": {
8
8
  ".NETCoreApp,Version=v10.0": {
9
- "Azure.Generator/1.0.0-alpha.20260303.1": {
9
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
10
10
  "dependencies": {
11
11
  "Azure.Core": "1.51.1",
12
12
  "Azure.Core.Expressions.DataFactory": "1.0.0",
@@ -679,7 +679,7 @@
679
679
  }
680
680
  },
681
681
  "libraries": {
682
- "Azure.Generator/1.0.0-alpha.20260303.1": {
682
+ "Azure.Generator/1.0.0-alpha.20260303.2": {
683
683
  "type": "project",
684
684
  "serviceable": false,
685
685
  "sha512": ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-typespec/http-client-csharp",
3
- "version": "1.0.0-alpha.20260303.1",
3
+ "version": "1.0.0-alpha.20260303.2",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec library for emitting Azure libraries for C#.",
6
6
  "readme": "https://github.com/Azure/azure-sdk-for-net/blob/main/eng/packages/http-client-csharp/README.md",