From 33816ced8172f272a6d63424753a0f87c4a721c4 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 12:39:31 -0800 Subject: [PATCH 01/14] KeyVault Secrets initial bootstrapping of crate --- Cargo.lock | 18 + Cargo.toml | 1 + eng/emitter-package-lock.json | 427 ++++++++++++---- eng/emitter-package.json | 11 +- .../CHANGELOG.md | 13 + .../Cargo.toml | 36 ++ .../azure_security_keyvault_secrets/README.md | 24 + .../azure_security_keyvault_secrets/build.rs | 39 ++ .../package-lock.json | 6 + .../src/generated/clients/key_vault_client.rs | 474 ++++++++++++++++++ .../src/generated/clients/mod.rs | 6 + .../src/generated/clients/secret_client.rs | 474 ++++++++++++++++++ .../src/generated/enums.rs | 20 + .../src/generated/mod.rs | 9 + .../src/generated/models.rs | 284 +++++++++++ .../src/generated/models_serde.rs | 80 +++ .../src/lib.rs | 15 + .../tsp-location.yaml | 3 + 18 files changed, 1848 insertions(+), 92 deletions(-) create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/CHANGELOG.md create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/Cargo.toml create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/README.md create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/build.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/package-lock.json create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/mod.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/mod.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/lib.rs create mode 100644 sdk/keyvault/azure_security_keyvault_secrets/tsp-location.yaml diff --git a/Cargo.lock b/Cargo.lock index 2fa61848f2..9419e7065f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,6 +168,7 @@ dependencies = [ "blocking", "futures-lite 2.5.0", "once_cell", + "tokio", ] [[package]] @@ -453,6 +454,23 @@ dependencies = [ "uuid", ] +[[package]] +name = "azure_security_keyvault_secrets" +version = "0.1.0" +dependencies = [ + "async-std", + "azure_core", + "azure_identity", + "futures", + "rand 0.8.5", + "rustc_version", + "serde", + "serde_json", + "time", + "tokio", + "typespec_client_core", +] + [[package]] name = "azure_storage_blob" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 1da769009c..a41cdbbf24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ members = [ "sdk/cosmos/azure_data_cosmos", "sdk/identity/azure_identity", "sdk/eventhubs/azure_messaging_eventhubs", + "sdk/keyvault/azure_security_keyvault_secrets", "eng/test/mock_transport", "sdk/storage", "sdk/storage/azure_storage_blob", diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index cd0a8e6a8b..f03dd846b8 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,18 +5,20 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-rust": "0.3.0" + "@azure-tools/typespec-rust": "0.5.0" }, "devDependencies": { - "@azure-tools/typespec-client-generator-core": "0.48.4", - "@typespec/compiler": "0.62.0", - "@typespec/xml": "0.62.0" + "@azure-tools/typespec-azure-rulesets": "0.49.0", + "@azure-tools/typespec-client-generator-core": "0.49.0", + "@typespec/compiler": "0.63.0", + "@typespec/xml": "0.63.0" } }, "node_modules/@azure-tools/async-io": { "version": "3.0.254", "resolved": "https://registry.npmjs.org/@azure-tools/async-io/-/async-io-3.0.254.tgz", "integrity": "sha512-X1C7XdyCuo50ch9FzKtTvmK18FgDxxf1Bbt3cSoknQqeDaRegHSSCO+zByq2YA4NvUzKXeZ1engh29IDxZXgpQ==", + "license": "MIT", "dependencies": { "@azure-tools/tasks": "~3.0.255", "proper-lockfile": "~2.0.1" @@ -29,6 +31,7 @@ "version": "2.9.2", "resolved": "https://registry.npmjs.org/@azure-tools/codegen/-/codegen-2.9.2.tgz", "integrity": "sha512-brVLyffOtPiEijYYBYgV+4q7IyAfqXIec7XbdEqvv7As6SeEdq5WtbtN9N0LdGVHDWtEfc+JArwIx9aYGFdMUg==", + "license": "MIT", "dependencies": { "@azure-tools/async-io": "~3.0.0", "js-yaml": "~4.0.0", @@ -42,6 +45,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -53,6 +57,7 @@ "version": "3.1.263", "resolved": "https://registry.npmjs.org/@azure-tools/linq/-/linq-3.1.263.tgz", "integrity": "sha512-r104pkF96Sk8MW+PgxWqwiwNXhPbJSkMDcmShu9EDEJem04SM7DnHWmDo8JZR08vHYaecZA126OoGQFe7WikSA==", + "license": "MIT", "engines": { "node": ">=10.12.0" } @@ -61,28 +66,33 @@ "version": "3.0.255", "resolved": "https://registry.npmjs.org/@azure-tools/tasks/-/tasks-3.0.255.tgz", "integrity": "sha512-GjALNLz7kWMEdRVbaN5g0cJHNAr3XVTbP0611Mv2UzMgGL6FOhNZJK+oPHJKLDR8EEDZNnkwPlyi7B+INXUSQA==", + "license": "MIT", "engines": { "node": ">=10.12.0" } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.48.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.48.0.tgz", - "integrity": "sha512-80qyqgTgBbrnCGXtz6eWAMBdEAjYVVL780L0Ye+rBEd6VoA0m3JrgzUqf5bC0Iwju6lEtBAb8o6sefKD/NGA7g==", + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.49.0.tgz", + "integrity": "sha512-hNKy+aePmPkB1brHQkO1tsJXqXPzt/9ehy10dv0rKdp9xq5dE3yBctHF5Aj3Nr8kr8GRG5z4KYpYPbV5guoT5w==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/rest": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/rest": "~0.63.0" } }, - "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.48.4", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.48.4.tgz", - "integrity": "sha512-TvX84FiQ3rax0e838m6kpVj8F24OzKAbyLgUXXZ/TjfxhvZb1u0ojMjSKAvmcal2klROJqRlj4d9tImidPYpgA==", + "node_modules/@azure-tools/typespec-azure-resource-manager": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-resource-manager/-/typespec-azure-resource-manager-0.49.0.tgz", + "integrity": "sha512-1xWuG8OBJDykYM6BFD2owV9WH+oC32zt7XteXA0T4nH2T+D+sEFKppkCOMtIjX7ENBAlecmbdwgSNTZYQf4vaw==", + "dev": true, + "license": "MIT", + "peer": true, "dependencies": { "change-case": "~5.4.4", "pluralize": "^8.0.0" @@ -91,18 +101,57 @@ "node": ">=18.0.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": "~0.48.0", - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0", - "@typespec/openapi": "~0.62.0", - "@typespec/rest": "~0.62.0", - "@typespec/versioning": "~0.62.0" + "@azure-tools/typespec-azure-core": "~0.49.0", + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/openapi": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0" + } + }, + "node_modules/@azure-tools/typespec-azure-rulesets": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-rulesets/-/typespec-azure-rulesets-0.49.0.tgz", + "integrity": "sha512-qKynK3lp+eqlt6QPGFSptrt9uqJUfeuv6yVXYDuaX1Jqu7tbTAgGf0HtN8mqPzfu3eAb84bdq6VgNspxyXLDOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.49.0", + "@azure-tools/typespec-azure-resource-manager": "~0.49.0", + "@azure-tools/typespec-client-generator-core": "~0.49.0", + "@typespec/compiler": "~0.63.0" + } + }, + "node_modules/@azure-tools/typespec-client-generator-core": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.49.0.tgz", + "integrity": "sha512-inFLRIeTU0mQg4PT19O3YwT/4YODLuTgIsXuhKDdG/sEsx8PG8AEFTabtnZJ0w3Lc4xuxKFJrzZ2ZH2iiAAbig==", + "license": "MIT", + "dependencies": { + "change-case": "~5.4.4", + "pluralize": "^8.0.0", + "yaml": "~2.5.1" + }, + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "@azure-tools/typespec-azure-core": "~0.49.0", + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0", + "@typespec/openapi": "~0.63.0", + "@typespec/rest": "~0.63.0", + "@typespec/versioning": "~0.63.0" } }, "node_modules/@azure-tools/typespec-rust": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.3.0.tgz", - "integrity": "sha512-Y2JXWG33a5G/RbMsg2JRrFdbl4UxrUEAQUa+/h2mLmmEGJTqnv0SzqAAEpo663N72njgGoz5J3vqZDcFb3uOpw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.5.0.tgz", + "integrity": "sha512-fvWKOoprUiorvTLhhAqvyg/GrQCQUIYA7hpZrY/Blhf9JudDafPcnDuqBvy9QXg+g74b1ax4i62SPHPq4FYY3A==", + "license": "MIT", "dependencies": { "@azure-tools/codegen": "~2.9.2", "@azure-tools/linq": "~3.1.263", @@ -115,14 +164,15 @@ "node": ">=20.0.0" }, "peerDependencies": { - "@azure-tools/typespec-client-generator-core": ">=0.48.4 <1.0.0", - "@typespec/compiler": ">=0.62.0 <1.0.0" + "@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0", + "@typespec/compiler": ">=0.63.0 <1.0.0" } }, "node_modules/@babel/code-frame": { "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.9.tgz", "integrity": "sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ==", + "license": "MIT", "dependencies": { "@babel/highlight": "^7.25.9", "picocolors": "^1.0.0" @@ -135,6 +185,7 @@ "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "license": "MIT", "engines": { "node": ">=6.9.0" } @@ -143,6 +194,7 @@ "version": "7.25.9", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", + "license": "MIT", "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", @@ -160,6 +212,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "aix" @@ -175,6 +228,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -190,6 +244,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -205,6 +260,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -220,6 +276,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -235,6 +292,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -250,6 +308,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -265,6 +324,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -280,6 +340,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -295,6 +356,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -310,6 +372,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -325,6 +388,7 @@ "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -340,6 +404,7 @@ "cpu": [ "mips64el" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -355,6 +420,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -370,6 +436,7 @@ "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -385,6 +452,7 @@ "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -400,6 +468,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -415,6 +484,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "netbsd" @@ -430,6 +500,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "openbsd" @@ -445,6 +516,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "sunos" @@ -460,6 +532,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -475,6 +548,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -490,6 +564,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -502,6 +577,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "license": "MIT", "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -512,12 +588,14 @@ "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==" + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "license": "MIT" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -530,6 +608,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "license": "MIT", "engines": { "node": ">= 8" } @@ -538,6 +617,7 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "license": "MIT", "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -553,6 +633,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -565,6 +646,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "android" @@ -577,6 +659,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -589,6 +672,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "darwin" @@ -601,6 +685,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -613,6 +698,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "freebsd" @@ -625,6 +711,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -637,6 +724,7 @@ "cpu": [ "arm" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -649,6 +737,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -661,6 +750,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -673,6 +763,7 @@ "cpu": [ "loong64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -685,6 +776,7 @@ "cpu": [ "ppc64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -697,6 +789,7 @@ "cpu": [ "riscv64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -709,6 +802,7 @@ "cpu": [ "s390x" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -721,6 +815,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -733,6 +828,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "linux" @@ -745,6 +841,7 @@ "cpu": [ "arm64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -757,6 +854,7 @@ "cpu": [ "ia32" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -769,6 +867,7 @@ "cpu": [ "x64" ], + "license": "MIT", "optional": true, "os": [ "win32" @@ -777,12 +876,14 @@ "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "license": "MIT" }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", "integrity": "sha512-LtoMMhxAlorcGhmFYI+LhPgbPZCkgP6ra1YL604EeF6U98pLlQ3iWIGMdWSC+vWmPBWBNgmDBAhnAobLROJmwg==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -793,19 +894,21 @@ "node_modules/@types/estree": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "license": "MIT" }, "node_modules/@typespec/compiler": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.62.0.tgz", - "integrity": "sha512-RfKJ/rF2Wjxu7dl74oJE8yEfSkeL7NopFlyJ4dW1JQXpRN2IOJYPxas12qZA6H9ZEIB8rBjyrHNxJSQbvn/UDQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-0.63.0.tgz", + "integrity": "sha512-cC3YniwbFghn1fASX3r1IgNjMrwaY4gmzznkHT4f/NxE+HK4XoXWn4EG7287QgVMCaHUykzJCIfW9k7kIleW5A==", + "license": "MIT", "dependencies": { "@babel/code-frame": "~7.25.7", "ajv": "~8.17.1", "change-case": "~5.4.4", "globby": "~14.0.2", "mustache": "~4.2.0", - "picocolors": "~1.1.0", + "picocolors": "~1.1.1", "prettier": "~3.3.3", "prompts": "~2.4.2", "semver": "^7.6.3", @@ -824,16 +927,17 @@ } }, "node_modules/@typespec/http": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.62.0.tgz", - "integrity": "sha512-6H9y9e32lb2s76MMy29ITCwSZNG42sa/qWthiByUvfbTEXMpu5a1fQHNj7RXg+xmDKmVIHv3gAfjGPAWfXhkaQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/http/-/http-0.63.0.tgz", + "integrity": "sha512-SYVbBmLPAPdWZfdMs0QlbpTnFREDnkINu2FR+0kRX12qzbRgpRbLsdhg59qx4TfKoh4IAPgSV+Fq84w7BWGsyQ==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/streams": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/streams": "~0.63.0" }, "peerDependenciesMeta": { "@typespec/streams": { @@ -842,59 +946,64 @@ } }, "node_modules/@typespec/openapi": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.62.0.tgz", - "integrity": "sha512-Xtm0Nd2BuSmEfSWGtc10ok22jyomYm9L2jY+kVTy+v5J89DrVh0o6+YpipUl1QhcItM1YMBphWHIHPfwkDRbnw==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/openapi/-/openapi-0.63.0.tgz", + "integrity": "sha512-/KzR60mj3P/LnNWd/QfH0KTN/If4+mjrsWNSB7/uab6c8Qu/lNsGlZDkmWq4EFiwBR7VmpdFz9FP7d/m3O+tGw==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0" } }, "node_modules/@typespec/rest": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.62.0.tgz", - "integrity": "sha512-ci5UjelEKFwsPTdpgysoUoDCcw02EnbG4GBuYJdR5mRrFCBZMxrbro+OJLgSN3g/TORSsWlW7dEOWLfbyrmlZQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/rest/-/rest-0.63.0.tgz", + "integrity": "sha512-HftzMjSDHAYX+ILE9C6pFS4oAq7oBHMCtpA8QgSFPDF4V5a8l1k2K8c4x1B+7yl+GkREmIdtpc6S0xZm2G7hXg==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0", - "@typespec/http": "~0.62.0" + "@typespec/compiler": "~0.63.0", + "@typespec/http": "~0.63.0" } }, "node_modules/@typespec/versioning": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.62.0.tgz", - "integrity": "sha512-M5KTCVH5fBniZU8eQlw+NV13vAmPr58HyBLDIyxeOuV+SHNlx+f+qanUEDIPaJheKlaSSNTEZKsDhs83/iIMMA==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/versioning/-/versioning-0.63.0.tgz", + "integrity": "sha512-BPvmPL+g20yEmSA8XRfbIHdToNOjssq4QfwOU6D7kKLLXnZHFb1hmuwW0tf0Wa/lYgoaUC60ONAeoXgNT1ZOIQ==", + "license": "MIT", "peer": true, "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@typespec/xml": { - "version": "0.62.0", - "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.62.0.tgz", - "integrity": "sha512-DexGTQHB75fncDcYfs5CIbNwO6NOhjwCaaNoHYAsVVzs4T8qwzw6WQdEEMzZRbgsxwnllFkxKwGhLtRMQdv/cQ==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/@typespec/xml/-/xml-0.63.0.tgz", + "integrity": "sha512-2aQxWWqc5f4OTmC2nNafHi+ppr8GqwwMXx/2DnNjeshZF/JD0FNCYH8gV4gFZe7mfRfB9bAxNkcKj2AF01ntqA==", "dev": true, + "license": "MIT", "engines": { "node": ">=18.0.0" }, "peerDependencies": { - "@typespec/compiler": "~0.62.0" + "@typespec/compiler": "~0.63.0" } }, "node_modules/@vitest/expect": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", + "license": "MIT", "dependencies": { "@vitest/spy": "1.6.0", "@vitest/utils": "1.6.0", @@ -908,6 +1017,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", + "license": "MIT", "dependencies": { "@vitest/utils": "1.6.0", "p-limit": "^5.0.0", @@ -921,6 +1031,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", + "license": "MIT", "dependencies": { "magic-string": "^0.30.5", "pathe": "^1.1.1", @@ -934,6 +1045,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", + "license": "MIT", "dependencies": { "tinyspy": "^2.2.0" }, @@ -945,6 +1057,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", + "license": "MIT", "dependencies": { "diff-sequences": "^29.6.3", "estree-walker": "^3.0.3", @@ -959,6 +1072,7 @@ "version": "8.14.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz", "integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==", + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -970,6 +1084,7 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "license": "MIT", "dependencies": { "acorn": "^8.11.0" }, @@ -981,6 +1096,7 @@ "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -996,6 +1112,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1004,6 +1121,7 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -1014,12 +1132,14 @@ "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "license": "MIT", "engines": { "node": "*" } @@ -1028,6 +1148,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { "fill-range": "^7.1.1" }, @@ -1038,12 +1159,14 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" }, "node_modules/cac": { "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1052,6 +1175,7 @@ "version": "4.5.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "license": "MIT", "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.3", @@ -1069,6 +1193,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1081,12 +1206,14 @@ "node_modules/change-case": { "version": "5.4.4", "resolved": "https://registry.npmjs.org/change-case/-/change-case-5.4.4.tgz", - "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==" + "integrity": "sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==", + "license": "MIT" }, "node_modules/check-error": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "license": "MIT", "dependencies": { "get-func-name": "^2.0.2" }, @@ -1098,6 +1225,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", @@ -1111,6 +1239,7 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } @@ -1118,17 +1247,20 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" }, "node_modules/confbox": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", - "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==" + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "license": "MIT" }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", @@ -1142,6 +1274,7 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "license": "MIT", "dependencies": { "ms": "^2.1.3" }, @@ -1158,6 +1291,7 @@ "version": "0.4.1", "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.4.1.tgz", "integrity": "sha512-+8VxcR21HhTy8nOt6jf20w0c9CADrw1O8d+VZ/YzzCt4bJ3uBjw+D1q2osAB8RnpwwaeYBxy0HyKQxD5JBMuuQ==", + "license": "MIT", "engines": { "node": ">=14.16" } @@ -1166,6 +1300,7 @@ "version": "4.1.4", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "license": "MIT", "dependencies": { "type-detect": "^4.0.0" }, @@ -1177,6 +1312,7 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "license": "MIT", "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -1184,13 +1320,15 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", "hasInstallScript": true, + "license": "MIT", "bin": { "esbuild": "bin/esbuild" }, @@ -1227,6 +1365,7 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "license": "MIT", "engines": { "node": ">=6" } @@ -1235,6 +1374,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", "engines": { "node": ">=0.8.0" } @@ -1243,6 +1383,7 @@ "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0" } @@ -1251,6 +1392,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "license": "MIT", "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^8.0.1", @@ -1272,12 +1414,14 @@ "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "license": "MIT", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -1292,12 +1436,14 @@ "node_modules/fast-uri": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.3.tgz", - "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==" + "integrity": "sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw==", + "license": "BSD-3-Clause" }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } @@ -1306,6 +1452,7 @@ "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -1317,6 +1464,7 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-5.1.0.tgz", "integrity": "sha512-qWeTREPoT7I0bifpPUXtxkZJ1XJzxWtfoWWkdVGqa+eCr3SHW/Ocp89o8vLvbUuQnadybJpjOKu4V+RwO6sGng==", + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -1329,6 +1477,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "hasInstallScript": true, + "license": "MIT", "optional": true, "os": [ "darwin" @@ -1341,6 +1490,7 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", "engines": { "node": "6.* || 8.* || >= 10.*" } @@ -1349,6 +1499,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1357,6 +1508,7 @@ "version": "8.0.1", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "license": "MIT", "engines": { "node": ">=16" }, @@ -1368,6 +1520,7 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "license": "ISC", "dependencies": { "is-glob": "^4.0.1" }, @@ -1379,6 +1532,7 @@ "version": "14.0.2", "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", + "license": "MIT", "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", "fast-glob": "^3.3.2", @@ -1397,12 +1551,14 @@ "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -1411,6 +1567,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "license": "Apache-2.0", "engines": { "node": ">=16.17.0" } @@ -1419,6 +1576,7 @@ "version": "5.3.2", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "license": "MIT", "engines": { "node": ">= 4" } @@ -1427,6 +1585,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1435,6 +1594,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1443,6 +1603,7 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", "dependencies": { "is-extglob": "^2.1.1" }, @@ -1454,6 +1615,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { "node": ">=0.12.0" } @@ -1462,6 +1624,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "license": "MIT", "engines": { "node": "^12.20.0 || ^14.13.1 || >=16.0.0" }, @@ -1472,17 +1635,20 @@ "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" }, "node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -1493,12 +1659,14 @@ "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "license": "MIT" }, "node_modules/kleur": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "license": "MIT", "engines": { "node": ">=6" } @@ -1507,6 +1675,7 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.1.tgz", "integrity": "sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==", + "license": "MIT", "dependencies": { "mlly": "^1.7.3", "pkg-types": "^1.2.1" @@ -1522,14 +1691,16 @@ "version": "2.3.7", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "license": "MIT", "dependencies": { "get-func-name": "^2.0.1" } }, "node_modules/magic-string": { - "version": "0.30.14", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.14.tgz", - "integrity": "sha512-5c99P1WKTed11ZC0HMJOj6CDIue6F8ySu+bJL+85q1zBEIY8IklrJ1eiKC2NDRh3Ct3FcvmJPyQHb9erXMTJNw==", + "version": "0.30.17", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "license": "MIT", "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0" } @@ -1537,12 +1708,14 @@ "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", - "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==" + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "license": "MIT" }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "license": "MIT", "engines": { "node": ">= 8" } @@ -1551,6 +1724,7 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -1563,6 +1737,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1574,6 +1749,7 @@ "version": "1.7.3", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.3.tgz", "integrity": "sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==", + "license": "MIT", "dependencies": { "acorn": "^8.14.0", "pathe": "^1.1.2", @@ -1584,12 +1760,14 @@ "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" }, "node_modules/mustache": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz", "integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==", + "license": "MIT", "bin": { "mustache": "bin/mustache" } @@ -1604,6 +1782,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "bin": { "nanoid": "bin/nanoid.cjs" }, @@ -1615,6 +1794,7 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "license": "MIT", "dependencies": { "path-key": "^4.0.0" }, @@ -1629,6 +1809,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1640,6 +1821,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "license": "MIT", "dependencies": { "mimic-fn": "^4.0.0" }, @@ -1654,6 +1836,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", + "license": "MIT", "dependencies": { "yocto-queue": "^1.0.0" }, @@ -1668,6 +1851,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1676,6 +1860,7 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-5.0.0.tgz", "integrity": "sha512-5HviZNaZcfqP95rwpv+1HDgUamezbqdSYTyzjTvwtJSnIH+3vnbmWsItli8OFEndS984VT55M3jduxZbX351gg==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -1686,12 +1871,14 @@ "node_modules/pathe": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", - "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==" + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", + "license": "MIT" }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1699,12 +1886,14 @@ "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "license": "MIT", "engines": { "node": ">=8.6" }, @@ -1716,6 +1905,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.2.1.tgz", "integrity": "sha512-sQoqa8alT3nHjGuTjuKgOnvjo4cljkufdtLMnO2LBP/wRwuDlo1tkaEdMxCRhyGRPacv/ztlZgDPm2b7FAmEvw==", + "license": "MIT", "dependencies": { "confbox": "^0.1.8", "mlly": "^1.7.2", @@ -1726,6 +1916,7 @@ "version": "8.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-8.0.0.tgz", "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==", + "license": "MIT", "engines": { "node": ">=4" } @@ -1748,6 +1939,7 @@ "url": "https://github.com/sponsors/ai" } ], + "license": "MIT", "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.1.1", @@ -1761,6 +1953,7 @@ "version": "3.3.3", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "license": "MIT", "bin": { "prettier": "bin/prettier.cjs" }, @@ -1775,6 +1968,7 @@ "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "license": "MIT", "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -1788,6 +1982,7 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "license": "MIT", "engines": { "node": ">=10" }, @@ -1799,6 +1994,7 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "license": "MIT", "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -1811,6 +2007,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/proper-lockfile/-/proper-lockfile-2.0.1.tgz", "integrity": "sha512-rjaeGbsmhNDcDInmwi4MuI6mRwJu6zq8GjYCLuSuE7GF+4UjgzkL69sVKKJ2T2xH61kK7rXvGYpvaTu909oXaQ==", + "license": "MIT", "dependencies": { "graceful-fs": "^4.1.2", "retry": "^0.10.0" @@ -1823,6 +2020,7 @@ "version": "9.1.1", "resolved": "https://registry.npmjs.org/query-string/-/query-string-9.1.1.tgz", "integrity": "sha512-MWkCOVIcJP9QSKU52Ngow6bsAWAPlPK2MludXvcrS2bGZSl+T1qX9MZvRIkqUIkGLJquMJHWfsT6eRqUpp4aWg==", + "license": "MIT", "dependencies": { "decode-uri-component": "^0.4.1", "filter-obj": "^5.1.0", @@ -1852,17 +2050,20 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==" + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "license": "MIT" }, "node_modules/require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1871,6 +2072,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -1879,6 +2081,7 @@ "version": "0.10.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.10.1.tgz", "integrity": "sha512-ZXUSQYTHdl3uS7IuCehYfMzKyIDBNoAuUblvy5oGO5UJSUTmStUUVPXbA9Qxd173Bgre53yCQczQuHgRWAdvJQ==", + "license": "MIT", "engines": { "node": "*" } @@ -1887,6 +2090,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -1896,6 +2100,7 @@ "version": "4.28.1", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.28.1.tgz", "integrity": "sha512-61fXYl/qNVinKmGSTHAZ6Yy8I3YIJC/r2m9feHo6SwVAVcLT5MPwOUFe7EuURA/4m0NR8lXG4BBXuo/IZEsjMg==", + "license": "MIT", "dependencies": { "@types/estree": "1.0.6" }, @@ -1947,6 +2152,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "queue-microtask": "^1.2.2" } @@ -1955,6 +2161,7 @@ "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", "bin": { "semver": "bin/semver.js" }, @@ -1966,6 +2173,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", "dependencies": { "shebang-regex": "^3.0.0" }, @@ -1977,6 +2185,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", "engines": { "node": ">=8" } @@ -1984,12 +2193,14 @@ "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==" + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "license": "ISC" }, "node_modules/signal-exit": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", "engines": { "node": ">=14" }, @@ -2000,12 +2211,14 @@ "node_modules/sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" }, "node_modules/slash": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", + "license": "MIT", "engines": { "node": ">=14.16" }, @@ -2017,6 +2230,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2025,6 +2239,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" } @@ -2033,6 +2248,7 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "license": "MIT", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -2042,6 +2258,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-3.0.0.tgz", "integrity": "sha512-qxQJTx2ryR0Dw0ITYyekNQWpz6f8dGd7vffGNflQQ3Iqj9NJ6qiZ7ELpZsJ/QBhIVAiDfXdag3+Gp8RvWa62AA==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -2052,17 +2269,20 @@ "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==" + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "license": "MIT" }, "node_modules/std-env": { "version": "3.8.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.8.0.tgz", - "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==" + "integrity": "sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==", + "license": "MIT" }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -2076,6 +2296,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", "dependencies": { "ansi-regex": "^5.0.1" }, @@ -2087,6 +2308,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "license": "MIT", "engines": { "node": ">=12" }, @@ -2098,6 +2320,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.1.tgz", "integrity": "sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==", + "license": "MIT", "dependencies": { "js-tokens": "^9.0.1" }, @@ -2108,12 +2331,14 @@ "node_modules/strip-literal/node_modules/js-tokens": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", - "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==" + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "license": "MIT" }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -2125,6 +2350,7 @@ "version": "0.2.5", "resolved": "https://registry.npmjs.org/temporal-polyfill/-/temporal-polyfill-0.2.5.tgz", "integrity": "sha512-ye47xp8Cb0nDguAhrrDS1JT1SzwEV9e26sSsrWzVu+yPZ7LzceEcH0i2gci9jWfOfSCCgM3Qv5nOYShVUUFUXA==", + "license": "MIT", "dependencies": { "temporal-spec": "^0.2.4" } @@ -2132,17 +2358,20 @@ "node_modules/temporal-spec": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/temporal-spec/-/temporal-spec-0.2.4.tgz", - "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==" + "integrity": "sha512-lDMFv4nKQrSjlkHKAlHVqKrBG4DyFfa9F74cmBZ3Iy3ed8yvWnlWSIdi4IKfSqwmazAohBNwiN64qGx4y5Q3IQ==", + "license": "ISC" }, "node_modules/tinybench": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==" + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "license": "MIT" }, "node_modules/tinypool": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2151,6 +2380,7 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2159,6 +2389,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -2170,6 +2401,7 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "license": "MIT", "engines": { "node": ">=4" } @@ -2177,12 +2409,14 @@ "node_modules/ufo": { "version": "1.5.4", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", - "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==" + "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", + "license": "MIT" }, "node_modules/unicorn-magic": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/unicorn-magic/-/unicorn-magic-0.1.0.tgz", "integrity": "sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==", + "license": "MIT", "engines": { "node": ">=18" }, @@ -2194,6 +2428,7 @@ "version": "5.4.11", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.11.tgz", "integrity": "sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==", + "license": "MIT", "dependencies": { "esbuild": "^0.21.3", "postcss": "^8.4.43", @@ -2252,6 +2487,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", + "license": "MIT", "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", @@ -2273,6 +2509,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "license": "MIT", "dependencies": { "@vitest/expect": "1.6.0", "@vitest/runner": "1.6.0", @@ -2337,6 +2574,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz", "integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==", + "license": "MIT", "engines": { "node": ">=14.0.0" } @@ -2345,6 +2583,7 @@ "version": "9.0.1", "resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-9.0.1.tgz", "integrity": "sha512-woByF3PDpkHFUreUa7Hos7+pUWdeWMXRd26+ZX2A8cFx6v/JPTtd4/uN0/jB6XQHYaOlHbio03NTHCqrgG5n7g==", + "license": "MIT", "dependencies": { "vscode-languageserver-protocol": "3.17.5" }, @@ -2356,6 +2595,7 @@ "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz", "integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==", + "license": "MIT", "dependencies": { "vscode-jsonrpc": "8.2.0", "vscode-languageserver-types": "3.17.5" @@ -2364,17 +2604,20 @@ "node_modules/vscode-languageserver-textdocument": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==" + "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", + "license": "MIT" }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", - "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==" + "integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg==", + "license": "MIT" }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", "dependencies": { "isexe": "^2.0.0" }, @@ -2389,6 +2632,7 @@ "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "license": "MIT", "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -2404,6 +2648,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -2420,6 +2665,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", "dependencies": { "color-convert": "^2.0.1" }, @@ -2434,6 +2680,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", "dependencies": { "color-name": "~1.1.4" }, @@ -2444,12 +2691,14 @@ "node_modules/wrap-ansi/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", "engines": { "node": ">=10" } @@ -2458,6 +2707,7 @@ "version": "2.5.1", "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", + "license": "ISC", "bin": { "yaml": "bin.mjs" }, @@ -2469,6 +2719,7 @@ "version": "17.7.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", @@ -2486,6 +2737,7 @@ "version": "21.1.1", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", "engines": { "node": ">=12" } @@ -2494,6 +2746,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.1.1.tgz", "integrity": "sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==", + "license": "MIT", "engines": { "node": ">=12.20" }, diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 6ec6ca1361..ea9dad65cd 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,11 +1,12 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-rust": "0.3.0" + "@azure-tools/typespec-rust": "0.5.0" }, "devDependencies": { - "@azure-tools/typespec-client-generator-core": "0.48.4", - "@typespec/compiler": "0.62.0", - "@typespec/xml": "0.62.0" + "@azure-tools/typespec-client-generator-core": "0.49.0", + "@azure-tools/typespec-azure-rulesets": "0.49.0", + "@typespec/compiler": "0.63.0", + "@typespec/xml": "0.63.0" } -} +} \ No newline at end of file diff --git a/sdk/keyvault/azure_security_keyvault_secrets/CHANGELOG.md b/sdk/keyvault/azure_security_keyvault_secrets/CHANGELOG.md new file mode 100644 index 0000000000..32598f4e8a --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/CHANGELOG.md @@ -0,0 +1,13 @@ +# Release History + +## 0.1.0 (Unreleased) + +### Features Added + +- initial publish to [crates.io](https://crates.io/crates/azure_security_keyvault_secrets) + +### Breaking Changes + +### Bugs Fixed + +### Other Changes diff --git a/sdk/keyvault/azure_security_keyvault_secrets/Cargo.toml b/sdk/keyvault/azure_security_keyvault_secrets/Cargo.toml new file mode 100644 index 0000000000..75162ff142 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "azure_security_keyvault_secrets" +version = "0.1.0" +description = "Rust wrappers around Microsoft Azure REST APIs - Azure KeyVault Secrets" +readme = "README.md" +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +rust-version.workspace = true +homepage = "https://github.com/azure/azure-sdk-for-rust" +documentation = "https://docs.rs/azure_security_keyvault_secrets" +keywords = ["sdk", "azure", "rest", "cloud", "keyvault", "security"] +categories = ["api-bindings"] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +async-std = { workspace = true, features = ["attributes", "tokio1"] } +azure_core = { workspace = true} +futures = { workspace = true} +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true} +time = { workspace = true} +typespec_client_core = { workspace = true, features = ["derive"] } + +[dev-dependencies] +azure_identity.workspace = true +rand.workspace = true +tokio.workspace = true + +[build-dependencies] +rustc_version.workspace = true + +[lints] +workspace = true diff --git a/sdk/keyvault/azure_security_keyvault_secrets/README.md b/sdk/keyvault/azure_security_keyvault_secrets/README.md new file mode 100644 index 0000000000..c6ad42389a --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/README.md @@ -0,0 +1,24 @@ +# Azure KeyVault Secrets Client + +The `azure_security_keyvault_secrets` crate. +These crates follow the [Azure SDK Design Guidelines for Rust](https://azure.github.io/azure-sdk/rust_introduction.html). + +## Getting started + +## Contributing +This project welcomes contributions and suggestions. Most contributions require +you to agree to a Contributor License Agreement (CLA) declaring that you have +the right to, and actually do, grant us the rights to use your contribution. +For details, visit [https://cla.microsoft.com](https://cla.microsoft.com). + +When you submit a pull request, a CLA-bot will automatically determine whether +you need to provide a CLA and decorate the PR appropriately (e.g., label, +comment). Simply follow the instructions provided by the bot. You will only +need to do this once across all repos using our CLA. + +This project has adopted the +[Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information, see the +[Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any +additional questions or comments. \ No newline at end of file diff --git a/sdk/keyvault/azure_security_keyvault_secrets/build.rs b/sdk/keyvault/azure_security_keyvault_secrets/build.rs new file mode 100644 index 0000000000..b8fa65045e --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/build.rs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +use rustc_version::version; +use std::env; +use std::io::{self, Write}; +use std::process::Command; + +fn generate_typespec() { + println!("Generating typespec..."); + + let output = Command::new("tsp-client.cmd") + .args(&["update"]) + //.stdout(Stdio::piped()) + .output() + .unwrap(); + + println!("status: {}", output.status); + io::stdout().write_all(&output.stdout).unwrap(); + io::stderr().write_all(&output.stderr).unwrap(); + + assert!(output.status.success()); + + println!("Generating typespec Completed."); +} + +fn main() { + let version = match version() { + Ok(version) => version.to_string(), + Err(_) => "unknown".to_owned(), + }; + println!("cargo:rustc-env=AZSDK_RUSTC_VERSION={version}"); + + let generate_enabled = env::var("GENERATE_TYPESPEC").unwrap_or("1".to_string()); + + if generate_enabled == "1" { + generate_typespec(); + } +} diff --git a/sdk/keyvault/azure_security_keyvault_secrets/package-lock.json b/sdk/keyvault/azure_security_keyvault_secrets/package-lock.json new file mode 100644 index 0000000000..6e341ecfd0 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "azure_security_keyvault_secrets", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs new file mode 100644 index 0000000000..b1ad118204 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + BearerTokenCredentialPolicy, ClientMethodOptions, ClientOptions, Context, Method, Pager, Pipeline, Policy, Request, RequestContent, Response, Result, Url, +}; +use azure_core::credentials::TokenCredential; +use crate::models::{ + BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, +}; +use std::sync::Arc; +use typespec_client_core::json; +use typespec_client_core::http::PagerResult; + +pub struct KeyVaultClient { + api_version: String, + endpoint: Url, + pipeline: Pipeline, +} + +#[derive(Clone, Debug)] +pub struct KeyVaultClientOptions { + pub api_version: String, + pub client_options: ClientOptions, +} + +impl KeyVaultClient { + pub fn new(endpoint: &str, credential: Arc, options: Option) -> Result { + let options = options.unwrap_or_default(); + let mut endpoint = Url::parse(endpoint)?; + endpoint.set_query(None); + let auth_policy: Arc = Arc::new(BearerTokenCredentialPolicy::new(credential, vec!["https://vault.azure.net/.default"])); + Ok(Self { + endpoint, + api_version: options.api_version, + pipeline: Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options.client_options, + Vec::default(), + vec![auth_policy], + ), + }) + } + + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// Backs up the specified secret. +/// +/// Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. +/// This operation requires the secrets/backup permission. + pub async fn backup_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/backup"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Deletes a secret from a specified key vault. +/// +/// The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version +/// of a secret. This operation requires the secrets/delete permission. + pub async fn delete_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Gets the specified deleted secret. +/// +/// The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires +/// the secrets/get permission. + pub async fn get_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Lists deleted secrets for the specified vault. +/// +/// The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This +/// operation requires the secrets/list permission. + pub fn get_deleted_secrets(&self, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + first_url = first_url.join("deletedsecrets")?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: DeletedSecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// Get a specified secret from a given key vault. +/// +/// The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + pub async fn get_secret(&self, secret_name: String, secret_version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/{secret-version}"); + path = path.replace("{secret-name}", &secret_name); + path = path.replace("{secret-version}", &secret_version); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// List all versions of the specified secret. +/// +/// The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations +/// requires the secrets/list permission. + pub fn get_secret_versions(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/versions"); + path = path.replace("{secret-name}", &secret_name); + first_url = first_url.join(&path)?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: SecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// List secrets in a specified key vault. +/// +/// The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes +/// are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list +/// permission. + pub fn get_secrets(&self, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + first_url = first_url.join("secrets")?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: SecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// Permanently deletes the specified secret. +/// +/// The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation +/// can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + pub async fn purge_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Recovers the deleted secret to the latest version. +/// +/// Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. +/// This operation requires the secrets/recover permission. + pub async fn recover_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}/recover"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Restores a backed up secret to a vault. +/// +/// Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + pub async fn restore_secret(&self, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url = url.join("secrets/restore")?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Sets a secret in a specified key vault. +/// +/// The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a +/// new version of that secret. This operation requires the secrets/set permission. + pub async fn set_secret(&self, secret_name: String, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Updates the attributes associated with a specified secret in a given key vault. +/// +/// The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the +/// request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + pub async fn update_secret(&self, secret_name: String, secret_version: String, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/{secret-version}"); + path = path.replace("{secret-name}", &secret_name); + path = path.replace("{secret-version}", &secret_version); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Patch); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +impl Default for KeyVaultClientOptions { + fn default() -> Self { + Self { + api_version: String::from("7.6-preview.1"), + client_options: ClientOptions::default(), + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientBackupSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientDeleteSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientGetDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientGetDeletedSecretsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> KeyVaultClientGetDeletedSecretsOptions<'a> { + pub fn into_owned(self) -> KeyVaultClientGetDeletedSecretsOptions<'static> { + KeyVaultClientGetDeletedSecretsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientGetSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientGetSecretVersionsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> KeyVaultClientGetSecretVersionsOptions<'a> { + pub fn into_owned(self) -> KeyVaultClientGetSecretVersionsOptions<'static> { + KeyVaultClientGetSecretVersionsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientGetSecretsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> KeyVaultClientGetSecretsOptions<'a> { + pub fn into_owned(self) -> KeyVaultClientGetSecretsOptions<'static> { + KeyVaultClientGetSecretsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientPurgeDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientRecoverDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientRestoreSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientSetSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct KeyVaultClientUpdateSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/mod.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/mod.rs new file mode 100644 index 0000000000..12d4881733 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/mod.rs @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod secret_client; diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs new file mode 100644 index 0000000000..50fdfb1a63 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::{ + BearerTokenCredentialPolicy, ClientMethodOptions, ClientOptions, Context, Method, Pager, Pipeline, Policy, Request, RequestContent, Response, Result, Url, +}; +use azure_core::credentials::TokenCredential; +use crate::models::{ + BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, +}; +use std::sync::Arc; +use typespec_client_core::json; +use typespec_client_core::http::PagerResult; + +pub struct SecretClient { + api_version: String, + endpoint: Url, + pipeline: Pipeline, +} + +#[derive(Clone, Debug)] +pub struct SecretClientOptions { + pub api_version: String, + pub client_options: ClientOptions, +} + +impl SecretClient { + pub fn new(endpoint: &str, credential: Arc, options: Option) -> Result { + let options = options.unwrap_or_default(); + let mut endpoint = Url::parse(endpoint)?; + endpoint.set_query(None); + let auth_policy: Arc = Arc::new(BearerTokenCredentialPolicy::new(credential, vec!["https://vault.azure.net/.default"])); + Ok(Self { + endpoint, + api_version: options.api_version, + pipeline: Pipeline::new( + option_env!("CARGO_PKG_NAME"), + option_env!("CARGO_PKG_VERSION"), + options.client_options, + Vec::default(), + vec![auth_policy], + ), + }) + } + + /// Returns the Url associated with this client. + pub fn endpoint(&self) -> &Url { + &self.endpoint + } + + /// Backs up the specified secret. +/// +/// Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. +/// This operation requires the secrets/backup permission. + pub async fn backup_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/backup"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Deletes a secret from a specified key vault. +/// +/// The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version +/// of a secret. This operation requires the secrets/delete permission. + pub async fn delete_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Gets the specified deleted secret. +/// +/// The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires +/// the secrets/get permission. + pub async fn get_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Lists deleted secrets for the specified vault. +/// +/// The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This +/// operation requires the secrets/list permission. + pub fn get_deleted_secrets(&self, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + first_url = first_url.join("deletedsecrets")?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: DeletedSecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// Get a specified secret from a given key vault. +/// +/// The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + pub async fn get_secret(&self, secret_name: String, secret_version: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/{secret-version}"); + path = path.replace("{secret-name}", &secret_name); + path = path.replace("{secret-version}", &secret_version); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// List all versions of the specified secret. +/// +/// The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations +/// requires the secrets/list permission. + pub fn get_secret_versions(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/versions"); + path = path.replace("{secret-name}", &secret_name); + first_url = first_url.join(&path)?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: SecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// List secrets in a specified key vault. +/// +/// The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes +/// are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list +/// permission. + pub fn get_secrets(&self, options: Option>) -> Result> { + let options = options.unwrap_or_default().into_owned(); + let pipeline = self.pipeline.clone(); + let mut first_url = self.endpoint.clone(); + first_url = first_url.join("secrets")?; + first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + if let Some(maxresults) = options.maxresults { + first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + } + Ok(Pager::from_callback(move |next_link: Option| { + let url: Url; + match next_link { + Some(next_link) => { + url = next_link; + }, + None => { + url = first_url.clone(); + }, + }; + let mut request = Request::new(url, Method::Get); + request.insert_header("accept", "application/json"); + let mut ctx = options.method_options.context.clone(); + let pipeline = pipeline.clone(); + async move { + let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let (status, headers, body) = rsp.deconstruct(); + let bytes = body.collect().await?; + let res: SecretListResult = json::from_json(bytes.clone())?; + let rsp = Response::from_bytes(status, headers, bytes); + Ok(match res.next_link { + Some(next_link) => PagerResult::Continue { + response: rsp, + continuation: next_link.parse()?, + }, + None => PagerResult::Complete { + response: rsp, + }, + }) + } + })) + } + + /// Permanently deletes the specified secret. +/// +/// The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation +/// can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + pub async fn purge_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Delete); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Recovers the deleted secret to the latest version. +/// +/// Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. +/// This operation requires the secrets/recover permission. + pub async fn recover_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("deletedsecrets/{secret-name}/recover"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Restores a backed up secret to a vault. +/// +/// Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + pub async fn restore_secret(&self, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + url = url.join("secrets/restore")?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Post); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Sets a secret in a specified key vault. +/// +/// The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a +/// new version of that secret. This operation requires the secrets/set permission. + pub async fn set_secret(&self, secret_name: String, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}"); + path = path.replace("{secret-name}", &secret_name); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Put); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } + + /// Updates the attributes associated with a specified secret in a given key vault. +/// +/// The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the +/// request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + pub async fn update_secret(&self, secret_name: String, secret_version: String, parameters: RequestContent, options: Option>) -> Result> { + let options = options.unwrap_or_default(); + let mut ctx = Context::with_context(&options.method_options.context); + let mut url = self.endpoint.clone(); + let mut path = String::from("secrets/{secret-name}/{secret-version}"); + path = path.replace("{secret-name}", &secret_name); + path = path.replace("{secret-version}", &secret_version); + url = url.join(&path)?; + url.query_pairs_mut().append_pair("api-version", &self.api_version); + let mut request = Request::new(url, Method::Patch); + request.insert_header("accept", "application/json"); + request.insert_header("content-type", "application/json"); + request.set_body(parameters); + self.pipeline.send(&mut ctx, &mut request).await + + } +} + +impl Default for SecretClientOptions { + fn default() -> Self { + Self { + api_version: String::from("7.6-preview.1"), + client_options: ClientOptions::default(), + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct SecretClientBackupSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientDeleteSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientGetDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientGetDeletedSecretsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> SecretClientGetDeletedSecretsOptions<'a> { + pub fn into_owned(self) -> SecretClientGetDeletedSecretsOptions<'static> { + SecretClientGetDeletedSecretsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct SecretClientGetSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientGetSecretVersionsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> SecretClientGetSecretVersionsOptions<'a> { + pub fn into_owned(self) -> SecretClientGetSecretVersionsOptions<'static> { + SecretClientGetSecretVersionsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct SecretClientGetSecretsOptions<'a> { + pub maxresults: Option, + pub method_options: ClientMethodOptions<'a>, +} + +impl<'a> SecretClientGetSecretsOptions<'a> { + pub fn into_owned(self) -> SecretClientGetSecretsOptions<'static> { + SecretClientGetSecretsOptions { + maxresults: self.maxresults, + method_options: ClientMethodOptions { + context: self.method_options.context.into_owned(), + }, + } + } +} + +#[derive(Clone, Debug, Default)] +pub struct SecretClientPurgeDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientRecoverDeletedSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientRestoreSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientSetSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + +#[derive(Clone, Debug, Default)] +pub struct SecretClientUpdateSecretOptions<'a> { + pub method_options: ClientMethodOptions<'a>, +} + + diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs new file mode 100644 index 0000000000..3b8bf31a9f --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use typespec_client_core::{ + create_enum, create_extensible_enum, +}; + +create_extensible_enum!( + DeletionRecoveryLevel, + (CustomizedRecoverable, "CustomizedRecoverable"), + (CustomizedRecoverableProtectedSubscription, "CustomizedRecoverable+ProtectedSubscription"), + (CustomizedRecoverablePurgeable, "CustomizedRecoverable+Purgeable"), + (Purgeable, "Purgeable"), + (Recoverable, "Recoverable"), + (RecoverableProtectedSubscription, "Recoverable+ProtectedSubscription"), + (RecoverablePurgeable, "Recoverable+Purgeable") +); + diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/mod.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/mod.rs new file mode 100644 index 0000000000..e3c9c5fa4a --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/mod.rs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +pub mod clients; +pub mod enums; +pub mod models; +pub mod models_serde; diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs new file mode 100644 index 0000000000..ac6c5c804b --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use azure_core::base64; +use crate::models::DeletionRecoveryLevel; +use serde::{ + Deserialize, Serialize, +}; +use std::collections::HashMap; +use time::OffsetDateTime; + +/// The backup secret result, containing the backup blob. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct BackupSecretResult { +/// The backup blob containing the backed up secret. + #[serde(deserialize_with = "base64::deserialize_url_safe", serialize_with = "base64::serialize_url_safe", skip_serializing_if = "Option::is_none")] + pub value: Option>, + +} + +/// A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct DeletedSecretBundle { +/// The secret management attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub attributes: Option, + +/// The content type of the secret. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// The time when the secret was deleted, in UTC + #[serde(rename = "deletedDate", skip_serializing_if = "Option::is_none")] + pub deleted_date: Option, + +/// The secret id. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + +/// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + #[serde(skip_serializing_if = "Option::is_none")] + pub kid: Option, + +/// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be +/// true. + #[serde(skip_serializing_if = "Option::is_none")] + pub managed: Option, + +/// The url of the recovery object, used to identify and recover the deleted secret. + #[serde(rename = "recoveryId", skip_serializing_if = "Option::is_none")] + pub recovery_id: Option, + +/// The time when the secret is scheduled to be purged, in UTC + #[serde(rename = "scheduledPurgeDate", skip_serializing_if = "Option::is_none")] + pub scheduled_purge_date: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +/// The secret value. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, + +} + +/// The deleted secret item containing metadata about the deleted secret. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct DeletedSecretItem { +/// The secret management attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub attributes: Option, + +/// Type of the secret value such as a password. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// The time when the secret was deleted, in UTC + #[serde(rename = "deletedDate", skip_serializing_if = "Option::is_none")] + pub deleted_date: Option, + +/// Secret identifier. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + +/// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + #[serde(skip_serializing_if = "Option::is_none")] + pub managed: Option, + +/// The url of the recovery object, used to identify and recover the deleted secret. + #[serde(rename = "recoveryId", skip_serializing_if = "Option::is_none")] + pub recovery_id: Option, + +/// The time when the secret is scheduled to be purged, in UTC + #[serde(rename = "scheduledPurgeDate", skip_serializing_if = "Option::is_none")] + pub scheduled_purge_date: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +} + +/// The deleted secret list result +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct DeletedSecretListResult { +/// The URL to get the next set of deleted secrets. + #[serde(rename = "nextLink", skip_serializing_if = "Option::is_none")] + pub next_link: Option, + +/// A response message containing a list of deleted secrets in the key vault along with a link to the next page of deleted +/// secrets. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option>, + +} + +/// The secret management attributes. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretAttributes { +/// Creation time in UTC. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + +/// Determines whether the object is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + +/// Expiry date in UTC. + #[serde(rename = "exp", skip_serializing_if = "Option::is_none")] + pub expires: Option, + +/// Not before date in UTC. + #[serde(rename = "nbf", skip_serializing_if = "Option::is_none")] + pub not_before: Option, + +/// softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. + #[serde(rename = "recoverableDays", skip_serializing_if = "Option::is_none")] + pub recoverable_days: Option, + +/// Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', +/// the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end +/// of the retention interval. + #[serde(rename = "recoveryLevel", skip_serializing_if = "Option::is_none")] + pub recovery_level: Option, + +/// Last updated time in UTC. + #[serde(skip_serializing_if = "Option::is_none")] + pub updated: Option, + +} + +/// A secret consisting of a value, id and its attributes. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretBundle { +/// The secret management attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub attributes: Option, + +/// The content type of the secret. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// The secret id. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + +/// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + #[serde(skip_serializing_if = "Option::is_none")] + pub kid: Option, + +/// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be +/// true. + #[serde(skip_serializing_if = "Option::is_none")] + pub managed: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +/// The secret value. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, + +} + +/// The secret item containing secret metadata. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretItem { +/// The secret management attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub attributes: Option, + +/// Type of the secret value such as a password. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// Secret identifier. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + +/// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + #[serde(skip_serializing_if = "Option::is_none")] + pub managed: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +} + +/// The secret list result. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretListResult { +/// The URL to get the next set of secrets. + #[serde(rename = "nextLink", skip_serializing_if = "Option::is_none")] + pub next_link: Option, + +/// A response message containing a list of secrets in the key vault along with a link to the next page of secrets. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option>, + +} + +/// The secret restore parameters. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretRestoreParameters { +/// The backup blob associated with a secret bundle. + #[serde(rename = "value", deserialize_with = "base64::deserialize_url_safe", serialize_with = "base64::serialize_url_safe", skip_serializing_if = "Option::is_none")] + pub secret_bundle_backup: Option>, + +} + +/// The secret set parameters. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretSetParameters { +/// Type of the secret value such as a password. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// The secret management attributes. + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub secret_attributes: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +/// The value of the secret. + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option, + +} + +/// The secret update parameters. +#[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] +#[non_exhaustive] +pub struct SecretUpdateParameters { +/// Type of the secret value such as a password. + #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] + pub content_type: Option, + +/// The secret management attributes. + #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] + pub secret_attributes: Option, + +/// Application specific metadata in the form of key-value pairs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option>, + +} + diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs new file mode 100644 index 0000000000..25e5f9234e --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +use async_std::task::block_on; +use azure_core::{ + RequestContent, Response, Result, +}; +use crate::models::{ + BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, +}; +use typespec_client_core::json::to_json; + +impl TryFrom> for BackupSecretResult { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_json_body(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for DeletedSecretBundle { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_json_body(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for DeletedSecretListResult { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_json_body(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for SecretBundle { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_json_body(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom> for SecretListResult { + type Error = azure_core::Error; + fn try_from(value: Response) -> Result { + let f = || value.into_json_body(); + let r = block_on(f())?; + Ok(r) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SecretRestoreParameters) -> Result { + RequestContent::try_from(to_json(&value)?) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SecretSetParameters) -> Result { + RequestContent::try_from(to_json(&value)?) + } +} + +impl TryFrom for RequestContent { + type Error = azure_core::Error; + fn try_from(value: SecretUpdateParameters) -> Result { + RequestContent::try_from(to_json(&value)?) + } +} + diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/lib.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/lib.rs new file mode 100644 index 0000000000..29d092be50 --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/lib.rs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. + +mod generated; + +pub use crate::generated::clients::*; + +pub mod models { + pub use crate::generated::enums::*; + pub use crate::generated::models::*; +} + +pub use secret_client::SecretClient; diff --git a/sdk/keyvault/azure_security_keyvault_secrets/tsp-location.yaml b/sdk/keyvault/azure_security_keyvault_secrets/tsp-location.yaml new file mode 100644 index 0000000000..7ffdf3aa7d --- /dev/null +++ b/sdk/keyvault/azure_security_keyvault_secrets/tsp-location.yaml @@ -0,0 +1,3 @@ +directory: specification/keyvault/Security.KeyVault.Secrets +commit: b1caaf5a33601e3333d27069df3e4aceb3b31cef +repo: Azure/azure-rest-api-specs From d41912abb8e05a6c84a2403c4583d62e1517f65a Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 12:42:09 -0800 Subject: [PATCH 02/14] Update eng/emitter-package.json --- eng/emitter-package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/emitter-package.json b/eng/emitter-package.json index ea9dad65cd..9776257e53 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -9,4 +9,4 @@ "@typespec/compiler": "0.63.0", "@typespec/xml": "0.63.0" } -} \ No newline at end of file +} From 6062bdf1a79bfaa698eaaaebcabdd135a281119a Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 12:46:00 -0800 Subject: [PATCH 03/14] Renaming the client --- .../src/generated/clients/key_vault_client.rs | 474 ------------------ 1 file changed, 474 deletions(-) delete mode 100644 sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs deleted file mode 100644 index b1ad118204..0000000000 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/key_vault_client.rs +++ /dev/null @@ -1,474 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. - -use azure_core::{ - BearerTokenCredentialPolicy, ClientMethodOptions, ClientOptions, Context, Method, Pager, Pipeline, Policy, Request, RequestContent, Response, Result, Url, -}; -use azure_core::credentials::TokenCredential; -use crate::models::{ - BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, -}; -use std::sync::Arc; -use typespec_client_core::json; -use typespec_client_core::http::PagerResult; - -pub struct KeyVaultClient { - api_version: String, - endpoint: Url, - pipeline: Pipeline, -} - -#[derive(Clone, Debug)] -pub struct KeyVaultClientOptions { - pub api_version: String, - pub client_options: ClientOptions, -} - -impl KeyVaultClient { - pub fn new(endpoint: &str, credential: Arc, options: Option) -> Result { - let options = options.unwrap_or_default(); - let mut endpoint = Url::parse(endpoint)?; - endpoint.set_query(None); - let auth_policy: Arc = Arc::new(BearerTokenCredentialPolicy::new(credential, vec!["https://vault.azure.net/.default"])); - Ok(Self { - endpoint, - api_version: options.api_version, - pipeline: Pipeline::new( - option_env!("CARGO_PKG_NAME"), - option_env!("CARGO_PKG_VERSION"), - options.client_options, - Vec::default(), - vec![auth_policy], - ), - }) - } - - /// Returns the Url associated with this client. - pub fn endpoint(&self) -> &Url { - &self.endpoint - } - - /// Backs up the specified secret. -/// -/// Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. -/// This operation requires the secrets/backup permission. - pub async fn backup_secret(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}/backup"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Post); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Deletes a secret from a specified key vault. -/// -/// The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version -/// of a secret. This operation requires the secrets/delete permission. - pub async fn delete_secret(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Delete); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Gets the specified deleted secret. -/// -/// The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires -/// the secrets/get permission. - pub async fn get_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("deletedsecrets/{secret-name}"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Get); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Lists deleted secrets for the specified vault. -/// -/// The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This -/// operation requires the secrets/list permission. - pub fn get_deleted_secrets(&self, options: Option>) -> Result> { - let options = options.unwrap_or_default().into_owned(); - let pipeline = self.pipeline.clone(); - let mut first_url = self.endpoint.clone(); - first_url = first_url.join("deletedsecrets")?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); - if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); - } - Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - }, - None => { - url = first_url.clone(); - }, - }; - let mut request = Request::new(url, Method::Get); - request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); - let pipeline = pipeline.clone(); - async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; - let (status, headers, body) = rsp.deconstruct(); - let bytes = body.collect().await?; - let res: DeletedSecretListResult = json::from_json(bytes.clone())?; - let rsp = Response::from_bytes(status, headers, bytes); - Ok(match res.next_link { - Some(next_link) => PagerResult::Continue { - response: rsp, - continuation: next_link.parse()?, - }, - None => PagerResult::Complete { - response: rsp, - }, - }) - } - })) - } - - /// Get a specified secret from a given key vault. -/// -/// The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. - pub async fn get_secret(&self, secret_name: String, secret_version: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}/{secret-version}"); - path = path.replace("{secret-name}", &secret_name); - path = path.replace("{secret-version}", &secret_version); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Get); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// List all versions of the specified secret. -/// -/// The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations -/// requires the secrets/list permission. - pub fn get_secret_versions(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default().into_owned(); - let pipeline = self.pipeline.clone(); - let mut first_url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}/versions"); - path = path.replace("{secret-name}", &secret_name); - first_url = first_url.join(&path)?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); - if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); - } - Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - }, - None => { - url = first_url.clone(); - }, - }; - let mut request = Request::new(url, Method::Get); - request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); - let pipeline = pipeline.clone(); - async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; - let (status, headers, body) = rsp.deconstruct(); - let bytes = body.collect().await?; - let res: SecretListResult = json::from_json(bytes.clone())?; - let rsp = Response::from_bytes(status, headers, bytes); - Ok(match res.next_link { - Some(next_link) => PagerResult::Continue { - response: rsp, - continuation: next_link.parse()?, - }, - None => PagerResult::Complete { - response: rsp, - }, - }) - } - })) - } - - /// List secrets in a specified key vault. -/// -/// The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes -/// are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list -/// permission. - pub fn get_secrets(&self, options: Option>) -> Result> { - let options = options.unwrap_or_default().into_owned(); - let pipeline = self.pipeline.clone(); - let mut first_url = self.endpoint.clone(); - first_url = first_url.join("secrets")?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); - if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); - } - Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - }, - None => { - url = first_url.clone(); - }, - }; - let mut request = Request::new(url, Method::Get); - request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); - let pipeline = pipeline.clone(); - async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; - let (status, headers, body) = rsp.deconstruct(); - let bytes = body.collect().await?; - let res: SecretListResult = json::from_json(bytes.clone())?; - let rsp = Response::from_bytes(status, headers, bytes); - Ok(match res.next_link { - Some(next_link) => PagerResult::Continue { - response: rsp, - continuation: next_link.parse()?, - }, - None => PagerResult::Complete { - response: rsp, - }, - }) - } - })) - } - - /// Permanently deletes the specified secret. -/// -/// The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation -/// can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. - pub async fn purge_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("deletedsecrets/{secret-name}"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Delete); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Recovers the deleted secret to the latest version. -/// -/// Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. -/// This operation requires the secrets/recover permission. - pub async fn recover_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("deletedsecrets/{secret-name}/recover"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Post); - request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Restores a backed up secret to a vault. -/// -/// Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. - pub async fn restore_secret(&self, parameters: RequestContent, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - url = url.join("secrets/restore")?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Post); - request.insert_header("accept", "application/json"); - request.insert_header("content-type", "application/json"); - request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Sets a secret in a specified key vault. -/// -/// The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a -/// new version of that secret. This operation requires the secrets/set permission. - pub async fn set_secret(&self, secret_name: String, parameters: RequestContent, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}"); - path = path.replace("{secret-name}", &secret_name); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Put); - request.insert_header("accept", "application/json"); - request.insert_header("content-type", "application/json"); - request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await - - } - - /// Updates the attributes associated with a specified secret in a given key vault. -/// -/// The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the -/// request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. - pub async fn update_secret(&self, secret_name: String, secret_version: String, parameters: RequestContent, options: Option>) -> Result> { - let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); - let mut url = self.endpoint.clone(); - let mut path = String::from("secrets/{secret-name}/{secret-version}"); - path = path.replace("{secret-name}", &secret_name); - path = path.replace("{secret-version}", &secret_version); - url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); - let mut request = Request::new(url, Method::Patch); - request.insert_header("accept", "application/json"); - request.insert_header("content-type", "application/json"); - request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await - - } -} - -impl Default for KeyVaultClientOptions { - fn default() -> Self { - Self { - api_version: String::from("7.6-preview.1"), - client_options: ClientOptions::default(), - } - } -} - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientBackupSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientDeleteSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientGetDeletedSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientGetDeletedSecretsOptions<'a> { - pub maxresults: Option, - pub method_options: ClientMethodOptions<'a>, -} - -impl<'a> KeyVaultClientGetDeletedSecretsOptions<'a> { - pub fn into_owned(self) -> KeyVaultClientGetDeletedSecretsOptions<'static> { - KeyVaultClientGetDeletedSecretsOptions { - maxresults: self.maxresults, - method_options: ClientMethodOptions { - context: self.method_options.context.into_owned(), - }, - } - } -} - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientGetSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientGetSecretVersionsOptions<'a> { - pub maxresults: Option, - pub method_options: ClientMethodOptions<'a>, -} - -impl<'a> KeyVaultClientGetSecretVersionsOptions<'a> { - pub fn into_owned(self) -> KeyVaultClientGetSecretVersionsOptions<'static> { - KeyVaultClientGetSecretVersionsOptions { - maxresults: self.maxresults, - method_options: ClientMethodOptions { - context: self.method_options.context.into_owned(), - }, - } - } -} - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientGetSecretsOptions<'a> { - pub maxresults: Option, - pub method_options: ClientMethodOptions<'a>, -} - -impl<'a> KeyVaultClientGetSecretsOptions<'a> { - pub fn into_owned(self) -> KeyVaultClientGetSecretsOptions<'static> { - KeyVaultClientGetSecretsOptions { - maxresults: self.maxresults, - method_options: ClientMethodOptions { - context: self.method_options.context.into_owned(), - }, - } - } -} - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientPurgeDeletedSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientRecoverDeletedSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientRestoreSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientSetSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - -#[derive(Clone, Debug, Default)] -pub struct KeyVaultClientUpdateSecretOptions<'a> { - pub method_options: ClientMethodOptions<'a>, -} - - From e51fbc9bb2951527002f6c6615ffd69dfcf591f9 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 12:53:28 -0800 Subject: [PATCH 04/14] By default don't regenerate --- sdk/keyvault/azure_security_keyvault_secrets/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/build.rs b/sdk/keyvault/azure_security_keyvault_secrets/build.rs index b8fa65045e..2cd8fcc222 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/build.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/build.rs @@ -31,7 +31,7 @@ fn main() { }; println!("cargo:rustc-env=AZSDK_RUSTC_VERSION={version}"); - let generate_enabled = env::var("GENERATE_TYPESPEC").unwrap_or("1".to_string()); + let generate_enabled = env::var("GENERATE_TYPESPEC").unwrap_or("0".to_string()); if generate_enabled == "1" { generate_typespec(); From d26c534443fc8bf83cfc7c2fe9cdc318666690c4 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 13:00:50 -0800 Subject: [PATCH 05/14] Cargo format all the files --- .../src/generated/clients/secret_client.rs | 266 +++++++++++------- .../src/generated/enums.rs | 20 +- .../src/generated/models.rs | 141 +++++----- .../src/generated/models_serde.rs | 10 +- 4 files changed, 246 insertions(+), 191 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs index 50fdfb1a63..81f865a2ad 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs @@ -3,16 +3,18 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use azure_core::{ - BearerTokenCredentialPolicy, ClientMethodOptions, ClientOptions, Context, Method, Pager, Pipeline, Policy, Request, RequestContent, Response, Result, Url, +use crate::models::{ + BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, + SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, }; use azure_core::credentials::TokenCredential; -use crate::models::{ - BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, +use azure_core::{ + BearerTokenCredentialPolicy, ClientMethodOptions, ClientOptions, Context, Method, Pager, + Pipeline, Policy, Request, RequestContent, Response, Result, Url, }; use std::sync::Arc; -use typespec_client_core::json; use typespec_client_core::http::PagerResult; +use typespec_client_core::json; pub struct SecretClient { api_version: String, @@ -27,11 +29,18 @@ pub struct SecretClientOptions { } impl SecretClient { - pub fn new(endpoint: &str, credential: Arc, options: Option) -> Result { - let options = options.unwrap_or_default(); + pub fn new( + endpoint: &str, + credential: Arc, + options: Option, + ) -> Result { + let options = options.unwrap_or_default(); let mut endpoint = Url::parse(endpoint)?; endpoint.set_query(None); - let auth_policy: Arc = Arc::new(BearerTokenCredentialPolicy::new(credential, vec!["https://vault.azure.net/.default"])); + let auth_policy: Arc = Arc::new(BearerTokenCredentialPolicy::new( + credential, + vec!["https://vault.azure.net/.default"], + )); Ok(Self { endpoint, api_version: options.api_version, @@ -51,88 +60,108 @@ impl SecretClient { } /// Backs up the specified secret. -/// -/// Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. -/// This operation requires the secrets/backup permission. - pub async fn backup_secret(&self, secret_name: String, options: Option>) -> Result> { + /// + /// Requests that a backup of the specified secret be downloaded to the client. All versions of the secret will be downloaded. + /// This operation requires the secrets/backup permission. + pub async fn backup_secret( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}/backup"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Post); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// Deletes a secret from a specified key vault. -/// -/// The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version -/// of a secret. This operation requires the secrets/delete permission. - pub async fn delete_secret(&self, secret_name: String, options: Option>) -> Result> { + /// + /// The DELETE operation applies to any secret stored in Azure Key Vault. DELETE cannot be applied to an individual version + /// of a secret. This operation requires the secrets/delete permission. + pub async fn delete_secret( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Delete); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// Gets the specified deleted secret. -/// -/// The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires -/// the secrets/get permission. - pub async fn get_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + /// + /// The Get Deleted Secret operation returns the specified deleted secret along with its attributes. This operation requires + /// the secrets/get permission. + pub async fn get_deleted_secret( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// Lists deleted secrets for the specified vault. -/// -/// The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This -/// operation requires the secrets/list permission. - pub fn get_deleted_secrets(&self, options: Option>) -> Result> { + /// + /// The Get Deleted Secrets operation returns the secrets that have been deleted for a vault enabled for soft-delete. This + /// operation requires the secrets/list permission. + pub fn get_deleted_secrets( + &self, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default().into_owned(); let pipeline = self.pipeline.clone(); let mut first_url = self.endpoint.clone(); first_url = first_url.join("deletedsecrets")?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + first_url + .query_pairs_mut() + .append_pair("api-version", &self.api_version); if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + first_url + .query_pairs_mut() + .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { let url: Url; match next_link { Some(next_link) => { url = next_link; - }, + } None => { url = first_url.clone(); - }, + } }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); let mut ctx = options.method_options.context.clone(); let pipeline = pipeline.clone(); async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let rsp: Response = + pipeline.send(&mut ctx, &mut request).await?; let (status, headers, body) = rsp.deconstruct(); let bytes = body.collect().await?; let res: DeletedSecretListResult = json::from_json(bytes.clone())?; @@ -142,18 +171,21 @@ impl SecretClient { response: rsp, continuation: next_link.parse()?, }, - None => PagerResult::Complete { - response: rsp, - }, + None => PagerResult::Complete { response: rsp }, }) } })) } /// Get a specified secret from a given key vault. -/// -/// The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. - pub async fn get_secret(&self, secret_name: String, secret_version: String, options: Option>) -> Result> { + /// + /// The GET operation is applicable to any secret stored in Azure Key Vault. This operation requires the secrets/get permission. + pub async fn get_secret( + &self, + secret_name: String, + secret_version: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); @@ -161,37 +193,45 @@ impl SecretClient { path = path.replace("{secret-name}", &secret_name); path = path.replace("{secret-version}", &secret_version); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// List all versions of the specified secret. -/// -/// The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations -/// requires the secrets/list permission. - pub fn get_secret_versions(&self, secret_name: String, options: Option>) -> Result> { + /// + /// The full secret identifier and attributes are provided in the response. No values are returned for the secrets. This operations + /// requires the secrets/list permission. + pub fn get_secret_versions( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default().into_owned(); let pipeline = self.pipeline.clone(); let mut first_url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}/versions"); path = path.replace("{secret-name}", &secret_name); first_url = first_url.join(&path)?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + first_url + .query_pairs_mut() + .append_pair("api-version", &self.api_version); if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + first_url + .query_pairs_mut() + .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { let url: Url; match next_link { Some(next_link) => { url = next_link; - }, + } None => { url = first_url.clone(); - }, + } }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); @@ -208,37 +248,42 @@ impl SecretClient { response: rsp, continuation: next_link.parse()?, }, - None => PagerResult::Complete { - response: rsp, - }, + None => PagerResult::Complete { response: rsp }, }) } })) } /// List secrets in a specified key vault. -/// -/// The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes -/// are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list -/// permission. - pub fn get_secrets(&self, options: Option>) -> Result> { + /// + /// The Get Secrets operation is applicable to the entire vault. However, only the base secret identifier and its attributes + /// are provided in the response. Individual secret versions are not listed in the response. This operation requires the secrets/list + /// permission. + pub fn get_secrets( + &self, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default().into_owned(); let pipeline = self.pipeline.clone(); let mut first_url = self.endpoint.clone(); first_url = first_url.join("secrets")?; - first_url.query_pairs_mut().append_pair("api-version", &self.api_version); + first_url + .query_pairs_mut() + .append_pair("api-version", &self.api_version); if let Some(maxresults) = options.maxresults { - first_url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string()); + first_url + .query_pairs_mut() + .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { let url: Url; match next_link { Some(next_link) => { url = next_link; - }, + } None => { url = first_url.clone(); - }, + } }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); @@ -255,92 +300,113 @@ impl SecretClient { response: rsp, continuation: next_link.parse()?, }, - None => PagerResult::Complete { - response: rsp, - }, + None => PagerResult::Complete { response: rsp }, }) } })) } /// Permanently deletes the specified secret. -/// -/// The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation -/// can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. - pub async fn purge_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + /// + /// The purge deleted secret operation removes the secret permanently, without the possibility of recovery. This operation + /// can only be enabled on a soft-delete enabled vault. This operation requires the secrets/purge permission. + pub async fn purge_deleted_secret( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Delete); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// Recovers the deleted secret to the latest version. -/// -/// Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. -/// This operation requires the secrets/recover permission. - pub async fn recover_deleted_secret(&self, secret_name: String, options: Option>) -> Result> { + /// + /// Recovers the deleted secret in the specified vault. This operation can only be performed on a soft-delete enabled vault. + /// This operation requires the secrets/recover permission. + pub async fn recover_deleted_secret( + &self, + secret_name: String, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}/recover"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Post); request.insert_header("accept", "application/json"); self.pipeline.send(&mut ctx, &mut request).await - } /// Restores a backed up secret to a vault. -/// -/// Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. - pub async fn restore_secret(&self, parameters: RequestContent, options: Option>) -> Result> { + /// + /// Restores a backed up secret, and all its versions, to a vault. This operation requires the secrets/restore permission. + pub async fn restore_secret( + &self, + parameters: RequestContent, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); url = url.join("secrets/restore")?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Post); request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); self.pipeline.send(&mut ctx, &mut request).await - } /// Sets a secret in a specified key vault. -/// -/// The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a -/// new version of that secret. This operation requires the secrets/set permission. - pub async fn set_secret(&self, secret_name: String, parameters: RequestContent, options: Option>) -> Result> { + /// + /// The SET operation adds a secret to the Azure Key Vault. If the named secret already exists, Azure Key Vault creates a + /// new version of that secret. This operation requires the secrets/set permission. + pub async fn set_secret( + &self, + secret_name: String, + parameters: RequestContent, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Put); request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); self.pipeline.send(&mut ctx, &mut request).await - } /// Updates the attributes associated with a specified secret in a given key vault. -/// -/// The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the -/// request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. - pub async fn update_secret(&self, secret_name: String, secret_version: String, parameters: RequestContent, options: Option>) -> Result> { + /// + /// The UPDATE operation changes specified attributes of an existing stored secret. Attributes that are not specified in the + /// request are left unchanged. The value of a secret itself cannot be changed. This operation requires the secrets/set permission. + pub async fn update_secret( + &self, + secret_name: String, + secret_version: String, + parameters: RequestContent, + options: Option>, + ) -> Result> { let options = options.unwrap_or_default(); let mut ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); @@ -348,13 +414,13 @@ impl SecretClient { path = path.replace("{secret-name}", &secret_name); path = path.replace("{secret-version}", &secret_version); url = url.join(&path)?; - url.query_pairs_mut().append_pair("api-version", &self.api_version); + url.query_pairs_mut() + .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Patch); request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); self.pipeline.send(&mut ctx, &mut request).await - } } @@ -372,19 +438,16 @@ pub struct SecretClientBackupSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientDeleteSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientGetDeletedSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientGetDeletedSecretsOptions<'a> { pub maxresults: Option, @@ -407,7 +470,6 @@ pub struct SecretClientGetSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientGetSecretVersionsOptions<'a> { pub maxresults: Option, @@ -447,28 +509,22 @@ pub struct SecretClientPurgeDeletedSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientRecoverDeletedSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientRestoreSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientSetSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - #[derive(Clone, Debug, Default)] pub struct SecretClientUpdateSecretOptions<'a> { pub method_options: ClientMethodOptions<'a>, } - - diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs index 3b8bf31a9f..b63267c853 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs @@ -3,18 +3,24 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use typespec_client_core::{ - create_enum, create_extensible_enum, -}; +use typespec_client_core::{create_enum, create_extensible_enum}; create_extensible_enum!( DeletionRecoveryLevel, (CustomizedRecoverable, "CustomizedRecoverable"), - (CustomizedRecoverableProtectedSubscription, "CustomizedRecoverable+ProtectedSubscription"), - (CustomizedRecoverablePurgeable, "CustomizedRecoverable+Purgeable"), + ( + CustomizedRecoverableProtectedSubscription, + "CustomizedRecoverable+ProtectedSubscription" + ), + ( + CustomizedRecoverablePurgeable, + "CustomizedRecoverable+Purgeable" + ), (Purgeable, "Purgeable"), (Recoverable, "Recoverable"), - (RecoverableProtectedSubscription, "Recoverable+ProtectedSubscription"), + ( + RecoverableProtectedSubscription, + "Recoverable+ProtectedSubscription" + ), (RecoverablePurgeable, "Recoverable+Purgeable") ); - diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs index ac6c5c804b..52ddd28131 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs @@ -3,11 +3,9 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use azure_core::base64; use crate::models::DeletionRecoveryLevel; -use serde::{ - Deserialize, Serialize, -}; +use azure_core::base64; +use serde::{Deserialize, Serialize}; use std::collections::HashMap; use time::OffsetDateTime; @@ -15,270 +13,267 @@ use time::OffsetDateTime; #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct BackupSecretResult { -/// The backup blob containing the backed up secret. - #[serde(deserialize_with = "base64::deserialize_url_safe", serialize_with = "base64::serialize_url_safe", skip_serializing_if = "Option::is_none")] + /// The backup blob containing the backed up secret. + #[serde( + deserialize_with = "base64::deserialize_url_safe", + serialize_with = "base64::serialize_url_safe", + skip_serializing_if = "Option::is_none" + )] pub value: Option>, - } /// A Deleted Secret consisting of its previous id, attributes and its tags, as well as information on when it will be purged. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct DeletedSecretBundle { -/// The secret management attributes. + /// The secret management attributes. #[serde(skip_serializing_if = "Option::is_none")] pub attributes: Option, -/// The content type of the secret. + /// The content type of the secret. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// The time when the secret was deleted, in UTC + /// The time when the secret was deleted, in UTC #[serde(rename = "deletedDate", skip_serializing_if = "Option::is_none")] pub deleted_date: Option, -/// The secret id. + /// The secret id. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, -/// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + /// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. #[serde(skip_serializing_if = "Option::is_none")] pub kid: Option, -/// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be -/// true. + /// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be + /// true. #[serde(skip_serializing_if = "Option::is_none")] pub managed: Option, -/// The url of the recovery object, used to identify and recover the deleted secret. + /// The url of the recovery object, used to identify and recover the deleted secret. #[serde(rename = "recoveryId", skip_serializing_if = "Option::is_none")] pub recovery_id: Option, -/// The time when the secret is scheduled to be purged, in UTC + /// The time when the secret is scheduled to be purged, in UTC #[serde(rename = "scheduledPurgeDate", skip_serializing_if = "Option::is_none")] pub scheduled_purge_date: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, -/// The secret value. + /// The secret value. #[serde(skip_serializing_if = "Option::is_none")] pub value: Option, - } /// The deleted secret item containing metadata about the deleted secret. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct DeletedSecretItem { -/// The secret management attributes. + /// The secret management attributes. #[serde(skip_serializing_if = "Option::is_none")] pub attributes: Option, -/// Type of the secret value such as a password. + /// Type of the secret value such as a password. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// The time when the secret was deleted, in UTC + /// The time when the secret was deleted, in UTC #[serde(rename = "deletedDate", skip_serializing_if = "Option::is_none")] pub deleted_date: Option, -/// Secret identifier. + /// Secret identifier. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, -/// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + /// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. #[serde(skip_serializing_if = "Option::is_none")] pub managed: Option, -/// The url of the recovery object, used to identify and recover the deleted secret. + /// The url of the recovery object, used to identify and recover the deleted secret. #[serde(rename = "recoveryId", skip_serializing_if = "Option::is_none")] pub recovery_id: Option, -/// The time when the secret is scheduled to be purged, in UTC + /// The time when the secret is scheduled to be purged, in UTC #[serde(rename = "scheduledPurgeDate", skip_serializing_if = "Option::is_none")] pub scheduled_purge_date: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, - } /// The deleted secret list result #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct DeletedSecretListResult { -/// The URL to get the next set of deleted secrets. + /// The URL to get the next set of deleted secrets. #[serde(rename = "nextLink", skip_serializing_if = "Option::is_none")] pub next_link: Option, -/// A response message containing a list of deleted secrets in the key vault along with a link to the next page of deleted -/// secrets. + /// A response message containing a list of deleted secrets in the key vault along with a link to the next page of deleted + /// secrets. #[serde(skip_serializing_if = "Option::is_none")] pub value: Option>, - } /// The secret management attributes. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretAttributes { -/// Creation time in UTC. + /// Creation time in UTC. #[serde(skip_serializing_if = "Option::is_none")] pub created: Option, -/// Determines whether the object is enabled. + /// Determines whether the object is enabled. #[serde(skip_serializing_if = "Option::is_none")] pub enabled: Option, -/// Expiry date in UTC. + /// Expiry date in UTC. #[serde(rename = "exp", skip_serializing_if = "Option::is_none")] pub expires: Option, -/// Not before date in UTC. + /// Not before date in UTC. #[serde(rename = "nbf", skip_serializing_if = "Option::is_none")] pub not_before: Option, -/// softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. + /// softDelete data retention days. Value should be >=7 and <=90 when softDelete enabled, otherwise 0. #[serde(rename = "recoverableDays", skip_serializing_if = "Option::is_none")] pub recoverable_days: Option, -/// Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', -/// the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end -/// of the retention interval. + /// Reflects the deletion recovery level currently in effect for secrets in the current vault. If it contains 'Purgeable', + /// the secret can be permanently deleted by a privileged user; otherwise, only the system can purge the secret, at the end + /// of the retention interval. #[serde(rename = "recoveryLevel", skip_serializing_if = "Option::is_none")] pub recovery_level: Option, -/// Last updated time in UTC. + /// Last updated time in UTC. #[serde(skip_serializing_if = "Option::is_none")] pub updated: Option, - } /// A secret consisting of a value, id and its attributes. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretBundle { -/// The secret management attributes. + /// The secret management attributes. #[serde(skip_serializing_if = "Option::is_none")] pub attributes: Option, -/// The content type of the secret. + /// The content type of the secret. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// The secret id. + /// The secret id. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, -/// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. + /// If this is a secret backing a KV certificate, then this field specifies the corresponding key backing the KV certificate. #[serde(skip_serializing_if = "Option::is_none")] pub kid: Option, -/// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be -/// true. + /// True if the secret's lifetime is managed by key vault. If this is a secret backing a certificate, then managed will be + /// true. #[serde(skip_serializing_if = "Option::is_none")] pub managed: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, -/// The secret value. + /// The secret value. #[serde(skip_serializing_if = "Option::is_none")] pub value: Option, - } /// The secret item containing secret metadata. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretItem { -/// The secret management attributes. + /// The secret management attributes. #[serde(skip_serializing_if = "Option::is_none")] pub attributes: Option, -/// Type of the secret value such as a password. + /// Type of the secret value such as a password. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// Secret identifier. + /// Secret identifier. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option, -/// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. + /// True if the secret's lifetime is managed by key vault. If this is a key backing a certificate, then managed will be true. #[serde(skip_serializing_if = "Option::is_none")] pub managed: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, - } /// The secret list result. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretListResult { -/// The URL to get the next set of secrets. + /// The URL to get the next set of secrets. #[serde(rename = "nextLink", skip_serializing_if = "Option::is_none")] pub next_link: Option, -/// A response message containing a list of secrets in the key vault along with a link to the next page of secrets. + /// A response message containing a list of secrets in the key vault along with a link to the next page of secrets. #[serde(skip_serializing_if = "Option::is_none")] pub value: Option>, - } /// The secret restore parameters. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretRestoreParameters { -/// The backup blob associated with a secret bundle. - #[serde(rename = "value", deserialize_with = "base64::deserialize_url_safe", serialize_with = "base64::serialize_url_safe", skip_serializing_if = "Option::is_none")] + /// The backup blob associated with a secret bundle. + #[serde( + rename = "value", + deserialize_with = "base64::deserialize_url_safe", + serialize_with = "base64::serialize_url_safe", + skip_serializing_if = "Option::is_none" + )] pub secret_bundle_backup: Option>, - } /// The secret set parameters. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretSetParameters { -/// Type of the secret value such as a password. + /// Type of the secret value such as a password. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// The secret management attributes. + /// The secret management attributes. #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] pub secret_attributes: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, -/// The value of the secret. + /// The value of the secret. #[serde(skip_serializing_if = "Option::is_none")] pub value: Option, - } /// The secret update parameters. #[derive(Clone, Debug, Default, Deserialize, Serialize, azure_core::Model)] #[non_exhaustive] pub struct SecretUpdateParameters { -/// Type of the secret value such as a password. + /// Type of the secret value such as a password. #[serde(rename = "contentType", skip_serializing_if = "Option::is_none")] pub content_type: Option, -/// The secret management attributes. + /// The secret management attributes. #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] pub secret_attributes: Option, -/// Application specific metadata in the form of key-value pairs. + /// Application specific metadata in the form of key-value pairs. #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, - } - diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 25e5f9234e..0717ea07ff 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -3,13 +3,12 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. -use async_std::task::block_on; -use azure_core::{ - RequestContent, Response, Result, -}; use crate::models::{ - BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, + BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, + SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, }; +use async_std::task::block_on; +use azure_core::{RequestContent, Response, Result}; use typespec_client_core::json::to_json; impl TryFrom> for BackupSecretResult { @@ -77,4 +76,3 @@ impl TryFrom for RequestContent RequestContent::try_from(to_json(&value)?) } } - From 0e694e4266c040da9a2877133d5de6227d881355 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 13:14:08 -0800 Subject: [PATCH 06/14] Clippy fixes --- .../azure_security_keyvault_secrets/build.rs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/build.rs b/sdk/keyvault/azure_security_keyvault_secrets/build.rs index 2cd8fcc222..c39eae89c7 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/build.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/build.rs @@ -10,7 +10,28 @@ fn generate_typespec() { println!("Generating typespec..."); let output = Command::new("tsp-client.cmd") - .args(&["update"]) + .args(["update"]) + //.stdout(Stdio::piped()) + .output() + .unwrap(); + + println!("status: {}", output.status); + io::stdout().write_all(&output.stdout).unwrap(); + io::stderr().write_all(&output.stderr).unwrap(); + + assert!(output.status.success()); + + println!("Generating typespec Completed."); +} + +fn cargo_fmt() { + println!("Run cargo fmt on generated files..."); + + let output = Command::new("cargo") + .args(["+stable"]) + .args(["fmt"]) + .args(["--all"]) + .args(["--"]) //.stdout(Stdio::piped()) .output() .unwrap(); @@ -35,5 +56,6 @@ fn main() { if generate_enabled == "1" { generate_typespec(); + cargo_fmt(); } } From 7e8d16fb2353d72956056206be0014d33234bff2 Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 14:10:53 -0800 Subject: [PATCH 07/14] Add cspell words --- .../src/generated/clients/secret_client.rs | 2 ++ .../azure_security_keyvault_secrets/src/generated/enums.rs | 2 ++ .../azure_security_keyvault_secrets/src/generated/models.rs | 2 ++ 3 files changed, 6 insertions(+) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs index 81f865a2ad..6da0c1859a 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs @@ -3,6 +3,8 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. +//cspell: words deletedsecrets maxresults + use crate::models::{ BackupSecretResult, DeletedSecretBundle, DeletedSecretListResult, SecretBundle, SecretListResult, SecretRestoreParameters, SecretSetParameters, SecretUpdateParameters, diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs index b63267c853..69653bd61a 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/enums.rs @@ -3,6 +3,8 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. +//cspell: words Purgeable + use typespec_client_core::{create_enum, create_extensible_enum}; create_extensible_enum!( diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs index 52ddd28131..ef9b69e7cd 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models.rs @@ -3,6 +3,8 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT. +//cspell: words Purgeable + use crate::models::DeletionRecoveryLevel; use azure_core::base64; use serde::{Deserialize, Serialize}; From f7ef74a5423a9eacee3db398d297e00e507c9bab Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 15:23:31 -0800 Subject: [PATCH 08/14] Update to latest emitter --- eng/emitter-package-lock.json | 8 +- eng/emitter-package.json | 4 +- .../src/generated/clients/secret_client.rs | 81 ++++++++----------- 3 files changed, 39 insertions(+), 54 deletions(-) diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index f03dd846b8..0c3f4b6e03 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,7 +5,7 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-rust": "0.5.0" + "@azure-tools/typespec-rust": "0.5.1" }, "devDependencies": { "@azure-tools/typespec-azure-rulesets": "0.49.0", @@ -148,9 +148,9 @@ } }, "node_modules/@azure-tools/typespec-rust": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.5.0.tgz", - "integrity": "sha512-fvWKOoprUiorvTLhhAqvyg/GrQCQUIYA7hpZrY/Blhf9JudDafPcnDuqBvy9QXg+g74b1ax4i62SPHPq4FYY3A==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-rust/-/typespec-rust-0.5.1.tgz", + "integrity": "sha512-9QRHW6m64mdIF5avx9Ud+61HZEc5jLM+DFLzddsxctRZWo+KK3V5F63v4BEwdStT0QnqxXiU3iaOxyYBLwiTWA==", "license": "MIT", "dependencies": { "@azure-tools/codegen": "~2.9.2", diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 9776257e53..8fb0463de1 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,7 +1,7 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-rust": "0.5.0" + "@azure-tools/typespec-rust": "0.5.1" }, "devDependencies": { "@azure-tools/typespec-client-generator-core": "0.49.0", @@ -9,4 +9,4 @@ "@typespec/compiler": "0.63.0", "@typespec/xml": "0.63.0" } -} +} \ No newline at end of file diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs index 6da0c1859a..1c3f423105 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs @@ -71,7 +71,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}/backup"); path = path.replace("{secret-name}", &secret_name); @@ -80,7 +80,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Post); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Deletes a secret from a specified key vault. @@ -93,7 +93,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); @@ -102,7 +102,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Delete); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Gets the specified deleted secret. @@ -115,7 +115,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); @@ -124,7 +124,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Lists deleted secrets for the specified vault. @@ -148,22 +148,17 @@ impl SecretClient { .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - } - None => { - url = first_url.clone(); - } + let url = match next_link { + Some(next_link) => next_link, + None => first_url.clone(), }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); + let ctx = options.method_options.context.clone(); let pipeline = pipeline.clone(); async move { let rsp: Response = - pipeline.send(&mut ctx, &mut request).await?; + pipeline.send(&ctx, &mut request).await?; let (status, headers, body) = rsp.deconstruct(); let bytes = body.collect().await?; let res: DeletedSecretListResult = json::from_json(bytes.clone())?; @@ -189,7 +184,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}/{secret-version}"); path = path.replace("{secret-name}", &secret_name); @@ -199,7 +194,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// List all versions of the specified secret. @@ -226,21 +221,16 @@ impl SecretClient { .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - } - None => { - url = first_url.clone(); - } + let url = match next_link { + Some(next_link) => next_link, + None => first_url.clone(), }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); + let ctx = options.method_options.context.clone(); let pipeline = pipeline.clone(); async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let rsp: Response = pipeline.send(&ctx, &mut request).await?; let (status, headers, body) = rsp.deconstruct(); let bytes = body.collect().await?; let res: SecretListResult = json::from_json(bytes.clone())?; @@ -278,21 +268,16 @@ impl SecretClient { .append_pair("maxresults", &maxresults.to_string()); } Ok(Pager::from_callback(move |next_link: Option| { - let url: Url; - match next_link { - Some(next_link) => { - url = next_link; - } - None => { - url = first_url.clone(); - } + let url = match next_link { + Some(next_link) => next_link, + None => first_url.clone(), }; let mut request = Request::new(url, Method::Get); request.insert_header("accept", "application/json"); - let mut ctx = options.method_options.context.clone(); + let ctx = options.method_options.context.clone(); let pipeline = pipeline.clone(); async move { - let rsp: Response = pipeline.send(&mut ctx, &mut request).await?; + let rsp: Response = pipeline.send(&ctx, &mut request).await?; let (status, headers, body) = rsp.deconstruct(); let bytes = body.collect().await?; let res: SecretListResult = json::from_json(bytes.clone())?; @@ -318,7 +303,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); @@ -327,7 +312,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Delete); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Recovers the deleted secret to the latest version. @@ -340,7 +325,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("deletedsecrets/{secret-name}/recover"); path = path.replace("{secret-name}", &secret_name); @@ -349,7 +334,7 @@ impl SecretClient { .append_pair("api-version", &self.api_version); let mut request = Request::new(url, Method::Post); request.insert_header("accept", "application/json"); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Restores a backed up secret to a vault. @@ -361,7 +346,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); url = url.join("secrets/restore")?; url.query_pairs_mut() @@ -370,7 +355,7 @@ impl SecretClient { request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Sets a secret in a specified key vault. @@ -384,7 +369,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}"); path = path.replace("{secret-name}", &secret_name); @@ -395,7 +380,7 @@ impl SecretClient { request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } /// Updates the attributes associated with a specified secret in a given key vault. @@ -410,7 +395,7 @@ impl SecretClient { options: Option>, ) -> Result> { let options = options.unwrap_or_default(); - let mut ctx = Context::with_context(&options.method_options.context); + let ctx = Context::with_context(&options.method_options.context); let mut url = self.endpoint.clone(); let mut path = String::from("secrets/{secret-name}/{secret-version}"); path = path.replace("{secret-name}", &secret_name); @@ -422,7 +407,7 @@ impl SecretClient { request.insert_header("accept", "application/json"); request.insert_header("content-type", "application/json"); request.set_body(parameters); - self.pipeline.send(&mut ctx, &mut request).await + self.pipeline.send(&ctx, &mut request).await } } From 6d3bc378478f68e50d29591bc0f6e39c4e5d2e4c Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 15:40:28 -0800 Subject: [PATCH 09/14] Ignore lifetime --- .../src/generated/clients/secret_client.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs index 1c3f423105..9d78e84abf 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/clients/secret_client.rs @@ -441,6 +441,7 @@ pub struct SecretClientGetDeletedSecretsOptions<'a> { pub method_options: ClientMethodOptions<'a>, } +#[allow(clippy::needless_lifetimes)] impl<'a> SecretClientGetDeletedSecretsOptions<'a> { pub fn into_owned(self) -> SecretClientGetDeletedSecretsOptions<'static> { SecretClientGetDeletedSecretsOptions { @@ -463,6 +464,7 @@ pub struct SecretClientGetSecretVersionsOptions<'a> { pub method_options: ClientMethodOptions<'a>, } +#[allow(clippy::needless_lifetimes)] impl<'a> SecretClientGetSecretVersionsOptions<'a> { pub fn into_owned(self) -> SecretClientGetSecretVersionsOptions<'static> { SecretClientGetSecretVersionsOptions { @@ -480,6 +482,7 @@ pub struct SecretClientGetSecretsOptions<'a> { pub method_options: ClientMethodOptions<'a>, } +#[allow(clippy::needless_lifetimes)] impl<'a> SecretClientGetSecretsOptions<'a> { pub fn into_owned(self) -> SecretClientGetSecretsOptions<'static> { SecretClientGetSecretsOptions { From 13ba49e4a74c4705c876d8d0e79abc869a80724a Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 16:12:51 -0800 Subject: [PATCH 10/14] Unwrap the result --- .../src/generated/models_serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 0717ea07ff..561932b638 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -15,7 +15,7 @@ impl TryFrom> for BackupSecretResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap(); Ok(r) } } @@ -24,7 +24,7 @@ impl TryFrom> for DeletedSecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap(); Ok(r) } } @@ -33,7 +33,7 @@ impl TryFrom> for DeletedSecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap(); Ok(r) } } @@ -42,7 +42,7 @@ impl TryFrom> for SecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap(); Ok(r) } } @@ -51,7 +51,7 @@ impl TryFrom> for SecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap(); Ok(r) } } From 63826a89baa2fbcc074ba95d838f6a8f9681d54f Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Thu, 19 Dec 2024 16:26:05 -0800 Subject: [PATCH 11/14] Revert the unwrap change --- .../src/generated/models_serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 561932b638..0717ea07ff 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -15,7 +15,7 @@ impl TryFrom> for BackupSecretResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f()).unwrap(); + let r = block_on(f())?; Ok(r) } } @@ -24,7 +24,7 @@ impl TryFrom> for DeletedSecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f()).unwrap(); + let r = block_on(f())?; Ok(r) } } @@ -33,7 +33,7 @@ impl TryFrom> for DeletedSecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f()).unwrap(); + let r = block_on(f())?; Ok(r) } } @@ -42,7 +42,7 @@ impl TryFrom> for SecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f()).unwrap(); + let r = block_on(f())?; Ok(r) } } @@ -51,7 +51,7 @@ impl TryFrom> for SecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_json_body(); - let r = block_on(f()).unwrap(); + let r = block_on(f())?; Ok(r) } } From 6bab0f93bd74fa299fa794edfba1099b8aebf3ae Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Fri, 20 Dec 2024 09:01:39 -0800 Subject: [PATCH 12/14] Convert to body --- .../src/generated/models_serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 0717ea07ff..23f84b4dd0 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -14,7 +14,7 @@ use typespec_client_core::json::to_json; impl TryFrom> for BackupSecretResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { - let f = || value.into_json_body(); + let f = || value.into_body(); let r = block_on(f())?; Ok(r) } @@ -23,7 +23,7 @@ impl TryFrom> for BackupSecretResult { impl TryFrom> for DeletedSecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { - let f = || value.into_json_body(); + let f = || value.into_body(); let r = block_on(f())?; Ok(r) } @@ -32,7 +32,7 @@ impl TryFrom> for DeletedSecretBundle { impl TryFrom> for DeletedSecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { - let f = || value.into_json_body(); + let f = || value.into_body(); let r = block_on(f())?; Ok(r) } @@ -41,7 +41,7 @@ impl TryFrom> for DeletedSecretListResult { impl TryFrom> for SecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { - let f = || value.into_json_body(); + let f = || value.into_body(); let r = block_on(f())?; Ok(r) } @@ -50,7 +50,7 @@ impl TryFrom> for SecretBundle { impl TryFrom> for SecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { - let f = || value.into_json_body(); + let f = || value.into_body(); let r = block_on(f())?; Ok(r) } From 11926e85d83073ec90e31e92873b84c90dc0fc9e Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Fri, 20 Dec 2024 11:47:52 -0800 Subject: [PATCH 13/14] Unwrap --- .../src/generated/models_serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 23f84b4dd0..05d4435007 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -15,7 +15,7 @@ impl TryFrom> for BackupSecretResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap().into(); Ok(r) } } @@ -24,7 +24,7 @@ impl TryFrom> for DeletedSecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap().into(); Ok(r) } } @@ -33,7 +33,7 @@ impl TryFrom> for DeletedSecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap().into(); Ok(r) } } @@ -42,7 +42,7 @@ impl TryFrom> for SecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap().into(); Ok(r) } } @@ -51,7 +51,7 @@ impl TryFrom> for SecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f())?; + let r = block_on(f()).unwrap().into(); Ok(r) } } From 708e4ed0ceb9d7c5d25b18611fe2cc2d6c95f1dd Mon Sep 17 00:00:00 2001 From: Rick Winter Date: Fri, 20 Dec 2024 12:12:08 -0800 Subject: [PATCH 14/14] Revert unwrap --- .../src/generated/models_serde.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs index 05d4435007..23f84b4dd0 100644 --- a/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs +++ b/sdk/keyvault/azure_security_keyvault_secrets/src/generated/models_serde.rs @@ -15,7 +15,7 @@ impl TryFrom> for BackupSecretResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f()).unwrap().into(); + let r = block_on(f())?; Ok(r) } } @@ -24,7 +24,7 @@ impl TryFrom> for DeletedSecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f()).unwrap().into(); + let r = block_on(f())?; Ok(r) } } @@ -33,7 +33,7 @@ impl TryFrom> for DeletedSecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f()).unwrap().into(); + let r = block_on(f())?; Ok(r) } } @@ -42,7 +42,7 @@ impl TryFrom> for SecretBundle { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f()).unwrap().into(); + let r = block_on(f())?; Ok(r) } } @@ -51,7 +51,7 @@ impl TryFrom> for SecretListResult { type Error = azure_core::Error; fn try_from(value: Response) -> Result { let f = || value.into_body(); - let r = block_on(f()).unwrap().into(); + let r = block_on(f())?; Ok(r) } }