@azure-tools/typespec-autorest 0.58.0-dev.3 → 0.58.0-dev.5
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/src/openapi.js +1 -1
- package/dist/src/utils.js +10 -10
- package/dist/src/utils.js.map +1 -1
- package/package.json +5 -6
package/dist/src/openapi.js
CHANGED
|
@@ -241,7 +241,7 @@ export async function getOpenAPIForService(context, options) {
|
|
|
241
241
|
const itemsName = paging.output.pageItems.property.name;
|
|
242
242
|
return {
|
|
243
243
|
nextLinkName: paging.output.nextLink.property.name,
|
|
244
|
-
itemName: itemsName === "
|
|
244
|
+
itemName: itemsName === "value" ? undefined : itemsName,
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
return undefined;
|
package/dist/src/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getClientLocation, getClientNameOverride, } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { getFriendlyName, getLifecycleVisibilityEnum, getVisibilityForClass, isGlobalNamespace, isService, isTemplateInstance, } from "@typespec/compiler";
|
|
3
|
+
import { capitalize } from "@typespec/compiler/casing";
|
|
3
4
|
import { getOperationId } from "@typespec/openapi";
|
|
4
|
-
import { pascalCase } from "change-case";
|
|
5
5
|
export function getClientName(context, type) {
|
|
6
6
|
const clientName = getClientNameOverride(context.tcgcSdkContext, type);
|
|
7
7
|
return clientName ?? type.name;
|
|
@@ -59,28 +59,28 @@ export function resolveOperationId(context, operation) {
|
|
|
59
59
|
const clientLocation = getClientLocation(context.tcgcSdkContext, operation);
|
|
60
60
|
if (clientLocation) {
|
|
61
61
|
if (typeof clientLocation === "string") {
|
|
62
|
-
return
|
|
62
|
+
return standardizeOperationId(`${clientLocation}_${operationName}`);
|
|
63
63
|
}
|
|
64
64
|
if (clientLocation.kind === "Interface") {
|
|
65
|
-
return
|
|
65
|
+
return standardizeOperationId(`${getClientName(context, clientLocation)}_${operationName}`);
|
|
66
66
|
}
|
|
67
67
|
if (clientLocation.kind === "Namespace") {
|
|
68
68
|
if (isGlobalNamespace(program, clientLocation) || isService(program, clientLocation)) {
|
|
69
|
-
return
|
|
69
|
+
return standardizeOperationId(operationName);
|
|
70
70
|
}
|
|
71
|
-
return
|
|
71
|
+
return standardizeOperationId(`${getClientName(context, clientLocation)}_${operationName}`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
if (operation.interface) {
|
|
75
|
-
return
|
|
75
|
+
return standardizeOperationId(`${getClientName(context, operation.interface)}_${operationName}`);
|
|
76
76
|
}
|
|
77
77
|
const namespace = operation.namespace;
|
|
78
78
|
if (namespace === undefined ||
|
|
79
79
|
isGlobalNamespace(program, namespace) ||
|
|
80
80
|
isService(program, namespace)) {
|
|
81
|
-
return
|
|
81
|
+
return standardizeOperationId(operationName);
|
|
82
82
|
}
|
|
83
|
-
return
|
|
83
|
+
return standardizeOperationId(`${getClientName(context, namespace)}_${operationName}`);
|
|
84
84
|
}
|
|
85
85
|
/**
|
|
86
86
|
* Determines if a property is read-only, which is defined as having only the
|
|
@@ -98,10 +98,10 @@ export function isReadonlyProperty(program, property) {
|
|
|
98
98
|
// readonly: true, but using separate schemas.
|
|
99
99
|
return visibility.size === 1 && visibility.has(read);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function standardizeOperationId(name) {
|
|
102
102
|
return name
|
|
103
103
|
.split("_")
|
|
104
|
-
.map((s) =>
|
|
104
|
+
.map((s) => capitalize(s))
|
|
105
105
|
.join("_");
|
|
106
106
|
}
|
|
107
107
|
//# sourceMappingURL=utils.js.map
|
package/dist/src/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GAEtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,qBAAqB,E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S,GAAG,SAAS,CAAC,SAAS,CAAC;IACtC,IACE,SAAS,KAAK,SAAS;QACvB,iBAAiB,CAAC,OAAO,EAAE,SAAS,CAAC;QACrC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,EAC7B,CAAC;QACD,OAAO,sBAAsB,CAAC,aAAa,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,sBAAsB,CAAC,GAAG,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;AACzF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,QAAuB;IAC1E,MAAM,SAAS,GAAG,0BAA0B,CAAC,OAAO,CAAC,CAAC;IAEtD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAE,CAAC;IAE5C,MAAM,UAAU,GAAG,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAEvE,sEAAsE;IACtE,8CAA8C;IAC9C,OAAO,UAAU,CAAC,IAAI,KAAK,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACvD,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAY;IAC1C,OAAO,IAAI;SACR,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;SACzB,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-autorest",
|
|
3
|
-
"version": "0.58.0-dev.
|
|
3
|
+
"version": "0.58.0-dev.5",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec library for emitting openapi from the TypeSpec REST protocol binding",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
],
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@azure-tools/typespec-azure-core": "^0.57.0 || >=0.58.0-dev <0.58.0",
|
|
45
|
-
"@azure-tools/typespec-azure-resource-manager": "^0.57.
|
|
46
|
-
"@azure-tools/typespec-client-generator-core": "^0.57.
|
|
45
|
+
"@azure-tools/typespec-azure-resource-manager": "^0.57.2 || >=0.58.0-dev <0.58.0",
|
|
46
|
+
"@azure-tools/typespec-client-generator-core": "^0.57.3 || >=0.58.0-dev <0.58.0",
|
|
47
47
|
"@typespec/compiler": "^1.1.0",
|
|
48
48
|
"@typespec/http": "^1.1.0",
|
|
49
49
|
"@typespec/openapi": "^1.1.0",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@azure-tools/typespec-azure-core": "^0.57.0 || >=0.58.0-dev <0.58.0",
|
|
55
|
-
"@azure-tools/typespec-azure-resource-manager": "^0.57.
|
|
56
|
-
"@azure-tools/typespec-client-generator-core": "^0.57.
|
|
55
|
+
"@azure-tools/typespec-azure-resource-manager": "^0.57.2 || >=0.58.0-dev <0.58.0",
|
|
56
|
+
"@azure-tools/typespec-client-generator-core": "^0.57.3 || >=0.58.0-dev <0.58.0",
|
|
57
57
|
"@types/node": "~24.0.3",
|
|
58
58
|
"@typespec/compiler": "^1.1.0",
|
|
59
59
|
"@typespec/http": "^1.1.0",
|
|
@@ -66,7 +66,6 @@
|
|
|
66
66
|
"@vitest/coverage-v8": "^3.1.2",
|
|
67
67
|
"@vitest/ui": "^3.1.2",
|
|
68
68
|
"c8": "^10.1.3",
|
|
69
|
-
"change-case": "~5.4.4",
|
|
70
69
|
"rimraf": "~6.0.1",
|
|
71
70
|
"typescript": "~5.8.2",
|
|
72
71
|
"vitest": "^3.1.2"
|