From 6c6f3116ef2fd39a8a29b8c5967654f823780c49 Mon Sep 17 00:00:00 2001 From: Christopher Radek <14189820+chrisradek@users.noreply.github.com> Date: Mon, 14 Oct 2024 10:55:53 -0700 Subject: [PATCH 1/4] tsp-openapi3: support path-level parameters (#4708) Fixes #4455 Previously, the parameters defined as a child of a `path` were ignored. Now they are added to the operations defined in each of the path's methods. The spec states that duplicates are not allowed in the final operation-level parameter list, and the more specific (operation level) replaces the less specific (path level) if there is a collision. A combination of the location and name uniquely identify a parameter for these purposes. Example: ```yml openapi: 3.0.0 info: title: (title) version: 0.0.0 tags: [] paths: /widgets/{id}: get: operationId: Widgets_read responses: "200": description: The request has succeeded. content: application/json: schema: $ref: "#/components/schemas/Widget" delete: operationId: Widgets_delete responses: "204": description: "There is no content to send for this request, but the headers may be useful. " parameters: - name: id in: path required: true schema: type: string components: schemas: Widget: type: object required: - id properties: id: type: string ``` --------- Co-authored-by: Christopher Radek --- ...penapi3-common-params-2024-9-11-14-26-2.md | 7 + .../src/cli/actions/convert/interfaces.ts | 1 + .../convert/transforms/transform-paths.ts | 28 +- .../openapi3/test/tsp-openapi3/paths.test.ts | 269 ++++++++++++++++++ .../test/tsp-openapi3/utils/expect.ts | 57 ++++ .../tsp-openapi3/utils/tsp-for-openapi3.ts | 6 +- 6 files changed, 365 insertions(+), 3 deletions(-) create mode 100644 .chronus/changes/tsp-openapi3-common-params-2024-9-11-14-26-2.md create mode 100644 packages/openapi3/test/tsp-openapi3/paths.test.ts create mode 100644 packages/openapi3/test/tsp-openapi3/utils/expect.ts diff --git a/.chronus/changes/tsp-openapi3-common-params-2024-9-11-14-26-2.md b/.chronus/changes/tsp-openapi3-common-params-2024-9-11-14-26-2.md new file mode 100644 index 0000000000..1bd62f1866 --- /dev/null +++ b/.chronus/changes/tsp-openapi3-common-params-2024-9-11-14-26-2.md @@ -0,0 +1,7 @@ +--- +changeKind: fix +packages: + - "@typespec/openapi3" +--- + +Updates tsp-openapi3 to include path-level parameters in generated typespec operations. \ No newline at end of file diff --git a/packages/openapi3/src/cli/actions/convert/interfaces.ts b/packages/openapi3/src/cli/actions/convert/interfaces.ts index eeb04eb2c3..c4e6897cea 100644 --- a/packages/openapi3/src/cli/actions/convert/interfaces.ts +++ b/packages/openapi3/src/cli/actions/convert/interfaces.ts @@ -112,6 +112,7 @@ export interface TypeSpecOperation extends TypeSpecDeclaration { export interface TypeSpecOperationParameter { name: string; + in: string; doc?: string; decorators: TypeSpecDecorator[]; isOptional: boolean; diff --git a/packages/openapi3/src/cli/actions/convert/transforms/transform-paths.ts b/packages/openapi3/src/cli/actions/convert/transforms/transform-paths.ts index a6480c1054..e616aef113 100644 --- a/packages/openapi3/src/cli/actions/convert/transforms/transform-paths.ts +++ b/packages/openapi3/src/cli/actions/convert/transforms/transform-paths.ts @@ -29,6 +29,7 @@ export function transformPaths( const operations: TypeSpecOperation[] = []; for (const route of Object.keys(paths)) { + const routeParameters = paths[route].parameters?.map(transformOperationParameter) ?? []; const path = paths[route]; for (const verb of supportedHttpMethods) { const operation = path[verb]; @@ -48,7 +49,7 @@ export function transformPaths( { name: "route", args: [route] }, { name: verb, args: [] }, ], - parameters, + parameters: dedupeParameters([...routeParameters, ...parameters]), doc: operation.description, operationId: operation.operationId, requestBodies: transformRequestBodies(operation.requestBody), @@ -61,6 +62,30 @@ export function transformPaths( return operations; } +function dedupeParameters( + parameters: Refable[], +): Refable[] { + const seen = new Set(); + const dedupeList: Refable[] = []; + + // iterate in reverse since more specific-scoped parameters are added last + for (let i = parameters.length - 1; i >= 0; i--) { + // ignore resolving the $ref for now, unlikely to be able to resolve + // issues without user intervention if a duplicate is present except in + // very simple cases. + const param = parameters[i]; + + const identifier = "$ref" in param ? param.$ref : `${param.in}.${param.name}`; + + if (seen.has(identifier)) continue; + seen.add(identifier); + + dedupeList.unshift(param); + } + + return dedupeList; +} + function transformOperationParameter( parameter: Refable, ): Refable { @@ -70,6 +95,7 @@ function transformOperationParameter( return { name: printIdentifier(parameter.name), + in: parameter.in, doc: parameter.description, decorators: getParameterDecorators(parameter), isOptional: !parameter.required, diff --git a/packages/openapi3/test/tsp-openapi3/paths.test.ts b/packages/openapi3/test/tsp-openapi3/paths.test.ts new file mode 100644 index 0000000000..667d0ce2a9 --- /dev/null +++ b/packages/openapi3/test/tsp-openapi3/paths.test.ts @@ -0,0 +1,269 @@ +import assert from "assert"; +import { expect, it } from "vitest"; +import { OpenAPI3Response } from "../../src/types.js"; +import { expectDecorators } from "./utils/expect.js"; +import { tspForOpenAPI3 } from "./utils/tsp-for-openapi3.js"; + +const response: OpenAPI3Response = { + description: "test response", + content: { + "application/json": { + schema: { + type: "object", + properties: { + message: { type: "string" }, + }, + }, + }, + }, +}; + +it("generates operations with no params", async () => { + const serviceNamespace = await tspForOpenAPI3({ + paths: { + "/": { + get: { + operationId: "rootGet", + parameters: [], + responses: { + "200": response, + }, + }, + }, + }, + }); + + const operations = serviceNamespace.operations; + + expect(operations.size).toBe(1); + + /* @route("/") @get op rootGet(): rootGet200ApplicationJsonResponse; */ + const rootGet = operations.get("rootGet"); + assert(rootGet, "rootGet operation not found"); + + /* @get @route("/") */ + expectDecorators(rootGet.decorators, [{ name: "get" }, { name: "route", args: ["/"] }]); + // verify no operation parameters + expect(rootGet.parameters.properties.size).toBe(0); + assert(rootGet.returnType.kind === "Model", "Expected model return type"); + expect(rootGet.returnType.name).toBe("rootGet200ApplicationJsonResponse"); +}); + +it("generates operations without common params", async () => { + const serviceNamespace = await tspForOpenAPI3({ + paths: { + "/{id}": { + get: { + operationId: "idGet", + parameters: [{ name: "id", in: "path", required: true, schema: { type: "string" } }], + responses: { + "200": response, + }, + }, + }, + }, + }); + + const operations = serviceNamespace.operations; + + expect(operations.size).toBe(1); + + /* @route("/{id}") @get op idGet(@path id: string): idGet200ApplicationJsonResponse; */ + const idGet = operations.get("idGet"); + assert(idGet, "idGet operation not found"); + + /* @get @route("/{id}") */ + expectDecorators(idGet.decorators, [{ name: "get" }, { name: "route", args: ["/{id}"] }]); + + expect(idGet.parameters.properties.size).toBe(1); + const idParam = idGet.parameters.properties.get("id")!; + expect(idParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(idParam.decorators, [{ name: "path" }]); + + assert(idGet.returnType.kind === "Model", "Expected model return type"); + expect(idGet.returnType.name).toBe("idGet200ApplicationJsonResponse"); +}); + +it("generates operations with common params", async () => { + const serviceNamespace = await tspForOpenAPI3({ + paths: { + "/{id}": { + parameters: [{ name: "id", in: "path", required: true, schema: { type: "string" } }], + get: { + operationId: "idGet", + parameters: [], + responses: { + "200": response, + }, + }, + }, + }, + }); + + const operations = serviceNamespace.operations; + + expect(operations.size).toBe(1); + + /* @route("/{id}") @get op idGet(@path id: string): idGet200ApplicationJsonResponse; */ + const idGet = operations.get("idGet"); + assert(idGet, "idGet operation not found"); + + /* @get @route("/{id}") */ + expectDecorators(idGet.decorators, [{ name: "get" }, { name: "route", args: ["/{id}"] }]); + + expect(idGet.parameters.properties.size).toBe(1); + const idParam = idGet.parameters.properties.get("id")!; + expect(idParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(idParam.decorators, [{ name: "path" }]); + + assert(idGet.returnType.kind === "Model", "Expected model return type"); + expect(idGet.returnType.name).toBe("idGet200ApplicationJsonResponse"); +}); + +it("generates operations with common and specific params", async () => { + const serviceNamespace = await tspForOpenAPI3({ + paths: { + "/{id}": { + parameters: [{ name: "id", in: "path", required: true, schema: { type: "string" } }], + get: { + operationId: "idGet", + parameters: [{ name: "foo", in: "query", schema: { type: "string" } }], + responses: { + "200": response, + }, + }, + }, + }, + }); + + const operations = serviceNamespace.operations; + + expect(operations.size).toBe(1); + + /* @route("/{id}") @get op idGet(@path id: string, @query foo?: string): idGet200ApplicationJsonResponse; */ + const idGet = operations.get("idGet"); + assert(idGet, "idGet operation not found"); + + /* @get @route("/{id}") */ + expectDecorators(idGet.decorators, [{ name: "get" }, { name: "route", args: ["/{id}"] }]); + + /* (@path id: string, @query foo?: string) */ + expect(idGet.parameters.properties.size).toBe(2); + const idParam = idGet.parameters.properties.get("id")!; + expect(idParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(idParam.decorators, { name: "path" }); + + const fooParam = idGet.parameters.properties.get("foo")!; + expect(fooParam).toMatchObject({ + optional: true, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(fooParam.decorators, { name: "query" }); + + assert(idGet.returnType.kind === "Model", "Expected model return type"); + expect(idGet.returnType.name).toBe("idGet200ApplicationJsonResponse"); +}); + +it("supports overriding common params with operation params", async () => { + const serviceNamespace = await tspForOpenAPI3({ + paths: { + "/{id}": { + parameters: [ + { name: "id", in: "path", required: true, schema: { type: "string" } }, + { name: "x-header", in: "header", required: false, schema: { type: "string" } }, + ], + get: { + operationId: "idGet", + parameters: [ + { name: "foo", in: "query", schema: { type: "string" } }, + { name: "x-header", in: "header", required: true, schema: { type: "string" } }, + ], + responses: { + "200": response, + }, + }, + put: { + operationId: "idPut", + parameters: [], + responses: { + "200": response, + }, + }, + }, + }, + }); + + const operations = serviceNamespace.operations; + + expect(operations.size).toBe(2); + + // `idGet` overrides the common `x-header` parameter with it's own, making it required + /* @route("/{id}") @get op idGet(@path id: string, @query foo?: string, @header `x-header`: string): idGet200ApplicationJsonResponse; */ + const idGet = operations.get("idGet"); + assert(idGet, "idGet operation not found"); + + /* @get @route("/{id}") */ + expectDecorators(idGet.decorators, [{ name: "get" }, { name: "route", args: ["/{id}"] }]); + + /* (@path id: string, @query foo?: string, @header `x-header`: string) */ + expect(idGet.parameters.properties.size).toBe(3); + const idParam = idGet.parameters.properties.get("id")!; + expect(idParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(idParam.decorators, { name: "path" }); + + const fooParam = idGet.parameters.properties.get("foo")!; + expect(fooParam).toMatchObject({ + optional: true, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(fooParam.decorators, { name: "query" }); + + const xHeaderParam = idGet.parameters.properties.get("x-header")!; + expect(xHeaderParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(xHeaderParam.decorators, { name: "header" }); + + assert(idGet.returnType.kind === "Model", "Expected model return type"); + expect(idGet.returnType.name).toBe("idGet200ApplicationJsonResponse"); + + // `idPut` uses the common `x-header` parameter, which is marked optional + /* @route("/{id}") @put op idPut(@path id: string, @header `x-header`: string): idPut200ApplicationJsonResponse; */ + const idPut = operations.get("idPut"); + assert(idPut, "idPut operation not found"); + + /* @put @route("/{id}") */ + expectDecorators(idPut.decorators, [{ name: "put" }, { name: "route", args: ["/{id}"] }]); + + /* (@path id: string, @header `x-header`?: string) */ + expect(idPut.parameters.properties.size).toBe(2); + const idPutParam = idPut.parameters.properties.get("id")!; + expect(idPutParam).toMatchObject({ + optional: false, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(idPutParam.decorators, [{ name: "path" }]); + + const xHeaderSharedParam = idPut.parameters.properties.get("x-header")!; + expect(xHeaderSharedParam).toMatchObject({ + optional: true, + type: { kind: "Scalar", name: "string" }, + }); + expectDecorators(xHeaderSharedParam.decorators, { name: "header" }); + + assert(idPut.returnType.kind === "Model", "Expected model return type"); + expect(idPut.returnType.name).toBe("idPut200ApplicationJsonResponse"); +}); diff --git a/packages/openapi3/test/tsp-openapi3/utils/expect.ts b/packages/openapi3/test/tsp-openapi3/utils/expect.ts new file mode 100644 index 0000000000..55df73a60f --- /dev/null +++ b/packages/openapi3/test/tsp-openapi3/utils/expect.ts @@ -0,0 +1,57 @@ +import { DecoratorApplication, isType, Numeric } from "@typespec/compiler"; +import { expect } from "vitest"; + +export interface DecoratorMatch { + /** + * The name of the decorator without the "@" prefix. + */ + name: string; + + /** + * The arguments passed into the decorator. + */ + args?: any[]; +} + +export interface ExpectDecoratorsOptions { + strict?: boolean; +} + +export function expectDecorators( + decorators: DecoratorApplication[], + matches: DecoratorMatch | DecoratorMatch[], + options: ExpectDecoratorsOptions = { strict: true }, +) { + const expectations = Array.isArray(matches) ? matches : [matches]; + + if (options.strict) { + expect(decorators).toHaveLength(expectations.length); + } + + for (let i = 0; i < expectations.length; i++) { + const decorator = decorators[i]; + const expectation = expectations[i]; + + if (expectation.name) { + expect(decorator.definition?.name).toBe(`@${expectation.name}`); + } + + if (expectation.args) { + const args = expectation.args.map(transformDecoratorArg); + expect(decorator.args).toMatchObject(args); + } + } +} + +function transformDecoratorArg(arg: any) { + if (isType(arg)) return arg; + + if (typeof arg === "string") { + return { jsValue: arg }; + } + if (typeof arg === "number") { + return { jsValue: Numeric(`${arg}`) }; + } + + return arg; +} diff --git a/packages/openapi3/test/tsp-openapi3/utils/tsp-for-openapi3.ts b/packages/openapi3/test/tsp-openapi3/utils/tsp-for-openapi3.ts index 533fdfa1b9..fe8031062f 100644 --- a/packages/openapi3/test/tsp-openapi3/utils/tsp-for-openapi3.ts +++ b/packages/openapi3/test/tsp-openapi3/utils/tsp-for-openapi3.ts @@ -7,6 +7,7 @@ import { OpenAPI3TestLibrary } from "../../../src/testing/index.js"; import { OpenAPI3Document, OpenAPI3Parameter, + OpenAPI3PathItem, OpenAPI3Schema, Refable, } from "../../../src/types.js"; @@ -20,16 +21,17 @@ function wrapCodeInTest(code: string): string { export interface OpenAPI3Options { schemas?: Record>; parameters?: Record>; + paths?: Record; } -export async function tspForOpenAPI3({ parameters, schemas }: OpenAPI3Options) { +export async function tspForOpenAPI3({ parameters, paths, schemas }: OpenAPI3Options) { const openApi3Doc: OpenAPI3Document = { info: { title: "Test Service", version: "1.0.0", }, openapi: "3.0.0", - paths: {}, + paths: { ...paths }, components: { schemas: { ...(schemas as any), From dffa3cc9189ded10b0dcd7ea2f6179137927d5b8 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Tue, 15 Oct 2024 04:01:11 +0800 Subject: [PATCH 2/4] back port https://github.com/Azure/cadl-ranch/pull/748 (#4714) sync cadl-ranch fix of https://github.com/Azure/cadl-ranch/pull/748 --- packages/http-specs/specs/encode/bytes/mockapi.ts | 4 ++-- .../specs/parameters/body-optionality/mockapi.ts | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/http-specs/specs/encode/bytes/mockapi.ts b/packages/http-specs/specs/encode/bytes/mockapi.ts index 3840b5ba17..f1cf120097 100644 --- a/packages/http-specs/specs/encode/bytes/mockapi.ts +++ b/packages/http-specs/specs/encode/bytes/mockapi.ts @@ -208,11 +208,11 @@ Scenarios.Encode_Bytes_RequestBody_base64 = createRequestBodyServerTests( ); Scenarios.Encode_Bytes_RequestBody_base64url = createRequestBodyServerTests( "/encode/bytes/body/request/base64url", - '"dGVzdA=="', + '"dGVzdA"', { "Content-Type": "application/json", }, - '"dGVzdA=="', + '"dGVzdA"', ); Scenarios.Encode_Bytes_RequestBody_customContentType = createRequestBodyServerTests( diff --git a/packages/http-specs/specs/parameters/body-optionality/mockapi.ts b/packages/http-specs/specs/parameters/body-optionality/mockapi.ts index 0e7e2a31ac..dec097235b 100644 --- a/packages/http-specs/specs/parameters/body-optionality/mockapi.ts +++ b/packages/http-specs/specs/parameters/body-optionality/mockapi.ts @@ -47,16 +47,12 @@ Scenarios.Parameters_BodyOptionality_OptionalExplicit = passOnSuccess([ { uri: "/parameters/body-optionality/optional-explicit/omit", method: "post", - request: { - body: { - name: "foo", - }, - }, + request: {}, response: { status: 204, }, handler: (req: MockRequest) => { - req.expect.bodyEquals({ name: "foo" }); + req.expect.rawBodyEquals(undefined); return { status: 204 }; }, kind: "MockApiDefinition", From 224d71a565e51db3b9e9afef930a987865026cdd Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 15 Oct 2024 04:01:21 +0800 Subject: [PATCH 3/4] specs, back port cadl-ranch fix PR 750 (#4713) back port fix in cadl-ranch (about "explode" query parameters in route (uri template) https://github.com/Azure/cadl-ranch/pull/750 --- packages/http-specs/specs/routes/mockapi.ts | 35 +++++++++------------ 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/packages/http-specs/specs/routes/mockapi.ts b/packages/http-specs/specs/routes/mockapi.ts index ec8eb6a7af..b1a8013c4e 100644 --- a/packages/http-specs/specs/routes/mockapi.ts +++ b/packages/http-specs/specs/routes/mockapi.ts @@ -4,34 +4,29 @@ export const Scenarios: Record = {}; function createTests(uri: string) { const url = new URL("http://example.com" + uri); - const searchParams = url.searchParams; - const params: Record = {}; - for (const [key, value] of searchParams) { - params[key] = value; + const queryMap = new Map(); + for (const [key, value] of url.searchParams.entries()) { + if (queryMap.has(key)) { + const existing = queryMap.get(key)!; + if (Array.isArray(existing)) { + existing.push(value); + } else { + queryMap.set(key, [existing, value]); + } + } else { + queryMap.set(key, value); + } } return passOnSuccess({ uri: url.pathname, method: "get", request: { - params, + params: Object.fromEntries(queryMap), }, response: { status: 204, }, handler: (req: MockRequest) => { - const queryMap = new Map(); - for (const [key, value] of url.searchParams.entries()) { - if (queryMap.has(key)) { - const existing = queryMap.get(key)!; - if (Array.isArray(existing)) { - existing.push(value); - } else { - queryMap.set(key, [existing, value]); - } - } else { - queryMap.set(key, value); - } - } for (const [key, value] of queryMap.entries()) { if (Array.isArray(value)) { req.expect.containsQueryParam(key, value, "multi"); @@ -155,7 +150,7 @@ Scenarios.Routes_QueryParameters_QueryExpansion_Explode_primitive = createTests( "/routes/query/query-expansion/explode/primitive?param=a", ); Scenarios.Routes_QueryParameters_QueryExpansion_Explode_array = createTests( - "/routes/query/query-expansion/explode/array?param=a,b", + "/routes/query/query-expansion/explode/array?param=a¶m=b", ); Scenarios.Routes_QueryParameters_QueryExpansion_Explode_record = createTests( "/routes/query/query-expansion/explode/record?a=1&b=2", @@ -173,7 +168,7 @@ Scenarios.Routes_QueryParameters_QueryContinuation_Explode_primitive = createTes "/routes/query/query-continuation/explode/primitive?fixed=true¶m=a", ); Scenarios.Routes_QueryParameters_QueryContinuation_Explode_array = createTests( - "/routes/query/query-continuation/explode/array?fixed=true¶m=a,b", + "/routes/query/query-continuation/explode/array?fixed=true¶m=a¶m=b", ); Scenarios.Routes_QueryParameters_QueryContinuation_Explode_record = createTests( "/routes/query/query-continuation/explode/record?fixed=true&a=1&b=2", From ab6d9512bdb86ec08eb1ab82b3dd73cd9e9abb3e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 20:40:11 +0000 Subject: [PATCH 4/4] Bump astro from 4.16.0 to 4.16.1 (#4726) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [astro](https://github.com/withastro/astro/tree/HEAD/packages/astro) from 4.16.0 to 4.16.1.
Release notes

Sourced from astro's releases.

astro@4.16.1

Patch Changes

  • #12177 a4ffbfa Thanks @​matthewp! - Ensure we target scripts for execution in the router

    Using document.scripts is unsafe because if the application has a name="scripts" this will shadow the built-in document.scripts. Fix is to use getElementsByTagName to ensure we're only grabbing real scripts.

  • #12173 2d10de5 Thanks @​ematipico! - Fixes a bug where Astro Actions couldn't redirect to the correct pathname when there was a rewrite involved.

Changelog

Sourced from astro's changelog.

4.16.1

Patch Changes

  • #12177 a4ffbfa Thanks @​matthewp! - Ensure we target scripts for execution in the router

    Using document.scripts is unsafe because if the application has a name="scripts" this will shadow the built-in document.scripts. Fix is to use getElementsByTagName to ensure we're only grabbing real scripts.

  • #12173 2d10de5 Thanks @​ematipico! - Fixes a bug where Astro Actions couldn't redirect to the correct pathname when there was a rewrite involved.

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=astro&package-manager=npm_and_yarn&previous-version=4.16.0&new-version=4.16.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/microsoft/typespec/network/alerts).
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/website-astro/package.json | 2 +- pnpm-lock.yaml | 171 +++++++++++++--------------- 2 files changed, 80 insertions(+), 93 deletions(-) diff --git a/packages/website-astro/package.json b/packages/website-astro/package.json index 573177e6e5..decc253800 100644 --- a/packages/website-astro/package.json +++ b/packages/website-astro/package.json @@ -27,7 +27,7 @@ "@fluentui/react-icons": "^2.0.260", "@typespec/compiler": "workspace:~", "@typespec/playground": "workspace:~", - "astro": "^4.16.0", + "astro": "^4.16.1", "clsx": "^2.1.1", "es-module-shims": "~1.10.0", "prism-react-renderer": "^2.4.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26fb838754..2fa4c09525 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -617,12 +617,12 @@ importers: '@typespec/spec-api': specifier: workspace:~ version: link:../spec-api - '@typespec/spector': - specifier: workspace:~ - version: link:../spector '@typespec/spec-lib': specifier: workspace:~ version: link:../spec-lib + '@typespec/spector': + specifier: workspace:~ + version: link:../spector '@typespec/versioning': specifier: workspace:~ version: link:../versioning @@ -1484,6 +1484,53 @@ importers: specifier: ^2.1.2 version: 2.1.2(@types/node@22.7.5)(@vitest/ui@2.1.2)(happy-dom@15.7.4)(jsdom@25.0.1)(terser@5.34.1) + packages/spec-coverage-sdk: + dependencies: + '@azure/identity': + specifier: ~4.4.1 + version: 4.4.1 + '@azure/storage-blob': + specifier: ~12.25.0 + version: 12.25.0 + '@types/node': + specifier: ~22.7.5 + version: 22.7.5 + devDependencies: + rimraf: + specifier: ~6.0.1 + version: 6.0.1 + typescript: + specifier: ~5.6.3 + version: 5.6.3 + + packages/spec-lib: + dependencies: + '@typespec/compiler': + specifier: workspace:~ + version: link:../compiler + '@typespec/http': + specifier: workspace:~ + version: link:../http + '@typespec/rest': + specifier: workspace:~ + version: link:../rest + '@typespec/versioning': + specifier: workspace:~ + version: link:../versioning + devDependencies: + '@types/node': + specifier: ~22.7.5 + version: 22.7.5 + '@typespec/tspd': + specifier: workspace:~ + version: link:../tspd + rimraf: + specifier: ~6.0.1 + version: 6.0.1 + typescript: + specifier: ~5.6.3 + version: 5.6.3 + packages/spector: dependencies: '@azure/identity': @@ -1599,53 +1646,6 @@ importers: specifier: ~5.6.3 version: 5.6.3 - packages/spec-coverage-sdk: - dependencies: - '@azure/identity': - specifier: ~4.4.1 - version: 4.4.1 - '@azure/storage-blob': - specifier: ~12.25.0 - version: 12.25.0 - '@types/node': - specifier: ~22.7.5 - version: 22.7.5 - devDependencies: - rimraf: - specifier: ~6.0.1 - version: 6.0.1 - typescript: - specifier: ~5.6.3 - version: 5.6.3 - - packages/spec-lib: - dependencies: - '@typespec/compiler': - specifier: workspace:~ - version: link:../compiler - '@typespec/http': - specifier: workspace:~ - version: link:../http - '@typespec/rest': - specifier: workspace:~ - version: link:../rest - '@typespec/versioning': - specifier: workspace:~ - version: link:../versioning - devDependencies: - '@types/node': - specifier: ~22.7.5 - version: 22.7.5 - '@typespec/tspd': - specifier: workspace:~ - version: link:../tspd - rimraf: - specifier: ~6.0.1 - version: 6.0.1 - typescript: - specifier: ~5.6.3 - version: 5.6.3 - packages/sse: devDependencies: '@types/node': @@ -2058,7 +2058,7 @@ importers: version: 3.6.2(@types/react-dom@18.3.0)(@types/react@18.3.11)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(vite@5.4.8(@types/node@22.7.5)(terser@5.34.1)) '@astrojs/starlight': specifier: ^0.28.3 - version: 0.28.3(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) + version: 0.28.3(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) '@docsearch/css': specifier: ^3.6.2 version: 3.6.2 @@ -2081,8 +2081,8 @@ importers: specifier: workspace:~ version: link:../playground astro: - specifier: ^4.16.0 - version: 4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) + specifier: ^4.16.1 + version: 4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -6705,8 +6705,8 @@ packages: peerDependencies: astro: ^4.0.0-beta || ^3.3.0 - astro@4.16.0: - resolution: {integrity: sha512-R5voBFy0yOg57uFnW24WV+RvqPerp9eOoDQoT0pQYqECuGuyV1PsZaSb9Nm0ec+KMLrfO9jvvESFw9LIN6XiUw==} + astro@4.16.1: + resolution: {integrity: sha512-ZeZd+L147HHgHmvoSkve7KM3EutV+hY0mOCa4PwARHEFAAh+omo4MUNoTWsFkfq7ozTgR0PCXQwslrZduoWHNg==} engines: {node: ^18.17.1 || ^20.3.0 || >=21.0.0, npm: '>=9.6.5', pnpm: '>=7.1.0'} hasBin: true @@ -8176,9 +8176,6 @@ packages: es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} - es-module-lexer@1.5.0: - resolution: {integrity: sha512-pqrTKmwEIgafsYZAGw9kszYzmagcE/n4dbgwGWLEXg7J4QFJVQRBld8j3Q3GNez79jzxZshq0bcT962QHOghjw==} - es-module-lexer@1.5.4: resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} @@ -13755,10 +13752,6 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} - engines: {node: '>=12.20'} - yocto-queue@1.1.1: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} @@ -13988,12 +13981,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@astrojs/mdx@3.1.8(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3))': + '@astrojs/mdx@3.1.8(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3))': dependencies: '@astrojs/markdown-remark': 5.3.0 '@mdx-js/mdx': 3.0.1 acorn: 8.12.1 - astro: 4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) + astro: 4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) es-module-lexer: 1.5.4 estree-util-visit: 2.0.0 gray-matter: 4.0.3 @@ -14030,15 +14023,15 @@ snapshots: stream-replace-string: 2.0.0 zod: 3.23.8 - '@astrojs/starlight@0.28.3(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3))': + '@astrojs/starlight@0.28.3(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3))': dependencies: - '@astrojs/mdx': 3.1.8(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) + '@astrojs/mdx': 3.1.8(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) '@astrojs/sitemap': 3.2.0 '@pagefind/default-ui': 1.1.1 '@types/hast': 3.0.4 '@types/mdast': 4.0.4 - astro: 4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) - astro-expressive-code: 0.35.6(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) + astro: 4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) + astro-expressive-code: 0.35.6(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)) bcp-47: 2.1.0 hast-util-from-html: 2.0.3 hast-util-select: 6.0.2 @@ -14318,7 +14311,7 @@ snapshots: '@babel/helper-member-expression-to-functions@7.24.5': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 '@babel/helper-module-imports@7.24.7': dependencies: @@ -14346,7 +14339,7 @@ snapshots: '@babel/helper-optimise-call-expression@7.22.5': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 '@babel/helper-plugin-utils@7.24.7': {} @@ -14375,7 +14368,7 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers@7.22.5': dependencies: - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 '@babel/helper-split-export-declaration@7.24.7': dependencies: @@ -14492,7 +14485,7 @@ snapshots: '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.25.8)': dependencies: '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.25.8)': dependencies: @@ -14542,7 +14535,7 @@ snapshots: '@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.25.8)': dependencies: '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.25.8)': dependencies: @@ -14805,7 +14798,7 @@ snapshots: '@babel/plugin-transform-react-display-name@7.24.1(@babel/core@7.25.8)': dependencies: '@babel/core': 7.25.8 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-transform-react-jsx-development@7.22.5(@babel/core@7.25.8)': dependencies: @@ -14839,7 +14832,7 @@ snapshots: dependencies: '@babel/core': 7.25.8 '@babel/helper-annotate-as-pure': 7.25.7 - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-transform-regenerator@7.24.1(@babel/core@7.25.8)': dependencies: @@ -14895,7 +14888,7 @@ snapshots: '@babel/core': 7.25.8 '@babel/helper-annotate-as-pure': 7.25.7 '@babel/helper-create-class-features-plugin': 7.24.5(@babel/core@7.25.8) - '@babel/helper-plugin-utils': 7.24.7 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.25.8) '@babel/plugin-transform-unicode-escapes@7.24.1(@babel/core@7.25.8)': @@ -18647,7 +18640,7 @@ snapshots: '@shikijs/engine-javascript': 1.21.0 '@shikijs/engine-oniguruma': 1.21.0 '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 hast-util-to-html: 9.0.3 @@ -18663,7 +18656,7 @@ snapshots: '@shikijs/engine-javascript@1.21.0': dependencies: '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/vscode-textmate': 9.3.0 oniguruma-to-js: 0.4.3 '@shikijs/engine-javascript@1.22.0': @@ -18675,7 +18668,7 @@ snapshots: '@shikijs/engine-oniguruma@1.21.0': dependencies: '@shikijs/types': 1.21.0 - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/vscode-textmate': 9.3.0 '@shikijs/engine-oniguruma@1.22.0': dependencies: @@ -18684,7 +18677,7 @@ snapshots: '@shikijs/types@1.21.0': dependencies: - '@shikijs/vscode-textmate': 9.2.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 '@shikijs/types@1.22.0': @@ -18809,7 +18802,7 @@ snapshots: dependencies: '@babel/core': 7.25.8 '@babel/preset-env': 7.24.5(@babel/core@7.25.8) - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 '@storybook/core': 8.3.5 '@storybook/csf': 0.1.11 '@types/cross-spawn': 6.0.6 @@ -20286,12 +20279,12 @@ snapshots: astring@1.8.6: {} - astro-expressive-code@0.35.6(astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)): + astro-expressive-code@0.35.6(astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3)): dependencies: - astro: 4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) + astro: 4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3) rehype-expressive-code: 0.35.6 - astro@4.16.0(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3): + astro@4.16.1(@types/node@22.7.5)(rollup@4.24.0)(terser@5.34.1)(typescript@5.6.3): dependencies: '@astrojs/compiler': 2.10.3 '@astrojs/internal-helpers': 0.4.1 @@ -20323,7 +20316,6 @@ snapshots: esbuild: 0.21.5 estree-walker: 3.0.3 fast-glob: 3.3.2 - fastq: 1.17.1 flattie: 1.1.1 github-slugger: 2.0.0 gray-matter: 4.0.3 @@ -20344,7 +20336,6 @@ snapshots: rehype: 13.0.2 semver: 7.6.3 shiki: 1.22.0 - string-width: 7.2.0 tinyexec: 0.3.0 tsconfck: 3.1.4(typescript@5.6.3) unist-util-visit: 5.0.0 @@ -22149,8 +22140,6 @@ snapshots: isarray: 2.0.5 stop-iteration-iterator: 1.0.0 - es-module-lexer@1.5.0: {} - es-module-lexer@1.5.4: {} es-module-shims@1.10.0: {} @@ -25680,7 +25669,7 @@ snapshots: p-limit@4.0.0: dependencies: - yocto-queue: 1.0.0 + yocto-queue: 1.1.1 p-limit@6.1.0: dependencies: @@ -28760,7 +28749,7 @@ snapshots: browserslist: 4.23.2 chrome-trace-event: 1.0.3 enhanced-resolve: 5.16.0 - es-module-lexer: 1.5.0 + es-module-lexer: 1.5.4 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 @@ -29071,8 +29060,6 @@ snapshots: yocto-queue@0.1.0: {} - yocto-queue@1.0.0: {} - yocto-queue@1.1.1: {} zod-to-json-schema@3.23.3(zod@3.23.8):