diff --git a/api/spec/package.json b/api/spec/package.json index c261e41ef..2147a54e8 100644 --- a/api/spec/package.json +++ b/api/spec/package.json @@ -28,7 +28,8 @@ "pnpm": { "patchedDependencies": { "@typespec/http": "patches/@typespec__http.patch", - "@typespec/openapi3": "patches/@typespec__openapi3.patch" + "@typespec/openapi3": "patches/@typespec__openapi3.patch", + "@typespec/openapi": "patches/@typespec__openapi.patch" } } } diff --git a/api/spec/patches/@typespec__openapi.patch b/api/spec/patches/@typespec__openapi.patch new file mode 100644 index 000000000..bcfa44eea --- /dev/null +++ b/api/spec/patches/@typespec__openapi.patch @@ -0,0 +1,289 @@ +diff --git a/dist/src/decorators.d.ts.map b/dist/src/decorators.d.ts.map +index de6a40635bcfc5b0e34854ea0aa279c3eec6cbf8..45cb61965af033d6f33320e8d69a4d78891813aa 100644 +--- a/dist/src/decorators.d.ts.map ++++ b/dist/src/decorators.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EAGL,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGxE;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,oBAM1B,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAEtF;AAID,uCAAuC;AACvC,eAAO,MAAM,UAAU,EAAE,kBAmBxB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,QAGrD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,IAAI,EACZ,aAAa,EAAE,YAAY,EAC3B,IAAI,EAAE,OAAO,QAMd;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,WAAW,CAAC,YAAY,EAAE,GAAG,CAAC,CAE5F;AAYD,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,EAAE,wBAO9B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,OAAO,CAEzE;AAID;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,qBAW3B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAG,YAAY,GAAG,SAAS,CAExF;AAID,kCAAkC;AAClC,eAAO,MAAM,KAAK,EAAE,aAcnB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAEvF;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAW3F"} +\ No newline at end of file ++{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,SAAS,EACT,SAAS,EACT,OAAO,EACP,IAAI,EAGL,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACb,oBAAoB,EACrB,MAAM,uCAAuC,CAAC;A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SAAS,CAEvF;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,GAAG,cAAc,GAAG,SAAS,CAW3F"} +\ No newline at end of file +diff --git a/dist/src/decorators.js b/dist/src/decorators.js +index b5e58132c795e647ff1582ebc14994d0c325f546..02a078b3951acd854b5d29dc17d69a23d9784805 100644 +--- a/dist/src/decorators.js ++++ b/dist/src/decorators.js +@@ -1,6 +1,6 @@ +-import { getDoc, getService, getSummary, typespecTypeToJson, } from "@typespec/compiler"; ++import { compilerAssert, getDoc, getProperty, getService, getSummary, typespecTypeToJson, } from "@typespec/compiler"; + import { setStatusCode } from "@typespec/http"; +-import { createStateSymbol, reportDiagnostic } from "./lib.js"; ++import { createDiagnostic, createStateSymbol, reportDiagnostic } from "./lib.js"; + const operationIdsKey = createStateSymbol("operationIds"); + /** + * Set a specific operation ID. +@@ -74,7 +74,7 @@ function isOpenAPIExtensionKey(key) { + const defaultResponseKey = createStateSymbol("defaultResponse"); + /** {@inheritdoc DefaultResponseDecorator} */ + export const $defaultResponse = (context, entity) => { +- // eslint-disable-next-line deprecation/deprecation ++ // eslint-disable-next-line @typescript-eslint/no-deprecated + setStatusCode(context.program, entity, ["*"]); + context.program.stateSet(defaultResponseKey).add(entity); + }; +@@ -116,6 +116,12 @@ export const $info = (context, entity, model) => { + if (data === undefined) { + return; + } ++ validateAdditionalInfoModel(context, model); ++ if (data.termsOfService) { ++ if (!validateIsUri(context, data.termsOfService, "TermsOfService")) { ++ return; ++ } ++ } + setInfo(context.program, entity, data); + }; + /** +@@ -133,7 +139,7 @@ export function resolveInfo(program, entity) { + return omitUndefined({ + ...info, + title: info?.title ?? service?.title, +- // eslint-disable-next-line deprecation/deprecation ++ // eslint-disable-next-line @typescript-eslint/no-deprecated + version: info?.version ?? service?.version, + summary: info?.summary ?? getSummary(program, entity), + description: info?.description ?? getDoc(program, entity), +@@ -142,4 +148,46 @@ export function resolveInfo(program, entity) { + function omitUndefined(data) { + return Object.fromEntries(Object.entries(data).filter(([k, v]) => v !== undefined)); + } ++function validateIsUri(context, url, propertyName) { ++ try { ++ new URL(url); ++ return true; ++ } ++ catch { ++ reportDiagnostic(context.program, { ++ code: "not-url", ++ target: context.getArgumentTarget(0), ++ format: { property: propertyName, value: url }, ++ }); ++ return false; ++ } ++} ++function validateAdditionalInfoModel(context, typespecType) { ++ const propertyModel = context.program.resolveTypeReference("TypeSpec.OpenAPI.AdditionalInfo")[0]; ++ if (typeof typespecType === "object" && propertyModel) { ++ const diagnostics = checkNoAdditionalProperties(typespecType, context.getArgumentTarget(0), propertyModel); ++ context.program.reportDiagnostics(diagnostics); ++ } ++} ++function checkNoAdditionalProperties(typespecType, target, source) { ++ const diagnostics = []; ++ compilerAssert(typespecType.kind === "Model", "Expected type to be a Model."); ++ for (const [name, type] of typespecType.properties.entries()) { ++ const sourceProperty = getProperty(source, name); ++ if (sourceProperty) { ++ if (sourceProperty.type.kind === "Model") { ++ const nestedDiagnostics = checkNoAdditionalProperties(type.type, target, sourceProperty.type); ++ diagnostics.push(...nestedDiagnostics); ++ } ++ } ++ else if (!isOpenAPIExtensionKey(name)) { ++ diagnostics.push(createDiagnostic({ ++ code: "invalid-extension-key", ++ format: { value: name }, ++ target, ++ })); ++ } ++ } ++ return diagnostics; ++} + //# sourceMappingURL=decorators.js.map +\ No newline at end of file +diff --git a/dist/src/decorators.js.map b/dist/src/decorators.js.map +index 4b8a50ad31a1fe172e685cc68e1c9f47d8ab81dc..0f86fc8697eb81d1a74d611024e33d9df64bae55 100644 +--- a/dist/src/decorators.js.map ++++ b/dist/src/decorators.js.map +@@ -1 +1 @@ +-{"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,MAAM,EACN,UAAU,EACV,UAAU,EAMV,kBAAkB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC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c,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;gBACzC,MAAM,iBAAiB,GAAG,2BAA2B,CACnD,IAAI,CAAC,IAAI,EACT,MAAM,EACN,cAAc,CAAC,IAAI,CACpB,CAAC;gBACF,WAAW,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;aAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,WAAW,CAAC,IAAI,CACd,gBAAgB,CAAC;gBACf,IAAI,EAAE,uBAAuB;gBAC7B,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;gBACvB,MAAM;aACP,CAAC,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"} +\ No newline at end of file +diff --git a/dist/src/helpers.d.ts.map b/dist/src/helpers.d.ts.map +index 74e855cfad7c12d4bbbdd2986b560dc752590f22..c315dc46727c9aa26bf3871755f9d181ab4674b4 100644 +--- a/dist/src/helpers.d.ts.map ++++ b/dist/src/helpers.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,aAAa,EACb,SAAS,EACT,OAAO,EACP,IAAI,EACJ,eAAe,EAChB,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAelE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,eAAe,EACxB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC7B,MAAM,CAKR;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,E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E,OAAO,EAChB,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,OAAO,EACjB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACvC,OAAO,EAAE,eAAe,GACvB,MAAM,CAoBR;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,UAmBxE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,WAK3E"} +\ No newline at end of file +diff --git a/dist/src/helpers.js b/dist/src/helpers.js +index 1232365136657a8452f1143c805cb40039e0bc49..b6752d4adc59917404d77e7d620d6d60c220be7a 100644 +--- a/dist/src/helpers.js ++++ b/dist/src/helpers.js +@@ -19,8 +19,8 @@ export function shouldInline(program, type) { + switch (type.kind) { + case "Model": + return !type.name || isTemplateInstance(type); +- case "Scalar": +- return program.checker.isStdType(type) || isTemplateInstance(type); ++ // case "Scalar": ++ // return program.checker.isStdType(type) || isTemplateInstance(type); + case "Enum": + case "Union": + return !type.name; +diff --git a/dist/src/helpers.js.map b/dist/src/helpers.js.map +index 4642dd3ea31669139e6ded3757762aaccef21a9d..4648072d1dab14196a5a688cd89e72ab697dece7 100644 +--- a/dist/src/helpers.js.map ++++ b/dist/src/helpers.js.map +@@ -1 +1 @@ +-{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,GAMnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,IAAU;IACvD,IAAI,eAAe,CAA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AC1E,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpD,sEAAsE;IACtE,8CAA8C;IAC9C,OAAO,UAAU,EAAE,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAC9D,CAAC"} +\ No newline at end of file ++{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,SAAS,EACT,kBAAkB,GAMnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,OAAgB,EAAE,IAAU;IACvD,IAAI,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC;QAChD,iBAAiB;QACjB,sEAAsE;QACtE,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACpB;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAgB,EAChB,IAAU,EACV,OAAwB,EACxB,QAA8B;IAE9B,MAAM,IAAI,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE1E,sBAAsB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,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CAAC,SAAS,EAAE,CAAC;QACxB,OAAO,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;IACzD,CAAC;IACD,MAAM,SAAS,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,SAAS,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,OAAO,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,QAAuB;IAC1E,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpD,sEAAsE;IACtE,8CAA8C;IAC9C,OAAO,UAAU,EAAE,MAAM,KAAK,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC;AAC9D,CAAC"} +\ No newline at end of file +diff --git a/dist/src/lib.d.ts b/dist/src/lib.d.ts +index 1d42849455a9f904cf5f175f2c9b661ed375f41f..6276604c7a24ab807bc16d0daec4650f47d98592 100644 +--- a/dist/src/lib.d.ts ++++ b/dist/src/lib.d.ts +@@ -6,8 +6,22 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{ + readonly default: import("@typespec/compiler").CallableMessage<["value"]>; + readonly parameter: import("@typespec/compiler").CallableMessage<["value"]>; + }; ++ "not-url": { ++ readonly default: import("@typespec/compiler").CallableMessage<["property", "value"]>; ++ }; + }, Record, never>; +-export declare const reportDiagnostic: ; ++ }; ++ "duplicate-type-name": { ++ readonly default: import("@typespec/compiler").CallableMessage<["value"]>; ++ readonly parameter: import("@typespec/compiler").CallableMessage<["value"]>; ++ }; ++ "not-url": { ++ readonly default: import("@typespec/compiler").CallableMessage<["property", "value"]>; ++ }; ++}[C]>(diag: import("@typespec/compiler").DiagnosticReport<{ + "invalid-extension-key": { + readonly default: import("@typespec/compiler").CallableMessage<["value"]>; + }; +@@ -15,6 +29,20 @@ export declare const reportDiagnostic: ; + readonly parameter: import("@typespec/compiler").CallableMessage<["value"]>; + }; ++ "not-url": { ++ readonly default: import("@typespec/compiler").CallableMessage<["property", "value"]>; ++ }; ++}, C, M>) => import("@typespec/compiler").Diagnostic, reportDiagnostic: ; ++ }; ++ "duplicate-type-name": { ++ readonly default: import("@typespec/compiler").CallableMessage<["value"]>; ++ readonly parameter: import("@typespec/compiler").CallableMessage<["value"]>; ++ }; ++ "not-url": { ++ readonly default: import("@typespec/compiler").CallableMessage<["property", "value"]>; ++ }; + }[C]>(program: import("@typespec/compiler").Program, diag: import("@typespec/compiler").DiagnosticReport<{ + "invalid-extension-key": { + readonly default: import("@typespec/compiler").CallableMessage<["value"]>; +@@ -23,5 +51,8 @@ export declare const reportDiagnostic: ; + readonly parameter: import("@typespec/compiler").CallableMessage<["value"]>; + }; ++ "not-url": { ++ readonly default: import("@typespec/compiler").CallableMessage<["property", "value"]>; ++ }; + }, C, M>) => void, createStateSymbol: (name: string) => symbol; + //# sourceMappingURL=lib.d.ts.map +\ No newline at end of file +diff --git a/dist/src/lib.d.ts.map b/dist/src/lib.d.ts.map +index 14057c66ef740eab6c8fe13dfe800ebe7a87857f..58cb1b0b69e8b1f4d5cc77f55ed4f9461020460b 100644 +--- a/dist/src/lib.d.ts.map ++++ b/dist/src/lib.d.ts.map +@@ -1 +1 @@ +-{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;8BAiBf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;mBAAE,iBAAiB,0BAAS,CAAC"} +\ No newline at end of file ++{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,IAAI;;;;;;;;;;;8BAuBf,CAAC;AAEH,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;sDAAE,gBAAgB;;;;;;;;;;;;;;;;;;;;;;mBAAE,iBAAiB,0BAAS,CAAC"} +\ No newline at end of file +diff --git a/dist/src/lib.js b/dist/src/lib.js +index 1984fee9bd4ace796ca6c9be6b99fd64410e7bb9..61843f8eb7102a297d9a990b9f4b30289a36e70f 100644 +--- a/dist/src/lib.js ++++ b/dist/src/lib.js +@@ -15,7 +15,13 @@ export const $lib = createTypeSpecLibrary({ + parameter: paramMessage `Duplicate parameter key: '${"value"}'. Check @friendlyName decorators and overlap with types in TypeSpec or service namespace.`, + }, + }, ++ "not-url": { ++ severity: "error", ++ messages: { ++ default: paramMessage `${"property"}: ${"value"} is not a valid URL.`, ++ }, ++ }, + }, + }); +-export const { reportDiagnostic, createStateSymbol } = $lib; ++export const { createDiagnostic, reportDiagnostic, createStateSymbol } = $lib; + //# sourceMappingURL=lib.js.map +\ No newline at end of file +diff --git a/dist/src/lib.js.map b/dist/src/lib.js.map +index 12ebe40bb7f9ea5a71f338613cbb531722966dc5..3118fc43c170ac7795e7635278d58a2caf2e8732 100644 +--- a/dist/src/lib.js.map ++++ b/dist/src/lib.js.map +@@ -1 +1 @@ +-{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;IACxC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;QACX,uBAAuB,EAAE;YACvB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,mDAAmD,OAAO,GAAG;aACnF;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,yBAAyB,OAAO,4FAA4F;gBACjJ,SAAS,EAAE,YAAY,CAAA,6BAA6B,OAAO,4FAA4F;aACxJ;SACF;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"} +\ No newline at end of file ++{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAC;IACxC,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;QACX,uBAAuB,EAAE;YACvB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,mDAAmD,OAAO,GAAG;aACnF;SACF;QACD,qBAAqB,EAAE;YACrB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,yBAAyB,OAAO,4FAA4F;gBACjJ,SAAS,EAAE,YAAY,CAAA,6BAA6B,OAAO,4FAA4F;aACxJ;SACF;QACD,SAAS,EAAE;YACT,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,GAAG,UAAU,KAAK,OAAO,sBAAsB;aACrE;SACF;KACF;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAC"} +\ No newline at end of file +diff --git a/dist/src/tsdoc-metadata.json b/dist/src/tsdoc-metadata.json +index 383a461406865e573419f7754303273b2b5a1661..9282787bcb11c42a6cc217c3c357b986dd93a113 100644 +--- a/dist/src/tsdoc-metadata.json ++++ b/dist/src/tsdoc-metadata.json +@@ -5,7 +5,7 @@ + "toolPackages": [ + { + "packageName": "@microsoft/api-extractor", +- "packageVersion": "7.47.7" ++ "packageVersion": "7.47.9" + } + ] + } +diff --git a/package.json b/package.json +index 65c55292d319de4e77c77814ab3b1579ed7e7e11..9ca6cf068d3df5e508c4a89fbed65bbd1fdd6a08 100644 +--- a/package.json ++++ b/package.json +@@ -38,22 +38,22 @@ + "!dist/test/**" + ], + "peerDependencies": { +- "@typespec/compiler": "~0.60.0", ++ "@typespec/compiler": "~0.60.1", + "@typespec/http": "~0.60.0" + }, + "devDependencies": { +- "@types/node": "~18.11.19", +- "@vitest/coverage-v8": "^2.0.4", +- "@vitest/ui": "^2.0.4", ++ "@types/node": "~22.7.1", ++ "@vitest/coverage-v8": "^2.1.1", ++ "@vitest/ui": "^2.1.1", + "c8": "^10.1.2", + "rimraf": "~6.0.1", +- "typescript": "~5.5.4", +- "vitest": "^2.0.4", +- "@typespec/compiler": "~0.60.0", ++ "typescript": "~5.6.2", ++ "vitest": "^2.1.1", ++ "@typespec/tspd": "~0.46.0", ++ "@typespec/library-linter": "~0.60.0", + "@typespec/rest": "~0.60.0", + "@typespec/http": "~0.60.0", +- "@typespec/library-linter": "~0.60.0", +- "@typespec/tspd": "~0.46.0" ++ "@typespec/compiler": "~0.60.1" + }, + "scripts": { + "clean": "rimraf ./dist ./temp", diff --git a/api/spec/pnpm-lock.yaml b/api/spec/pnpm-lock.yaml index c4aceb6b3..c5d095ba7 100644 --- a/api/spec/pnpm-lock.yaml +++ b/api/spec/pnpm-lock.yaml @@ -8,6 +8,9 @@ patchedDependencies: '@typespec/http': hash: aq5ro3ii4qoynjjd7xukskouxa path: patches/@typespec__http.patch + '@typespec/openapi': + hash: uvgfat3cfeep27th4nou2owmku + path: patches/@typespec__openapi.patch '@typespec/openapi3': hash: sb4t3kj46huooiaydawer2uxt4 path: patches/@typespec__openapi3.patch @@ -24,10 +27,10 @@ importers: version: 0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0) '@typespec/openapi': specifier: 0.60.0 - version: 0.60.0(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)) + version: 0.60.0(patch_hash=uvgfat3cfeep27th4nou2owmku)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)) '@typespec/openapi3': specifier: 0.60.0 - version: 0.60.0(patch_hash=sb4t3kj46huooiaydawer2uxt4)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))(@typespec/openapi@0.60.0(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)))(@typespec/versioning@0.60.0(@typespec/compiler@0.60.0))(openapi-types@12.1.3) + version: 0.60.0(patch_hash=sb4t3kj46huooiaydawer2uxt4)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))(@typespec/openapi@0.60.0(patch_hash=uvgfat3cfeep27th4nou2owmku)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)))(@typespec/versioning@0.60.0(@typespec/compiler@0.60.0))(openapi-types@12.1.3) '@typespec/prettier-plugin-typespec': specifier: 0.60.0 version: 0.60.0 @@ -544,18 +547,18 @@ snapshots: dependencies: '@typespec/compiler': 0.60.0 - '@typespec/openapi3@0.60.0(patch_hash=sb4t3kj46huooiaydawer2uxt4)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))(@typespec/openapi@0.60.0(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)))(@typespec/versioning@0.60.0(@typespec/compiler@0.60.0))(openapi-types@12.1.3)': + '@typespec/openapi3@0.60.0(patch_hash=sb4t3kj46huooiaydawer2uxt4)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))(@typespec/openapi@0.60.0(patch_hash=uvgfat3cfeep27th4nou2owmku)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)))(@typespec/versioning@0.60.0(@typespec/compiler@0.60.0))(openapi-types@12.1.3)': dependencies: '@readme/openapi-parser': 2.6.0(openapi-types@12.1.3) '@typespec/compiler': 0.60.0 '@typespec/http': 0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0) - '@typespec/openapi': 0.60.0(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)) + '@typespec/openapi': 0.60.0(patch_hash=uvgfat3cfeep27th4nou2owmku)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0)) '@typespec/versioning': 0.60.0(@typespec/compiler@0.60.0) yaml: 2.4.5 transitivePeerDependencies: - openapi-types - '@typespec/openapi@0.60.0(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))': + '@typespec/openapi@0.60.0(patch_hash=uvgfat3cfeep27th4nou2owmku)(@typespec/compiler@0.60.0)(@typespec/http@0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0))': dependencies: '@typespec/compiler': 0.60.0 '@typespec/http': 0.60.0(patch_hash=aq5ro3ii4qoynjjd7xukskouxa)(@typespec/compiler@0.60.0) diff --git a/api/spec/src/types.tsp b/api/spec/src/types.tsp index 1146931b8..b02731250 100644 --- a/api/spec/src/types.tsp +++ b/api/spec/src/types.tsp @@ -3,7 +3,6 @@ */ // See: https://github.com/ulid/spec/issues/94 @pattern("^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$") -@friendlyName("ULID") @example("01G65Z755AFWAKHE12NY0CQ9FH") scalar ULID extends string; @@ -16,7 +15,6 @@ scalar ULID extends string; ) @minLength(1) @maxLength(64) -@friendlyName("Key") scalar Key extends string; // NOTE (andras): key format enforcement isn't supported by TypeSpec (patternProperties). See: https://github.com/microsoft/typespec/discussions/1626 @@ -25,7 +23,6 @@ scalar Key extends string; * Metadata can be used to store additional information about a resource. */ @example(#{ externalId: "019142cc-a016-796a-8113-1a942fecd26d" }) -@friendlyName("Metadata") model Metadata { ...Record; }