From 04fc86dbe6721643d0b417a855723083d438645b Mon Sep 17 00:00:00 2001 From: yonihemi Date: Mon, 7 Jul 2025 16:19:42 +0800 Subject: [PATCH] Add wasm-sdk JSON API --- api/v1/install/dev/6.0/wasm-sdk.json | 1 + api/v1/install/dev/6.1/wasm-sdk.json | 1 + api/v1/install/dev/6.2/wasm-sdk.json | 4 ++++ api/v1/install/dev/main/wasm-sdk.json | 4 ++++ .../swiftorgClient/Tool.swift | 10 ++++++++ openapi/swiftorg.yaml | 23 +++++++++++++++++++ 6 files changed, 43 insertions(+) create mode 100644 api/v1/install/dev/6.0/wasm-sdk.json create mode 100644 api/v1/install/dev/6.1/wasm-sdk.json create mode 100644 api/v1/install/dev/6.2/wasm-sdk.json create mode 100644 api/v1/install/dev/main/wasm-sdk.json diff --git a/api/v1/install/dev/6.0/wasm-sdk.json b/api/v1/install/dev/6.0/wasm-sdk.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/api/v1/install/dev/6.0/wasm-sdk.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/api/v1/install/dev/6.1/wasm-sdk.json b/api/v1/install/dev/6.1/wasm-sdk.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/api/v1/install/dev/6.1/wasm-sdk.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/api/v1/install/dev/6.2/wasm-sdk.json b/api/v1/install/dev/6.2/wasm-sdk.json new file mode 100644 index 000000000..702d28626 --- /dev/null +++ b/api/v1/install/dev/6.2/wasm-sdk.json @@ -0,0 +1,4 @@ +--- +layout: none +--- +{{ site.data.builds.swift-6_2-branch.wasm-sdk | jsonify }} \ No newline at end of file diff --git a/api/v1/install/dev/main/wasm-sdk.json b/api/v1/install/dev/main/wasm-sdk.json new file mode 100644 index 000000000..342864a84 --- /dev/null +++ b/api/v1/install/dev/main/wasm-sdk.json @@ -0,0 +1,4 @@ +--- +layout: none +--- +{{ site.data.builds.development.wasm-sdk | jsonify }} \ No newline at end of file diff --git a/openapi/TestSwiftOrgClient/swiftorgClient/Tool.swift b/openapi/TestSwiftOrgClient/swiftorgClient/Tool.swift index 6f6e13195..b3a3606d5 100644 --- a/openapi/TestSwiftOrgClient/swiftorgClient/Tool.swift +++ b/openapi/TestSwiftOrgClient/swiftorgClient/Tool.swift @@ -79,6 +79,16 @@ struct Tool { ) ) } + for branch in Components.Schemas.KnownSourceBranch.allCases { + tests.append( + .init( + name: "listWasmSDKDevToolchains(\(branch.rawValue))", + work: { + _ = try await client.listWasmSDKDevToolchains(.init(path: .init(branch: .init(value1: branch)))).ok.body.json + } + ) + ) + } tests.append( .init( name: "getCurrentSwiftlyRelease", diff --git a/openapi/swiftorg.yaml b/openapi/swiftorg.yaml index 03ba23c3b..629110935 100644 --- a/openapi/swiftorg.yaml +++ b/openapi/swiftorg.yaml @@ -74,6 +74,25 @@ paths: application/json: schema: $ref: '#/components/schemas/DevToolchainsForArch' + /install/dev/{branch}/wasm-sdk.json: + parameters: + - name: branch + in: path + required: true + schema: + $ref: '#/components/schemas/SourceBranch' + get: + operationId: listWasmSDKDevToolchains + summary: Fetch all SDK for WebAssembly toolchains + tags: + - Toolchains + responses: + '200': + description: A successful response. + content: + application/json: + schema: + $ref: '#/components/schemas/DevToolchainsForArch' /swiftly.json: get: operationId: getCurrentSwiftlyRelease @@ -195,6 +214,10 @@ components: type: string description: Filename of the snapshot archive to download. example: 'swift-6.0-DEVELOPMENT-SNAPSHOT-2024-07-25-a-amazonlinux2-aarch64.tar.gz' + checksum: + type: string + description: SHA-256 Checksum of the download. + example: 'a915e4a5f167f4bc8bbf702c4b235ba2d4b9c79124f61e3d85d3e0c0cafbc63c' download_signature: type: string description: Filename of the signature file for the download.