diff --git a/.gitignore b/.gitignore index 831bcc4..33256cf 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /bin !.vscode node_modules -lock.json \ No newline at end of file +lock.json +.pspace \ No newline at end of file diff --git a/.graphql/deployments/mutations.graphql b/.graphql/deployments/mutations.graphql new file mode 100644 index 0000000..ea39e36 --- /dev/null +++ b/.graphql/deployments/mutations.graphql @@ -0,0 +1,26 @@ +mutation CreateDeployment($createDeploymentInput: CreateDeploymentInput!) { + createDeployment(input: $createDeploymentInput) { + deployment { + id + } + } +} + +mutation UpdateDeployment($updateDeploymentInput: UpdateDeploymentInput!) { + updateDeployment(input: $updateDeploymentInput) { + deployment { + id + } + } +} + +mutation DeleteDeploymentMutation( + $deleteDeploymentInput: DeleteDeploymentInput! +) { + deleteDeployment(input: $deleteDeploymentInput) { + deployment { + id + name + } + } +} diff --git a/.graphql/deployments/queries.graphql b/.graphql/deployments/queries.graphql new file mode 100644 index 0000000..cc4bf88 --- /dev/null +++ b/.graphql/deployments/queries.graphql @@ -0,0 +1,187 @@ +query Deployment( + $deploymentId: UUID! + $first: Int + $after: String + $runOrderBy: DeploymentRunOrder + $instanceOrderBy: DeploymentRunInstanceOrder +) { + deployment(id: $deploymentId) { + id + name + dtCreated + dtModified + deploymentSpecs(first: $first, after: $after) { + nodes { + id + endpointUrl + externalApplied + dtCreated + dtInvalid + error + actor { + avatarUrl + fullName + email + } + cluster { + name + fqdn + } + data { + image + containerRegistry + port + command + env { + name + value + } + models { + id + path + } + repositories { + dataset + mountPath + repositories { + url + name + ref + username + password + } + } + resources { + replicas + autoscaling { + enabled + maxReplicas + metrics { + metric + summary + value + } + } + instanceType + } + } + deploymentRuns(first: $first, orderBy: $runOrderBy) { + nodes { + id + availableReplicas + readyReplicas + replicas + dtDeleted + dtModified + dtCreated + deploymentRunInstances(first: $first, orderBy: $instanceOrderBy) { + nodes { + id + externalApplied + dtStarted + dtFinished + dtDeleted + phase + state + stateMessage + } + } + } + } + } + + edges { + cursor + } + + pageInfo { + hasNextPage + } + } + } +} + +query DeploymentList($projectHandle: String!, $first: Int, $after: String) { + deployments(projectId: $projectHandle, first: $first, after: $after) { + nodes { + id + name + deploymentSpecs(first: 10) { + nodes { + deploymentRuns(first: 10) { + nodes { + id + dtDeleted + availableReplicas + readyReplicas + replicas + deploymentRunInstances(first: 10) { + nodes { + id + externalApplied + dtStarted + dtFinished + phase + state + stateMessage + } + } + } + } + data { + image + containerRegistry + port + command + env { + name + value + } + models { + id + path + } + repositories { + dataset + mountPath + repositories { + url + name + ref + username + password + } + } + resources { + replicas + instanceType + autoscaling { + enabled + maxReplicas + metrics { + metric + summary + value + } + } + } + } + id + externalApplied + dtCreated + dtInvalid + error + } + } + dtCreated + } + + edges { + cursor + } + + pageInfo { + hasNextPage + } + } +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 74baffc..03c8098 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,7 @@ { - "recommendations": ["denoland.vscode-deno"] + "recommendations": [ + "esbenp.prettier-vscode", + "denoland.vscode-deno", + "GraphQL.vscode-graphql" + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 1186ffd..43565ee 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,5 +8,8 @@ "deno.inlayHints.functionLikeReturnTypes.enabled": false, "deno.inlayHints.parameterNames.enabled": "none", "editor.formatOnSave": true, - "editor.defaultFormatter": "denoland.vscode-deno" + "editor.defaultFormatter": "esbenp.prettier-vscode", + "[typescript]": { + "editor.defaultFormatter": "denoland.vscode-deno" + } } diff --git a/deno.jsonc b/deno.jsonc index 7a8ec5a..f407e6d 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -4,11 +4,21 @@ "cache": "deno cache --reload --lock=deno.lock --lock-write main.ts", "check": "deno check --lock=deno.lock main.ts", "compile": "deno task compile:macos && deno task compile:macos-arm && deno task compile:linux && deno task compile:windows", - "compile:macos": "deno compile --allow-env --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-apple-darwin --output bin/macos/pspace main.ts", - "compile:macos-arm": "deno compile --allow-env --allow-sys --allow-net --allow-run --lock=lock.json --target aarch64-apple-darwin --output bin/macos-arm/pspace main.ts", - "compile:linux": "deno compile --allow-env --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-unknown-linux-gnu --output bin/linux/pspace main.ts", - "compile:windows": "deno compile --allow-env --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-pc-windows-msvc --output bin/windows/pspace main.ts", + "compile:macos": "deno compile --allow-env --allow-read --allow-write --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-apple-darwin --output bin/macos/pspace main.ts", + "compile:macos-arm": "deno compile --allow-env --allow-read --allow-write --allow-sys --allow-net --allow-run --lock=lock.json --target aarch64-apple-darwin --output bin/macos-arm/pspace main.ts", + "compile:linux": "deno compile --allow-env --allow-read --allow-write --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-unknown-linux-gnu --output bin/linux/pspace main.ts", + "compile:windows": "deno compile --allow-env --allow-read --allow-write --allow-sys --allow-net --allow-run --lock=lock.json --target x86_64-pc-windows-msvc --output bin/windows/pspace main.ts", "generate": "cd .graphql && pnpm install && pnpm generate && cd .. && mv .graphql/paperspace-graphql.ts lib && npx replace-in-files-cli --string='@graphql-typed-document-node/core' --replacement='https://esm.sh/@graphql-typed-document-node/core@3.1.1' lib/paperspace-graphql.ts", - "run": "deno run --allow-env --allow-sys --allow-net --allow-run main.ts" + "run": "deno run --allow-env --allow-sys --allow-read --allow-write --allow-net --allow-run main.ts" + }, + "lint": { + "rules": { + "exclude": ["no-explicit-any"] + } + }, + "fmt": { + "files": { + "include": ["main.ts", "lib"] + } } } diff --git a/deno.lock b/deno.lock index 9183644..bba5e3f 100644 --- a/deno.lock +++ b/deno.lock @@ -5,67 +5,356 @@ "https://deno.land/std@0.106.0/path/_interface.ts": "1fa73b02aaa24867e481a48492b44f2598cd9dfa513c7b34001437007d3642e4", "https://deno.land/std@0.106.0/path/_util.ts": "2e06a3b9e79beaf62687196bd4b60a4c391d862cfa007a20fc3a39f778ba073b", "https://deno.land/std@0.106.0/path/posix.ts": "b81974c768d298f8dcd2c720229639b3803ca4a241fa9a355c762fa2bc5ef0c1", + "https://deno.land/std@0.170.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272", + "https://deno.land/std@0.170.0/_util/os.ts": "8a33345f74990e627b9dfe2de9b040004b08ea5146c7c9e8fe9a29070d193934", + "https://deno.land/std@0.170.0/async/abortable.ts": "80b2ac399f142cc528f95a037a7d0e653296352d95c681e284533765961de409", + "https://deno.land/std@0.170.0/async/deadline.ts": "2c2deb53c7c28ca1dda7a3ad81e70508b1ebc25db52559de6b8636c9278fd41f", + "https://deno.land/std@0.170.0/async/debounce.ts": "60301ffb37e730cd2d6f9dadfd0ecb2a38857681bd7aaf6b0a106b06e5210a98", + "https://deno.land/std@0.170.0/async/deferred.ts": "77d3f84255c3627f1cc88699d8472b664d7635990d5358c4351623e098e917d6", + "https://deno.land/std@0.170.0/async/delay.ts": "5a9bfba8de38840308a7a33786a0155a7f6c1f7a859558ddcec5fe06e16daf57", + "https://deno.land/std@0.170.0/async/mod.ts": "7809ad4bb223e40f5fdc043e5c7ca04e0e25eed35c32c3c32e28697c553fa6d9", + "https://deno.land/std@0.170.0/async/mux_async_iterator.ts": "770a0ff26c59f8bbbda6b703a2235f04e379f73238e8d66a087edc68c2a2c35f", + "https://deno.land/std@0.170.0/async/pool.ts": "6854d8cd675a74c73391c82005cbbe4cc58183bddcd1fbbd7c2bcda42b61cf69", + "https://deno.land/std@0.170.0/async/retry.ts": "e8e5173623915bbc0ddc537698fa418cf875456c347eda1ed453528645b42e67", + "https://deno.land/std@0.170.0/async/tee.ts": "3a47cc4e9a940904fd4341f0224907e199121c80b831faa5ec2b054c6d2eff5e", + "https://deno.land/std@0.170.0/bytes/index_of_needle.ts": "19db73583cf6e038ca7763dd9fe9b9f2733ffa8be530d7b42f52bc9f3c2ee989", + "https://deno.land/std@0.170.0/collections/map_values.ts": "726a3c2a27683f6870470105ceb9f626815a9e0e0071a01935e7799e7a51f207", + "https://deno.land/std@0.170.0/crypto/timing_safe_equal.ts": "3784958e40a5fe10429a68b75cc5f8d34356bf0bc2eb93c80c3033e2a6f17821", "https://deno.land/std@0.170.0/encoding/base64.ts": "8605e018e49211efc767686f6f687827d7f5fd5217163e981d8d693105640d7a", + "https://deno.land/std@0.170.0/encoding/base64url.ts": "0283b12fcd306c11e3cf26fc022fecc800c6acc19704ea8bdb3908898fcd06d6", + "https://deno.land/std@0.170.0/flags/mod.ts": "4f50ec6383c02684db35de38b3ffb2cd5b9fcfcc0b1147055d1980c49e82521c", "https://deno.land/std@0.170.0/fmt/colors.ts": "03ad95e543d2808bc43c17a3dd29d25b43d0f16287fe562a0be89bf632454a12", - "https://deno.land/x/cliffy@v0.25.6/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", - "https://deno.land/x/cliffy@v0.25.6/ansi/ansi.ts": "7f43d07d31dd7c24b721bb434c39cbb5132029fa4be3dd8938873065f65e5810", - "https://deno.land/x/cliffy@v0.25.6/ansi/ansi_escapes.ts": "885f61f343223f27b8ec69cc138a54bea30542924eacd0f290cd84edcf691387", - "https://deno.land/x/cliffy@v0.25.6/ansi/chain.ts": "31fb9fcbf72fed9f3eb9b9487270d2042ccd46a612d07dd5271b1a80ae2140a0", - "https://deno.land/x/cliffy@v0.25.6/ansi/colors.ts": "5f71993af5bd1aa0a795b15f41692d556d7c89584a601fed75997df844b832c9", - "https://deno.land/x/cliffy@v0.25.6/ansi/cursor_position.ts": "d537491e31d9c254b208277448eff92ff7f55978c4928dea363df92c0df0813f", - "https://deno.land/x/cliffy@v0.25.6/ansi/deps.ts": "0f35cb7e91868ce81561f6a77426ea8bc55dc15e13f84c7352f211023af79053", - "https://deno.land/x/cliffy@v0.25.6/ansi/mod.ts": "bb4e6588e6704949766205709463c8c33b30fec66c0b1846bc84a3db04a4e075", - "https://deno.land/x/cliffy@v0.25.6/ansi/tty.ts": "8fb064c17ead6cdf00c2d3bc87a9fd17b1167f2daa575c42b516f38bdb604673", - "https://deno.land/x/cliffy@v0.25.6/command/_errors.ts": "a9bd23dc816b32ec96c9b8f3057218241778d8c40333b43341138191450965e5", - "https://deno.land/x/cliffy@v0.25.6/command/_utils.ts": "9ab3d69fabab6c335b881b8a5229cbd5db0c68f630a1c307aff988b6396d9baf", - "https://deno.land/x/cliffy@v0.25.6/command/command.ts": "6ecc7c20e764246c021d92b12eea2226d08cb9688dffb5ac9b33277dbf16a2b0", - "https://deno.land/x/cliffy@v0.25.6/command/completions/_bash_completions_generator.ts": "43b4abb543d4dc60233620d51e69d82d3b7c44e274e723681e0dce2a124f69f9", - "https://deno.land/x/cliffy@v0.25.6/command/completions/_fish_completions_generator.ts": "d0289985f5cf0bd288c05273bfa286b24c27feb40822eb7fd9d7fee64e6580e8", - "https://deno.land/x/cliffy@v0.25.6/command/completions/_zsh_completions_generator.ts": "14461eb274954fea4953ee75938821f721da7da607dc49bcc7db1e3f33a207bd", - "https://deno.land/x/cliffy@v0.25.6/command/completions/bash.ts": "053aa2006ec327ccecacb00ba28e5eb836300e5c1bec1b3cfaee9ddcf8189756", - "https://deno.land/x/cliffy@v0.25.6/command/completions/complete.ts": "58df61caa5e6220ff2768636a69337923ad9d4b8c1932aeb27165081c4d07d8b", - "https://deno.land/x/cliffy@v0.25.6/command/completions/fish.ts": "9938beaa6458c6cf9e2eeda46a09e8cd362d4f8c6c9efe87d3cd8ca7477402a5", - "https://deno.land/x/cliffy@v0.25.6/command/completions/mod.ts": "aeef7ec8e319bb157c39a4bab8030c9fe8fa327b4c1e94c9c1025077b45b40c0", - "https://deno.land/x/cliffy@v0.25.6/command/completions/zsh.ts": "8b04ab244a0b582f7927d405e17b38602428eeb347a9968a657e7ea9f40e721a", - "https://deno.land/x/cliffy@v0.25.6/command/deprecated.ts": "bbe6670f1d645b773d04b725b8b8e7814c862c9f1afba460c4d599ffe9d4983c", - "https://deno.land/x/cliffy@v0.25.6/command/deps.ts": "bdf4eb349a6aa09beea1d2004edb232d5c91b252eff59f735ddd8b2be1f5915d", - "https://deno.land/x/cliffy@v0.25.6/command/help/_help_generator.ts": "10d0192727b97354e5fedca28418df94d9bee09253f3afe5196e1285c5e987cc", - "https://deno.land/x/cliffy@v0.25.6/command/help/mod.ts": "09d74d3eb42d21285407cda688074c29595d9c927b69aedf9d05ff3f215820d3", - "https://deno.land/x/cliffy@v0.25.6/command/mod.ts": "d0a32df6b14028e43bb2d41fa87d24bc00f9662a44e5a177b3db02f93e473209", - "https://deno.land/x/cliffy@v0.25.6/command/type.ts": "24e88e3085e1574662b856ccce70d589959648817135d4469fab67b9cce1b364", - "https://deno.land/x/cliffy@v0.25.6/command/types.ts": "ae02eec0ed7a769f7dba2dd5d3a931a61724b3021271b1b565cf189d9adfd4a0", - "https://deno.land/x/cliffy@v0.25.6/command/types/action_list.ts": "33c98d449617c7a563a535c9ceb3741bde9f6363353fd492f90a74570c611c27", - "https://deno.land/x/cliffy@v0.25.6/command/types/boolean.ts": "3879ec16092b4b5b1a0acb8675f8c9250c0b8a972e1e4c7adfba8335bd2263ed", - "https://deno.land/x/cliffy@v0.25.6/command/types/child_command.ts": "f1fca390c7fbfa7a713ca15ef55c2c7656bcbb394d50e8ef54085bdf6dc22559", - "https://deno.land/x/cliffy@v0.25.6/command/types/command.ts": "325d0382e383b725fd8d0ef34ebaeae082c5b76a1f6f2e843fee5dbb1a4fe3ac", - "https://deno.land/x/cliffy@v0.25.6/command/types/enum.ts": "2178345972adf7129a47e5f02856ca3e6852a91442a1c78307dffb8a6a3c6c9f", - "https://deno.land/x/cliffy@v0.25.6/command/types/file.ts": "8618f16ac9015c8589cbd946b3de1988cc4899b90ea251f3325c93c46745140e", - "https://deno.land/x/cliffy@v0.25.6/command/types/integer.ts": "29864725fd48738579d18123d7ee78fed37515e6dc62146c7544c98a82f1778d", - "https://deno.land/x/cliffy@v0.25.6/command/types/number.ts": "aeba96e6f470309317a16b308c82e0e4138a830ec79c9877e4622c682012bc1f", - "https://deno.land/x/cliffy@v0.25.6/command/types/string.ts": "e4dadb08a11795474871c7967beab954593813bb53d9f69ea5f9b734e43dc0e0", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/mod.ts": "17e2df3b620905583256684415e6c4a31e8de5c59066eb6d6c9c133919292dc4", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/provider.ts": "c6e8e0b8dc91359ece92f73061a218a8384790c29bc48feece9e81f5048611e7", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/provider/deno_land.ts": "24f8d82e38c51e09be989f30f8ad21f9dd41ac1bb1973b443a13883e8ba06d6d", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/provider/github.ts": "666f43d7ee687d90da42f1ab105c27f8f953db452f9a6bb88e68852cc813ad08", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/provider/nest_land.ts": "0e07936cea04fa41ac9297f32d87f39152ea873970c54cb5b4934b12fee1885e", - "https://deno.land/x/cliffy@v0.25.6/command/upgrade/upgrade_command.ts": "3640a287d914190241ea1e636774b1b4b0e1828fa75119971dd5304784061e05", - "https://deno.land/x/cliffy@v0.25.6/flags/_errors.ts": "f1fbb6bfa009e7950508c9d491cfb4a5551027d9f453389606adb3f2327d048f", - "https://deno.land/x/cliffy@v0.25.6/flags/_utils.ts": "340d3ecab43cde9489187e1f176504d2c58485df6652d1cdd907c0e9c3ce4cc2", - "https://deno.land/x/cliffy@v0.25.6/flags/_validate_flags.ts": "16eb5837986c6f6f7620817820161a78d66ce92d690e3697068726bbef067452", - "https://deno.land/x/cliffy@v0.25.6/flags/deprecated.ts": "a72a35de3cc7314e5ebea605ca23d08385b218ef171c32a3f135fb4318b08126", - "https://deno.land/x/cliffy@v0.25.6/flags/flags.ts": "68a9dfcacc4983a84c07ba19b66e5e9fccd04389fad215210c60fb414cc62576", - "https://deno.land/x/cliffy@v0.25.6/flags/types.ts": "7452ea5296758fb7af89930349ce40d8eb9a43b24b3f5759283e1cb5113075fd", - "https://deno.land/x/cliffy@v0.25.6/flags/types/boolean.ts": "b21be165b49b8517372361642cffaeaa4f4bb69637994a9762ceba642fe39676", - "https://deno.land/x/cliffy@v0.25.6/flags/types/integer.ts": "b60d4d590f309ddddf066782d43e4dc3799f0e7d08e5ede7dc62a5ee94b9a6d9", - "https://deno.land/x/cliffy@v0.25.6/flags/types/number.ts": "610936e2d29de7c8c304b65489a75ebae17b005c6122c24e791fbed12444d51e", - "https://deno.land/x/cliffy@v0.25.6/flags/types/string.ts": "e89b6a5ce322f65a894edecdc48b44956ec246a1d881f03e97bbda90dd8638c5", - "https://deno.land/x/cliffy@v0.25.6/table/border.ts": "2514abae4e4f51eda60a5f8c927ba24efd464a590027e900926b38f68e01253c", - "https://deno.land/x/cliffy@v0.25.6/table/cell.ts": "1d787d8006ac8302020d18ec39f8d7f1113612c20801b973e3839de9c3f8b7b3", - "https://deno.land/x/cliffy@v0.25.6/table/deps.ts": "5b05fa56c1a5e2af34f2103fd199e5f87f0507549963019563eae519271819d2", - "https://deno.land/x/cliffy@v0.25.6/table/layout.ts": "46bf10ae5430cf4fbb92f23d588230e9c6336edbdb154e5c9581290562b169f4", - "https://deno.land/x/cliffy@v0.25.6/table/row.ts": "5f519ba7488d2ef76cbbf50527f10f7957bfd668ce5b9169abbc44ec88302645", - "https://deno.land/x/cliffy@v0.25.6/table/table.ts": "ec204c9d08bb3ff1939c5ac7412a4c9ed7d00925d4fc92aff9bfe07bd269258d", - "https://deno.land/x/cliffy@v0.25.6/table/utils.ts": "187bb7dcbcfb16199a5d906113f584740901dfca1007400cba0df7dcd341bc29", + "https://deno.land/std@0.170.0/fmt/printf.ts": "e275fc8f189c03bb4134a2c7b52c3a448a4a16e16a85efcd69cd6108c5f48a32", + "https://deno.land/std@0.170.0/fs/eol.ts": "6e784ff8120c8d5589cb258e56dc39bc5b408ac9827a2e914163cbf9f2e3ce92", + "https://deno.land/std@0.170.0/fs/exists.ts": "6a447912e49eb79cc640adacfbf4b0baf8e17ede6d5bed057062ce33c4fa0d68", + "https://deno.land/std@0.170.0/node/_core.ts": "92e000441742387f7ded7cc582ca4089c0bc13aa5f00cecdfa4876dc832dfd10", + "https://deno.land/std@0.170.0/node/_events.d.ts": "3899ee9c37055fbb750e32cb43d7c435077c04446af948300080e1a590c6edf0", + "https://deno.land/std@0.170.0/node/_events.mjs": "303e8aa60ace559e4ca0d19e8475f87311bee9e8330b4b497644d70f2002fc27", + "https://deno.land/std@0.170.0/node/_fs/_fs_access.ts": "92feecc070e58487c3d129d6fc76e769f2c7a5ffa6707198842eebfa09a2be0a", + "https://deno.land/std@0.170.0/node/_fs/_fs_appendFile.ts": "f9d83bce0d3eae04246916da5b048313c24d88dfaf063f779c3434f0399d9042", + "https://deno.land/std@0.170.0/node/_fs/_fs_chmod.ts": "03c18067a37609a33f5a270413457eac83a5818cd023b71d183804e681817f97", + "https://deno.land/std@0.170.0/node/_fs/_fs_chown.ts": "e072f87628cfea956e945787f0e8af47be325b2e3183ae095279472b1fb9d085", + "https://deno.land/std@0.170.0/node/_fs/_fs_close.ts": "b23915f763addce9d96116c1e3179d9d33c596903f57e20afa46c4333072a460", + "https://deno.land/std@0.170.0/node/_fs/_fs_common.ts": "a4f820c9750fea15e90e32fab268658cc88113ce1b884a6cda43c85fbff5a3c7", + "https://deno.land/std@0.170.0/node/_fs/_fs_constants.ts": "66a07e0c0279ec118851cf30570d25bce3ac13dedb269d53d04e342bbad28cca", + "https://deno.land/std@0.170.0/node/_fs/_fs_copy.ts": "8e4a352de6df5352f23a37c008e8547efe08a58545208225898b466607db9460", + "https://deno.land/std@0.170.0/node/_fs/_fs_dir.ts": "beeafa572154696433d8b90424bba13a6139647877732f23d4ab4fc9608984ef", + "https://deno.land/std@0.170.0/node/_fs/_fs_dirent.ts": "649c0a794e7b8d930cdd7e6a168b404aa0448bf784e0cfbe1bd6d25b99052273", + "https://deno.land/std@0.170.0/node/_fs/_fs_exists.ts": "87b063b7b1a59b5d2302ba2de2204fbccc1bfbe7fafede8678694cae45b77682", + "https://deno.land/std@0.170.0/node/_fs/_fs_fdatasync.ts": "bbd078fea6c62c64d898101d697aefbfbb722797a75e328a82c2a4f2e7eb963d", + "https://deno.land/std@0.170.0/node/_fs/_fs_fstat.ts": "559ff6ff094337db37b0f3108aeaecf42672795af45b206adbd90105afebf9c6", + "https://deno.land/std@0.170.0/node/_fs/_fs_fsync.ts": "590be69ce5363dd4f8867f244cfabe8df89d40f86bbbe44fd00d69411d0b798e", + "https://deno.land/std@0.170.0/node/_fs/_fs_ftruncate.ts": "8eb2a9fcf026bd9b85dc07a22bc452c48db4be05ab83f5f2b6a0549e15c1f75f", + "https://deno.land/std@0.170.0/node/_fs/_fs_futimes.ts": "89c71d38dd6b8e0a97470f3545d739ba04f6e3ca981a664404a825fd772ac2a2", + "https://deno.land/std@0.170.0/node/_fs/_fs_link.ts": "f7c60f989a60becd6cdc1c553122be34f7c2ed83a900448757982683cebc0ffd", + "https://deno.land/std@0.170.0/node/_fs/_fs_lstat.ts": "c26a406ccdbc95dd7dab75aca0019b45b41edc07bebd40d9de183780d647a064", + "https://deno.land/std@0.170.0/node/_fs/_fs_mkdir.ts": "007e5cef536f1f64b10598951d8413aaebdc5ce6a26cb170b8cba1737a8c086d", + "https://deno.land/std@0.170.0/node/_fs/_fs_mkdtemp.ts": "a037c457d6542eb16df903f7126a4ddb174e37c7d7a58c6fbff86a2147b78509", + "https://deno.land/std@0.170.0/node/_fs/_fs_open.ts": "41bfe4259f679cf4b407b551896ff0debc16e9b8003be00dc93321a75031749f", + "https://deno.land/std@0.170.0/node/_fs/_fs_opendir.ts": "4a678152c184b9bbdafc3fbf53f4b2a942f74b954bcbcf6104990957170b2d8b", + "https://deno.land/std@0.170.0/node/_fs/_fs_read.ts": "6c9a63689bf373aa2b6572e077c446572074dd25868994b0804ac2c644ddf438", + "https://deno.land/std@0.170.0/node/_fs/_fs_readFile.ts": "7c42f8cb4bad2e37a53314de7831c0735bae010712fd914471850caa4d322ffd", + "https://deno.land/std@0.170.0/node/_fs/_fs_readdir.ts": "8d186b470aea8411c794687b20effaf1f478abb59956c67b671691d9444b7786", + "https://deno.land/std@0.170.0/node/_fs/_fs_readlink.ts": "a5582656af6f09361ecb408ed3c0ad3cc3afd683403539e4c22aa06deab90fc0", + "https://deno.land/std@0.170.0/node/_fs/_fs_realpath.ts": "0bf961c7b13d83e39b21255237b7ef352beb778a8274d03f2419907a8cd5c09c", + "https://deno.land/std@0.170.0/node/_fs/_fs_rename.ts": "9aa3cf6643499a38ccbfb14435239c7fc0da6b4cb5b5ab1c9e676d42daf27b71", + "https://deno.land/std@0.170.0/node/_fs/_fs_rm.ts": "82e926fe3e11e2a7f56116d3b7005372c339010cc1a7566a37a5591d19d680c6", + "https://deno.land/std@0.170.0/node/_fs/_fs_rmdir.ts": "0fd5b390ca97da55f2edd9682bab5b8b9edac0cd5b70823b642aad06e84d169e", + "https://deno.land/std@0.170.0/node/_fs/_fs_stat.ts": "4ccc93cd1938e5dcc5298feb9c6f0bc9f444fa8565c726854ea40210b93d254c", + "https://deno.land/std@0.170.0/node/_fs/_fs_symlink.ts": "a9fe02e745a8ab28e152f37e316cb204382f86ebafc3bcf32a9374cf9d369181", + "https://deno.land/std@0.170.0/node/_fs/_fs_truncate.ts": "1fe9cba3a54132426927639c024a7a354455e5a13b3b3143ad1c25ed0b5fc288", + "https://deno.land/std@0.170.0/node/_fs/_fs_unlink.ts": "d845c8067a2ba55c443e04d2706e6a4e53735488b30fc317418c9f75127913b0", + "https://deno.land/std@0.170.0/node/_fs/_fs_utimes.ts": "194eeb8dab1ebdf274f784a38241553cc440305461b30c987ecef1a24dfc01ca", + "https://deno.land/std@0.170.0/node/_fs/_fs_watch.ts": "aef811e78e04cff3da30dcd334af8d85018f915d1ec7b95f05b2e4c48a7b7a4f", + "https://deno.land/std@0.170.0/node/_fs/_fs_write.d.ts": "deb5c1a98b6cb1aa79f773f3b8fc9410463f0e30fede1ff9df2652fc11b69d35", + "https://deno.land/std@0.170.0/node/_fs/_fs_write.mjs": "265f1291a2e908fd2da9fc3cb541be09a592119a29767708354a3bec18645b04", + "https://deno.land/std@0.170.0/node/_fs/_fs_writeFile.ts": "ff2098d46ded5699a1fc694dd6cf260646fd06646b2a6b8cba3fc8f0a7ec3bc1", + "https://deno.land/std@0.170.0/node/_fs/_fs_writev.d.ts": "2cc02fc9ed20292e09a22bf215635804f397d9b8ed2df62067a42f3be1b31b76", + "https://deno.land/std@0.170.0/node/_fs/_fs_writev.mjs": "e500af8857779d404302658225c249b89f20fa4c40058c645b555dd70ca6b54f", + "https://deno.land/std@0.170.0/node/_global.d.ts": "6dadaf8cec2a0c506b22170617286e0bdc80be53dd0673e67fc7dd37a1130c68", + "https://deno.land/std@0.170.0/node/_next_tick.ts": "81c1826675493b76f90c646fb1274a4c84b5cc913a80ca4526c32cd7c46a0b06", + "https://deno.land/std@0.170.0/node/_process/exiting.ts": "bc9694769139ffc596f962087155a8bfef10101d03423b9dcbc51ce6e1f88fce", + "https://deno.land/std@0.170.0/node/_process/process.ts": "d5bf113a4b62f4abe4cb7ec5a9d00d44dac0ad9e82a23d00cc27d71e05ae8b66", + "https://deno.land/std@0.170.0/node/_process/stdio.mjs": "971c3b086040d8521562155db13f22f9971d5c42c852b2081d4d2f0d8b6ab6bd", + "https://deno.land/std@0.170.0/node/_process/streams.mjs": "3ce63d9eb24a8a8ec45eeebf5c184b43d888064f663f87e8f453888368e00f90", + "https://deno.land/std@0.170.0/node/_readline.d.ts": "31444cb4ae41b07261d9e226b8bb01caf9338f55ea4a573947b2d896bf5392d6", + "https://deno.land/std@0.170.0/node/_readline.mjs": "443ebeccb8b2b85c08fc75b0a09251b79469a4685c317157348e67674318522f", + "https://deno.land/std@0.170.0/node/_readline_shared_types.d.ts": "5e83e3e093f7d2b0e42fc17e6c5f5cdf93a4ad12fcffe089cfec2150380d635c", + "https://deno.land/std@0.170.0/node/_stream.d.ts": "83e9da2f81de3205926f1e86ba54442aa5a3caf4c5e84a4c8699402ad340142b", + "https://deno.land/std@0.170.0/node/_stream.mjs": "9a80217d9734f6e4284aae0ea55dd82b243f5517bc1814e983ad41b01732f712", + "https://deno.land/std@0.170.0/node/_util/_util_callbackify.ts": "a71353d5fde3dc785cfdf6b6bcad1379a9c78b374720af4aaa7f88ffab2bac0e", + "https://deno.land/std@0.170.0/node/_utils.ts": "1085a229e910b3a6672f3c3be05507591811dc67be2ae2188e9fc9ef4376b172", + "https://deno.land/std@0.170.0/node/assert.ts": "25c4383a4aa6f953e1c04b8c6def66b910c040ffebff82fa24fc1f8f36ebd99b", + "https://deno.land/std@0.170.0/node/assertion_error.ts": "438aca6fc88fca9ad2d0eaf9474efa4e8a42bc62d9df8591e44a2252f5d08962", + "https://deno.land/std@0.170.0/node/buffer.ts": "43f07b2d1523345bf35b7deb7fcdad6e916020a631a7bc1b5efcaff556db4e1d", + "https://deno.land/std@0.170.0/node/child_process.ts": "2ce8176b7dbcb6c867869ba09201e9e715393d89b24ecc458c18f8cc59f07dda", + "https://deno.land/std@0.170.0/node/events.ts": "f848398d3591534ca94ac6b852a9f3c4dbb2da310c3a26059cf4ff06b7eae088", + "https://deno.land/std@0.170.0/node/fs.ts": "28952cf0d26a9eb928a005739a14fbc177b82ef35342f0714525dfa47d063b52", + "https://deno.land/std@0.170.0/node/fs/promises.ts": "a437b457b4e6c4fbe903bd9f619392b3b988a4e3521dade6c0974885d6d702a2", + "https://deno.land/std@0.170.0/node/internal/assert.mjs": "118327c8866266534b30d3a36ad978204af7336dc2db3158b8167192918d4e06", + "https://deno.land/std@0.170.0/node/internal/buffer.d.ts": "90f674081428a61978b6d481c5f557ff743a3f4a85d7ae113caab48fdf5b8a63", + "https://deno.land/std@0.170.0/node/internal/buffer.mjs": "50320a6bcf770f03428e77e5ba46b19f69842539c6493b89c6515ba1b0def6ee", + "https://deno.land/std@0.170.0/node/internal/child_process.ts": "e746650136069abed1c18f23106f3489ebb9e453fe376c758feb906c682b0d25", + "https://deno.land/std@0.170.0/node/internal/crypto/_keys.ts": "63229ff3d8d15b5bd0a1d2ebc19313cbb8ac969875bf16df1ce4f2b497d74fb5", + "https://deno.land/std@0.170.0/node/internal/crypto/constants.ts": "d2c8821977aef55e4d66414d623c24a2447791a8b49b6404b8db32d81e20c315", + "https://deno.land/std@0.170.0/node/internal/error_codes.ts": "ac03c4eae33de3a69d6c98e8678003207eecf75a6900eb847e3fea3c8c9e6d8f", + "https://deno.land/std@0.170.0/node/internal/errors.ts": "b9aec7d1fe3eaf21322d0ea9dc2fcb344055d6b0c7a1bd0f62a0c379a5baa799", + "https://deno.land/std@0.170.0/node/internal/fixed_queue.ts": "455b3c484de48e810b13bdf95cd1658ecb1ba6bcb8b9315ffe994efcde3ba5f5", + "https://deno.land/std@0.170.0/node/internal/fs/streams.d.ts": "899e69c3179c903d89f448fac3acc742369e10a62e29d658b220e78181be1a40", + "https://deno.land/std@0.170.0/node/internal/fs/streams.mjs": "7dd52a833589ff273c4c99a0977e69eee56df9f221ae5874a17daaa8ce1a2af5", + "https://deno.land/std@0.170.0/node/internal/fs/utils.mjs": "7b1bb3f46a676303d2a873bb9c36f199bd2c253451d4bd013ac906a6accea5bd", + "https://deno.land/std@0.170.0/node/internal/hide_stack_frames.ts": "a91962ec84610bc7ec86022c4593cdf688156a5910c07b5bcd71994225c13a03", + "https://deno.land/std@0.170.0/node/internal/idna.ts": "3aed89919e3078160733b6e6ac60fdb06052cf0418acbabcf86f90017d102b78", + "https://deno.land/std@0.170.0/node/internal/net.ts": "1239886cd2508a68624c2dae8abf895e8aa3bb15a748955349f9ac5539032238", + "https://deno.land/std@0.170.0/node/internal/normalize_encoding.mjs": "3779ec8a7adf5d963b0224f9b85d1bc974a2ec2db0e858396b5d3c2c92138a0a", + "https://deno.land/std@0.170.0/node/internal/options.ts": "a23c285975e058cb26a19abcb048cd8b46ab12d21cfb028868ac8003fffb43ac", + "https://deno.land/std@0.170.0/node/internal/primordials.mjs": "7cf5afe471583e4a384eeea109bdff276b6b7f3a3af830f99f951fb7d57ef423", + "https://deno.land/std@0.170.0/node/internal/process/per_thread.mjs": "bc1be72a6a662bf81573c20fe74893374847a7302065ddf52fb3fb2af505f31f", + "https://deno.land/std@0.170.0/node/internal/querystring.ts": "c3b23674a379f696e505606ddce9c6feabe9fc497b280c56705c340f4028fe74", + "https://deno.land/std@0.170.0/node/internal/readline/callbacks.mjs": "17d9270a54fb5dceea8f894669e3401e5c6260bab075a1e9675a62f1fef50d8c", + "https://deno.land/std@0.170.0/node/internal/readline/emitKeypressEvents.mjs": "a8cff1322c779d8431cf4b82419e002077eae603325d671d2a963d5c278cb180", + "https://deno.land/std@0.170.0/node/internal/readline/interface.mjs": "c29c7409c9bb29670ffc7d07ae652caa487b6d4a5c811ad7b8401eeb682f7d96", + "https://deno.land/std@0.170.0/node/internal/readline/promises.mjs": "2cd5b1ebd0623b5fd286ae7510cfe85d94ccf42c86adb3a27e270f5121bee85d", + "https://deno.land/std@0.170.0/node/internal/readline/symbols.mjs": "0f0d16b7d64dfb953bee5575cbb7f69db8ad036ab0f3e640b357715daab2501d", + "https://deno.land/std@0.170.0/node/internal/readline/utils.mjs": "a93ebb99f85e0dbb4f05f4aff5583d12a15150e45c335e4ecf925e1879dc9c84", + "https://deno.land/std@0.170.0/node/internal/streams/destroy.mjs": "9c9bbeb172a437041d529829f433df72cf0b63ae49f3ee6080a55ffbef7572ad", + "https://deno.land/std@0.170.0/node/internal/streams/end-of-stream.mjs": "38be76eaceac231dfde643e72bc0940625446bf6d1dbd995c91c5ba9fd59b338", + "https://deno.land/std@0.170.0/node/internal/streams/utils.mjs": "a0a6b93a7e68ef52bef4ed00b0c82bb7e335abf360af57335b07c6a3fcdde717", + "https://deno.land/std@0.170.0/node/internal/timers.mjs": "8079bbe5dccb0b4b6aa7e54ab1fc5e23b25c4f8357f0381d958126becc9ced42", + "https://deno.land/std@0.170.0/node/internal/url.ts": "eacef0ace4f4c5394e9818a81499f4871b2a993d1bd3b902047e44a381ef0e22", + "https://deno.land/std@0.170.0/node/internal/util.mjs": "35d24fb775468cd24443bcf0ec68904b8aa44e5b53845491a5e3382421917f9a", + "https://deno.land/std@0.170.0/node/internal/util/comparisons.ts": "4093f52f05d84842b46496e448fa8d708e25c6d6b8971505fd4913a9d7075934", + "https://deno.land/std@0.170.0/node/internal/util/debuglog.ts": "570c399f0a066b81f0836eeb926b9142ae7f1738cee9abd85cd12ce32092d5af", + "https://deno.land/std@0.170.0/node/internal/util/inspect.mjs": "1ddace0c97719d2cc0869ba177d375e96051301352ec235cbfb2ecbfcd4e8fba", + "https://deno.land/std@0.170.0/node/internal/util/types.ts": "5b15a8051a6e58b6c1a424e0e7137b77b0ef60409d54d05db22a97e0d1d5b589", + "https://deno.land/std@0.170.0/node/internal/validators.mjs": "67deae0f488d013c8bf485742a5478112b8e48837cb2458c4a8b2669cf7017db", + "https://deno.land/std@0.170.0/node/internal_binding/_libuv_winerror.ts": "801e05c2742ae6cd42a5f0fd555a255a7308a65732551e962e5345f55eedc519", + "https://deno.land/std@0.170.0/node/internal_binding/_listen.ts": "c15a356ef4758770fc72d3ca4db33f0cc321016df1aafb927c027c0d73ac2c42", + "https://deno.land/std@0.170.0/node/internal_binding/_node.ts": "e4075ba8a37aef4eb5b592c8e3807c39cb49ca8653faf8e01a43421938076c1b", + "https://deno.land/std@0.170.0/node/internal_binding/_timingSafeEqual.ts": "80640f055101071cb3680a2d8a1fead5fd260ca8bf183efb94296b69463e06cd", + "https://deno.land/std@0.170.0/node/internal_binding/_utils.ts": "1c50883b5751a9ea1b38951e62ed63bacfdc9d69ea665292edfa28e1b1c5bd94", + "https://deno.land/std@0.170.0/node/internal_binding/_winerror.ts": "8811d4be66f918c165370b619259c1f35e8c3e458b8539db64c704fbde0a7cd2", + "https://deno.land/std@0.170.0/node/internal_binding/ares.ts": "33ff8275bc11751219af8bd149ea221c442d7e8676e3e9f20ccb0e1f0aac61b8", + "https://deno.land/std@0.170.0/node/internal_binding/async_wrap.ts": "b83e4021a4854b2e13720f96d21edc11f9905251c64c1bc625a361f574400959", + "https://deno.land/std@0.170.0/node/internal_binding/buffer.ts": "dfba9e1a50b637cfd72e569aa11959dcaf626b898ab7e851d21526a2bdaec588", + "https://deno.land/std@0.170.0/node/internal_binding/cares_wrap.ts": "720e6d5cff7018bb3d00e1a49dd4c31f0fc6af3a593ab68cd39e3592ed163d61", + "https://deno.land/std@0.170.0/node/internal_binding/config.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/connection_wrap.ts": "9debd4210d29c658054476fcb640c900725f564ef35412c56dc79eb07213a7c1", + "https://deno.land/std@0.170.0/node/internal_binding/constants.ts": "1ad4de9f76733320527c8bc841b5e4dd5869424924384157a72f3b171bd05b08", + "https://deno.land/std@0.170.0/node/internal_binding/contextify.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/credentials.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/crypto.ts": "d7f39700dc020364edf7f4785e5026bb91f099ce1bd02734182451b1af300c8c", + "https://deno.land/std@0.170.0/node/internal_binding/errors.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/fs.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/fs_dir.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/fs_event_wrap.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/handle_wrap.ts": "71c451060c9f555066d3ebe80de039a4e493a94b76c664450fbefd8f4167eb7e", + "https://deno.land/std@0.170.0/node/internal_binding/heap_utils.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/http_parser.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/icu.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/inspector.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/js_stream.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/messaging.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/mod.ts": "f68e74e8eed84eaa6b0de24f0f4c47735ed46866d7ee1c5a5e7c0667b4f0540f", + "https://deno.land/std@0.170.0/node/internal_binding/module_wrap.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/native_module.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/natives.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/node_file.ts": "37d6864897547d95ca24e0f5d01035915db0065bff128bc22191bc93f9ad59ad", + "https://deno.land/std@0.170.0/node/internal_binding/node_options.ts": "b098e6a1c80fa5003a1669c6828539167ab19337e13d20a47b610144cb888cef", + "https://deno.land/std@0.170.0/node/internal_binding/options.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/os.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/performance.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/pipe_wrap.ts": "105c73f268cb9ca1c6cebaf4bea089ab12e0c21c8c4e10bb0a14b0abd3e1661e", + "https://deno.land/std@0.170.0/node/internal_binding/process_methods.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/report.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/serdes.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/signal_wrap.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/spawn_sync.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/stream_wrap.ts": "64780dc713ee0a2dc36251a62fe533005f07f5996f2c7b61fd8b6fa277c25317", + "https://deno.land/std@0.170.0/node/internal_binding/string_decoder.ts": "5cb1863763d1e9b458bc21d6f976f16d9c18b3b3f57eaf0ade120aee38fba227", + "https://deno.land/std@0.170.0/node/internal_binding/symbols.ts": "51cfca9bb6132d42071d4e9e6b68a340a7f274041cfcba3ad02900886e972a6c", + "https://deno.land/std@0.170.0/node/internal_binding/task_queue.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/tcp_wrap.ts": "4217fa10072e048a26f26e5f548b3f38422452c9956265592cac57379a610acb", + "https://deno.land/std@0.170.0/node/internal_binding/timers.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/tls_wrap.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/trace_events.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/tty_wrap.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/types.ts": "69000b1b92e0ca999c737f5add38827742b3ca3fe37a2389c80290de0ae6ef01", + "https://deno.land/std@0.170.0/node/internal_binding/udp_wrap.ts": "cdd0882eff7e7db631d808608d20f5d1269b40fbcedd4a0972d6ed616a855c79", + "https://deno.land/std@0.170.0/node/internal_binding/url.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/util.ts": "faf5146c3cc3b2d6c26026a818b4a16e91488ab26e63c069f36ba3c3ae24c97b", + "https://deno.land/std@0.170.0/node/internal_binding/uv.ts": "27922aaec43de314afd99dfca1ce8f4d51ced9f5195e4917b54d387766404f61", + "https://deno.land/std@0.170.0/node/internal_binding/v8.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/worker.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/internal_binding/zlib.ts": "e292217d048a33573966b7d25352828d3282921fbcadce8735a20fb3da370cc4", + "https://deno.land/std@0.170.0/node/os.ts": "952ba42db48ae60133262b1094b7ee58c133b1348506e03878b3b846ff2a7ab6", + "https://deno.land/std@0.170.0/node/path.ts": "c65858e9cbb52dbc0dd348eefcdc41e82906c39cfa7982f2d4d805e828414b8c", + "https://deno.land/std@0.170.0/node/path/_constants.ts": "591787ca44a55859644a2d5dbaef43698ab29e72e58fd498ea5e8f78a341ba20", + "https://deno.land/std@0.170.0/node/path/_interface.ts": "4a6e96c17c1b5acb2b5909583d5808fb4e80e5120d230dd028ec04d2e7d0d906", + "https://deno.land/std@0.170.0/node/path/_util.ts": "70b4b58098c4638f3bf719fa700c95e308e3984a3f9aca551fab713426ba3cbe", + "https://deno.land/std@0.170.0/node/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.170.0/node/path/glob.ts": "a5dc1e064e6ce7aaab468ba48e233b02b322c8b6086a312938069ff7ec6ce9fc", + "https://deno.land/std@0.170.0/node/path/mod.ts": "f9125e20031aac43eef8baa58d852427c762541574513f6870d1d0abd8103252", + "https://deno.land/std@0.170.0/node/path/posix.ts": "e40c13ad352b3814116d25fed5196b59445e98c7802f9b55c0a8e33f0ddfb5bd", + "https://deno.land/std@0.170.0/node/path/separator.ts": "7176165f5b8351306357503357a3b241861d8b4e6c60aeb4e992da94f9487dc2", + "https://deno.land/std@0.170.0/node/path/win32.ts": "6554159c6b21a73bb4647c85c44f42cdbbd84c53c37f57a3a195a47d50c0ab92", + "https://deno.land/std@0.170.0/node/process.ts": "160ad8df6496ab00ed6ed25589d504855382d2641a0c9c4c6e1c577f770862d5", + "https://deno.land/std@0.170.0/node/querystring.ts": "ec6d8bd8b138a5c53fe8bc25a37bdd654d5fb76918fb6543864d62474b3860a8", + "https://deno.land/std@0.170.0/node/readline.ts": "8ef2df20447fcd40df1926a02fe2b32676c2c86e044486446bdd8ca53cbc72b8", + "https://deno.land/std@0.170.0/node/readline/promises.ts": "c429edf7dddc2174cd59dfc6264e7d002228091bae2b5b0a82365f616c1796b4", + "https://deno.land/std@0.170.0/node/stream.ts": "2c6d5d207d0ad295f396b34fd03a908c1638beb1754bc9c1fccd9a4cdcace8be", + "https://deno.land/std@0.170.0/node/string_decoder.ts": "7b6aaf9f98934fa33f89d7183a03858c0d1961870725d4ba39aa7cc137a9e9a1", + "https://deno.land/std@0.170.0/node/timers.ts": "c8bb53fb20b3d9c3d84ee98418dda5a644ff0ad8324555b7e3fa1712ae7d3c99", + "https://deno.land/std@0.170.0/node/url.ts": "c3c01ae65375c2ad4581f9071813b27b590faf5bf68663851b9fde76ff2f242e", + "https://deno.land/std@0.170.0/node/util.ts": "e926d996318017b41812983cacde63e39c92385de7a19a0cb788fc68f73318db", + "https://deno.land/std@0.170.0/node/util/types.ts": "5948b43e834f73a4becf85b02049632560c65da9c1127e5c533c83d200d3dfcd", + "https://deno.land/std@0.170.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", + "https://deno.land/std@0.170.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", + "https://deno.land/std@0.170.0/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677", + "https://deno.land/std@0.170.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", + "https://deno.land/std@0.170.0/path/glob.ts": "81cc6c72be002cd546c7a22d1f263f82f63f37fe0035d9726aa96fc8f6e4afa1", + "https://deno.land/std@0.170.0/path/mod.ts": "cf7cec7ac11b7048bb66af8ae03513e66595c279c65cfa12bfc07d9599608b78", + "https://deno.land/std@0.170.0/path/posix.ts": "b859684bc4d80edfd4cad0a82371b50c716330bed51143d6dcdbe59e6278b30c", + "https://deno.land/std@0.170.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", + "https://deno.land/std@0.170.0/path/win32.ts": "7cebd2bda6657371adc00061a1d23fdd87bcdf64b4843bb148b0b24c11b40f69", + "https://deno.land/std@0.170.0/streams/write_all.ts": "7525aa90e34a2bb56d094403ad9c0e31e7db87a47cb556e6dc0404e6deca084c", + "https://deno.land/std@0.170.0/testing/_diff.ts": "a23e7fc2b4d8daa3e158fa06856bedf5334ce2a2831e8bf9e509717f455adb2c", + "https://deno.land/std@0.170.0/testing/_format.ts": "cd11136e1797791045e639e9f0f4640d5b4166148796cad37e6ef75f7d7f3832", + "https://deno.land/std@0.170.0/testing/asserts.ts": "51353e79437361d4b02d8e32f3fc83b22231bc8f8d4c841d86fd32b0b0afe940", + "https://deno.land/std@0.171.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", + "https://deno.land/std@0.171.0/bytes/bytes_list.ts": "b4cbdfd2c263a13e8a904b12d082f6177ea97d9297274a4be134e989450dfa6a", + "https://deno.land/std@0.171.0/bytes/concat.ts": "d26d6f3d7922e6d663dacfcd357563b7bf4a380ce5b9c2bbe0c8586662f25ce2", + "https://deno.land/std@0.171.0/bytes/copy.ts": "939d89e302a9761dcf1d9c937c7711174ed74c59eef40a1e4569a05c9de88219", + "https://deno.land/std@0.171.0/encoding/_yaml/dumper/dumper.ts": "49053c293a2250b33f2efc0ce3973280c6dc3bc0b41397af3863b5f03340e01b", + "https://deno.land/std@0.171.0/encoding/_yaml/dumper/dumper_state.ts": "975a3702752a29251c5746206507dfebbfede60dd2c0dec161dc22633fbc6085", + "https://deno.land/std@0.171.0/encoding/_yaml/error.ts": "e60ab51d7c0253cf0d1cf7d445202e8e3da5c77aae0032071ba7400121c281b4", + "https://deno.land/std@0.171.0/encoding/_yaml/loader/loader.ts": "6c59f60faaf78d73db0e016293f4bfed19e6356d7064230d07d6b68a65a1df5d", + "https://deno.land/std@0.171.0/encoding/_yaml/loader/loader_state.ts": "fcc82fcdf167acb0e9e5e32b32682e58b45f2d44210bf685794797ccb5621232", + "https://deno.land/std@0.171.0/encoding/_yaml/mark.ts": "0027d6f62a70a6c64b85bd1751ddf1646ea97edcefbf5bea1706d5e519f4e34f", + "https://deno.land/std@0.171.0/encoding/_yaml/parse.ts": "63e79582e07145ca1d3205d1ac72b82bf5ce14159dabae195abe7e36de8111bd", + "https://deno.land/std@0.171.0/encoding/_yaml/schema.ts": "0833c75c59bf72c8a8f96f6c0615bcd98d23fdd9b076657f42b5c1a4f9d972b0", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/core.ts": "366f56673336ba24f5723c04319efcc7471be5f55d5f8d95c9b4a38ec233d4c6", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/default.ts": "96e9ed6ead36f53a0832c542fc9b8cca7f8b4a67c1c8424e1423a39ee7154db7", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/extended.ts": "f9bd75c79ebdfb92a8e167488b6bde7113a31b8fabe20ad7eed0904fba11bcd2", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/failsafe.ts": "cddcbf0258bbe0cd77ca10e2f5aec13439f50d4068f96aab08ca2d64496dabe8", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/json.ts": "c86905dfb1b6c4633750bfbb5bd529a30be5c08287ab7eb6694390b40e276487", + "https://deno.land/std@0.171.0/encoding/_yaml/schema/mod.ts": "051f93dd97a15aaad2da62bd24627e8fd2f02fb026d21567d924b720d606f078", + "https://deno.land/std@0.171.0/encoding/_yaml/state.ts": "ef03d55ec235d48dcfbecc0ab3ade90bfae69a61094846e08003421c2cf5cfc6", + "https://deno.land/std@0.171.0/encoding/_yaml/stringify.ts": "426b73e4dbaeed26ed855add3862786d7e374bd4c59e5e1bd9a6fcd5082be3c7", + "https://deno.land/std@0.171.0/encoding/_yaml/type.ts": "5ded5472a0f17a219ac3b0e90d96dc8472a68654a40258a31e03a6c6297b6788", + "https://deno.land/std@0.171.0/encoding/_yaml/type/binary.ts": "935d39794420ac3718d26716192239de6a53566c6f2ba5010e8ed26936b94a89", + "https://deno.land/std@0.171.0/encoding/_yaml/type/bool.ts": "1c99cfbaa94b022575b636a73e1549569b26fc6bbff2cd5e539aa77b49bdf303", + "https://deno.land/std@0.171.0/encoding/_yaml/type/float.ts": "f60ad19b27050add694bfc255b7efef27103f047861aa657823ff3f6853bad11", + "https://deno.land/std@0.171.0/encoding/_yaml/type/function.ts": "65a37f6bef43ef141854ee48a1058d9c9c4c80ed6eed6cd35608329a6957e27a", + "https://deno.land/std@0.171.0/encoding/_yaml/type/int.ts": "892f59bb7b2dbd64dd9b643c17441af95c0b962ad027e454cb84a68864787b86", + "https://deno.land/std@0.171.0/encoding/_yaml/type/map.ts": "92e647a6aec0dc184ea4b039a77a15883b54da754311189c595b43f6aaa50030", + "https://deno.land/std@0.171.0/encoding/_yaml/type/merge.ts": "8192bf3e4d637f32567917f48bb276043da9cf729cf594e5ec191f7cd229337e", + "https://deno.land/std@0.171.0/encoding/_yaml/type/mod.ts": "060e2b3d38725094b77ea3a3f05fc7e671fced8e67ca18e525be98c4aa8f4bbb", + "https://deno.land/std@0.171.0/encoding/_yaml/type/nil.ts": "606e8f0c44d73117c81abec822f89ef81e40f712258c74f186baa1af659b8887", + "https://deno.land/std@0.171.0/encoding/_yaml/type/omap.ts": "fbd5da9970c211335ff7c8fa11e9c5e9256e568d52418ac237d1538c5cb0d5e6", + "https://deno.land/std@0.171.0/encoding/_yaml/type/pairs.ts": "ea487a44c0ae64d8d952779fa1cb5fa0a12f32a0b5d3d1e8c1f06f446448427c", + "https://deno.land/std@0.171.0/encoding/_yaml/type/regexp.ts": "672000d22a1062d61577d30b218c28f5cb1d039a7a60079fdde6a4e558d5ca51", + "https://deno.land/std@0.171.0/encoding/_yaml/type/seq.ts": "39b28f7c7aa41263c5c42cab9d184f03555e9ba19493766afc0c0c325a9ac49f", + "https://deno.land/std@0.171.0/encoding/_yaml/type/set.ts": "0e30a9f750306b514c8ae9869d1ac2548d57beab55b33e85ea9673ca0a08264c", + "https://deno.land/std@0.171.0/encoding/_yaml/type/str.ts": "a67a3c6e429d95041399e964015511779b1130ea5889fa257c48457bd3446e31", + "https://deno.land/std@0.171.0/encoding/_yaml/type/timestamp.ts": "706ea80a76a73e48efaeb400ace087da1f927647b53ad6f754f4e06d51af087f", + "https://deno.land/std@0.171.0/encoding/_yaml/type/undefined.ts": "94a316ca450597ccbc6750cbd79097ad0d5f3a019797eed3c841a040c29540ba", + "https://deno.land/std@0.171.0/encoding/_yaml/utils.ts": "26b311f0d42a7ce025060bd6320a68b50e52fd24a839581eb31734cd48e20393", + "https://deno.land/std@0.171.0/encoding/yaml.ts": "02571d1bbbcfd7c5647789cee872ecf9c1c470e1b1a40948ed219fb661e19d87", + "https://deno.land/std@0.171.0/fmt/colors.ts": "938c5d44d889fb82eff6c358bea8baa7e85950a16c9f6dae3ec3a7a729164471", + "https://deno.land/std@0.171.0/fmt/printf.ts": "8afc5987c9a88d345cd4de25b30126b16062635f51de9496f0270b0e03b7b10f", + "https://deno.land/std@0.171.0/fs/exists.ts": "b8c8a457b71e9d7f29b9d2f87aad8dba2739cbe637e8926d6ba6e92567875f8e", + "https://deno.land/std@0.171.0/io/buf_reader.ts": "90a7adcb3638d8e1361695cdf844d58bcd97c41711dc6f9f8acc0626ebe097f5", + "https://deno.land/std@0.171.0/io/buf_writer.ts": "759c69d304b04d2909976f2a03a24a107276fbd81ed13593c5c2d43d104b52f3", + "https://deno.land/std@0.171.0/io/buffer.ts": "24abd4a65403ca3fdffcb6d3f985b0285adfd785f1311ce681708a21126776ad", + "https://deno.land/std@0.171.0/io/read_delim.ts": "7e102c66f00a118fa1e1ccd4abb080496f43766686907fd8b9522fdf85443586", + "https://deno.land/std@0.171.0/io/read_lines.ts": "baee9e35034f2fdfccf63bc24b7e3cb45aa1c1c5de26d178f7bcbc572e87772f", + "https://deno.land/std@0.171.0/io/read_string_delim.ts": "46eb0c9db3547caf8c759631effa200bbe48924f9b34f41edc627bde36cee52d", + "https://deno.land/std@0.171.0/log/handlers.ts": "38871ecbfa67b0d39dc3384210439ac9a13cba6118b912236f9011b5989b9a4d", + "https://deno.land/std@0.171.0/log/levels.ts": "6309147664e9e008cd6671610f2505c4c95f181f6bae4816a84b33e0aec66859", + "https://deno.land/std@0.171.0/log/logger.ts": "257ceb47e3f5f872068073de9809b015a7400e8d86dd40563c1d80169e578f71", + "https://deno.land/std@0.171.0/log/mod.ts": "36d156ad18de3f1806c6ddafa4965129be99ccafc27f1813de528d65b6c528bf", + "https://deno.land/std@0.171.0/types.d.ts": "220ed56662a0bd393ba5d124aa6ae2ad36a00d2fcbc0e8666a65f4606aaa9784", + "https://deno.land/x/cliffy@v0.25.7/_utils/distance.ts": "02af166952c7c358ac83beae397aa2fbca4ad630aecfcd38d92edb1ea429f004", + "https://deno.land/x/cliffy@v0.25.7/ansi/ansi.ts": "7f43d07d31dd7c24b721bb434c39cbb5132029fa4be3dd8938873065f65e5810", + "https://deno.land/x/cliffy@v0.25.7/ansi/ansi_escapes.ts": "885f61f343223f27b8ec69cc138a54bea30542924eacd0f290cd84edcf691387", + "https://deno.land/x/cliffy@v0.25.7/ansi/chain.ts": "31fb9fcbf72fed9f3eb9b9487270d2042ccd46a612d07dd5271b1a80ae2140a0", + "https://deno.land/x/cliffy@v0.25.7/ansi/colors.ts": "5f71993af5bd1aa0a795b15f41692d556d7c89584a601fed75997df844b832c9", + "https://deno.land/x/cliffy@v0.25.7/ansi/cursor_position.ts": "d537491e31d9c254b208277448eff92ff7f55978c4928dea363df92c0df0813f", + "https://deno.land/x/cliffy@v0.25.7/ansi/deps.ts": "0f35cb7e91868ce81561f6a77426ea8bc55dc15e13f84c7352f211023af79053", + "https://deno.land/x/cliffy@v0.25.7/ansi/mod.ts": "bb4e6588e6704949766205709463c8c33b30fec66c0b1846bc84a3db04a4e075", + "https://deno.land/x/cliffy@v0.25.7/ansi/tty.ts": "8fb064c17ead6cdf00c2d3bc87a9fd17b1167f2daa575c42b516f38bdb604673", + "https://deno.land/x/cliffy@v0.25.7/command/_errors.ts": "a9bd23dc816b32ec96c9b8f3057218241778d8c40333b43341138191450965e5", + "https://deno.land/x/cliffy@v0.25.7/command/_utils.ts": "9ab3d69fabab6c335b881b8a5229cbd5db0c68f630a1c307aff988b6396d9baf", + "https://deno.land/x/cliffy@v0.25.7/command/command.ts": "a2b83c612acd65c69116f70dec872f6da383699b83874b70fcf38cddf790443f", + "https://deno.land/x/cliffy@v0.25.7/command/completions/_bash_completions_generator.ts": "43b4abb543d4dc60233620d51e69d82d3b7c44e274e723681e0dce2a124f69f9", + "https://deno.land/x/cliffy@v0.25.7/command/completions/_fish_completions_generator.ts": "d0289985f5cf0bd288c05273bfa286b24c27feb40822eb7fd9d7fee64e6580e8", + "https://deno.land/x/cliffy@v0.25.7/command/completions/_zsh_completions_generator.ts": "14461eb274954fea4953ee75938821f721da7da607dc49bcc7db1e3f33a207bd", + "https://deno.land/x/cliffy@v0.25.7/command/completions/bash.ts": "053aa2006ec327ccecacb00ba28e5eb836300e5c1bec1b3cfaee9ddcf8189756", + "https://deno.land/x/cliffy@v0.25.7/command/completions/complete.ts": "58df61caa5e6220ff2768636a69337923ad9d4b8c1932aeb27165081c4d07d8b", + "https://deno.land/x/cliffy@v0.25.7/command/completions/fish.ts": "9938beaa6458c6cf9e2eeda46a09e8cd362d4f8c6c9efe87d3cd8ca7477402a5", + "https://deno.land/x/cliffy@v0.25.7/command/completions/mod.ts": "aeef7ec8e319bb157c39a4bab8030c9fe8fa327b4c1e94c9c1025077b45b40c0", + "https://deno.land/x/cliffy@v0.25.7/command/completions/zsh.ts": "8b04ab244a0b582f7927d405e17b38602428eeb347a9968a657e7ea9f40e721a", + "https://deno.land/x/cliffy@v0.25.7/command/deprecated.ts": "bbe6670f1d645b773d04b725b8b8e7814c862c9f1afba460c4d599ffe9d4983c", + "https://deno.land/x/cliffy@v0.25.7/command/deps.ts": "275b964ce173770bae65f6b8ebe9d2fd557dc10292cdd1ed3db1735f0d77fa1d", + "https://deno.land/x/cliffy@v0.25.7/command/help/_help_generator.ts": "f7c349cb2ddb737e70dc1f89bcb1943ca9017a53506be0d4138e0aadb9970a49", + "https://deno.land/x/cliffy@v0.25.7/command/help/mod.ts": "09d74d3eb42d21285407cda688074c29595d9c927b69aedf9d05ff3f215820d3", + "https://deno.land/x/cliffy@v0.25.7/command/mod.ts": "d0a32df6b14028e43bb2d41fa87d24bc00f9662a44e5a177b3db02f93e473209", + "https://deno.land/x/cliffy@v0.25.7/command/type.ts": "24e88e3085e1574662b856ccce70d589959648817135d4469fab67b9cce1b364", + "https://deno.land/x/cliffy@v0.25.7/command/types.ts": "ae02eec0ed7a769f7dba2dd5d3a931a61724b3021271b1b565cf189d9adfd4a0", + "https://deno.land/x/cliffy@v0.25.7/command/types/action_list.ts": "33c98d449617c7a563a535c9ceb3741bde9f6363353fd492f90a74570c611c27", + "https://deno.land/x/cliffy@v0.25.7/command/types/boolean.ts": "3879ec16092b4b5b1a0acb8675f8c9250c0b8a972e1e4c7adfba8335bd2263ed", + "https://deno.land/x/cliffy@v0.25.7/command/types/child_command.ts": "f1fca390c7fbfa7a713ca15ef55c2c7656bcbb394d50e8ef54085bdf6dc22559", + "https://deno.land/x/cliffy@v0.25.7/command/types/command.ts": "325d0382e383b725fd8d0ef34ebaeae082c5b76a1f6f2e843fee5dbb1a4fe3ac", + "https://deno.land/x/cliffy@v0.25.7/command/types/enum.ts": "2178345972adf7129a47e5f02856ca3e6852a91442a1c78307dffb8a6a3c6c9f", + "https://deno.land/x/cliffy@v0.25.7/command/types/file.ts": "8618f16ac9015c8589cbd946b3de1988cc4899b90ea251f3325c93c46745140e", + "https://deno.land/x/cliffy@v0.25.7/command/types/integer.ts": "29864725fd48738579d18123d7ee78fed37515e6dc62146c7544c98a82f1778d", + "https://deno.land/x/cliffy@v0.25.7/command/types/number.ts": "aeba96e6f470309317a16b308c82e0e4138a830ec79c9877e4622c682012bc1f", + "https://deno.land/x/cliffy@v0.25.7/command/types/string.ts": "e4dadb08a11795474871c7967beab954593813bb53d9f69ea5f9b734e43dc0e0", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/mod.ts": "17e2df3b620905583256684415e6c4a31e8de5c59066eb6d6c9c133919292dc4", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider.ts": "d6fb846043232cbd23c57d257100c7fc92274984d75a5fead0f3e4266dc76ab8", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/deno_land.ts": "24f8d82e38c51e09be989f30f8ad21f9dd41ac1bb1973b443a13883e8ba06d6d", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/github.ts": "99e1b133dd446c6aa79f69e69c46eb8bc1c968dd331c2a7d4064514a317c7b59", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/provider/nest_land.ts": "0e07936cea04fa41ac9297f32d87f39152ea873970c54cb5b4934b12fee1885e", + "https://deno.land/x/cliffy@v0.25.7/command/upgrade/upgrade_command.ts": "3640a287d914190241ea1e636774b1b4b0e1828fa75119971dd5304784061e05", + "https://deno.land/x/cliffy@v0.25.7/flags/_errors.ts": "f1fbb6bfa009e7950508c9d491cfb4a5551027d9f453389606adb3f2327d048f", + "https://deno.land/x/cliffy@v0.25.7/flags/_utils.ts": "340d3ecab43cde9489187e1f176504d2c58485df6652d1cdd907c0e9c3ce4cc2", + "https://deno.land/x/cliffy@v0.25.7/flags/_validate_flags.ts": "16eb5837986c6f6f7620817820161a78d66ce92d690e3697068726bbef067452", + "https://deno.land/x/cliffy@v0.25.7/flags/deprecated.ts": "a72a35de3cc7314e5ebea605ca23d08385b218ef171c32a3f135fb4318b08126", + "https://deno.land/x/cliffy@v0.25.7/flags/flags.ts": "68a9dfcacc4983a84c07ba19b66e5e9fccd04389fad215210c60fb414cc62576", + "https://deno.land/x/cliffy@v0.25.7/flags/types.ts": "7452ea5296758fb7af89930349ce40d8eb9a43b24b3f5759283e1cb5113075fd", + "https://deno.land/x/cliffy@v0.25.7/flags/types/boolean.ts": "4c026dd66ec9c5436860dc6d0241427bdb8d8e07337ad71b33c08193428a2236", + "https://deno.land/x/cliffy@v0.25.7/flags/types/integer.ts": "b60d4d590f309ddddf066782d43e4dc3799f0e7d08e5ede7dc62a5ee94b9a6d9", + "https://deno.land/x/cliffy@v0.25.7/flags/types/number.ts": "610936e2d29de7c8c304b65489a75ebae17b005c6122c24e791fbed12444d51e", + "https://deno.land/x/cliffy@v0.25.7/flags/types/string.ts": "e89b6a5ce322f65a894edecdc48b44956ec246a1d881f03e97bbda90dd8638c5", + "https://deno.land/x/cliffy@v0.25.7/keycode/key_code.ts": "c4ab0ffd102c2534962b765ded6d8d254631821bf568143d9352c1cdcf7a24be", + "https://deno.land/x/cliffy@v0.25.7/keycode/key_codes.ts": "917f0a2da0dbace08cf29bcfdaaa2257da9fe7e705fff8867d86ed69dfb08cfe", + "https://deno.land/x/cliffy@v0.25.7/keycode/mod.ts": "292d2f295316c6e0da6955042a7b31ab2968ff09f2300541d00f05ed6c2aa2d4", + "https://deno.land/x/cliffy@v0.25.7/prompt/_generic_input.ts": "737cff2de02c8ce35250f5dd79c67b5fc176423191a2abd1f471a90dd725659e", + "https://deno.land/x/cliffy@v0.25.7/prompt/_generic_list.ts": "79b301bf09eb19f0d070d897f613f78d4e9f93100d7e9a26349ef0bfaa7408d2", + "https://deno.land/x/cliffy@v0.25.7/prompt/_generic_prompt.ts": "8630ce89a66d83e695922df41721cada52900b515385d86def597dea35971bb2", + "https://deno.land/x/cliffy@v0.25.7/prompt/_generic_suggestions.ts": "2a8b619f91e8f9a270811eff557f10f1343a444a527b5fc22c94de832939920c", + "https://deno.land/x/cliffy@v0.25.7/prompt/_utils.ts": "676cca30762656ed1a9bcb21a7254244278a23ffc591750e98a501644b6d2df3", + "https://deno.land/x/cliffy@v0.25.7/prompt/checkbox.ts": "e5a5a9adbb86835dffa2afbd23c6f7a8fe25a9d166485388ef25aba5dc3fbf9e", + "https://deno.land/x/cliffy@v0.25.7/prompt/confirm.ts": "94c8e55de3bbcd53732804420935c432eab29945497d1c47c357d236a89cb5f6", + "https://deno.land/x/cliffy@v0.25.7/prompt/deps.ts": "4c38ab18e55a792c9a136c1c29b2b6e21ea4820c45de7ef4cf517ce94012c57d", + "https://deno.land/x/cliffy@v0.25.7/prompt/figures.ts": "26af0fbfe21497220e4b887bb550fab997498cde14703b98e78faf370fbb4b94", + "https://deno.land/x/cliffy@v0.25.7/prompt/input.ts": "ee45532e0a30c2463e436e08ae291d79d1c2c40872e17364c96d2b97c279bf4d", + "https://deno.land/x/cliffy@v0.25.7/prompt/list.ts": "6780427ff2a932a48c9b882d173c64802081d6cdce9ff618d66ba6504b6abc50", + "https://deno.land/x/cliffy@v0.25.7/prompt/mod.ts": "195aed14d10d279914eaa28c696dec404d576ca424c097a5bc2b4a7a13b66c89", + "https://deno.land/x/cliffy@v0.25.7/prompt/number.ts": "015305a76b50138234dde4fd50eb886c6c7c0baa1b314caf811484644acdc2cf", + "https://deno.land/x/cliffy@v0.25.7/prompt/prompt.ts": "0e7f6a1d43475ee33fb25f7d50749b2f07fc0bcddd9579f3f9af12d05b4a4412", + "https://deno.land/x/cliffy@v0.25.7/prompt/secret.ts": "58745f5231fb2c44294c4acf2511f8c5bfddfa1e12f259580ff90dedea2703d6", + "https://deno.land/x/cliffy@v0.25.7/prompt/select.ts": "1e982eae85718e4e15a3ee10a5ae2233e532d7977d55888f3a309e8e3982b784", + "https://deno.land/x/cliffy@v0.25.7/prompt/toggle.ts": "842c3754a40732f2e80bcd4670098713e402e64bd930e6cab2b787f7ad4d931a", + "https://deno.land/x/cliffy@v0.25.7/table/border.ts": "2514abae4e4f51eda60a5f8c927ba24efd464a590027e900926b38f68e01253c", + "https://deno.land/x/cliffy@v0.25.7/table/cell.ts": "1d787d8006ac8302020d18ec39f8d7f1113612c20801b973e3839de9c3f8b7b3", + "https://deno.land/x/cliffy@v0.25.7/table/deps.ts": "5b05fa56c1a5e2af34f2103fd199e5f87f0507549963019563eae519271819d2", + "https://deno.land/x/cliffy@v0.25.7/table/layout.ts": "46bf10ae5430cf4fbb92f23d588230e9c6336edbdb154e5c9581290562b169f4", + "https://deno.land/x/cliffy@v0.25.7/table/mod.ts": "e74f69f38810ee6139a71132783765feb94436a6619c07474ada45b465189834", + "https://deno.land/x/cliffy@v0.25.7/table/row.ts": "5f519ba7488d2ef76cbbf50527f10f7957bfd668ce5b9169abbc44ec88302645", + "https://deno.land/x/cliffy@v0.25.7/table/table.ts": "ec204c9d08bb3ff1939c5ac7412a4c9ed7d00925d4fc92aff9bfe07bd269258d", + "https://deno.land/x/cliffy@v0.25.7/table/utils.ts": "187bb7dcbcfb16199a5d906113f584740901dfca1007400cba0df7dcd341bc29", "https://deno.land/x/open@v0.0.5/index.ts": "387293f5063d620137d9ba87fa4a9aece5ac435ca9f5bf5e3f0999634f68e294", "https://deno.land/x/sentry_deno@v0.2.2/main.ts": "c45cc4a347148f89a7a5c574ccfb9802e6c6e807d8f85eb8329e630dbd5ae22b", "https://deno.land/x/sentry_deno@v0.2.2/packages/browser/src/client.ts": "b98d86adc9e6fa53ba973850db759e3f0146aa799050ec913fe32377a28d3315", @@ -183,6 +472,58 @@ "https://deno.land/x/zod@v3.20.2/index.ts": "035a7422d9f2be54daa0fe464254b69225b443000673e4794095d672471e8792", "https://deno.land/x/zod@v3.20.2/locales/en.ts": "ac7210faad6e67ec4f6dbe7062886f04db79ce91ae5ee6c9f64cbdf6221bc80e", "https://deno.land/x/zod@v3.20.2/mod.ts": "64e55237cb4410e17d968cd08975566059f27638ebb0b86048031b987ba251c4", - "https://deno.land/x/zod@v3.20.2/types.ts": "82b5fbb30d1ad0ed4c212002ebf4d43f0b253921c358e205936e6ee2308914d1" + "https://deno.land/x/zod@v3.20.2/types.ts": "82b5fbb30d1ad0ed4c212002ebf4d43f0b253921c358e205936e6ee2308914d1", + "https://esm.sh/cli-select@1.1.2": "204f155136f61ebcdab9aa8a40f6e403d0796350e11ea66111ed303308e9118a", + "https://esm.sh/log-update@5.0.1": "61f9a31832f7120ab2b95d2c794f321afda413e65fc8a01eee43cecd1b72eb79", + "https://esm.sh/object-path-immutable@4.1.2": "743d4d77d1339b783ff2f0dbf9445c33ab1e3d0be668344e0a91c07d2fbbebde", + "https://esm.sh/open-editor@4.0.0": "6ac68c941d354da943453dbfdee1eaaac0e0ad3de7f1fb6711621186b692086e", + "https://esm.sh/v102/@types/line-column-path@2.0.0/line-column-path~.d.ts": "854cdc32752c20a63ea380b17a93c803d6d1e06fa939fdc231732a7b35e8a906", + "https://esm.sh/v102/ansi-escapes@3.2.0/deno/ansi-escapes.js": "c421c4025c97b9a2fcb9a262b66891a04acd327820c11ca79b023bf35bfb6f0e", + "https://esm.sh/v102/ansi-escapes@5.0.0/deno/ansi-escapes.js": "003f9b41e5b5e38cadcc59e3f0ef748ef7c76e84b1105a562118f4e964965459", + "https://esm.sh/v102/ansi-regex@6.0.1/deno/ansi-regex.js": "3616c69e1973463a22532d1cd10f93ebd1c284db5b80e6dc0a3a827ff4cec547", + "https://esm.sh/v102/ansi-styles@6.2.1/deno/ansi-styles.js": "7aaf7d19de45255f535c85ef9c94a1b17a878602483745e4e405885053ce1234", + "https://esm.sh/v102/cli-cursor@4.0.0/deno/cli-cursor.js": "ba396b07604a3eaebafdfc2fa44d1b4e99a84216aad57a3448b55bcd96259867", + "https://esm.sh/v102/cli-select@1.1.2/deno/cli-select.js": "4c3768e41c6b87ff7cdb7bf5a045c548b53e7796caa9d7872822b6020374d9a0", + "https://esm.sh/v102/cli-select@1.1.2/typings/index.d.ts": "741559ad8346bd9c82635b2d1c69ec14d026ecd6a36ee8bfef7ab90b0a556ccc", + "https://esm.sh/v102/cross-spawn@7.0.3/deno/cross-spawn.js": "59e9d470a9a098b929d76aaf6897e53fb39b038c1021faa2acc9dcdbe1854fa3", + "https://esm.sh/v102/define-lazy-prop@2.0.0/deno/define-lazy-prop.js": "261c6329591c91f8bccae70e0588d17c7f452bd5ad021175c92ea04e25d26a05", + "https://esm.sh/v102/eastasianwidth@0.2.0/deno/eastasianwidth.js": "a84f6431401c8f10bb8b687ed1ebb33df390ec0d93bf8d628d0b6ebd7b0558e0", + "https://esm.sh/v102/emoji-regex@9.2.2/deno/emoji-regex.js": "3304eb76603bb512ec856675a955694b444db7320f68da4ef3263d467c474ca2", + "https://esm.sh/v102/env-editor@1.1.0/deno/env-editor.js": "e96bedbcb7629c6e286a7a2ad20fc5a4582265170786580d8ed6818d7b125e42", + "https://esm.sh/v102/execa@5.1.1/deno/execa.js": "8a126c851dc171f8e3c7304d968f59feed3ab5c68efeb98320f1149716607dfa", + "https://esm.sh/v102/get-stream@6.0.1/deno/get-stream.js": "114b0a0d7acb314c402f019a621b601849b765d720468a8ece2227a87074d3aa", + "https://esm.sh/v102/human-signals@2.1.0/deno/human-signals.js": "6b9d6abcb31a7bf4862a3e683da1e32a239552146e78bdfa84992b4ca41de8a6", + "https://esm.sh/v102/is-docker@2.2.1/deno/is-docker.js": "d2bfb93b3f67412a091463dc61bda7e2c8187f5c2791023823643a36fab9cb96", + "https://esm.sh/v102/is-fullwidth-code-point@4.0.0/deno/is-fullwidth-code-point.js": "84a756c36c8cf370ba6f079bbe6fd302e8586ef3dd7e691f1cf56cb53ea67640", + "https://esm.sh/v102/is-plain-object@5.0.0/deno/is-plain-object.js": "5841b90029968c3f2e47a609b32c7d0d846d90edda43dadee012993404e596b2", + "https://esm.sh/v102/is-stream@2.0.1/deno/is-stream.js": "ae469c3d933a420874db5225727c8de546c5524b8c27a52fd6de692e243a6422", + "https://esm.sh/v102/is-wsl@2.2.0/deno/is-wsl.js": "0b0194e5d55049d4193d5bc35816cabf4fca7d623e3a8c3afb57e86806f2a23b", + "https://esm.sh/v102/isexe@2.0.0/deno/isexe.js": "65fdec17a2e6ec3487a97c0cfb06f93be13af7312b596c3cfccdcf31275535a6", + "https://esm.sh/v102/line-column-path@3.0.0/deno/line-column-path.js": "453ea4c23049008aa23ab69af2380764bd89219a3cfbba1100ccd9dc82c38576", + "https://esm.sh/v102/log-update@5.0.1/deno/log-update.js": "cc46b545315bd3f859f254d23dbe05db6cfb3720e8da2018763507c8ca03993d", + "https://esm.sh/v102/log-update@5.0.1/index.d.ts": "42933d34bb60c9cdda56b23b6ebaab820f0c7e424f8bcaae55b89fbf7752cf91", + "https://esm.sh/v102/merge-stream@2.0.0/deno/merge-stream.js": "9e8afd3c4466bf7bd0d2bcbfd11a31ffabfc7cf28e7966d4c63429fcc8e43338", + "https://esm.sh/v102/mimic-fn@2.1.0/deno/mimic-fn.js": "0aeab339e90203c6b006bbc854de10df62fc6f813ad7e131c2ac623485508930", + "https://esm.sh/v102/node.ns.d.ts": "0fb081f0cd2150931bd54baa04f31466abd9ca701fd9060d07931402cf8367ba", + "https://esm.sh/v102/node_buffer.js": "445d389cb8c9f9fad5ff869ca2c2a863d178d410795ebd5f2f39d9a029156d56", + "https://esm.sh/v102/npm-run-path@4.0.1/deno/npm-run-path.js": "feb36b449900d44c9ee24411fc0bb4974dd59b16617c5ff59de11bd6a504a49e", + "https://esm.sh/v102/object-path-immutable@4.1.2/deno/object-path-immutable.js": "845e48d7286fcfcca7eb699cd6e50100b48130006c35f83a45bb6cd067ea3b24", + "https://esm.sh/v102/object-path-immutable@4.1.2/object-path-immutable.d.ts": "6690f85790c90079261eaa56dcaa99919c8560fa535ea238d6af2f1daafd3c75", + "https://esm.sh/v102/object-path@0.11.8/deno/object-path.js": "486dfa9e273ee5132b73508fb8d5679b7ffcf2327d1504d0cebfc0b70d59d59d", + "https://esm.sh/v102/onetime@5.1.2/deno/onetime.js": "a877caf8539c811ba6dc108c115485a9263e872ab8e9e2f26a73f4d23ed161db", + "https://esm.sh/v102/open-editor@4.0.0/deno/open-editor.js": "84bfb634c7f36cc31785a09f8f3066f861afc680efaa8624ee5085a5aa26b89a", + "https://esm.sh/v102/open-editor@4.0.0/index.d.ts": "b6e8ee65435070746e0b43a0b7d02c08e03a9b0d1d9e401ac57a471f17dd2c6f", + "https://esm.sh/v102/open@8.4.0/deno/open.js": "1cbe353af2c3baaf47599fbd74dd08a9bb12cb5ff52cbbd7d5f37163be193fa9", + "https://esm.sh/v102/path-key@3.1.1/deno/path-key.js": "ea9b69451fa6164b7eb0904dfed70df57a1a67132a1def392790fca1bc300e0b", + "https://esm.sh/v102/restore-cursor@4.0.0/deno/restore-cursor.js": "cdacde6cdd3859f2662096232385b2b404ee1c897b931e0fe1c54e10d09cc6f1", + "https://esm.sh/v102/shebang-command@2.0.0/deno/shebang-command.js": "2efae3ed3b701017dff25e5ebd3947e575e5e6f0fc710ce72c5f8bdf9fd2dfe4", + "https://esm.sh/v102/shebang-regex@3.0.0/deno/shebang-regex.js": "cd1f1e96b901cb6f176769d45a6fd6c7a9de611fe538e6ed0b3285623ba5539b", + "https://esm.sh/v102/signal-exit@3.0.7/deno/signal-exit.js": "d411f18fe1bafc3d067d1b0c353bd56f4243f29f71358d60b7c81e8e62be4471", + "https://esm.sh/v102/slice-ansi@5.0.0/deno/slice-ansi.js": "df6280389b5664c0fec7c49fc55467ee14f2b25a7cf54a76c0c1b777c1a1eadf", + "https://esm.sh/v102/string-width@5.1.2/deno/string-width.js": "079827585b8616ccc7fdf529ffd1e4b1467656b00f416ee0d520f848ad85bbbf", + "https://esm.sh/v102/strip-ansi@7.0.1/deno/strip-ansi.js": "e47537cbda4d6eeaf825bba71491251167245954e580dcfd63c92b7a2ee8c04a", + "https://esm.sh/v102/strip-final-newline@2.0.0/deno/strip-final-newline.js": "f39be28ef873f02fc625ed74ec9bd918851695549f7392181f213a38dff7843f", + "https://esm.sh/v102/which@2.0.2/deno/which.js": "22a47228406f324168dad65f6896b1cc79ad78ead9fd2ff508f245fff5398978", + "https://esm.sh/v102/wrap-ansi@8.0.1/deno/wrap-ansi.js": "4c7cc9dcff671d1b04dd70db7db6255d880f85df6fb353d3921236af3302599d" } } diff --git a/lib/act.ts b/lib/act.ts new file mode 100644 index 0000000..16865dd --- /dev/null +++ b/lib/act.ts @@ -0,0 +1,82 @@ +import { env } from "./env.ts"; + +/** + * Logs a message to the console in the appropriate format based on the + * CLI options. + * + * @param formats - Formats to print. + * @param opt - Configuration options + */ +function print( + formats: Formats, + opt: { + json: boolean; + }, +): void { + if (opt?.json) { + console.log( + JSON.stringify( + "value" in formats ? formats.value : formats.json, + null, + 2, + ), + ); + } else { + console.log("value" in formats ? formats.value : formats.human); + } +} + +/** + * A higher order function that needs to be added to every action. This will also + * print the return value of an action function in the appropriate format based on + * the CLI options. + * + * @param fn - An action function that returns a `PrintsFormats` object. + * + * @example + * ```ts + * cli.action(act(async () => { + * return { value: "Hello World" } + * })) + * ``` + */ +export function act< + Fn extends (...args: any[]) => Formats | Promise, +>(fn: Fn) { + return async function action(...args: Parameters): Promise { + const opt = args[0]; + + if (opt.debug !== undefined) { + env.set("DEBUG", opt.debug); + } + + if (opt.apiKey) { + env.set("PAPERSPACE_API_KEY", opt.apiKey); + } + + if (opt.apiUrl) { + env.set("PAPERSPACE_API_URL", opt.apiUrl); + } + + const formats = await fn(...args); + print(formats, opt); + }; +} + +type Formats = + | { + /** + * A JSON-serializable value to print. + */ + json: unknown; + /** + * A human-readable string to print. + */ + human: unknown; + } + | { + /** + * A JSON-serializable value to print. + */ + value: unknown; + }; diff --git a/lib/ansi.ts b/lib/ansi.ts index 7ce7c74..6d4b5f9 100644 --- a/lib/ansi.ts +++ b/lib/ansi.ts @@ -1,6 +1,8 @@ -import { colors } from "https://deno.land/x/cliffy@v0.25.6/ansi/mod.ts"; +import { colors } from "https://deno.land/x/cliffy@v0.25.7/ansi/mod.ts"; export const error = colors.bold.red; export const warn = colors.bold.yellow; export const info = colors.bold.cyan; export const success = colors.bold.green; +export const bold = colors.bold; +export { colors }; diff --git a/lib/cli.ts b/lib/cli.ts index 6e1248d..fa0ad3b 100644 --- a/lib/cli.ts +++ b/lib/cli.ts @@ -5,11 +5,19 @@ import { CompletionsCommand, EnumType, ValidationError, -} from "https://deno.land/x/cliffy@v0.25.6/command/mod.ts"; +} from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts"; +import { Input } from "https://deno.land/x/cliffy@v0.25.7/prompt/mod.ts"; import { open } from "https://deno.land/x/open@v0.0.5/index.ts"; +import { Table } from "https://deno.land/x/cliffy@v0.25.7/table/mod.ts"; +import * as obj from "https://esm.sh/object-path-immutable@4.1.2"; +import openEditor from "https://esm.sh/open-editor@4.0.0"; + import { formattedVersion } from "./version.ts"; -import { success } from "./ansi.ts"; -import { get } from "./deployments/get.ts"; +import * as credentials from "./credentials.ts"; +import * as config from "./config.ts"; +import { bold, colors } from "./ansi.ts"; +import { act } from "./act.ts"; +import { select } from "./select.ts"; const DOCS_ENDPOINT = "https://docs.paperspace.com"; @@ -23,21 +31,16 @@ export const cli = new Command() `, ) .type("url", zodType(z.string().url())) - .type("format", new EnumType(["json", "human"] as const)) .globalOption( - "--api-key ", + "--api-key ", `The Paperspace API key to use for authenticating requests.`, ) .globalOption( - "--api-url ", + "--api-url ", `The URL for the Paperspace API. Defaults to "https://api.paperspace.com/graphql".`, ) - .globalOption( - "-f, --format ", - `Display the output in a specific format. Defaults to "human".`, - ) - .globalOption("--no-color", `Disable colors in the output.".`) .globalOption("--debug", `Enable debug logging.`) + .globalOption("--json", `Display the output as JSON.`) .globalEnv( "PAPERSPACE_API_KEY=", `The Paperspace API key to use for authenticating requests.`, @@ -48,12 +51,19 @@ export const cli = new Command() { hidden: true, }, - ); + ) + .globalEnv("DEBUG=", `Enable debug logging.`, { + required: false, + hidden: true, + }) + .globalEnv("NO_COLOR=", `Disable colors in the output.`) + .action(() => { + cli.showHelp(); + }); /** * Custom types */ -const urlType = zodType(z.string().url()); function zodType(schema: z.ZodSchema) { return ({ name, value }: ArgumentValue) => { @@ -76,44 +86,280 @@ function zodType(schema: z.ZodSchema) { /** * Commands - * @see https://cliffy.io/docs@v0.25.6/command/commands + * @see https://cliffy.io/docs@v0.25.7/command/commands */ +/** + * Deployments + */ cli .command( - "docs", + "deployment, deploy", + new Command() + .command("init") + .action(() => { + console.log("init"); + }) + .command("create") + .action(() => { + console.log("create"); + }) + .command("update") + .action(() => { + console.log("update"); + }) + .command("delete") + .action(() => { + console.log("delete"); + }) + .command("list") + .action(() => { + console.log("list"); + }) + .command("get") + .action(() => { + console.log("list"); + }), + ) + .action(function () { + this.showHelp(); + }); + +/** + * Notebooks + */ +cli + .command( + "notebook, nb", + new Command() + .command("init") + .action(() => { + console.log("init"); + }) + .command("create") + .action(() => { + console.log("create"); + }) + .command("update") + .action(() => { + console.log("update"); + }) + .command("delete") + .action(() => { + console.log("delete"); + }) + .command("list") + .action(() => { + console.log("list"); + }) + .command("get") + .action(() => { + console.log("get"); + }), + ) + .action(function () { + this.showHelp(); + }); + +/** + * Machines + */ +cli + .command( + "machine, vm", + new Command() + .command("init") + .action(() => { + console.log("init"); + }) + .command("create") + .action(() => { + console.log("create"); + }) + .command("update") + .action(() => { + console.log("update"); + }) + .command("delete") + .action(() => { + console.log("delete"); + }) + .command("list") + .action(() => { + console.log("list"); + }) + .command("get") + .action(() => { + console.log("list"); + }), + ) + .action(function () { + this.showHelp(); + }); + +/** + * Login + */ +cli + .command( + "login", ` - Open Paperspace documention in your default browser. + Log in to the CLI using your Paperspace API key or by opening the web console. `, ) - .type("docsPage", new EnumType(["deploy", "nb", "vm"] as const)) - .arguments("[page:docsPage]") - .action((_opt, page) => { - const url = new URL(DOCS_ENDPOINT); + .arguments("[api-key:string]") + .action(async (_opt, apiKey) => { + if (!apiKey) { + open(`https://console.paperspace.com/account/api`); - if (page) { - url.pathname = { - deploy: "/gradient/deployments/", - nb: "/gradient/notebooks/", - vm: "/core/compute/", - }[page] ?? "/"; + const token = await Input.prompt({ + message: "Enter the token:", + }); + + console.log("token", token); + } else { + credentials.set("google-saml-prod", apiKey); } + }); - open(url + ""); +/** + * Logout + */ +cli + .command( + "logout", + ` + Log out of the CLI for the current team, a specific team, or all teams. + `, + ) + .arguments("[team:string]") + .option("--all", "Log out of all teams.") + .action(async (_opt, team) => { + if (_opt.all) { + return await credentials.clear(); + } + + if (team) { + return await credentials.remove(team); + } + + const currentTeam = await config.get("team"); + + if (currentTeam) { + return await credentials.remove(currentTeam); + } }); +/** + * Sign up + */ cli .command( - "deploy", + "signup", ` - Effortlessly deploy and manage ML apps. + Sign up for a Paperspace account. + `, + ) + .action(() => { + open(`https://console.paperspace.com/signup`); + }); + +/** + * Config + */ +cli + .command( + "config", + new Command() + .command("set") + .description( + ` + Set a configuration value at a given path. + `, + ) + .example(`Set the team to "my-team"`, "pspace config set team my-team") + .type("key", new EnumType(config.paths)) + .arguments(" ") + .action( + act(async (_opt, key, value) => { + await config.set(key, value); + const parsedValue = await config.get(key); + return { value: parsedValue }; + }), + ) + .command("get") + .description( + ` + Get a configuration value at a given path. + `, + ) + .example(`Get the current team`, "pspace config get team") + .type("key", new EnumType(config.paths)) + .arguments("[key:key]") + .action( + act(async (_opt, key) => { + if (!key) { + key = await select({ + label: "Select a key to get the value for:", + options: config.paths, + }); + } + const value = await config.get(key); + return { value }; + }), + ) + .command("delete") + .description( + ` + Delete a configuration value at a given path. + `, + ) + .example(`Delete the current team`, "pspace config delete team") + .type("key", new EnumType(config.paths)) + .arguments("") + .action(async (_opt, key) => { + await config.remove(key); + }) + .command("list") + .description( + ` + List all configuration values with their paths. + `, + ) + .action( + act(async () => { + const json = await config.read(); + + const table = new Table().header([bold("Key"), bold("Value")]).body( + config.paths.reduce((acc, key) => { + acc.push([colors.cyan(key), JSON.stringify(obj.get(json, key))]); + return acc; + }, [] as [string, string][]), + ); + + return { + human: table.padding(4).toString(), + json, + }; + }), + ) + .command("open") + .description( + ` + Open the configuration file in a "nano" editor. + `, + ) + .action(() => { + openEditor([config.CONFIG_PATH], { editor: "nano" }); + }), + ) + .description( + ` + Manage global configuration values stored in: "${config.CONFIG_PATH}". `, ) - .type("url", urlType) - .arguments("") - .action(async (_opt, u) => { - const result = await get(u); - console.log("\n" + success(JSON.stringify(result, null, 2))); + .action(function () { + this.showHelp(); }); /** @@ -121,6 +367,61 @@ cli */ cli.command("completions", new CompletionsCommand()); +/** + * Console + */ +cli + .command( + "console", + ` + Open the Paperspace web console. + `, + ) + .action(() => { + open(`https://console.paperspace.com/`); + }); + +/** + * Docs + */ +cli + .command( + "docs", + ` + Open Paperspace documention in your default browser. + `, + ) + .type( + "docsPage", + new EnumType( + [ + "deploy", + "nb", + "vm", + "deployment", + "notebook", + "machine", + ] as const, + ), + ) + .arguments("[page:docsPage]") + .action((_opt, page) => { + const url = new URL(DOCS_ENDPOINT); + + if (page) { + url.pathname = { + deploy: "/gradient/deployments/", + deployment: "/gradient/deployments/", + nb: "/gradient/notebooks/", + notebook: "/gradient/notebooks/", + vm: "/core/compute/", + machine: "/core/compute/", + }[page] ?? "/"; + } + + open(url + ""); + }); + /** * Adds a command to upgrade the CLI diff --git a/lib/client.ts b/lib/client.ts index 59845da..e87de71 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -1,11 +1,14 @@ import { GraphQLClient } from "https://esm.sh/graphql-request@5.1.0"; import { TypedDocumentNode } from "https://esm.sh/v102/@graphql-typed-document-node/core@3.1.1"; import { env } from "./env.ts"; +import { formattedVersion } from "./version.ts"; -const gqlClient = new GraphQLClient(env.PAPERSPACE_API_URL, { - headers: env.PAPERSPACE_API_KEY +const gqlClient = new GraphQLClient(env.get("PAPERSPACE_API_URL"), { + headers: env.get("PAPERSPACE_API_KEY") ? { - authorization: `Bearer ${env.PAPERSPACE_API_KEY}`, + authorization: `Bearer ${env.get("PAPERSPACE_API_KEY")}`, + "x-client": "paperspace-cli", + "x-client-version": formattedVersion, } : {}, }); @@ -13,18 +16,12 @@ const gqlClient = new GraphQLClient(env.PAPERSPACE_API_URL, { export function gqlFetch>( operation: TypedDocumentNode, variables?: TVariables, - options?: { - apiKey?: string; - apiUrl?: string; - }, ): Promise { - if (options?.apiUrl) { - gqlClient.setEndpoint(options.apiUrl); - } - - if (options?.apiKey) { - gqlClient.setHeader("authorization", `Bearer ${options.apiKey}`); - } + gqlClient.setEndpoint(env.get("PAPERSPACE_API_URL")); + gqlClient.setHeader( + "authorization", + `Bearer ${env.get("PAPERSPACE_API_KEY")}`, + ); return gqlClient.request(operation, variables); } diff --git a/lib/config.ts b/lib/config.ts new file mode 100644 index 0000000..c489eb3 --- /dev/null +++ b/lib/config.ts @@ -0,0 +1,200 @@ +import { + parse, + stringify, +} from "https://deno.land/std@0.171.0/encoding/yaml.ts"; +import { z } from "https://deno.land/x/zod@v3.20.2/mod.ts"; +import * as obj from "https://esm.sh/object-path-immutable@4.1.2"; +import { env } from "./env.ts"; +import * as credentials from "./credentials.ts"; +import { logger } from "./logger.ts"; + +/** + * Load the config file + */ +export async function read() { + try { + Deno.statSync(CONFIG_PATH); + } catch (_err) { + logger.warning(`No config file found at "${CONFIG_PATH}".`); + return await schema.parseAsync({ + team: null, + }); + } + + const config = parse(await Deno.readTextFile(CONFIG_PATH)); + return await schema.parseAsync(config); +} + +/** + * Write the config file + * + * @param config - The config to write to the file + */ +export async function write(config: z.infer) { + try { + Deno.statSync(CONFIG_DIR); + } catch (_err) { + logger.warning( + `No config directory found. Creating one: "${CONFIG_DIR}".`, + ); + await Deno.mkdir(CONFIG_DIR, { recursive: true }); + } + + config = await schema.parseAsync(config); + logger.info(`Writing config: "${CONFIG_PATH}".`); + await Deno.writeTextFile( + CONFIG_PATH, + stringify(config), + { + mode: 0o600, + }, + ); +} + +/** + * Get the config value for a given path + * + * @param path - The path to get the value for + */ +export async function get( + path: Path, +): Promise> { + const config = await read(); + return obj.get(config, path); +} + +/** + * Set the value for a given path in the config file + * + * @param path - The path to set the value for + * @param value - The value to set for the path + */ +export async function set( + path: Path, + value: TypeFromPath, +) { + const config = await read(); + return await write(obj.set(config, path, value)); +} + +/** + * Remove a key from the config file + * + * @param path - The path to remove + */ +export async function remove(path: Path) { + const config = await read(); + return await write(obj.del(config, path)); +} + +/** + * Clear the config file + */ +export async function clear() { + return await write( + await schema.parseAsync({ + team: null, + }), + ); +} + +export const schema = z.object({ + version: z.literal(1).default(1), + team: z + .string() + .transform(async (value) => { + if (await credentials.get(value)) { + return value; + } + + return null; + }) + .describe("The name of the current team.") + .nullable() + .default(null), +}); + +export const paths = getKeys(schema).filter((key) => + key !== "version" +) as ConfigPaths[]; + +export type Config = z.infer; +export type ConfigPaths = Exclude< + Exclude, undefined>, + "version" +>; + +const CONFIG_DIR = `${env.get("HOME")}/.paperspace`; +export const CONFIG_PATH = `${CONFIG_DIR}/config.yml`; + +// deno-lint-ignore no-explicit-any +function getKeys(obj: z.ZodObject): string[] { + return Object.keys(obj.shape) + .map((key) => { + const nestedObj = obj.shape[key]?.isOptional() + ? obj.shape[key]._def.innerType + : obj.shape[key]; + + if ("shape" in nestedObj) { + return getKeys(nestedObj).map((subKey: string) => `${key}.${subKey}`); + } + + return key; + }) + .flat(); +} + +type Primitive = string | number | symbol; + +type GenericObject = Record; + +type Join< + L extends Primitive | undefined, + R extends Primitive | undefined, +> = L extends string | number ? R extends string | number ? `${L}.${R}` + : L + : R extends string | number ? R + : undefined; + +type Union< + L extends unknown | undefined, + R extends unknown | undefined, +> = L extends undefined ? R extends undefined ? undefined + : R + : R extends undefined ? L + : L | R; + +/** + * NestedPaths + * Get all the possible paths of an object + * @example + * type Keys = NestedPaths<{ a: { b: { c: string } }> + * // 'a' | 'a.b' | 'a.b.c' + */ +export type NestedPaths< + T extends GenericObject, + Prev extends Primitive | undefined = undefined, + Path extends Primitive | undefined = undefined, +> = { + [K in keyof T]: T[K] extends GenericObject + ? NestedPaths, Join> + : Union, Join>; +}[keyof T]; + +/** + * TypeFromPath + * Get the type of the element specified by the path + * @example + * type TypeOfAB = TypeFromPath<{ a: { b: { c: string } }, 'a.b'> + * // { c: string } + */ +export type TypeFromPath< + T extends GenericObject, + Path extends string, // Or, if you prefer, NestedPaths +> = { + [K in Path]: K extends keyof T ? T[K] + : K extends `${infer P}.${infer S}` + ? T[P] extends GenericObject ? TypeFromPath + : never + : never; +}[Path]; diff --git a/lib/credentials.ts b/lib/credentials.ts new file mode 100644 index 0000000..7b8d3e4 --- /dev/null +++ b/lib/credentials.ts @@ -0,0 +1,93 @@ +import { + parse, + stringify, +} from "https://deno.land/std@0.171.0/encoding/yaml.ts"; +import { z } from "https://deno.land/x/zod@v3.20.2/mod.ts"; +import { env } from "./env.ts"; +import { logger } from "./logger.ts"; + +/** + * Load the credentials file + */ +export async function read() { + try { + Deno.statSync(CREDENTIALS_PATH); + } catch (_err) { + logger.warning(`No credentials file found at "${CREDENTIALS_PATH}".`); + return schema.parse({}); + } + + const credentials = parse(await Deno.readTextFile(CREDENTIALS_PATH)); + return schema.parse(credentials); +} + +/** + * Write the credentials file + * + * @param credentials - The credentials to write to the file + */ +export async function write(credentials: z.infer) { + try { + Deno.statSync(CREDENTIALS_DIR); + } catch (_err) { + logger.warning( + `No credentials directory found. Creating one: "${CREDENTIALS_DIR}".`, + ); + await Deno.mkdir(CREDENTIALS_DIR, { recursive: true }); + } + + credentials = schema.parse(credentials); + logger.info(`Writing credentials: "${CREDENTIALS_PATH}".`); + await Deno.writeTextFile(CREDENTIALS_PATH, stringify(credentials), { + mode: 0o600, + }); +} + +/** + * Get the API key for a team from the credentials file + * + * @param team - The team to get the API key for + */ +export async function get(team: string) { + const credentials = await read(); + return credentials.keys[team]; +} + +/** + * Set the API key for a team in the credentials file + * + * @param team - The team to set the API key for + * @param apiKey - The API key to set for the team + */ +export async function set(team: string, apiKey: string) { + const credentials = await read(); + credentials.keys[team] = apiKey; + + return await write(credentials); +} + +/** + * Remove a team from the credentials file + * + * @param team - The team to remove from the credentials file + */ +export async function remove(team: string) { + const credentials = await read(); + delete credentials.keys[team]; + + return await write(credentials); +} + +/** + * Clear the credentials file + */ +export async function clear() { + return await write({ version: 1, keys: {} }); +} + +export const schema = z.object({ + version: z.literal(1).default(1), + keys: z.record(z.string()).optional().default({}), +}); +const CREDENTIALS_DIR = `${env.get("HOME")}/.paperspace`; +export const CREDENTIALS_PATH = `${CREDENTIALS_DIR}/credentials.yml`; diff --git a/lib/deployments/README.md b/lib/deployments/README.md new file mode 100644 index 0000000..c719658 --- /dev/null +++ b/lib/deployments/README.md @@ -0,0 +1,40 @@ +## CRUD (create, update, delete, list, get) + +- [ ] `pspace deploy create --spec path/to/spec.yml [--template]` +- [ ] `pspace deploy delete` +- [ ] `pspace deploy update [id] --spec path/to/**.yml` +- [ ] `pspace deploy list [--first] [--after] [--order-by]` +- [ ] `pspace deploy get [id] --poll [interval]` + +## Project linking + +Link the working directory to a project. Saves typing `--project-id` for every +command. + +- [ ] `pspace project link [projectId]` +- [ ] Maybe? `pspace deploy link [deploymentId]` + +## Global config + +- [ ] `pspace config get team` +- [ ] `pspace config set team google-saml-prod` + - `$HOME/.pspace/credentials.yml` + - `$HOME/.pspace/config.yml` + - Prompt for API key if not in creds file + +## Login + +- [ ] `pspace login ` +- [ ] `pspace login` + - Open up the web browser to a page to receive a temporary token + - Enter token into the CLI + - Send to public API, receive API key + - Store API key in creds file + +## Notebooks + +- `pspace nb create` + +## VMs + +- `pspace vm create` diff --git a/lib/env.ts b/lib/env.ts index 2b83896..9a93bb3 100644 --- a/lib/env.ts +++ b/lib/env.ts @@ -1,35 +1,60 @@ import { z } from "https://deno.land/x/zod@v3.20.2/mod.ts"; import { info } from "./ansi.ts"; +const bool = z + .string() + .transform((value) => { + return value === "true" || value === "1"; + }); + export const envSchema = z.object({ - PAPERSPACE_API_KEY: z.string(), + PAPERSPACE_API_KEY: z.string().optional(), PAPERSPACE_API_URL: z .string() .url() .default("https://api.paperspace.com/graphql"), + HOME: z.string(), + DEBUG: bool.optional(), + NO_COLOR: bool.optional(), }); -export let safeEnv: z.infer; - -try { - safeEnv = envSchema.parse(Deno.env.toObject()); -} catch (error) { - if (error instanceof z.ZodError) { - console.error( - `Invalid environment variables:\n${ - Object.keys( - error.formErrors.fieldErrors, - ) - .map( - (key) => - ` ${info(key)}: ${error.formErrors.fieldErrors[key].message}`, - ) - .join("\n") - }`, - ); - } - - Deno.exit(1); -} - -export const env = safeEnv; +export const env = { + get(name: Name): Env[Name] { + let value: Env[Name]; + + try { + value = envSchema.shape[name].parse(Deno.env.get(name)) as Env[Name]; + } catch (error) { + if (error instanceof z.ZodError) { + console.error( + `Invalid environment variables:\n${ + Object.keys( + error.formErrors.fieldErrors, + ) + .map( + (key) => + ` ${info(key)}: ${ + error.formErrors.fieldErrors[key].message + }`, + ) + .join("\n") + }`, + ); + } + + Deno.exit(1); + } + + return value; + }, + + set(name: Name, value: Env[Name]): void { + if (value === undefined) { + return Deno.env.delete(name); + } + + Deno.env.set(name, value.toString()); + }, +}; + +export type Env = z.infer; diff --git a/lib/logger.ts b/lib/logger.ts new file mode 100644 index 0000000..23aa2a3 --- /dev/null +++ b/lib/logger.ts @@ -0,0 +1,27 @@ +import { env } from "./env.ts"; +import * as log from "https://deno.land/std@0.171.0/log/mod.ts"; + +class PaperspaceLogger extends log.handlers.ConsoleHandler { + override log(msg: string) { + if (env.get("DEBUG")) { + console.log(msg); + } + } +} + +log.setup({ + handlers: { + console: new PaperspaceLogger("DEBUG", { + formatter: "{levelName} – {msg}", + }), + }, + + loggers: { + default: { + level: "DEBUG", + handlers: ["console"], + }, + }, +}); + +export const logger = log.getLogger(); diff --git a/lib/paperspace-graphql.ts b/lib/paperspace-graphql.ts index eef0763..36add5b 100644 --- a/lib/paperspace-graphql.ts +++ b/lib/paperspace-graphql.ts @@ -3629,6 +3629,301 @@ export type Address = { zipCode?: Maybe; }; +export type CreateDeploymentMutationVariables = Exact<{ + createDeploymentInput: CreateDeploymentInput; +}>; + +export type CreateDeploymentMutation = { + __typename?: "Mutation"; + createDeployment: { + __typename?: "CreateDeploymentPayload"; + deployment: { __typename?: "Deployment"; id: string }; + }; +}; + +export type UpdateDeploymentMutationVariables = Exact<{ + updateDeploymentInput: UpdateDeploymentInput; +}>; + +export type UpdateDeploymentMutation = { + __typename?: "Mutation"; + updateDeployment: { + __typename?: "UpdateDeploymentPayload"; + deployment: { __typename?: "Deployment"; id: string }; + }; +}; + +export type DeleteDeploymentMutationMutationVariables = Exact<{ + deleteDeploymentInput: DeleteDeploymentInput; +}>; + +export type DeleteDeploymentMutationMutation = { + __typename?: "Mutation"; + deleteDeployment: { + __typename?: "DeleteDeploymentPayload"; + deployment: { __typename?: "Deployment"; id: string; name: string }; + }; +}; + +export type DeploymentQueryVariables = Exact<{ + deploymentId: Scalars["UUID"]; + first?: InputMaybe; + after?: InputMaybe; + runOrderBy?: InputMaybe; + instanceOrderBy?: InputMaybe; +}>; + +export type DeploymentQuery = { + __typename?: "Query"; + deployment?: { + __typename?: "Deployment"; + id: string; + name: string; + dtCreated: Date; + dtModified?: Date | null; + deploymentSpecs: { + __typename?: "DeploymentSpecConnection"; + nodes: Array< + { + __typename?: "DeploymentSpec"; + id: string; + endpointUrl: string; + externalApplied?: Date | null; + dtCreated: Date; + dtInvalid?: Date | null; + error?: string | null; + actor: { + __typename?: "Actor"; + avatarUrl?: string | null; + fullName?: string | null; + email?: string | null; + }; + cluster?: + | { __typename?: "Cluster"; name: string; fqdn: string } + | null; + data: { + __typename?: "DeploymentSpecData"; + image: string; + containerRegistry?: string | null; + port?: number | null; + command?: Array | null; + env?: + | Array< + { + __typename?: "DeploymentSpecEnvVariable"; + name: string; + value: string; + } + > + | null; + models?: + | Array< + { + __typename?: "DeploymentSpecModel"; + id: string; + path?: string | null; + } + > + | null; + repositories?: { + __typename?: "DeploymentSpecRepositories"; + dataset?: string | null; + mountPath?: string | null; + repositories?: + | Array< + { + __typename?: "DeploymentSpecRepository"; + url: string; + name: string; + ref?: string | null; + username?: string | null; + password?: string | null; + } + > + | null; + } | null; + resources?: { + __typename?: "DeploymentSpecResources"; + replicas: number; + instanceType?: string | null; + autoscaling?: { + __typename?: "DeploymentSpecAutoscaling"; + enabled?: boolean | null; + maxReplicas: number; + metrics: Array< + { + __typename?: "DeploymentSpecAutoscalingMetricObject"; + metric: string; + summary: string; + value: number; + } + >; + } | null; + } | null; + }; + deploymentRuns?: { + __typename?: "DeploymentRunConnection"; + nodes: Array< + { + __typename?: "DeploymentRun"; + id: string; + availableReplicas?: number | null; + readyReplicas?: number | null; + replicas?: number | null; + dtDeleted?: Date | null; + dtModified?: Date | null; + dtCreated: Date; + deploymentRunInstances?: { + __typename?: "DeploymentRunInstanceConnection"; + nodes: Array< + { + __typename?: "DeploymentRunInstance"; + id: string; + externalApplied?: Date | null; + dtStarted?: Date | null; + dtFinished?: Date | null; + dtDeleted?: Date | null; + phase?: InstancePhase | null; + state?: DeploymentRunInstanceState | null; + stateMessage?: string | null; + } + >; + } | null; + } + >; + } | null; + } + >; + edges: Array<{ __typename?: "DeploymentSpecEdge"; cursor: string }>; + pageInfo: { __typename?: "PageInfo"; hasNextPage: boolean }; + }; + } | null; +}; + +export type DeploymentListQueryVariables = Exact<{ + projectHandle: Scalars["String"]; + first?: InputMaybe; + after?: InputMaybe; +}>; + +export type DeploymentListQuery = { + __typename?: "Query"; + deployments: { + __typename?: "DeploymentConnection"; + nodes: Array< + { + __typename?: "Deployment"; + id: string; + name: string; + dtCreated: Date; + deploymentSpecs: { + __typename?: "DeploymentSpecConnection"; + nodes: Array< + { + __typename?: "DeploymentSpec"; + id: string; + externalApplied?: Date | null; + dtCreated: Date; + dtInvalid?: Date | null; + error?: string | null; + deploymentRuns?: { + __typename?: "DeploymentRunConnection"; + nodes: Array< + { + __typename?: "DeploymentRun"; + id: string; + dtDeleted?: Date | null; + availableReplicas?: number | null; + readyReplicas?: number | null; + replicas?: number | null; + deploymentRunInstances?: { + __typename?: "DeploymentRunInstanceConnection"; + nodes: Array< + { + __typename?: "DeploymentRunInstance"; + id: string; + externalApplied?: Date | null; + dtStarted?: Date | null; + dtFinished?: Date | null; + phase?: InstancePhase | null; + state?: DeploymentRunInstanceState | null; + stateMessage?: string | null; + } + >; + } | null; + } + >; + } | null; + data: { + __typename?: "DeploymentSpecData"; + image: string; + containerRegistry?: string | null; + port?: number | null; + command?: Array | null; + env?: + | Array< + { + __typename?: "DeploymentSpecEnvVariable"; + name: string; + value: string; + } + > + | null; + models?: + | Array< + { + __typename?: "DeploymentSpecModel"; + id: string; + path?: string | null; + } + > + | null; + repositories?: { + __typename?: "DeploymentSpecRepositories"; + dataset?: string | null; + mountPath?: string | null; + repositories?: + | Array< + { + __typename?: "DeploymentSpecRepository"; + url: string; + name: string; + ref?: string | null; + username?: string | null; + password?: string | null; + } + > + | null; + } | null; + resources?: { + __typename?: "DeploymentSpecResources"; + replicas: number; + instanceType?: string | null; + autoscaling?: { + __typename?: "DeploymentSpecAutoscaling"; + enabled?: boolean | null; + maxReplicas: number; + metrics: Array< + { + __typename?: "DeploymentSpecAutoscalingMetricObject"; + metric: string; + summary: string; + value: number; + } + >; + } | null; + } | null; + }; + } + >; + }; + } + >; + edges: Array<{ __typename?: "DeploymentEdge"; cursor: string }>; + pageInfo: { __typename?: "PageInfo"; hasNextPage: boolean }; + }; +}; + export type ActivityLogQueryVariables = Exact<{ projectId: Scalars["String"]; first?: InputMaybe; @@ -3793,6 +4088,1073 @@ export type ActivityLogQuery = { }; }; +export const CreateDeploymentDocument = { + "kind": "Document", + "definitions": [{ + "kind": "OperationDefinition", + "operation": "mutation", + "name": { "kind": "Name", "value": "CreateDeployment" }, + "variableDefinitions": [{ + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "createDeploymentInput" }, + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "CreateDeploymentInput" }, + }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "createDeployment" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "input" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "createDeploymentInput" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deployment" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }], + }, + }], + }, + }], + }, + }], +} as unknown as DocumentNode< + CreateDeploymentMutation, + CreateDeploymentMutationVariables +>; +export const UpdateDeploymentDocument = { + "kind": "Document", + "definitions": [{ + "kind": "OperationDefinition", + "operation": "mutation", + "name": { "kind": "Name", "value": "UpdateDeployment" }, + "variableDefinitions": [{ + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "updateDeploymentInput" }, + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "UpdateDeploymentInput" }, + }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "updateDeployment" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "input" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "updateDeploymentInput" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deployment" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }], + }, + }], + }, + }], + }, + }], +} as unknown as DocumentNode< + UpdateDeploymentMutation, + UpdateDeploymentMutationVariables +>; +export const DeleteDeploymentMutationDocument = { + "kind": "Document", + "definitions": [{ + "kind": "OperationDefinition", + "operation": "mutation", + "name": { "kind": "Name", "value": "DeleteDeploymentMutation" }, + "variableDefinitions": [{ + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "deleteDeploymentInput" }, + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "DeleteDeploymentInput" }, + }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deleteDeployment" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "input" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "deleteDeploymentInput" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deployment" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }], + }, + }], + }, + }], + }, + }], +} as unknown as DocumentNode< + DeleteDeploymentMutationMutation, + DeleteDeploymentMutationMutationVariables +>; +export const DeploymentDocument = { + "kind": "Document", + "definitions": [{ + "kind": "OperationDefinition", + "operation": "query", + "name": { "kind": "Name", "value": "Deployment" }, + "variableDefinitions": [{ + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "deploymentId" }, + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "UUID" }, + }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "Int" }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "after" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "String" }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "runOrderBy" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "DeploymentRunOrder" }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "instanceOrderBy" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "DeploymentRunInstanceOrder" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deployment" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "id" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "deploymentId" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [ + { "kind": "Field", "name": { "kind": "Name", "value": "id" } }, + { "kind": "Field", "name": { "kind": "Name", "value": "name" } }, + { + "kind": "Field", + "name": { "kind": "Name", "value": "dtCreated" }, + }, + { + "kind": "Field", + "name": { "kind": "Name", "value": "dtModified" }, + }, + { + "kind": "Field", + "name": { "kind": "Name", "value": "deploymentSpecs" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + }, { + "kind": "Argument", + "name": { "kind": "Name", "value": "after" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "after" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "endpointUrl" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "externalApplied" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtCreated" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtInvalid" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "error" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "actor" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "avatarUrl" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "fullName" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "email" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "cluster" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "fqdn" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "data" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "image" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "containerRegistry", + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "port" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "command" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "env" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "value" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "models" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "path" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "repositories" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "dataset" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "mountPath" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "repositories", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "url" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "ref" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "username", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "password", + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "resources" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "replicas" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "autoscaling", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "enabled", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "maxReplicas", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "metrics", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "metric", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "summary", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "value", + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "instanceType", + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "deploymentRuns" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + }, { + "kind": "Argument", + "name": { "kind": "Name", "value": "orderBy" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "runOrderBy" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "availableReplicas", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "readyReplicas", + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "replicas" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtDeleted" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtModified" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtCreated" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "deploymentRunInstances", + }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + }, { + "kind": "Argument", + "name": { "kind": "Name", "value": "orderBy" }, + "value": { + "kind": "Variable", + "name": { + "kind": "Name", + "value": "instanceOrderBy", + }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "externalApplied", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtStarted", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtFinished", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtDeleted", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "phase", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "state", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "stateMessage", + }, + }], + }, + }], + }, + }], + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "edges" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "cursor" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "pageInfo" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "hasNextPage" }, + }], + }, + }], + }, + }, + ], + }, + }], + }, + }], +} as unknown as DocumentNode; +export const DeploymentListDocument = { + "kind": "Document", + "definitions": [{ + "kind": "OperationDefinition", + "operation": "query", + "name": { "kind": "Name", "value": "DeploymentList" }, + "variableDefinitions": [{ + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "projectHandle" }, + }, + "type": { + "kind": "NonNullType", + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "String" }, + }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "Int" }, + }, + }, { + "kind": "VariableDefinition", + "variable": { + "kind": "Variable", + "name": { "kind": "Name", "value": "after" }, + }, + "type": { + "kind": "NamedType", + "name": { "kind": "Name", "value": "String" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deployments" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "projectId" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "projectHandle" }, + }, + }, { + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "first" }, + }, + }, { + "kind": "Argument", + "name": { "kind": "Name", "value": "after" }, + "value": { + "kind": "Variable", + "name": { "kind": "Name", "value": "after" }, + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "deploymentSpecs" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { "kind": "IntValue", "value": "10" }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "deploymentRuns" }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { "kind": "IntValue", "value": "10" }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "nodes" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtDeleted", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "availableReplicas", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "readyReplicas", + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "replicas" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "deploymentRunInstances", + }, + "arguments": [{ + "kind": "Argument", + "name": { "kind": "Name", "value": "first" }, + "value": { + "kind": "IntValue", + "value": "10", + }, + }], + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "nodes", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "id", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "externalApplied", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtStarted", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "dtFinished", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "phase", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "state", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "stateMessage", + }, + }], + }, + }], + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "data" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "image" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "containerRegistry", + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "port" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "command" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "env" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "value" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "models" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "path" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "repositories" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "dataset" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "mountPath", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "repositories", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "url" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "name" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "ref" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "username", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "password", + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "resources" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "replicas" }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "instanceType", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "autoscaling", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "enabled", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "maxReplicas", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "metrics", + }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "metric", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "summary", + }, + }, { + "kind": "Field", + "name": { + "kind": "Name", + "value": "value", + }, + }], + }, + }], + }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "id" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "externalApplied" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtCreated" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtInvalid" }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "error" }, + }], + }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "dtCreated" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "edges" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "cursor" }, + }], + }, + }, { + "kind": "Field", + "name": { "kind": "Name", "value": "pageInfo" }, + "selectionSet": { + "kind": "SelectionSet", + "selections": [{ + "kind": "Field", + "name": { "kind": "Name", "value": "hasNextPage" }, + }], + }, + }], + }, + }], + }, + }], +} as unknown as DocumentNode; export const ActivityLogDocument = { "kind": "Document", "definitions": [{ diff --git a/lib/select.ts b/lib/select.ts new file mode 100644 index 0000000..49289a7 --- /dev/null +++ b/lib/select.ts @@ -0,0 +1,54 @@ +import cliSelect from "https://esm.sh/cli-select@1.1.2"; +import { info } from "./ansi.ts"; + +export async function select( + { label, options, renderValue, ...other }: SelectConfig, +) { + if (label) { + console.log(info("❯"), label); + } + + const value = await cliSelect({ + values: options, + indentation: 2, + selected: info("◉"), + unselected: "◯", + valueRenderer(value, selected) { + if (selected) { + return info( + renderValue ? renderValue(value, selected) : String(value), + ); + } + + return renderValue ? renderValue(value, selected) : String(value); + }, + ...other, + }); + + return value.value; +} + +export type SelectConfig = + & { + label?: string; + options: ValuesObject | ValuesArray; + defaultValue?: Index; + cleanup?: boolean; + } + & (T extends { [s: string | number | symbol]: any } ? { + renderValue: RenderValue; + } + : { renderValue?: RenderValue }); + +type ValuesObject = { + [s: string]: T; +}; + +// deno-lint-ignore no-empty-interface +interface ValuesArray extends Array {} + +type RenderValue = { + (value: T, selected: boolean): string; +}; + +type Index = number | string; diff --git a/lib/upgrade.ts b/lib/upgrade.ts index 50156a4..c50e345 100644 --- a/lib/upgrade.ts +++ b/lib/upgrade.ts @@ -2,7 +2,7 @@ import { z } from "https://deno.land/x/zod@v3.20.2/mod.ts"; import { Command, EnumType, -} from "https://deno.land/x/cliffy@v0.25.6/command/mod.ts"; +} from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts"; import { __COMMIT__ } from "./version.ts"; type Provider = "scoop" | "choco" | "brew" | "curl"; diff --git a/main.ts b/main.ts index aad2198..629e365 100644 --- a/main.ts +++ b/main.ts @@ -1,5 +1,5 @@ import * as Sentry from "https://deno.land/x/sentry_deno@v0.2.2/main.ts"; -import { ValidationError } from "https://deno.land/x/cliffy@v0.25.6/command/mod.ts"; +import { ValidationError } from "https://deno.land/x/cliffy@v0.25.7/command/mod.ts"; import { cli } from "./lib/cli.ts"; import { __COMMIT__, __VERSION__ } from "./lib/version.ts";