diff --git a/.gitignore b/.gitignore deleted file mode 100644 index c904c1d..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/key.json diff --git a/deno.lock b/deno.lock index 01529ce..c4fafe1 100644 --- a/deno.lock +++ b/deno.lock @@ -1,8 +1,6 @@ { "version": "2", "remote": { - "https://deno.land/std@0.167.0/_util/asserts.ts": "d0844e9b62510f89ce1f9878b046f6a57bf88f208a10304aab50efcb48365272", - "https://deno.land/std@0.167.0/_util/os.ts": "8a33345f74990e627b9dfe2de9b040004b08ea5146c7c9e8fe9a29070d193934", "https://deno.land/std@0.167.0/async/abortable.ts": "80b2ac399f142cc528f95a037a7d0e653296352d95c681e284533765961de409", "https://deno.land/std@0.167.0/async/deadline.ts": "2c2deb53c7c28ca1dda7a3ad81e70508b1ebc25db52559de6b8636c9278fd41f", "https://deno.land/std@0.167.0/async/debounce.ts": "60301ffb37e730cd2d6f9dadfd0ecb2a38857681bd7aaf6b0a106b06e5210a98", @@ -13,95 +11,16 @@ "https://deno.land/std@0.167.0/async/pool.ts": "6854d8cd675a74c73391c82005cbbe4cc58183bddcd1fbbd7c2bcda42b61cf69", "https://deno.land/std@0.167.0/async/retry.ts": "e8e5173623915bbc0ddc537698fa418cf875456c347eda1ed453528645b42e67", "https://deno.land/std@0.167.0/async/tee.ts": "3a47cc4e9a940904fd4341f0224907e199121c80b831faa5ec2b054c6d2eff5e", - "https://deno.land/std@0.167.0/collections/group_by.ts": "ce8057c75d640491c0c81e0a6ce5524a8c0af00977a445ca5dbde24e4371d109", - "https://deno.land/std@0.167.0/fs/_util.ts": "fdc156f897197f261a1c096dcf8ff9267ed0ff42bd5b31f55053a4763a4bae3b", - "https://deno.land/std@0.167.0/fs/copy.ts": "c6303e52f544c81271c929931f5b59c9cfa4f81930719d2d3f777188c38aac9f", - "https://deno.land/std@0.167.0/fs/empty_dir.ts": "453d6232ff109f2afb5e57ec14c3228e399205c1b408d85536aed7230290c414", - "https://deno.land/std@0.167.0/fs/ensure_dir.ts": "5e9e3d7da7fc5b5e391e6d9ccead17086d76e82fb46ccc7cc9b9ee3491bab6e0", - "https://deno.land/std@0.167.0/fs/ensure_file.ts": "76ef3a8ebef60d8da1fc4316fcb8e20c1b6f52b1baed3a9692ad3b0d1a9a1b03", - "https://deno.land/std@0.167.0/fs/ensure_link.ts": "adc8919063e26819f5971a0010fedc1bfd71d6350a24db1a36dff432bc35c7d7", - "https://deno.land/std@0.167.0/fs/ensure_symlink.ts": "5273557b8c50be69477aa9cb003b54ff2240a336db52a40851c97abce76b96ab", - "https://deno.land/std@0.167.0/fs/eol.ts": "6e784ff8120c8d5589cb258e56dc39bc5b408ac9827a2e914163cbf9f2e3ce92", - "https://deno.land/std@0.167.0/fs/exists.ts": "6a447912e49eb79cc640adacfbf4b0baf8e17ede6d5bed057062ce33c4fa0d68", - "https://deno.land/std@0.167.0/fs/expand_glob.ts": "3a92ee4921d2b063b8dfefd1d87c35bf81126f0f1cb16e5a0f4e9ecb88ec6fe3", - "https://deno.land/std@0.167.0/fs/mod.ts": "79c209c6e66903b3426f9245a4f216380a0ed47ffe9d253f5a61a0bc9ad1f314", - "https://deno.land/std@0.167.0/fs/move.ts": "02ab1fc9b744da8b496f406e9fc77b0bf7960b6faaa7ec9f5fb0a129e5bef215", - "https://deno.land/std@0.167.0/fs/walk.ts": "677eac2e5386217a7a4e7526769ae28b41ff4ae7a3cd0389f3aa4eb662545edd", "https://deno.land/std@0.167.0/http/server.ts": "e99c1bee8a3f6571ee4cdeb2966efad465b8f6fe62bec1bdb59c1f007cc4d155", - "https://deno.land/std@0.167.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", - "https://deno.land/std@0.167.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", - "https://deno.land/std@0.167.0/path/_util.ts": "d16be2a16e1204b65f9d0dfc54a9bc472cafe5f4a190b3c8471ec2016ccd1677", - "https://deno.land/std@0.167.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", - "https://deno.land/std@0.167.0/path/glob.ts": "81cc6c72be002cd546c7a22d1f263f82f63f37fe0035d9726aa96fc8f6e4afa1", - "https://deno.land/std@0.167.0/path/mod.ts": "cf7cec7ac11b7048bb66af8ae03513e66595c279c65cfa12bfc07d9599608b78", - "https://deno.land/std@0.167.0/path/posix.ts": "b859684bc4d80edfd4cad0a82371b50c716330bed51143d6dcdbe59e6278b30c", - "https://deno.land/std@0.167.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", - "https://deno.land/std@0.167.0/path/win32.ts": "7cebd2bda6657371adc00061a1d23fdd87bcdf64b4843bb148b0b24c11b40f69", - "https://deno.land/x/fast_base64@v0.1.7/dist/base64-wasm.js": "39af9bac84f55fd88dff52cf756ec06318f3263432475bcccafa92dca666df5f", - "https://deno.land/x/fast_base64@v0.1.7/mod.ts": "7aad1b1c8f53eeb3da3a24cbd637f3ce5342fb8107f54ed95fd9b066bbce9931", - "https://esm.sh/prettier@2.7.1/parser-typescript?pin=v99": "a1874f021ffe0e7e9fe8245f6224db2dc676fed90502e01cd3ad9f8b49b4fdbf", - "https://esm.sh/prettier@2.7.1?pin=v99": "e9bcba322fb24e29142bde52bdc3086c2921b24a1df3a3b58ca129926ce7bfa7", "https://esm.sh/react-dom@18.2.0/server?pin=v99": "254dadb754ed6c9e58892a8ac39b3bc049c305df75841f174f51ee9fe44f308b", "https://esm.sh/react@18.2.0?pin=v99": "84aa07282d2f3c843f7d56daeae0be41ceae768391c4418f7358dd64e8fe4eca", "https://esm.sh/stable/react@18.2.0/deno/react.js": "806868069cfdb815e028419cf07ebc7a7bcba7f9e31dec9e3a045b9f8e82c1ed", - "https://esm.sh/v99/@types/prettier@2.7.1/index.d.ts": "93c4fc5b5237c09bc9ed65cb8f0dc1d89034406ab40500b89701341994897142", - "https://esm.sh/v99/@types/prettier@2.7.1/parser-typescript~.d.ts": "39b32b7e7e804787afd891865071a345f1cb6dafb9175edebb8407eb83a5c1ba", "https://esm.sh/v99/@types/prop-types@15.7.5/index.d.ts": "6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea", "https://esm.sh/v99/@types/react-dom@18.0.9/server~.d.ts": "54e0e45acce638a46c2dc13a5e9800c3fc094ec58baef3aeaedbd0c674a55249", "https://esm.sh/v99/@types/react@18.0.25/global.d.ts": "bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f", "https://esm.sh/v99/@types/react@18.0.25/index.d.ts": "12154bc47748a901d10aa84dc39d0ec3a5f2d50624a7f018b473ef5af23063b4", "https://esm.sh/v99/@types/scheduler@0.16.2/tracing.d.ts": "f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5", "https://esm.sh/v99/csstype@3.1.1/index.d.ts": "1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383", - "https://esm.sh/v99/prettier@2.7.1/deno/parser-typescript.js": "2bcbf6e674e162d9faf010cc22ec20e42313cac58185cbbfc46ce71d6fda6767", - "https://esm.sh/v99/prettier@2.7.1/deno/prettier.js": "14dbc613cd7818b445dc18084aaa393e16d809daac3baa732e0386a2a1459f33", - "https://esm.sh/v99/react-dom@18.2.0/deno/server.js": "bf1ce0fcb084be382713a3bbf9df8d6564cddad331ef30e9307f1c8eaa1e513d", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/func.ts": "416c0722244a4118e05c9ffd556a264cb99191a1ad449f2b82fbd24d9f08da08", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/main.ts": "4dd9928dfddc71f80ae3855513a442b56f34a0e1135cdeb48b66190b40e53a0f", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/namespace.ts": "5ed1502b9e3dc7369a6bb7a9d0fea259c351c1440e142ec0b03cc7930fceb55d", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/result.ts": "b44d7cede767eeb9f39d3b85b0d2622fd0ace5886be789a8233aa3b55bdbaa29", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/type.ts": "7b705c4c55685adadb130a7fd68ca72c2bbda7e576f21b3c070616beaaf285a4", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/type/use.ts": "f12b5446249976c85c164896485c65f8d8d6aa2c1c809db4f3a3c071048758f3", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/typeVariable/from.ts": "41bb690ee5e13c54b474236e234b86d995ca4ea4aa2cca65f2c19c57d8a4fcbb", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/typeVariable/tag.ts": "0e155d45ea0919291fca20bcd448a09a654a72fc744336e503680744007d9cb0", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/typeVariable/type.ts": "762830426d6fb44d8b151268d33d40b6ffd4a803e5b1eb105aa14ef2076b4175", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/typeVariable/use.ts": "228de4319db80fbfc7fc17be084299ffbb4f8bf89405c1332d78deb236366784", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/useMaybe.ts": "c50c83f83a3add0ce59709d59115ebc4a4548efb658aec967530d5b5b57ef9c2", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/codeGen/useNamespace.ts": "3444caa092f39518a46215d7926572dea3049c81b336c183ffb5acce0e98bfbc", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/apiFunction.ts": "03f62a08b9fd7a5530d76fb6c2fb63e128dca930050d60fb8540239233ec4456", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/builtInFunctions.ts": "5c133cd3da2a1a2ad87e824e1ccd737fed0d8c4933a3e603bb98decc56e8875e", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/collectType.ts": "eed72d41f034ec9b10df88349aecd9849d0c30a48bfef4cf529fb693fd564774", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/coreType.ts": "b2d86547914d59425d12c86a75cabceea2302cb2467868072af8d5e1772caf9f", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/coreTypeInfo.ts": "48ec3b665c6e03c2845e944b427e20bf185fe08a92cbc3ebea3c59143d344e41", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/fromStructuredJson.ts": "6d7ffa5ad7895605de5769e1e70bc59d36d2f6fc71bf497f1b703ffa16a7cdb5", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/generateMetaAndLocalCode.ts": "d83c47d2c397b55cc315a3d742107a7bcc160e309417351ecc015ac3c54c118c", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/core/toStructuredJson.ts": "c6cae03c73a660f2a141f040c4139a8335151f3c775008d4e7d4d16f190ba88c", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/server/browserClient.json": "14cde6bad8a17e356a74bb713b87a396b030dbd54fdfd52283f73747a29259de", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/definyRpc/server/definyRpc.ts": "d4056625fe4cdc9bb43895741a5d82e2826c61dd4ba6e1a3dad43d3e74f1b3b1", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/collect.ts": "a18618da3939d5480732a0042beffabe2498da75765e74d8e5f41f056568a35d", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/data.ts": "6831399419c49cd37fc6bd39352d7eacb1f0dbe63334ba8b425883cc0ae9e161", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/identifier.ts": "8cd43bcb1aa9ecc115970121722633b6950d7db3ac3d1e8e02f9344dd010fc9c", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/interface.ts": "6f4e6ceb2e6120e38d9f6e37bd83c28042defa9de2fddfec41296e3540a585ff", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/main.ts": "4c08633f958e3fd27948aa6180cb06c4f900871be5c96eb8d50d09a598521c22", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString.ts": "00d5666a6cf9eec74cadf9e1beb453fa59ebe91ef4fc0f793cf5903488f6786e", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString/common.ts": "9e189f3c57403cb1d0a1818fefd9634444f83ad91e92f7223eeb2012f1a630b8", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString/context.ts": "a20916fbd39e4cc6540ee70ffd9675a814c8699b71d06562e0fdbb8988f8b12a", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString/expr.ts": "b37d42a9530b81a3af0e3aa49df0209c83d8a5a477717634c7fbd6c29893b36f", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString/statement.ts": "4e225df6d441a0f1f035b1d1867fb26dd71a26675fe5f0b3529d182fea757a93", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/jsTs/toString/type.ts": "e720b53199a338a8c073e5c79226a3379e378216425d29e3aa808b2da12aa4b7", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/objectEntriesSameValue.ts": "6fd929a645c013c0bb5c402340e7c1a936e8ba413a5ac17a208f23e627bcea4a", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/prettier.ts": "9d2dad42d9dcb5618c06577731de961d2da1b7b41f31afd368e9ea4a424e6691", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/simpleRequestResponse/simpleRequest.ts": "a0a8f0cc2004da6a2423609aeffff6f84cebf0d049f642fb1f19a5cd05ebf4ac", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/simpleRequestResponse/simpleResponse.ts": "2433d462f6accc88ad9d9eb210eba1641371e5f96d38ee63ee99387694140274", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/simpleRequestResponse/simpleUrl.ts": "d66dae7ba254503e522533aedb544f47bc8153ae4945d16e2731e6b1dba2b2ed", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/typedJson.ts": "fd631a66c9183600272f0834370b8a0bef99c367a6bb8615071bba9fb5d3f404", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/util.ts": "3d1bac8a177b4901b21328f33281ed5c528d7643b6e2f968c0367d1bf994f8f6", - "https://raw.githubusercontent.com/narumincho/definy/0b25ff2f004a96153cc0405afb80e09fddd45672/deno-lib/writeFileAndLog.ts": "3890c1410c24f5f7b2b460cbec6f93cbbd73811a0043dbc114cd885a949f54e1", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/codeGen/namespace.ts": "de320dd2c1956ed1e6e508d38f982e952459d857a1fd983c5b21021539db7adb", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/collectType.ts": "038f26fb9f1b2684bbe4d91d1a748a88baf035d9d4a7061fdaa5d70f89fbf87d", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/coreType.ts": "b2d86547914d59425d12c86a75cabceea2302cb2467868072af8d5e1772caf9f", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/fromStructuredJson.ts": "6d7ffa5ad7895605de5769e1e70bc59d36d2f6fc71bf497f1b703ffa16a7cdb5", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/request.ts": "572ddced3f44dfcc4619108b343315bd71ca81612cd061e3f0791fcdc5086b5f", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/toStructuredJson.ts": "c6cae03c73a660f2a141f040c4139a8335151f3c775008d4e7d4d16f190ba88c", - "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/typedJson.ts": "fd631a66c9183600272f0834370b8a0bef99c367a6bb8615071bba9fb5d3f404" + "https://esm.sh/v99/react-dom@18.2.0/deno/server.js": "bf1ce0fcb084be382713a3bbf9df8d6564cddad331ef30e9307f1c8eaa1e513d" } } diff --git a/generated/api/main.ts b/generated/api/main.ts deleted file mode 100644 index 9ec2624..0000000 --- a/generated/api/main.ts +++ /dev/null @@ -1,144 +0,0 @@ -/* eslint-disable */ -/* generated by definy. Do not edit! */ - -import * as a from "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/coreType.ts"; -import * as b from "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/request.ts"; - -/** - * アカウント - */ -export type Account = { - /** - * アカウント名 - */ - readonly name: string; - /** - * 年齢 - */ - readonly age: number; - readonly [Symbol.toStringTag]: "main.Account"; -}; - -/** - * アカウント - */ -export const Account: { - /** - * Account の型 - */ - readonly type: () => a.Type; - /** - * オブジェクトから作成する. 余計なフィールドがレスポンスに含まれてしまうのを防ぐ. 型のチェックはしない - */ - readonly from: ( - a: globalThis.Omit - ) => Account; -} = { - type: (): a.Type => - a.Type.from({ - namespace: a.Namespace.local(["main"]), - name: "Account", - parameters: [], - }), - from: ( - obj: globalThis.Omit - ): Account => ({ - name: obj.name, - age: obj.age, - [Symbol.toStringTag]: "main.Account", - }), -}; - -/** - * カスタムAPI Function - */ -export const hello = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.local(["main"]), - name: "hello", - inputType: a.Unit.type(), - outputType: a.String.type(), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - ]), - }); - -/** - * カスタムAPI Function - */ -export const useCustomType = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.local(["main"]), - name: "useCustomType", - inputType: a.Unit.type(), - outputType: a.String.type(), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - ]), - }); diff --git a/generated/meta.ts b/generated/meta.ts deleted file mode 100644 index 912d276..0000000 --- a/generated/meta.ts +++ /dev/null @@ -1,1013 +0,0 @@ -/* eslint-disable */ -/* generated by definy. Do not edit! */ - -import * as a from "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/coreType.ts"; -import * as b from "https://raw.githubusercontent.com/narumincho/definy/f662850e6a0cb9ec7a69e60f424624c07dd417fa/deno-lib/definyRpc/core/request.ts"; - -/** - * 認証が必要なリクエストに使用する - */ -export type AccountToken = string & { readonly __accountTokenBland: never }; - -/** - * サーバー名の取得 - */ -export const name = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "name", - inputType: a.Unit.type(), - outputType: a.String.type(), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - ]), - }); - -/** - * get namespace list. namespace は API の公開非公開, コード生成のモジュールを分けるチャンク. JavaScriptのSetの仕様上, オブジェクトのSetはうまく扱えないので List にしている - */ -export const namespaceList = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise< - a.Result, string> -> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "namespaceList", - inputType: a.Unit.type(), - outputType: a.List.type(a.FunctionNamespace.type()), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - [ - "*coreType.List", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "List", - description: "リスト", - parameter: [ - a.TypeParameterInfo.from({ - name: "element", - description: "要素の型", - }), - ], - attribute: a.Maybe.nothing(), - body: a.TypeBody.list, - }), - ], - [ - "*coreType.FunctionNamespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "FunctionNamespace", - description: "出力されるAPI関数のモジュール名", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "meta", - description: - "APIがどんな構造で表現されているかを取得するためのAPI", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "local", - description: "definy RPC を利用するユーザーが定義したモジュール", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - ]), - }), - ], - ]), - }); - -/** - * 名前から関数を検索する (公開APIのみ) - */ -export const functionListByName = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise< - a.Result, string> -> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "functionListByName", - inputType: a.Unit.type(), - outputType: a.List.type(a.FunctionDetail.type()), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - [ - "*coreType.Bool", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Bool", - description: "Bool. boolean. 真偽値. True か False", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.boolean, - }), - ], - [ - "*coreType.List", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "List", - description: "リスト", - parameter: [ - a.TypeParameterInfo.from({ - name: "element", - description: "要素の型", - }), - ], - attribute: a.Maybe.nothing(), - body: a.TypeBody.list, - }), - ], - [ - "*coreType.Namespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Namespace", - description: - "名前空間. ユーザーが生成するものがこっちが用意するものか", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "local", - description: "ユーザーが作ったAPIがあるところ", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - a.Pattern.from({ - name: "coreType", - description: "definyRpc 共通で使われる型", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "typedJson", - description: "型安全なJSONのコーデック", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "request", - description: "HTTP経路でAPI呼ぶときに使うコード", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "meta", - description: "各サーバーにアクセスし型情報を取得する", - parameter: a.Maybe.nothing(), - }), - ]), - }), - ], - [ - "*coreType.Type", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Type", - description: "型", - parameter: [], - attribute: a.Maybe.just(a.TypeAttribute.asType), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "名前空間", - type: a.Namespace.type(), - }), - a.Field.from({ - name: "name", - description: "型の名前", - type: a.String.type(), - }), - a.Field.from({ - name: "parameters", - description: "型パラメータ", - type: a.List.type(a.Type.type()), - }), - ]), - }), - ], - [ - "*coreType.FunctionNamespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "FunctionNamespace", - description: "出力されるAPI関数のモジュール名", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "meta", - description: - "APIがどんな構造で表現されているかを取得するためのAPI", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "local", - description: "definy RPC を利用するユーザーが定義したモジュール", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - ]), - }), - ], - [ - "*coreType.FunctionDetail", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "FunctionDetail", - description: "関数のデータ functionByNameの結果", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "名前空間", - type: a.FunctionNamespace.type(), - }), - a.Field.from({ - name: "name", - description: "api名", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "説明文", - type: a.String.type(), - }), - a.Field.from({ - name: "input", - description: "入力の型", - type: a.Type.type(), - }), - a.Field.from({ - name: "output", - description: "出力の型", - type: a.Type.type(), - }), - a.Field.from({ - name: "needAuthentication", - description: "認証が必要かどうか (キャッシュしなくなる)", - type: a.Bool.type(), - }), - a.Field.from({ - name: "isMutation", - description: "単なるデータの取得ではなく, 変更するようなものか", - type: a.Bool.type(), - }), - ]), - }), - ], - ]), - }); - -/** - * 名前から関数を検索する (非公開API) - */ -export const functionListByNamePrivate = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; - readonly accountToken: AccountToken; -}): globalThis.Promise< - a.Result, string> -> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "functionListByNamePrivate", - inputType: a.Unit.type(), - outputType: a.List.type(a.FunctionDetail.type()), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - [ - "*coreType.Bool", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Bool", - description: "Bool. boolean. 真偽値. True か False", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.boolean, - }), - ], - [ - "*coreType.List", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "List", - description: "リスト", - parameter: [ - a.TypeParameterInfo.from({ - name: "element", - description: "要素の型", - }), - ], - attribute: a.Maybe.nothing(), - body: a.TypeBody.list, - }), - ], - [ - "*coreType.Namespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Namespace", - description: - "名前空間. ユーザーが生成するものがこっちが用意するものか", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "local", - description: "ユーザーが作ったAPIがあるところ", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - a.Pattern.from({ - name: "coreType", - description: "definyRpc 共通で使われる型", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "typedJson", - description: "型安全なJSONのコーデック", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "request", - description: "HTTP経路でAPI呼ぶときに使うコード", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "meta", - description: "各サーバーにアクセスし型情報を取得する", - parameter: a.Maybe.nothing(), - }), - ]), - }), - ], - [ - "*coreType.Type", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Type", - description: "型", - parameter: [], - attribute: a.Maybe.just(a.TypeAttribute.asType), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "名前空間", - type: a.Namespace.type(), - }), - a.Field.from({ - name: "name", - description: "型の名前", - type: a.String.type(), - }), - a.Field.from({ - name: "parameters", - description: "型パラメータ", - type: a.List.type(a.Type.type()), - }), - ]), - }), - ], - [ - "*coreType.FunctionNamespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "FunctionNamespace", - description: "出力されるAPI関数のモジュール名", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "meta", - description: - "APIがどんな構造で表現されているかを取得するためのAPI", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "local", - description: "definy RPC を利用するユーザーが定義したモジュール", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - ]), - }), - ], - [ - "*coreType.FunctionDetail", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "FunctionDetail", - description: "関数のデータ functionByNameの結果", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "名前空間", - type: a.FunctionNamespace.type(), - }), - a.Field.from({ - name: "name", - description: "api名", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "説明文", - type: a.String.type(), - }), - a.Field.from({ - name: "input", - description: "入力の型", - type: a.Type.type(), - }), - a.Field.from({ - name: "output", - description: "出力の型", - type: a.Type.type(), - }), - a.Field.from({ - name: "needAuthentication", - description: "認証が必要かどうか (キャッシュしなくなる)", - type: a.Bool.type(), - }), - a.Field.from({ - name: "isMutation", - description: "単なるデータの取得ではなく, 変更するようなものか", - type: a.Bool.type(), - }), - ]), - }), - ], - ]), - accountToken: parameter.accountToken, - }); - -/** - * 型のリストを返す - */ -export const typeList = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise< - a.Result, string> -> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "typeList", - inputType: a.Unit.type(), - outputType: a.List.type(a.DefinyRpcTypeInfo.type()), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - [ - "*coreType.List", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "List", - description: "リスト", - parameter: [ - a.TypeParameterInfo.from({ - name: "element", - description: "要素の型", - }), - ], - attribute: a.Maybe.nothing(), - body: a.TypeBody.list, - }), - ], - [ - "*coreType.Maybe", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Maybe", - description: "", - parameter: [ - a.TypeParameterInfo.from({ - name: "element", - description: "justのときに入る値の型", - }), - ], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "just", - description: "", - parameter: a.Maybe.just( - a.Type.from({ - namespace: a.Namespace.coreType, - name: "element", - parameters: [], - }) - ), - }), - a.Pattern.from({ - name: "nothing", - description: "", - parameter: a.Maybe.nothing(), - }), - ]), - }), - ], - [ - "*coreType.Namespace", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Namespace", - description: - "名前空間. ユーザーが生成するものがこっちが用意するものか", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "local", - description: "ユーザーが作ったAPIがあるところ", - parameter: a.Maybe.just(a.List.type(a.String.type())), - }), - a.Pattern.from({ - name: "coreType", - description: "definyRpc 共通で使われる型", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "typedJson", - description: "型安全なJSONのコーデック", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "request", - description: "HTTP経路でAPI呼ぶときに使うコード", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "meta", - description: "各サーバーにアクセスし型情報を取得する", - parameter: a.Maybe.nothing(), - }), - ]), - }), - ], - [ - "*coreType.DefinyRpcTypeInfo", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "DefinyRpcTypeInfo", - description: "definy RPC 型の構造", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "型が所属する名前空間", - type: a.Namespace.type(), - }), - a.Field.from({ - name: "name", - description: "型の名前", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "説明文. コメントなどに出力される", - type: a.String.type(), - }), - a.Field.from({ - name: "parameter", - description: "パラメーター", - type: a.List.type(a.TypeParameterInfo.type()), - }), - a.Field.from({ - name: "attribute", - description: "特殊な扱いをする", - type: a.Maybe.type(a.TypeAttribute.type()), - }), - a.Field.from({ - name: "body", - description: "型の構造を表現する", - type: a.TypeBody.type(), - }), - ]), - }), - ], - [ - "*coreType.TypeParameterInfo", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "TypeParameterInfo", - description: "型パラメータ名と説明文", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "name", - description: "型パラメーター名", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "型パラメーター説明", - type: a.String.type(), - }), - ]), - }), - ], - [ - "*coreType.TypeAttribute", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "TypeAttribute", - description: "型をどのような特殊な扱いをするかどうか", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "asType", - description: "型のデータ. 型パラメータを付与する", - parameter: a.Maybe.nothing(), - }), - ]), - }), - ], - [ - "*coreType.TypeBody", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "TypeBody", - description: "型の構造を表現する", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.sum([ - a.Pattern.from({ - name: "string", - description: "string", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "number", - description: "number", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "boolean", - description: "boolean", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "unit", - description: "unit", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "list", - description: "list", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "set", - description: "set", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "map", - description: "map", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "url", - description: "url", - parameter: a.Maybe.nothing(), - }), - a.Pattern.from({ - name: "product", - description: "product", - parameter: a.Maybe.just(a.List.type(a.Field.type())), - }), - a.Pattern.from({ - name: "sum", - description: "sum", - parameter: a.Maybe.just(a.List.type(a.Pattern.type())), - }), - ]), - }), - ], - [ - "*coreType.Field", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Field", - description: "product 直積型で使う", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "name", - description: "フィールド名", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "フィールドの説明", - type: a.String.type(), - }), - a.Field.from({ - name: "type", - description: "型", - type: a.Type.type(), - }), - ]), - }), - ], - [ - "*coreType.Pattern", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Pattern", - description: "直和型の表現", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.product([ - a.Field.from({ - name: "name", - description: "パターン名", - type: a.String.type(), - }), - a.Field.from({ - name: "description", - description: "説明", - type: a.String.type(), - }), - a.Field.from({ - name: "parameter", - description: "パラメーター", - type: a.Maybe.type(a.Type.type()), - }), - ]), - }), - ], - [ - "*coreType.Type", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Type", - description: "型", - parameter: [], - attribute: a.Maybe.just(a.TypeAttribute.asType), - body: a.TypeBody.product([ - a.Field.from({ - name: "namespace", - description: "名前空間", - type: a.Namespace.type(), - }), - a.Field.from({ - name: "name", - description: "型の名前", - type: a.String.type(), - }), - a.Field.from({ - name: "parameters", - description: "型パラメータ", - type: a.List.type(a.Type.type()), - }), - ]), - }), - ], - ]), - }); - -/** - * 名前空間「definyRpc」のApiFunctionを呼ぶ TypeScript のコードを生成する - */ -export const generateCallDefinyRpcTypeScriptCode = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "generateCallDefinyRpcTypeScriptCode", - inputType: a.Unit.type(), - outputType: a.String.type(), - input: undefined, - typeMap: new Map([ - [ - "*coreType.String", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "String", - description: "文字列", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.string, - }), - ], - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - ]), - }); - -/** - * サーバーが実行している環境でコードを生成し, ファイルとして保存する. - * 保存先:file:///workspace/deno-handson/generated/ - */ -export const generateCodeAndWriteAsFileInServer = (parameter: { - /** - * api end point - * @default new URL("http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io") - */ - readonly url?: globalThis.URL | undefined; -}): globalThis.Promise> => - b.requestQuery({ - url: - parameter.url ?? - new globalThis.URL( - "http://8000-cpslab-denohandson-ahmh56yjxdk.ws-us79.gitpod.io" - ), - namespace: a.FunctionNamespace.meta, - name: "generateCodeAndWriteAsFileInServer", - inputType: a.Unit.type(), - outputType: a.Unit.type(), - input: undefined, - typeMap: new Map([ - [ - "*coreType.Unit", - a.DefinyRpcTypeInfo.from({ - namespace: a.Namespace.coreType, - name: "Unit", - description: "値が1つだけ", - parameter: [], - attribute: a.Maybe.nothing(), - body: a.TypeBody.unit, - }), - ], - ]), - }); diff --git a/main.tsx b/main.tsx index 8c1953d..e0174c4 100644 --- a/main.tsx +++ b/main.tsx @@ -1,5 +1,5 @@ import { serve } from "https://deno.land/std@0.167.0/http/server.ts"; serve((_request) => { - return new Response("各自決め台詞をどうぞ 😏"); + return new Response("こんにちは!"); }); diff --git a/spreadsheet.ts b/spreadsheet.ts deleted file mode 100644 index 31838ed..0000000 --- a/spreadsheet.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { google } from "npm:googleapis"; - -const keyFilePath = "key.json"; -const spreadsheetId = "1CSW2Z9WGrpkQ7E0Gas93jL5k-woAUGb5ixK-t0nlJGk"; - -const GOOGLE_KEY_JSON = Deno.env.get("GOOGLE_KEY_JSON"); - -if (GOOGLE_KEY_JSON === undefined) { - throw new Error("環境変数 GOOGLE_KEY_JSON が未指定です!"); -} - -await Deno.writeTextFile(keyFilePath, GOOGLE_KEY_JSON); - -const auth = new google.auth.GoogleAuth({ - keyFile: keyFilePath, - scopes: ["https://www.googleapis.com/auth/spreadsheets"], -}); - -const valuesResponse = await google.sheets("v4").spreadsheets.values.get({ - auth, - range: "target!A1:D9", - spreadsheetId: spreadsheetId, -}); - -console.log("valuesResponse", valuesResponse); diff --git a/useDefinyRpc.ts b/useDefinyRpc.ts deleted file mode 100644 index 3ed3f1d..0000000 --- a/useDefinyRpc.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { handleRequest } from "https://raw.githubusercontent.com/narumincho/definy/3e527ebb2bfb17f91ed44ecf76a48f31148d4cb8/deno-lib/definyRpc/server/definyRpc.ts"; -import { requestObjectToSimpleRequest } from "https://raw.githubusercontent.com/narumincho/definy/3e527ebb2bfb17f91ed44ecf76a48f31148d4cb8/deno-lib/simpleRequestResponse/simpleRequest.ts"; -import { - simpleResponseToResponse, -} from "https://raw.githubusercontent.com/narumincho/definy/3e527ebb2bfb17f91ed44ecf76a48f31148d4cb8/deno-lib/simpleRequestResponse/simpleResponse.ts"; -import { serve } from "https://deno.land/std@0.167.0/http/server.ts"; -import { createApiFunction } from "https://raw.githubusercontent.com/narumincho/definy/3e527ebb2bfb17f91ed44ecf76a48f31148d4cb8/deno-lib/definyRpc/core/apiFunction.ts"; -import { - DefinyRpcTypeInfo, - Field, - FunctionNamespace, - Maybe, - Namespace, - Number, - String, - TypeBody, - Unit, -} from "https://raw.githubusercontent.com/narumincho/definy/3e527ebb2bfb17f91ed44ecf76a48f31148d4cb8/deno-lib/definyRpc/core/coreType.ts"; -import { Account } from "./generated/api/main.ts"; - -serve(async (request) => { - const simpleRequest = await requestObjectToSimpleRequest(request); - if (simpleRequest === undefined) { - throw new Error("解釈できないリクエストだった"); - } - const simpleResponse = await handleRequest({ - all: () => ({ - functionsList: [ - createApiFunction({ - namespace: FunctionNamespace.local(["main"]), - description: "カスタムAPI Function", - name: "hello", - input: Unit.type(), - output: String.type(), - isMutation: false, - needAuthentication: false, - resolve: () => { - return "hi!"; - }, - }), - createApiFunction({ - namespace: FunctionNamespace.local(["main"]), - description: "カスタムAPI Function", - name: "useCustomType", - input: Unit.type(), - output: Account.type(), - isMutation: false, - needAuthentication: false, - resolve: () => { - return Account.from({ - name: "ラフィーア", - age: 18, - }); - }, - }), - ], - typeList: [ - DefinyRpcTypeInfo.from({ - namespace: Namespace.local(["main"]), - name: "Account", - description: "アカウント", - attribute: Maybe.nothing(), - parameter: [], - body: TypeBody.product([ - Field.from({ - name: "name", - description: "アカウント名", - type: String.type(), - }), - Field.from({ - name: "age", - description: "年齢", - type: Number.type(), - }), - ]), - }), - ], - }), - codeGenOutputFolderPath: new URL(import.meta.resolve("./generated/")), - name: "hansonTest", - originHint: simpleRequest.url.origin, - }, simpleRequest); - if (simpleResponse === undefined) { - return new Response(JSON.stringify({ error: "notFound..." }), { - status: 404, - }); - } - return simpleResponseToResponse(simpleResponse); -});