@azure-tools/typespec-autorest-canonical 0.3.0-dev.5 → 0.3.0-dev.6
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/emitter.d.ts +5 -0
- package/dist/src/emitter.d.ts.map +1 -0
- package/dist/src/emitter.js +125 -0
- package/dist/src/emitter.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -130
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +0 -85
- package/dist/src/lib.js.map +1 -1
- package/package.json +4 -6
- package/dist/src/autorest-canonical-openapi-schema.d.ts +0 -3
- package/dist/src/autorest-canonical-openapi-schema.d.ts.map +0 -1
- package/dist/src/autorest-canonical-openapi-schema.js +0 -12
- package/dist/src/autorest-canonical-openapi-schema.js.map +0 -1
- package/dist/src/json-schema-sorter/sorter.d.ts +0 -30
- package/dist/src/json-schema-sorter/sorter.d.ts.map +0 -1
- package/dist/src/json-schema-sorter/sorter.js +0 -163
- package/dist/src/json-schema-sorter/sorter.js.map +0 -1
- package/dist/src/openapi.d.ts +0 -31
- package/dist/src/openapi.d.ts.map +0 -1
- package/dist/src/openapi.js +0 -1714
- package/dist/src/openapi.js.map +0 -1
- package/dist/src/types.d.ts +0 -475
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.d.ts +0 -42
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -79
- package/dist/src/utils.js.map +0 -1
- package/schema/dist/schema.js +0 -3
@@ -0,0 +1,5 @@
|
|
1
|
+
import { EmitContext } from "@typespec/compiler";
|
2
|
+
import { AutorestCanonicalEmitterOptions } from "./lib.js";
|
3
|
+
export declare const canonicalVersion = "canonical";
|
4
|
+
export declare function $onEmit(context: EmitContext<AutorestCanonicalEmitterOptions>): Promise<void>;
|
5
|
+
//# sourceMappingURL=emitter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"emitter.d.ts","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,WAAW,EAYZ,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAE,+BAA+B,EAAoB,MAAM,UAAU,CAAC;AAQ7E,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAc5C,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,+BAA+B,CAAC,iBAqBlF"}
|
@@ -0,0 +1,125 @@
|
|
1
|
+
import { getOpenAPIForService, sortOpenAPIDocument, } from "@azure-tools/typespec-autorest";
|
2
|
+
import { createSdkContext } from "@azure-tools/typespec-client-generator-core";
|
3
|
+
import { emitFile, getDirectoryPath, getNamespaceFullName, interpolatePath, listServices, navigateType, resolvePath, } from "@typespec/compiler";
|
4
|
+
import { getRenamedFrom, getReturnTypeChangedFrom, getTypeChangedFrom, getVersion, } from "@typespec/versioning";
|
5
|
+
import { reportDiagnostic } from "./lib.js";
|
6
|
+
const defaultOptions = {
|
7
|
+
"output-file": "{azure-resource-provider-folder}/{service-name}/canonical/openapi.json",
|
8
|
+
"new-line": "lf",
|
9
|
+
"include-x-typespec-name": "never",
|
10
|
+
};
|
11
|
+
export const canonicalVersion = "canonical";
|
12
|
+
export async function $onEmit(context) {
|
13
|
+
const resolvedOptions = { ...defaultOptions, ...context.options };
|
14
|
+
const tcgcSdkContext = createSdkContext(context, "@azure-tools/typespec-autorest-canonical");
|
15
|
+
const armTypesDir = interpolatePath(resolvedOptions["arm-types-dir"] ?? "{project-root}/../../common-types/resource-management", {
|
16
|
+
"project-root": context.program.projectRoot,
|
17
|
+
"emitter-output-dir": context.emitterOutputDir,
|
18
|
+
});
|
19
|
+
const options = {
|
20
|
+
outputFile: resolvedOptions["output-file"],
|
21
|
+
outputDir: context.emitterOutputDir,
|
22
|
+
azureResourceProviderFolder: resolvedOptions["azure-resource-provider-folder"],
|
23
|
+
newLine: resolvedOptions["new-line"],
|
24
|
+
omitUnreachableTypes: resolvedOptions["omit-unreachable-types"],
|
25
|
+
includeXTypeSpecName: resolvedOptions["include-x-typespec-name"],
|
26
|
+
armTypesDir,
|
27
|
+
};
|
28
|
+
await emitAllServices(context.program, tcgcSdkContext, options);
|
29
|
+
}
|
30
|
+
async function emitAllServices(program, tcgcSdkContext, options) {
|
31
|
+
const services = listServices(program);
|
32
|
+
if (services.length === 0) {
|
33
|
+
services.push({ type: program.getGlobalNamespaceType() });
|
34
|
+
}
|
35
|
+
for (const service of services) {
|
36
|
+
validateUnsupportedVersioning(program, service.type);
|
37
|
+
const context = {
|
38
|
+
program,
|
39
|
+
outputFile: resolveOutputFile(service, services.length > 1, options),
|
40
|
+
service,
|
41
|
+
version: canonicalVersion,
|
42
|
+
tcgcSdkContext,
|
43
|
+
};
|
44
|
+
const result = await getOpenAPIForService(context, options);
|
45
|
+
const includedVersions = getVersion(program, service.type)
|
46
|
+
?.getVersions()
|
47
|
+
?.map((item) => item.name);
|
48
|
+
result.document.info["x-canonical-included-versions"] = includedVersions;
|
49
|
+
result.document.info["x-typespec-generated"] = [
|
50
|
+
{
|
51
|
+
emitter: "@azure-tools/typespec-autorest-canonical",
|
52
|
+
},
|
53
|
+
];
|
54
|
+
if (!program.compilerOptions.noEmit && !program.hasError()) {
|
55
|
+
// Sort the document
|
56
|
+
const sortedDocument = sortOpenAPIDocument(result.document);
|
57
|
+
// Write out the OpenAPI document to the output path
|
58
|
+
await emitFile(program, {
|
59
|
+
path: context.outputFile,
|
60
|
+
content: prettierOutput(JSON.stringify(sortedDocument, null, 2)),
|
61
|
+
newLine: options.newLine,
|
62
|
+
});
|
63
|
+
// Copy examples to the output directory
|
64
|
+
if (options.examplesDirectory && result.operationExamples.length > 0) {
|
65
|
+
const examplesPath = resolvePath(getDirectoryPath(context.outputFile), "examples");
|
66
|
+
await program.host.mkdirp(examplesPath);
|
67
|
+
for (const { examples } of result.operationExamples) {
|
68
|
+
if (examples) {
|
69
|
+
for (const [fileName, { file }] of Object.entries(examples)) {
|
70
|
+
await emitFile(program, {
|
71
|
+
path: resolvePath(examplesPath, fileName),
|
72
|
+
content: file.text,
|
73
|
+
newLine: options.newLine,
|
74
|
+
});
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
}
|
82
|
+
function resolveOutputFile(service, multipleServices, options, version) {
|
83
|
+
const azureResourceProviderFolder = options.azureResourceProviderFolder;
|
84
|
+
const interpolated = interpolatePath(options.outputFile, {
|
85
|
+
"azure-resource-provider-folder": azureResourceProviderFolder,
|
86
|
+
"service-name": multipleServices || azureResourceProviderFolder
|
87
|
+
? getNamespaceFullName(service.type)
|
88
|
+
: undefined,
|
89
|
+
"version-status": azureResourceProviderFolder
|
90
|
+
? version?.includes("preview")
|
91
|
+
? "preview"
|
92
|
+
: "stable"
|
93
|
+
: undefined,
|
94
|
+
version,
|
95
|
+
});
|
96
|
+
return resolvePath(options.outputDir, interpolated);
|
97
|
+
}
|
98
|
+
function prettierOutput(output) {
|
99
|
+
return output + "\n";
|
100
|
+
}
|
101
|
+
function validateUnsupportedVersioning(program, namespace) {
|
102
|
+
navigateType(namespace, {
|
103
|
+
operation: (operation) => {
|
104
|
+
if (getReturnTypeChangedFrom(program, operation)) {
|
105
|
+
reportDisallowedDecorator("returnTypeChangedFrom", operation);
|
106
|
+
}
|
107
|
+
},
|
108
|
+
modelProperty: (prop) => {
|
109
|
+
if (getRenamedFrom(program, prop)) {
|
110
|
+
reportDisallowedDecorator("renamedFrom", prop);
|
111
|
+
}
|
112
|
+
if (getTypeChangedFrom(program, prop)) {
|
113
|
+
reportDisallowedDecorator("typeChangedFrom", prop);
|
114
|
+
}
|
115
|
+
},
|
116
|
+
}, {});
|
117
|
+
function reportDisallowedDecorator(decorator, type) {
|
118
|
+
reportDiagnostic(program, {
|
119
|
+
code: "unsupported-versioning-decorator",
|
120
|
+
format: { decorator },
|
121
|
+
target: type,
|
122
|
+
});
|
123
|
+
}
|
124
|
+
}
|
125
|
+
//# sourceMappingURL=emitter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"emitter.js","sourceRoot":"","sources":["../../src/emitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAc,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAML,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAmC,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE7E,MAAM,cAAc,GAAG;IACrB,aAAa,EAAE,wEAAwE;IACvF,UAAU,EAAE,IAAI;IAChB,yBAAyB,EAAE,OAAO;CAC1B,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAc5C,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,OAAqD;IACjF,MAAM,eAAe,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAClE,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,EAAE,0CAA0C,CAAC,CAAC;IAC7F,MAAM,WAAW,GAAG,eAAe,CACjC,eAAe,CAAC,eAAe,CAAC,IAAI,uDAAuD,EAC3F;QACE,cAAc,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW;QAC3C,oBAAoB,EAAE,OAAO,CAAC,gBAAgB;KAC/C,CACF,CAAC;IACF,MAAM,OAAO,GAA4C;QACvD,UAAU,EAAE,eAAe,CAAC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AAI,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;gBACtC,yBAAyB,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;KACF,EACD,EAAE,CACH,CAAC;IAEF,SAAS,yBAAyB,CAAC,SAAiB,EAAE,IAAU;QAC9D,gBAAgB,CAAC,OAAO,EAAE;YACxB,IAAI,EAAE,kCAAkC;YACxC,MAAM,EAAE,EAAE,SAAS,EAAE;YACrB,MAAM,EAAE,IAAI;SACb,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/src/index.js
CHANGED
package/dist/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,IAAI,EAAmC,MAAM,UAAU,CAAC"}
|
package/dist/src/lib.d.ts
CHANGED
@@ -48,144 +48,15 @@ export interface AutorestCanonicalEmitterOptions {
|
|
48
48
|
"arm-types-dir"?: string;
|
49
49
|
}
|
50
50
|
export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
|
51
|
-
"duplicate-body-types": {
|
52
|
-
readonly default: "Request has multiple body types";
|
53
|
-
};
|
54
|
-
"invalid-schema": {
|
55
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
56
|
-
};
|
57
|
-
"union-null": {
|
58
|
-
readonly default: "Cannot have a union containing only null types.";
|
59
|
-
};
|
60
|
-
"union-unsupported": {
|
61
|
-
readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.";
|
62
|
-
readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value.";
|
63
|
-
};
|
64
|
-
"invalid-default": {
|
65
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
66
|
-
};
|
67
|
-
"invalid-multi-collection-format": {
|
68
|
-
readonly default: "The 'multi' should be applied to parameter in 'query', 'header' or 'formData'.";
|
69
|
-
};
|
70
|
-
"inline-cycle": {
|
71
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
72
|
-
};
|
73
|
-
"nonspecific-scalar": {
|
74
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>;
|
75
|
-
};
|
76
|
-
"unsupported-http-auth-scheme": {
|
77
|
-
readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>;
|
78
|
-
};
|
79
|
-
"unsupported-status-code-range": {
|
80
|
-
readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>;
|
81
|
-
};
|
82
|
-
"unsupported-multipart-type": {
|
83
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
84
|
-
};
|
85
|
-
"unsupported-param-type": {
|
86
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
87
|
-
};
|
88
|
-
"invalid-format": {
|
89
|
-
readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>;
|
90
|
-
};
|
91
|
-
"unsupported-auth": {
|
92
|
-
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
93
|
-
};
|
94
51
|
"unsupported-versioning-decorator": {
|
95
52
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
96
53
|
};
|
97
54
|
}, AutorestCanonicalEmitterOptions, never>;
|
98
|
-
export declare const reportDiagnostic: <C extends "
|
99
|
-
"duplicate-body-types": {
|
100
|
-
readonly default: "Request has multiple body types";
|
101
|
-
};
|
102
|
-
"invalid-schema": {
|
103
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
104
|
-
};
|
105
|
-
"union-null": {
|
106
|
-
readonly default: "Cannot have a union containing only null types.";
|
107
|
-
};
|
108
|
-
"union-unsupported": {
|
109
|
-
readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.";
|
110
|
-
readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value.";
|
111
|
-
};
|
112
|
-
"invalid-default": {
|
113
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
114
|
-
};
|
115
|
-
"invalid-multi-collection-format": {
|
116
|
-
readonly default: "The 'multi' should be applied to parameter in 'query', 'header' or 'formData'.";
|
117
|
-
};
|
118
|
-
"inline-cycle": {
|
119
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
120
|
-
};
|
121
|
-
"nonspecific-scalar": {
|
122
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>;
|
123
|
-
};
|
124
|
-
"unsupported-http-auth-scheme": {
|
125
|
-
readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>;
|
126
|
-
};
|
127
|
-
"unsupported-status-code-range": {
|
128
|
-
readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>;
|
129
|
-
};
|
130
|
-
"unsupported-multipart-type": {
|
131
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
132
|
-
};
|
133
|
-
"unsupported-param-type": {
|
134
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
135
|
-
};
|
136
|
-
"invalid-format": {
|
137
|
-
readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>;
|
138
|
-
};
|
139
|
-
"unsupported-auth": {
|
140
|
-
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
141
|
-
};
|
55
|
+
export declare const reportDiagnostic: <C extends "unsupported-versioning-decorator", M extends keyof {
|
142
56
|
"unsupported-versioning-decorator": {
|
143
57
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
144
58
|
};
|
145
59
|
}[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{
|
146
|
-
"duplicate-body-types": {
|
147
|
-
readonly default: "Request has multiple body types";
|
148
|
-
};
|
149
|
-
"invalid-schema": {
|
150
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
151
|
-
};
|
152
|
-
"union-null": {
|
153
|
-
readonly default: "Cannot have a union containing only null types.";
|
154
|
-
};
|
155
|
-
"union-unsupported": {
|
156
|
-
readonly default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.";
|
157
|
-
readonly empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value.";
|
158
|
-
};
|
159
|
-
"invalid-default": {
|
160
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
161
|
-
};
|
162
|
-
"invalid-multi-collection-format": {
|
163
|
-
readonly default: "The 'multi' should be applied to parameter in 'query', 'header' or 'formData'.";
|
164
|
-
};
|
165
|
-
"inline-cycle": {
|
166
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type"]>;
|
167
|
-
};
|
168
|
-
"nonspecific-scalar": {
|
169
|
-
readonly default: import("@typespec/compiler").CallableMessage<["type", "chosenType"]>;
|
170
|
-
};
|
171
|
-
"unsupported-http-auth-scheme": {
|
172
|
-
readonly default: import("@typespec/compiler").CallableMessage<["scheme"]>;
|
173
|
-
};
|
174
|
-
"unsupported-status-code-range": {
|
175
|
-
readonly default: import("@typespec/compiler").CallableMessage<["start", "end"]>;
|
176
|
-
};
|
177
|
-
"unsupported-multipart-type": {
|
178
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
179
|
-
};
|
180
|
-
"unsupported-param-type": {
|
181
|
-
readonly default: import("@typespec/compiler").CallableMessage<["part"]>;
|
182
|
-
};
|
183
|
-
"invalid-format": {
|
184
|
-
readonly default: import("@typespec/compiler").CallableMessage<["schema", "format"]>;
|
185
|
-
};
|
186
|
-
"unsupported-auth": {
|
187
|
-
readonly default: import("@typespec/compiler").CallableMessage<["authType"]>;
|
188
|
-
};
|
189
60
|
"unsupported-versioning-decorator": {
|
190
61
|
readonly default: import("@typespec/compiler").CallableMessage<["decorator"]>;
|
191
62
|
};
|
package/dist/src/lib.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,+BAA+B;IAC9C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAE1C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAEpD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,+BAA+B;IAC9C;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,gCAAgC,CAAC,EAAE,MAAM,CAAC;IAE1C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;;OAIG;IACH,yBAAyB,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAEpD;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAyED,eAAO,MAAM,IAAI;;;;0CAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;mBAAE,iBAAiB,4BAAE,SAAS,wFAAS,CAAC"}
|
package/dist/src/lib.js
CHANGED
@@ -54,91 +54,6 @@ const EmitterOptionsSchema = {
|
|
54
54
|
const libDef = {
|
55
55
|
name: "@azure-tools/typespec-autorest-canonical",
|
56
56
|
diagnostics: {
|
57
|
-
"duplicate-body-types": {
|
58
|
-
severity: "error",
|
59
|
-
messages: {
|
60
|
-
default: "Request has multiple body types",
|
61
|
-
},
|
62
|
-
},
|
63
|
-
"invalid-schema": {
|
64
|
-
severity: "error",
|
65
|
-
messages: {
|
66
|
-
default: paramMessage `Couldn't get schema for type ${"type"}`,
|
67
|
-
},
|
68
|
-
},
|
69
|
-
"union-null": {
|
70
|
-
severity: "error",
|
71
|
-
messages: {
|
72
|
-
default: "Cannot have a union containing only null types.",
|
73
|
-
},
|
74
|
-
},
|
75
|
-
"union-unsupported": {
|
76
|
-
severity: "warning",
|
77
|
-
messages: {
|
78
|
-
default: "Unions cannot be emitted to OpenAPI v2 unless all options are literals of the same type.",
|
79
|
-
empty: "Empty unions are not supported for OpenAPI v2 - enums must have at least one value.",
|
80
|
-
},
|
81
|
-
},
|
82
|
-
"invalid-default": {
|
83
|
-
severity: "error",
|
84
|
-
messages: {
|
85
|
-
default: paramMessage `Invalid type '${"type"}' for a default value`,
|
86
|
-
},
|
87
|
-
},
|
88
|
-
"invalid-multi-collection-format": {
|
89
|
-
severity: "error",
|
90
|
-
messages: {
|
91
|
-
default: "The 'multi' should be applied to parameter in 'query', 'header' or 'formData'.",
|
92
|
-
},
|
93
|
-
},
|
94
|
-
"inline-cycle": {
|
95
|
-
severity: "error",
|
96
|
-
messages: {
|
97
|
-
default: paramMessage `Cycle detected in '${"type"}'. Use @friendlyName decorator to assign an OpenAPI definition name and make it non-inline.`,
|
98
|
-
},
|
99
|
-
},
|
100
|
-
"nonspecific-scalar": {
|
101
|
-
severity: "warning",
|
102
|
-
messages: {
|
103
|
-
default: paramMessage `Scalar type '${"type"}' is not specific enough. The more specific type '${"chosenType"}' has been chosen.`,
|
104
|
-
},
|
105
|
-
},
|
106
|
-
"unsupported-http-auth-scheme": {
|
107
|
-
severity: "warning",
|
108
|
-
messages: {
|
109
|
-
default: paramMessage `The specified HTTP authentication scheme is not supported by this emitter: ${"scheme"}.`,
|
110
|
-
},
|
111
|
-
},
|
112
|
-
"unsupported-status-code-range": {
|
113
|
-
severity: "error",
|
114
|
-
messages: {
|
115
|
-
default: paramMessage `Status code range '${"start"} to '${"end"}' is not supported. OpenAPI 2.0 can only represent range 1XX, 2XX, 3XX, 4XX and 5XX. Example: \`@minValue(400) @maxValue(499)\` for 4XX.`,
|
116
|
-
},
|
117
|
-
},
|
118
|
-
"unsupported-multipart-type": {
|
119
|
-
severity: "warning",
|
120
|
-
messages: {
|
121
|
-
default: paramMessage `Multipart parts can only be represented as primitive types in swagger 2.0. Information is lost for part '${"part"}'.`,
|
122
|
-
},
|
123
|
-
},
|
124
|
-
"unsupported-param-type": {
|
125
|
-
severity: "warning",
|
126
|
-
messages: {
|
127
|
-
default: paramMessage `Parameter can only be represented as primitive types in swagger 2.0. Information is lost for part '${"part"}'.`,
|
128
|
-
},
|
129
|
-
},
|
130
|
-
"invalid-format": {
|
131
|
-
severity: "warning",
|
132
|
-
messages: {
|
133
|
-
default: paramMessage `'${"schema"}' format '${"format"}' is not supported in AutorestCanonical. It will not be emitted.`,
|
134
|
-
},
|
135
|
-
},
|
136
|
-
"unsupported-auth": {
|
137
|
-
severity: "warning",
|
138
|
-
messages: {
|
139
|
-
default: paramMessage `Authentication "${"authType"}" is not a known authentication by the AutorestCanonical emitter, it will be ignored.`,
|
140
|
-
},
|
141
|
-
},
|
142
57
|
"unsupported-versioning-decorator": {
|
143
58
|
severity: "warning",
|
144
59
|
messages: {
|
package/dist/src/lib.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAkB,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAyDzF,MAAM,oBAAoB,GAAoD;IAC5E,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,aAAa,EAAE;YACb,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE;gBACX,0BAA0B;gBAC1B,oDAAoD;gBACpD,kDAAkD;gBAClD,uFAAuF;gBACvF,EAAE;gBACF,mFAAmF;gBACnF,EAAE;gBACF,EAAE;gBACF,yBAAyB;gBACzB,6BAA6B;gBAC7B,EAAE;gBACF,4BAA4B;gBAC5B,sCAAsC;gBACtC,sCAAsC;aACvC,CAAC,IAAI,CAAC,IAAI,CAAC;SACb;QACD,gCAAgC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACpE,eAAe,EAAE;YACf,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,8GAA8G;SACjH;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC;YACpB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,IAAI;YACb,WAAW,EAAE,+CAA+C;SAC7D;QACD,wBAAwB,EAAE;YACxB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,IAAI;YACd,WAAW,EACT,8KAA8K;SACjL;QACD,yBAAyB,EAAE;YACzB,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC;YAC9B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,OAAO;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AO,CAAC;YAC9B,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,OAAO;YAChB,WAAW,EACT,0MAA0M;SAC7M;KACF;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,0CAA0C;IAChD,WAAW,EAAE;QACX,kCAAkC,EAAE;YAClC,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,cAAc,WAAW,yCAAyC;aACxF;SACF;KACF;IACD,OAAO,EAAE;QACP,OAAO,EAAE,oBAAuE;KACjF;CACO,CAAC;AAEX,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAClD,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure-tools/typespec-autorest-canonical",
|
3
|
-
"version": "0.3.0-dev.
|
3
|
+
"version": "0.3.0-dev.6",
|
4
4
|
"author": "Microsoft Corporation",
|
5
5
|
"description": "TypeSpec library for emitting canonical swagger",
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
@@ -41,18 +41,17 @@
|
|
41
41
|
],
|
42
42
|
"peerDependencies": {
|
43
43
|
"@azure-tools/typespec-azure-core": "~0.41.0 || >=0.42.0-dev <0.42.0",
|
44
|
-
"@azure-tools/typespec-client-generator-core": "~0.41.
|
44
|
+
"@azure-tools/typespec-client-generator-core": "~0.41.8 || >=0.42.0-dev <0.42.0",
|
45
45
|
"@typespec/versioning": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
46
46
|
"@azure-tools/typespec-autorest": "~0.41.1 || >=0.42.0-dev <0.42.0"
|
47
47
|
},
|
48
48
|
"devDependencies": {
|
49
49
|
"@azure-tools/typespec-autorest": "~0.41.1 || >=0.42.0-dev <0.42.0",
|
50
50
|
"@azure-tools/typespec-azure-core": "~0.41.0 || >=0.42.0-dev <0.42.0",
|
51
|
-
"@azure-tools/typespec-client-generator-core": "~0.41.
|
51
|
+
"@azure-tools/typespec-client-generator-core": "~0.41.8 || >=0.42.0-dev <0.42.0",
|
52
52
|
"@types/node": "~18.11.19",
|
53
53
|
"@typespec/compiler": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
54
54
|
"@typespec/http": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
55
|
-
"@typespec/json-schema": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
56
55
|
"@typespec/library-linter": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
57
56
|
"@typespec/openapi": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
58
57
|
"@typespec/rest": "~0.55.0 || >=0.56.0-dev <0.56.0",
|
@@ -69,10 +68,9 @@
|
|
69
68
|
"dependencies": {},
|
70
69
|
"scripts": {
|
71
70
|
"clean": "rimraf ./dist ./temp",
|
72
|
-
"build": "
|
71
|
+
"build": " tsc -p . && npm run lint-typespec-library",
|
73
72
|
"watch": "tsc -p . --watch",
|
74
73
|
"lint-typespec-library": "tsp compile . --warn-as-error --import @typespec/library-linter --no-emit",
|
75
|
-
"regen-autorest-canonical-openapi-schema": "tsp compile ./schema/autorest-canonical-openapi-schema.tsp --warn-as-error && node ./.scripts/schema-json-to-js.js",
|
76
74
|
"test": "vitest run",
|
77
75
|
"test:watch": "vitest -w",
|
78
76
|
"test:ui": "vitest --ui",
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"autorest-canonical-openapi-schema.d.ts","sourceRoot":"","sources":["../../src/autorest-canonical-openapi-schema.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,8BAA8B,EAAE,GAAG,CAAC;AAUxC,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
let AutorestCanonicalOpenAPISchema;
|
2
|
-
try {
|
3
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
4
|
-
// @ts-ignore
|
5
|
-
AutorestCanonicalOpenAPISchema = (await import("../../schema/dist/schema.js")).default;
|
6
|
-
}
|
7
|
-
catch {
|
8
|
-
const name = "../schema/dist/schema.js";
|
9
|
-
AutorestCanonicalOpenAPISchema = (await import(/* @vite-ignore */ name)).default;
|
10
|
-
}
|
11
|
-
export { AutorestCanonicalOpenAPISchema };
|
12
|
-
//# sourceMappingURL=autorest-canonical-openapi-schema.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"autorest-canonical-openapi-schema.js","sourceRoot":"","sources":["../../src/autorest-canonical-openapi-schema.ts"],"names":[],"mappings":"AAAA,IAAI,8BAAmC,CAAC;AACxC,IAAI,CAAC;IACH,6DAA6D;IAC7D,aAAa;IACb,8BAA8B,GAAG,CAAC,MAAM,MAAM,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC;AACzF,CAAC;AAAC,MAAM,CAAC;IACP,MAAM,IAAI,GAAG,0BAA0B,CAAC;IACxC,8BAA8B,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AACnF,CAAC;AAED,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
export type JsonSchema = {
|
2
|
-
title?: string;
|
3
|
-
id?: string;
|
4
|
-
schema?: string;
|
5
|
-
$defs?: Record<string, JsonSchemaType>;
|
6
|
-
} & JsonSchemaObject;
|
7
|
-
export type ResolvedJsonSchemaType = Exclude<JsonSchemaType, JsonSchemaRef>;
|
8
|
-
export type JsonSchemaType = JsonSchemaObject | JsonSchemaArray | JsonSchemaPrimitive | JsonSchemaRef;
|
9
|
-
export interface JsonSchemaBase {
|
10
|
-
$id?: string;
|
11
|
-
}
|
12
|
-
export interface JsonSchemaObject extends JsonSchemaBase {
|
13
|
-
type: "object";
|
14
|
-
properties?: Record<string, JsonSchemaType>;
|
15
|
-
additionalProperties?: JsonSchemaType | boolean;
|
16
|
-
patternProperties?: Record<string, JsonSchemaType>;
|
17
|
-
"x-ordering"?: "keep" | "url";
|
18
|
-
}
|
19
|
-
export interface JsonSchemaArray extends JsonSchemaBase {
|
20
|
-
type: "array";
|
21
|
-
items?: JsonSchema;
|
22
|
-
}
|
23
|
-
export interface JsonSchemaRef {
|
24
|
-
$ref: string;
|
25
|
-
}
|
26
|
-
export interface JsonSchemaPrimitive extends JsonSchemaBase {
|
27
|
-
type: "number" | "string" | "boolean";
|
28
|
-
}
|
29
|
-
export declare function sortWithJsonSchema<T>(value: T, jsonSchema: JsonSchema, ref?: string): T;
|
30
|
-
//# sourceMappingURL=sorter.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sorter.d.ts","sourceRoot":"","sources":["../../../src/json-schema-sorter/sorter.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CACxC,GAAG,gBAAgB,CAAC;AAErB,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC;AAE5E,MAAM,MAAM,cAAc,GACtB,gBAAgB,GAChB,eAAe,GACf,mBAAmB,GACnB,aAAa,CAAC;AAElB,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AACD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC5C,oBAAoB,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC;IAChD,iBAAiB,CAAC,EAAE,M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