diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d4797aa0..0fefca0d 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 664aaca5-a41f-4434-8f2a-642dba92fe68 management: - docChecksum: 33958fda4f2b946f46f0593aac3a619d + docChecksum: a78df2be3deb0e29f26820ae93e5c2f8 docVersion: 0.9.0 - speakeasyVersion: 1.789.2 - generationVersion: 2.916.4 - releaseVersion: 0.17.3 - configChecksum: ceee23da0b77c78087da10f0482d460b + speakeasyVersion: 1.790.1 + generationVersion: 2.918.1 + releaseVersion: 0.18.0 + configChecksum: c46e4d263981bd07c6768121df37be5c repoURL: https://github.com/gleanwork/api-client-typescript.git installationURL: https://github.com/gleanwork/api-client-typescript published: true persistentEdits: - generation_id: bca12c17-b37a-4623-8cfa-8c16b8e7b105 - pristine_commit_hash: 25a6b7be93cadf51cef11dcf921d6e6f9309fa05 - pristine_tree_hash: 66a52f40c31e803cfa2280c47bebbf1198ed1770 + generation_id: 0bf17228-92e5-4d8f-afd0-7e2b0c788fba + pristine_commit_hash: c8f27121705e90213e7956ebac8a5000e42bcd1d + pristine_tree_hash: aca9483a0f5bdff493a0cc6b810ab7103a624113 features: typescript: acceptHeaders: 2.81.2 @@ -38,7 +38,7 @@ features: mockServer: 0.1.4 nameOverrides: 2.81.4 nullables: 0.1.1 - reactQueryHooks: 0.2.4 + reactQueryHooks: 0.3.0 responseFormat: 0.3.0 retries: 2.83.1 sdkHooks: 0.4.0 @@ -106,6 +106,10 @@ trackedFiles: id: f9f286d7b5c6 last_write_checksum: sha1:7fe4c8bda926832bf790916fc4b4ac6268a23d66 pristine_git_object: 0d14dd6829e09b0e4cba2fce647a052c2e0d551d + docs/models/components/actiontypesource.md: + id: 5a875e42f006 + last_write_checksum: sha1:2c4b06e3885ab43d3447f3dfbcd346f29d82af72 + pristine_git_object: 79973f1c82029ad59ab9a7f30f047d3770ddb375 docs/models/components/activity.md: id: a2d8273e4214 last_write_checksum: sha1:c60b11a27a8ae6f368638c29439e21b6d87828ce @@ -1942,6 +1946,34 @@ trackedFiles: id: d398b8139176 last_write_checksum: sha1:e87b453fc43313b7275d35a14db9f3a0292f45a4 pristine_git_object: 404fa57a35d0fa2d12fc8c923ddac48e5ede9667 + docs/models/components/platformskill.md: + id: 0085679a1f14 + last_write_checksum: sha1:fc27bcaf60d14961e709f8c017c67a792ed2aba8 + pristine_git_object: 2dcbec60361ffb3adf6a9fad93bc3b94b2a13221 + docs/models/components/platformskillgetresponse.md: + id: bc5043e8f6f7 + last_write_checksum: sha1:f8892bf1ee203e952a667673d864ce3defc64715 + pristine_git_object: f351362d91b60243f4573c491bcf6f8f531f3eb7 + docs/models/components/platformskillorigin.md: + id: 9dc751dc212a + last_write_checksum: sha1:d7f89e1e10da33e9d6af6983b324f49bcc876cfb + pristine_git_object: 89cb7ecfca1f3f0fe1c5e54a88ee219faa1875fc + docs/models/components/platformskillslistresponse.md: + id: 58b27e4bea7e + last_write_checksum: sha1:1c20dd9e1d26aefc91f80f9a8e1770beced531d9 + pristine_git_object: b4f6fedd39e34887f548bc7784f67317062909d4 + docs/models/components/platformskillsourceprovenance.md: + id: 29fe97f47f93 + last_write_checksum: sha1:c46c23275c9848fec5d5da755e1a52148f99da65 + pristine_git_object: b593b3040b32719fa0562c9ab4791b6f8640092f + docs/models/components/platformskillstatus.md: + id: 3342d36796ac + last_write_checksum: sha1:f298d1146869a6f7861af5022216e6e9ef3d1e81 + pristine_git_object: 5d552f7d73774acf99ca8023ed296464420b5f0e + docs/models/components/platformskillsyncstatus.md: + id: b4dfbecbfcf6 + last_write_checksum: sha1:83277f661926e6cf54883ebf380591dd144fc4f0 + pristine_git_object: 52ad9e9017bf515f7efb7ecd0a9485571c4feaf1 docs/models/components/platformtimerange.md: id: d2e589bb488c last_write_checksum: sha1:b16b0fb45a16cafd4942fc70075e8ba92d0b9386 @@ -2376,8 +2408,8 @@ trackedFiles: pristine_git_object: c18bd70e3cea544587589120059dd81f661b99a9 docs/models/components/toolmetadata.md: id: e8ce3b56fbdc - last_write_checksum: sha1:3bc2c9f3b8fadcf8f54e8f3f3e89390386940112 - pristine_git_object: 8db965e129c3314959431a622d3bcdd50d8e4586 + last_write_checksum: sha1:a3509b5d26b0508b8e324d0125b2528af8696588 + pristine_git_object: 94a16f97223aaa93f213cd9390b871a1165bcf23 docs/models/components/toolmetadatatype.md: id: 45942314082a last_write_checksum: sha1:fc372cbeb54818244460f3ba08fc2ab0f0e69cb6 @@ -2946,6 +2978,14 @@ trackedFiles: id: 58d615b7c78f last_write_checksum: sha1:f72548f52835bd70987fa96727569f7fd5d32f9f pristine_git_object: 86d0551865da2973d4bc49c26a9ae3fab6829f85 + docs/models/operations/platformskillsgetrequest.md: + id: 6e77031ea696 + last_write_checksum: sha1:77b912d1988027c6569d81359278fe1ce453b9e2 + pristine_git_object: 9e4d8cee63af8a2ff90a3bb1579be91720170191 + docs/models/operations/platformskillslistrequest.md: + id: 2e304cbf2212 + last_write_checksum: sha1:91ee0f4ef89ff4d3634615a9d2ee6daa1db63c20 + pristine_git_object: 6a07bb06bb7902990b6031e194b30e73a289d62a docs/models/operations/postapiindexv1debugdatasourcedocumenteventsrequest.md: id: 13205d748dcd last_write_checksum: sha1:a4343ef66a0c237e1eada5f9fe0ca897db13a0a2 @@ -3138,6 +3178,10 @@ trackedFiles: id: 5c534716244c last_write_checksum: sha1:8a3c41c736e3ce7dfd9b0f5d733beed5f7446648 pristine_git_object: 233dcbff8035e0284a82067af91f627201db89df + docs/sdks/skills/README.md: + id: 3a14a5c90791 + last_write_checksum: sha1:e47b646f5585cca139b327da7e892102f468263b + pristine_git_object: 9d12a7e5f49dc47352e4abcc9a5a5bafe94fa5e8 docs/sdks/tools/README.md: id: 044286549bac last_write_checksum: sha1:15085522c8371637004ea441fe579e3ab1f0b47b @@ -3176,12 +3220,12 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:29bee120baea5f4cec8750e18851255bb91b26d0 - pristine_git_object: 46c99d73c4de09443131fcead0e0c89f2ab2df1c + last_write_checksum: sha1:72760fce1a4a085f0fbd440fdb19b7426f08458b + pristine_git_object: 8b5402c972521a31c3633c162fce20667eb7be6b package.json: id: 7030d0b2f71b - last_write_checksum: sha1:9f8c2067f0b5cf9f70f0f34671b64db143a81be8 - pristine_git_object: 9b387e1c7de105beaed38d17e160a0f6bd696f30 + last_write_checksum: sha1:ee6482e9f26c8796220e8a867e0f3ce54c38ab62 + pristine_git_object: 6f0ccb839633e10f694dc84929d8d22e274f1803 src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 @@ -3292,8 +3336,8 @@ trackedFiles: pristine_git_object: d252821b825c62856886e3ab9287181d7ef7f9de src/__tests__/messages.test.ts: id: 39e293f09219 - last_write_checksum: sha1:d71d67d8ed6743e623401b4101f70705c2eb5172 - pristine_git_object: a4785e3180745bef1ba299e2191e9c49bec1da88 + last_write_checksum: sha1:614ea7fd801e89ad1a53d01b4b5129e9501e54b2 + pristine_git_object: 12904134bbdc280929babb05d7977adda65fc58c src/__tests__/mockserver/.gitignore: id: 4a7fc421b6b6 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -3348,8 +3392,8 @@ trackedFiles: pristine_git_object: af3a6d136d837850b34ed893a8faf800ea114721 src/__tests__/mockserver/internal/handler/generated_handlers.go: id: e6f590a8ce11 - last_write_checksum: sha1:00f15028ea6d680d0a826975bc93d6e4b3c2b2f6 - pristine_git_object: e2e2fdc55bb8561e1c8e80b9ddd28a805195a2cb + last_write_checksum: sha1:a0c7afd33e8092f06d95ecd445e8329e58d4a5a1 + pristine_git_object: 8ce40366a01be126629af0d23e8fdc501670225d src/__tests__/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: ef047f0e0f32 last_write_checksum: sha1:187ff16d05efa1c937632f61dd3f49e49691d5ff @@ -3366,6 +3410,14 @@ trackedFiles: id: e095cf890e73 last_write_checksum: sha1:dec4b7dbf683ac9ab16c749e9e2bf7d1f29b0046 pristine_git_object: 4acc6c497e6435bb7c095577f9a0db82043ac61f + src/__tests__/mockserver/internal/handler/pathgetapiskills.go: + id: 7a35981bf5e0 + last_write_checksum: sha1:1d7ab0e5d4f9b9b75b257b9e4e2a59b96f9cfe50 + pristine_git_object: 77c87bf10db80a152b4029cc64cbdf7642478a98 + src/__tests__/mockserver/internal/handler/pathgetapiskillsskillid.go: + id: 1eef14b2fbcb + last_write_checksum: sha1:b78324bee0a003a8b4a6a776190121546fc5ee12 + pristine_git_object: 84afc7c545c639be8a4307469a64b4f67d4f156e src/__tests__/mockserver/internal/handler/pathgetrestapiindexcustommetadataschemagroupname.go: id: 68f9bc7ddc35 last_write_checksum: sha1:4fe0018044e99586f72be23534b463468e194ba2 @@ -5274,6 +5326,34 @@ trackedFiles: id: 609dccefec94 last_write_checksum: sha1:8a87c40e6ec0ea1471bb5702ee6d9c9b7c60d7c8 pristine_git_object: 95bffd73a040f0b46fd8961c78a364f65be25416 + src/__tests__/mockserver/internal/sdk/models/components/platformskill.go: + id: 9348b7a0ba5c + last_write_checksum: sha1:6a7d58754e05d3de8095415bd6d34b98800a849f + pristine_git_object: b7d510d4a92676348b12506824fc217cbdf7ec0e + src/__tests__/mockserver/internal/sdk/models/components/platformskillgetresponse.go: + id: ce9faaafa240 + last_write_checksum: sha1:592a5dd5d7ec0d3dad4d65470039296b6b99ba2d + pristine_git_object: e470cbc23e4ce6dc3e97ca95c538cedae4c0384a + src/__tests__/mockserver/internal/sdk/models/components/platformskillorigin.go: + id: 028d9e74ac5d + last_write_checksum: sha1:b2bba455acf61820e88c7e6512a271802835d43c + pristine_git_object: 91d4d1afe5091865d1895d29a52cc475bc92a795 + src/__tests__/mockserver/internal/sdk/models/components/platformskillslistresponse.go: + id: ea644abdd909 + last_write_checksum: sha1:e1eb355015d35871464b551e1c7c8d182cec8dba + pristine_git_object: 7bf1e0b4fa8c2c1ff1d0fdd1847d9a21b77e39b9 + src/__tests__/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go: + id: "312434003494" + last_write_checksum: sha1:e18be9872b74b1962988eba65c1a8084a559d301 + pristine_git_object: 64b5f70f9b0828287e4ca09b5fea02341ea12aab + src/__tests__/mockserver/internal/sdk/models/components/platformskillstatus.go: + id: 180ceed8be9b + last_write_checksum: sha1:d74d70098e9e768d5a67deb91038d39eef253616 + pristine_git_object: 8176be88a1481bec24f8fe8a8bcce1cb1f8f2215 + src/__tests__/mockserver/internal/sdk/models/components/platformskillsyncstatus.go: + id: bc07f04da2f3 + last_write_checksum: sha1:e2dbfb1023f704f09d4d25e60abdac8c710e2c56 + pristine_git_object: 1d30df91449dcb75231c193ad5857d2c0b801f8a src/__tests__/mockserver/internal/sdk/models/components/platformtimerange.go: id: b8e92c9af7ab last_write_checksum: sha1:4e21c170201779eccc4d8c31ddbd56673895e674 @@ -5612,8 +5692,8 @@ trackedFiles: pristine_git_object: 10427b2194460749821b4c73cfeadffea9c437a2 src/__tests__/mockserver/internal/sdk/models/components/toolmetadata.go: id: b83a619f6030 - last_write_checksum: sha1:34930f11f6c97b9bc30e120a0d78b070067db6a6 - pristine_git_object: 440a10f01a7c06171d08c87b90b456ebb34fb3e9 + last_write_checksum: sha1:4464d7ab28f611a8eb3b5585c826dc921a234e74 + pristine_git_object: 18410420e40a4a977bdf181973e237c1ed6912ba src/__tests__/mockserver/internal/sdk/models/components/toolparameter.go: id: 836d1d622155 last_write_checksum: sha1:e5b5526fd431bf150740e5358dce60af44bb1ee1 @@ -6130,6 +6210,14 @@ trackedFiles: id: 8d5d0787d271 last_write_checksum: sha1:99dd76e44d3d48fb22d7582ecea439e2505ca224 pristine_git_object: 20b4d8b2efb5bc9a67f3e927fe3d3f919bf85897 + src/__tests__/mockserver/internal/sdk/models/operations/platformskillsget.go: + id: 7cf3c9da1e9e + last_write_checksum: sha1:43b482282e4f3e624fb01ee72666fee30e9c383f + pristine_git_object: 6fc2f6f0210cd505660309adfdba9cdc79141243 + src/__tests__/mockserver/internal/sdk/models/operations/platformskillslist.go: + id: 8531b738e2ad + last_write_checksum: sha1:cc94474c35afd9c2df50305439cdd30081780b9d + pristine_git_object: 4e0bdef118db95cf31b410e1cf8801061ada2343 src/__tests__/mockserver/internal/sdk/models/operations/postapiindexv1adddatasource.go: id: 4e5c790cee10 last_write_checksum: sha1:883a8812b033023bad4b6b01e7717970bbd2c3ba @@ -6470,10 +6558,14 @@ trackedFiles: id: 97f2005515d0 last_write_checksum: sha1:ddd72ab0c544d9bdc041891b5d6c85921c1f4a5b pristine_git_object: e36f1fde9af40fca3a6eee03a93a8c9c43e424bd + src/__tests__/skills.test.ts: + id: 3fa6e540c659 + last_write_checksum: sha1:d155ce50eaa3b48339821d9f432059d02822ff2e + pristine_git_object: 9ee0b856bf64da2bd7ca97432e01265be7712316 src/__tests__/summarize.test.ts: id: 3105d6ebc7eb - last_write_checksum: sha1:bb2dba46f1d4304d8236c52e0355a53081ab6119 - pristine_git_object: bb5e2b02fd92c4bc218d0a791e8786a14448f109 + last_write_checksum: sha1:db7535a40dd5b6bd52eb7feed8c3f99f1891de6a + pristine_git_object: ea417cd5a96534dd6d9d05de1e7a816c18c99e8e src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 @@ -7042,6 +7134,14 @@ trackedFiles: id: cc6075d2a5d0 last_write_checksum: sha1:2b013dc9368701f9b40ca2cd755094fcd72aba45 pristine_git_object: ad23061a8f21ce08b627a6ab903b462441bc1116 + src/funcs/skillsList.ts: + id: a643d8a0c73b + last_write_checksum: sha1:23440e1a5e404eff9b9392156cded3df9f38146a + pristine_git_object: 099d6983f978b48c4cf376a9e931d4742c8da7b2 + src/funcs/skillsRetrieve.ts: + id: 7bff1ef0523e + last_write_checksum: sha1:bde130c314937ad66a558488943ad485d9389c81 + pristine_git_object: f942a2894ee0886f9396f0951112e2e58a6bd9cb src/hooks/hooks.ts: id: a2463fc6f69b last_write_checksum: sha1:6e42a763f6217572cc59f8799af55dd21d961be9 @@ -7064,8 +7164,8 @@ trackedFiles: pristine_git_object: 42d9739ab67c2fec0689f83777ffa5e1f875e5d5 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:cd016a878ec09f9911255d937e2a532760ad3077 - pristine_git_object: e49a687706fb518da0b4be82d27e37838b777bf3 + last_write_checksum: sha1:888340d58d1ef65145f4eb750cc6a11e0895c652 + pristine_git_object: 1b849b9d4e4f3c147f7244dddf7199f4459d5ebe src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:a74725064d06b6994b95873c037975d2f2e63467 @@ -8212,8 +8312,8 @@ trackedFiles: pristine_git_object: c1b51fb164e5fddc23f344a60899933a91902f4c src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:d956d73b7097e50a226e45b8addb6dbbbc8e53a9 - pristine_git_object: 7e39bf7d431ffe6c3ab65dd658d31e8f4615f13e + last_write_checksum: sha1:2d7a63f8b49295b0222bbdfb7c5f329ea011c64c + pristine_git_object: a62c5237046b722322b45b2c7f1ed6b696cb6110 src/models/components/indexdocumentrequest.ts: id: deb13e2cdc65 last_write_checksum: sha1:33e2093c7fcdd3c90ef45c48e7b79c4cb2aea6e5 @@ -8574,6 +8674,34 @@ trackedFiles: id: a12b46a101c0 last_write_checksum: sha1:55664d86976b98357e67d15dc592c37be042f3c2 pristine_git_object: e26c0612c799afdf42ca17bbb685881e6c07a101 + src/models/components/platformskill.ts: + id: d34696ea810b + last_write_checksum: sha1:ace2a7de3be1bdd74889516f88ce49f5635775a4 + pristine_git_object: 4d1a1f40b145c5c9cf0a6f000f13adc599fd54f8 + src/models/components/platformskillgetresponse.ts: + id: b9dd0e54b6c6 + last_write_checksum: sha1:05d286bf771305eba6e0c6781f268f075b4dc31b + pristine_git_object: 26177c0f925782064a24ea2d7fc5f7cecaeef328 + src/models/components/platformskillorigin.ts: + id: 5f9163750617 + last_write_checksum: sha1:571c0e1d66e8a5e33e0a795dbd1132f4d7053207 + pristine_git_object: a2cd7a5fc25d7893a2e2b75fc053f06f616b6c36 + src/models/components/platformskillslistresponse.ts: + id: 0b4832ec4dc7 + last_write_checksum: sha1:7e207da3be46ace0accddc3b705466cf973cc939 + pristine_git_object: 584e18493e4723f9727bfc550c886598e4d7d2d1 + src/models/components/platformskillsourceprovenance.ts: + id: d205a4ca5eab + last_write_checksum: sha1:77e843a2a61af9b80ab43e0a5fa25e4a52e69709 + pristine_git_object: be0b13f624932ec5a21afe70d4a490bc7e414c6e + src/models/components/platformskillstatus.ts: + id: 3239e840356d + last_write_checksum: sha1:db01ab90569ebc193bd92c2e07ee90a00e68cc0e + pristine_git_object: 43aaae8cca26fecd3dfbc03a7029777ec2d6b26a + src/models/components/platformskillsyncstatus.ts: + id: 474e34580f2d + last_write_checksum: sha1:5b5383fea1d9cc953c97e366214c75a0baf97268 + pristine_git_object: 2efda9b8a2656f343a15314dd77bfbd1c10636e1 src/models/components/platformtimerange.ts: id: fb9ab6343c3a last_write_checksum: sha1:5816eda5ae4c626e40a45ad8f94a2409bc885d49 @@ -8912,8 +9040,8 @@ trackedFiles: pristine_git_object: 794fbf76b160d3a78fc308eba6ad1c983c6685d7 src/models/components/toolmetadata.ts: id: fdf3bdc60c23 - last_write_checksum: sha1:d3ff0040b2a619ecf83df98a9497fe7b235898d6 - pristine_git_object: 4fb9511c82ec42bbfd8745e2cb2ab79e66767448 + last_write_checksum: sha1:add829851c8345a1b2f6814a5597f7528bab4f34 + pristine_git_object: 7f4802a6f7d6b9e313cf3ceede05b5889db9c97d src/models/components/toolparameter.ts: id: 8104b99f27c9 last_write_checksum: sha1:6d2d885c65ca160c446664630c1a18488ff1faba @@ -9372,8 +9500,8 @@ trackedFiles: pristine_git_object: ddf76652b5d27d602a300b5909b728b59be4ad73 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:eb38833bba483438a754cf3c4f9bde1be5cfe51d - pristine_git_object: 00caa4b04d57c7835e9f8aa4e79d1eea79c4e2a5 + last_write_checksum: sha1:7eceaca11b6efde43950a36a914b2b7eb05fe4f8 + pristine_git_object: e9f5e4f1a6f4dd8efa29462566f8c06f5da7a9dc src/models/operations/insights.ts: id: 7bef0edaab32 last_write_checksum: sha1:37db16bc7603defd715210dfd8c12de88bde8b72 @@ -9434,6 +9562,14 @@ trackedFiles: id: c025879102b3 last_write_checksum: sha1:65d7361ac886e2c8f3200c6cc3141daf78ba1eac pristine_git_object: 69bd1349edebd305537e0ec66afbe70db4e9aa14 + src/models/operations/platformskillsget.ts: + id: 24dc86e69e49 + last_write_checksum: sha1:4979b3fb3b38b0b13a40a1fb548fa73d3f36bc48 + pristine_git_object: c3d2123ed894d2bdbeee10060566018e320c36cb + src/models/operations/platformskillslist.ts: + id: 909cbd063812 + last_write_checksum: sha1:f4ff7c3e2ae74219bdc8df3f9efd1d6a9db5d1fe + pristine_git_object: e081d77940f8b67ed533e1a8e7bceb9e0f83c80c src/models/operations/postapiindexv1debugdatasourcedocument.ts: id: 03753664a7e3 last_write_checksum: sha1:1fc8451990ad08329b62b2915f227f575e7e4b0b @@ -9964,8 +10100,8 @@ trackedFiles: pristine_git_object: 7ea1d5c56f074fe08998790eed62e014c840891b src/react-query/index.ts: id: 9e975471aa65 - last_write_checksum: sha1:f1bb81fe81124fd2745365a4935321633020ffcf - pristine_git_object: b8610dc067e62e80f6b22bf039feaac1bb348b73 + last_write_checksum: sha1:7906b387b86a3d566bb9978949725107f7ce626a + pristine_git_object: f64f2ba6e2bb960d7c6dfb83d358025d36ef12a6 src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -10146,6 +10282,22 @@ trackedFiles: id: a67629da8040 last_write_checksum: sha1:5ce8b5811af2d6dd5bc95afd2e9358c16d7c7a99 pristine_git_object: bc4f7e63f7066516b637ad801275acd0fa53c9e0 + src/react-query/skillsList.core.ts: + id: e91168fc9e6b + last_write_checksum: sha1:e4718db715009eeb0164e2f028c9c8aea98b9a3b + pristine_git_object: 9134b7a24fabb2357cd6f921dc5da320d49c01a6 + src/react-query/skillsList.ts: + id: 3377edb65dda + last_write_checksum: sha1:9b5acfb883b415945c36788173ba43df30c1ca3d + pristine_git_object: b911a654408806c59ae24bf8aef2d8c7ad301557 + src/react-query/skillsRetrieve.core.ts: + id: b293a018b942 + last_write_checksum: sha1:2b87aaf09b4dd7b921cc1d117fb497520bdeb799 + pristine_git_object: 3c4f811c987d2c6ca64f9466d9fcb90094f1d431 + src/react-query/skillsRetrieve.ts: + id: 8bd7927c56aa + last_write_checksum: sha1:fbb324daffbfc4dfe43b66bb93bb4f21173546c7 + pristine_git_object: c3b68b1393a78bf26c9a230da61af23abd4305d6 src/sdk/activity.ts: id: 87dddbbca815 last_write_checksum: sha1:1b66eb529dcde53e002e35ac6fd6e6e7e56be73e @@ -10280,12 +10432,16 @@ trackedFiles: pristine_git_object: b13d325fd129a1e93b8f78617fc401a58f14364c src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:7ecc6578d93f9fa841c0a9e77cd23639a66214b3 - pristine_git_object: 65e63fcc09b34e4978dd2a1441d4f17713087724 + last_write_checksum: sha1:3a33ea0f35139239417eeee74519f287bb51bb0f + pristine_git_object: 2cca83bdec91898235f72cc7138b1ebebbdc1956 src/sdk/search.ts: id: b88871d87236 last_write_checksum: sha1:7aa823227d511aea3f70dd460e70b7478c6daf1f pristine_git_object: d8b2b8c62743cb5b2e9d524fe24884ac23681858 + src/sdk/skills.ts: + id: 847667a72f83 + last_write_checksum: sha1:7022e33fc87f658aa54ae271827bfb802867406a + pristine_git_object: 93d42981784538b55a3b4254f7630f22bb09d45f src/sdk/tools.ts: id: f997ccdd9dd9 last_write_checksum: sha1:803cc691fc4535aba26609bc73553dcef9edda58 @@ -11346,6 +11502,27 @@ examples: responses: "200": application/json: {"authorizationUrl": "https://shocked-casket.name/"} + platform-skills-list: + speakeasy-default-platform-skills-list: + responses: + "200": + application/json: {"skills": [], "has_more": true, "next_cursor": "", "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-skills-get: + speakeasy-default-platform-skills-get: + parameters: + path: + skill_id: "" + responses: + "200": + application/json: {"skill": {"id": "", "display_name": "Chad_Herzog", "description": "whenever up aha controvert", "latest_version": 151495, "latest_minor_version": 170771, "status": "DISABLED", "origin": "CUSTOM", "owner": {"name": ""}, "created_at": "2024-12-25T16:41:00.099Z", "updated_at": "2026-12-07T21:59:59.375Z"}, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-05-05T15:08:35-05:00" @@ -11513,7 +11690,9 @@ generatedTests: platform-search: "2026-07-02T17:51:23Z" getToolServerAuthStatus: "2026-07-08T02:25:28Z" authorizeToolServer: "2026-07-08T02:25:28Z" -releaseNotes: "## Typescript SDK Changes:\n* `glean.client.chat.create()`: \n * `request.chatRequest.messages[].fragments[]` **Changed**\n * `response.messages[].fragments[]` **Changed**\n* `glean.client.chat.retrieve()`: `response.chatResult.chat.messages[].fragments[]` **Changed**\n* `glean.client.chat.createStream()`: \n * `request.chatRequest.messages[].fragments[]` **Changed**\n" + platform-skills-list: "2026-07-15T02:05:48Z" + platform-skills-get: "2026-07-15T02:05:48Z" +releaseNotes: "## Typescript SDK Changes:\n* `glean.skills.list()`: **Added**\n* `glean.skills.retrieve()`: **Added**\n* `glean.client.chat.create()`: \n * `request.chatRequest.messages[].fragments[].action.metadata.actionTypeSource` **Added**\n * `response.messages[].fragments[].action.metadata.actionTypeSource` **Added**\n* `glean.client.chat.retrieve()`: `response.chatResult.chat.messages[].fragments[].action.metadata.actionTypeSource` **Added**\n* `glean.client.chat.createStream()`: \n * `request.chatRequest.messages[].fragments[].action.metadata.actionTypeSource` **Added**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 91028514..ad1a9116 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true typescript: - version: 0.17.3 + version: 0.18.0 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a1f493a7..d58837f2 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.0.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 270b693d49bac2f68e751b2345bac0c267741119 - x-open-api-commit-sha: 592aec2b4913505edb8161645eaf9a72b5286f20 + x-source-commit-sha: 380b9ac625827427bd231c63559cdb032a30c3d3 + x-open-api-commit-sha: b33fefa2ab11fea825ccff3e528f2c8ed8b96808 description: | # Introduction In addition to the data sources that Glean has built-in support for, Glean also provides a REST API that enables customers to put arbitrary content in the search index. This is useful, for example, for doing permissions-aware search over content in internal tools that reside on-prem as well as for searching over applications that Glean does not currently support first class. In addition these APIs allow the customer to push organization data (people info, organization structure etc) into Glean. @@ -250,6 +250,108 @@ paths: x-speakeasy-name-override: createRun security: - APIToken: [] + /api/skills: + get: + tags: + - Skills + summary: List skills + description: | + List skills available to the authenticated user. + operationId: platform-skills-list + x-visibility: Public + x-glean-experimental: + id: 3eb65937-03a3-472b-9a00-be713f302b5f + introduced: "2026-06-23" + parameters: + - in: query + name: page_size + description: Maximum number of skills to return. + required: false + schema: + type: integer + minimum: 1 + maximum: 100 + - in: query + name: cursor + description: Opaque pagination cursor from a previous response. + required: false + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillsListResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: skills + x-speakeasy-name-override: list + security: + - APIToken: [] + /api/skills/{skill_id}: + get: + tags: + - Skills + summary: Retrieve skill + description: | + Retrieve metadata for a skill available to the authenticated user. + operationId: platform-skills-get + x-visibility: Public + x-glean-experimental: + id: 8f8d1c92-a484-4769-9903-200613dc8a72 + introduced: "2026-06-23" + parameters: + - name: skill_id + in: path + required: true + description: Glean skill ID. + schema: + type: string + minLength: 1 + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSkillGetResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: skills + x-speakeasy-name-override: retrieve + security: + - APIToken: [] /api/search: post: tags: @@ -5479,6 +5581,138 @@ components: request_id: type: string description: Platform-generated request ID for support correlation. + PlatformSkillStatus: + type: string + enum: + - DRAFT + - ENABLED + - DISABLED + description: Current skill status. + PlatformSkillOrigin: + type: string + enum: + - CUSTOM + description: Source category for the skill. + PlatformSkillSyncStatus: + type: string + enum: + - UP_TO_DATE + - UPDATE_AVAILABLE + - SYNC_FAILED + description: Current external-source sync status. + PlatformSkillSourceProvenance: + type: object + properties: + source_url: + type: string + description: URL of the external source the skill was imported from. + commit_sha: + type: string + description: Source commit SHA for the imported skill. + imported_at: + type: string + format: date-time + description: Time the skill was imported. + last_synced_at: + type: string + format: date-time + description: Time the skill was last synced from its source. + sync_status: + $ref: "#/components/schemas/PlatformSkillSyncStatus" + sync_error: + type: string + description: Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + PlatformPersonReference: + type: object + description: A lightweight reference to a person, used where a payload merely points at someone. + required: + - name + properties: + id: + type: string + description: Opaque Glean person ID. + name: + type: string + description: Display name. + PlatformSkill: + type: object + required: + - id + - display_name + - description + - latest_version + - latest_minor_version + - status + - origin + - owner + - created_at + - updated_at + properties: + id: + type: string + description: Glean skill ID. + display_name: + type: string + description: Human-readable skill name. + description: + type: string + description: Human-readable skill description. + latest_version: + type: integer + description: Latest major version number for the skill. + latest_minor_version: + type: integer + description: Latest minor version number for the skill. + status: + $ref: "#/components/schemas/PlatformSkillStatus" + origin: + $ref: "#/components/schemas/PlatformSkillOrigin" + source_provenance: + $ref: "#/components/schemas/PlatformSkillSourceProvenance" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + created_at: + type: string + format: date-time + description: Time the skill was created. + updated_at: + type: string + format: date-time + description: Time the skill was last updated. + PlatformSkillsListResponse: + type: object + required: + - skills + - has_more + - next_cursor + - request_id + properties: + skills: + type: array + description: Skills available to the user. + items: + $ref: "#/components/schemas/PlatformSkill" + has_more: + type: boolean + description: Whether additional results are available. + next_cursor: + type: string + nullable: true + description: Cursor for the next page, or null when no more results are available. + request_id: + type: string + description: Platform-generated request ID for support correlation. + PlatformSkillGetResponse: + type: object + required: + - skill + - request_id + properties: + skill: + $ref: "#/components/schemas/PlatformSkill" + request_id: + type: string + description: Platform-generated request ID for support correlation. PlatformFilterOperator: type: string description: Supported filter operator. @@ -5579,18 +5813,6 @@ components: Structured filters applied to search results. Equality operators OR multiple values within a filter. Multiple filters are AND'd together, including range filters on the same field. Filters are AND'd with any inline operators in `query`. Note that conflicting constraints on the same field (e.g., `type:document` in the query and `type: spreadsheet` in a filter) produce an empty result set. time_range: $ref: "#/components/schemas/PlatformTimeRange" - PlatformPersonReference: - type: object - description: A lightweight reference to a person, used where a payload merely points at someone. - required: - - name - properties: - id: - type: string - description: Opaque Glean person ID. - name: - type: string - description: Display name. PlatformResult: type: object required: @@ -9635,6 +9857,22 @@ components: - EXECUTION - MCP description: Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. + actionTypeSource: + type: string + enum: + - MCP_ANNOTATION + - ADMIN_OVERRIDE + - NONE + - NATIVE_TOOL_DEFINITION + description: | + Analytics-only signal (product snapshot) describing WHERE the action's + read/write determination came from. Complementary to the effective + read/write value (the tool's ToolType, which drives HITL): the value says + read-or-write, this says how confident that is. MCP_ANNOTATION = from the + tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + NONE = no usable hint (the effective value then defaults to write); + NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + Does not affect runtime behavior. authType: type: string enum: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index b1ff6863..5ae5d114 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164747,3 +164747,33 @@ workflows: type: simple x-speakeasy-test-group: tools x-speakeasy-test-rebuild: true + - workflowId: platform-skills-list + steps: + - stepId: test + operationId: platform-skills-list + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"skills":[],"has_more":true,"next_cursor":"","request_id":""} + type: simple + x-speakeasy-test-group: skills + x-speakeasy-test-rebuild: true + - workflowId: platform-skills-get + steps: + - stepId: test + operationId: platform-skills-get + parameters: + - name: skill_id + in: path + value: + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"skill":{"id":"","display_name":"Chad_Herzog","description":"whenever up aha controvert","latest_version":151495,"latest_minor_version":170771,"status":"DISABLED","origin":"CUSTOM","owner":{"name":""},"created_at":"2024-12-25T16:41:00.099Z","updated_at":"2026-12-07T21:59:59.375Z"},"request_id":""} + type: simple + x-speakeasy-test-group: skills + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ca951a32..bd8ad72d 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.789.2 +speakeasyVersion: 1.790.1 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5e0593f4d69a128e6684e80a7f023aeaed2f0f6ccabcdbc997c88f547188d4e + sourceBlobDigest: sha256:f157d18c5a42488478bab62fde7a59b809c0258f414e0318a01ba992b62ee37f tags: - latest Glean Client API: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5e0593f4d69a128e6684e80a7f023aeaed2f0f6ccabcdbc997c88f547188d4e + sourceBlobDigest: sha256:f157d18c5a42488478bab62fde7a59b809c0258f414e0318a01ba992b62ee37f codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:3926e0a4287d60c4246139ee2a719a81878de8c9e8716c7c1f962b062706e5aa + codeSamplesRevisionDigest: sha256:24329d4181db0149a8730029220ce93939726ef90364c9799cf67c7671598b76 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 17a81aaa..ee592591 100644 --- a/README.md +++ b/README.md @@ -494,6 +494,11 @@ For more information on obtaining the appropriate token type, please contact you * [query](docs/sdks/search/README.md#query) - Search +### [Skills](docs/sdks/skills/README.md) + +* [list](docs/sdks/skills/README.md#list) - List skills +* [retrieve](docs/sdks/skills/README.md#retrieve) - Retrieve skill + @@ -649,6 +654,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`indexingShortcutsBulkIndex`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`indexingShortcutsUpload`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts - [`searchQuery`](docs/sdks/search/README.md#query) - Search +- [`skillsList`](docs/sdks/skills/README.md#list) - List skills +- [`skillsRetrieve`](docs/sdks/skills/README.md#retrieve) - Retrieve skill - ~~[`clientAnswersList`](docs/sdks/answers/README.md#list)~~ - List Answers :warning: **Deprecated** - ~~[`indexingDocumentsCount`](docs/sdks/indexingdocuments/README.md#count)~~ - Get document count :warning: **Deprecated** - ~~[`indexingDocumentsStatus`](docs/sdks/indexingdocuments/README.md#status)~~ - Get document upload and indexing status :warning: **Deprecated** @@ -817,6 +824,8 @@ To learn about this feature and how to get started, check - [`useIndexingShortcutsBulkIndexMutation`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`useIndexingShortcutsUploadMutation`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts - [`useSearchQueryMutation`](docs/sdks/search/README.md#query) - Search +- [`useSkillsList`](docs/sdks/skills/README.md#list) - List skills +- [`useSkillsRetrieve`](docs/sdks/skills/README.md#retrieve) - Retrieve skill - ~~[`useClientAnswersListMutation`](docs/sdks/answers/README.md#list)~~ - List Answers :warning: **Deprecated** - ~~[`useIndexingDocumentsCountMutation`](docs/sdks/indexingdocuments/README.md#count)~~ - Get document count :warning: **Deprecated** - ~~[`useIndexingDocumentsStatusMutation`](docs/sdks/indexingdocuments/README.md#status)~~ - Get document upload and indexing status :warning: **Deprecated** diff --git a/RELEASES.md b/RELEASES.md index 916acaf5..6c503843 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -828,4 +828,14 @@ Based on: ### Generated - [typescript v0.17.3] . ### Releases -- [NPM v0.17.3] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.3 - . \ No newline at end of file +- [NPM v0.17.3] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.3 - . + +## 2026-07-15 02:02:12 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.790.1 (2.918.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.18.0] . +### Releases +- [NPM v0.18.0] https://www.npmjs.com/package/@gleanwork/api-client/v/0.18.0 - . \ No newline at end of file diff --git a/docs/models/components/actiontypesource.md b/docs/models/components/actiontypesource.md new file mode 100644 index 00000000..79973f1c --- /dev/null +++ b/docs/models/components/actiontypesource.md @@ -0,0 +1,27 @@ +# ActionTypeSource + +Analytics-only signal (product snapshot) describing WHERE the action's +read/write determination came from. Complementary to the effective +read/write value (the tool's ToolType, which drives HITL): the value says +read-or-write, this says how confident that is. MCP_ANNOTATION = from the +tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; +NONE = no usable hint (the effective value then defaults to write); +NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). +Does not affect runtime behavior. + + +## Example Usage + +```typescript +import { ActionTypeSource } from "@gleanwork/api-client/models/components"; + +let value: ActionTypeSource = "NONE"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"MCP_ANNOTATION" | "ADMIN_OVERRIDE" | "NONE" | "NATIVE_TOOL_DEFINITION" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/platformskill.md b/docs/models/components/platformskill.md new file mode 100644 index 00000000..2dcbec60 --- /dev/null +++ b/docs/models/components/platformskill.md @@ -0,0 +1,38 @@ +# PlatformSkill + +## Example Usage + +```typescript +import { PlatformSkill } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkill = { + id: "", + display_name: "Jerome_Kutch", + description: "afore joyously insidious daily bog coop haze meh pointless", + latest_version: 325433, + latest_minor_version: 984891, + status: "DRAFT", + origin: "CUSTOM", + owner: { + name: "", + }, + created_at: new Date("2024-01-07T19:53:38.172Z"), + updated_at: new Date("2026-08-25T04:34:11.776Z"), +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Glean skill ID. | +| `displayName` | *string* | :heavy_check_mark: | Human-readable skill name. | +| `description` | *string* | :heavy_check_mark: | Human-readable skill description. | +| `latestVersion` | *number* | :heavy_check_mark: | Latest major version number for the skill. | +| `latestMinorVersion` | *number* | :heavy_check_mark: | Latest minor version number for the skill. | +| `status` | [components.PlatformSkillStatus](../../models/components/platformskillstatus.md) | :heavy_check_mark: | Current skill status. | +| `origin` | [components.PlatformSkillOrigin](../../models/components/platformskillorigin.md) | :heavy_check_mark: | Source category for the skill. | +| `sourceProvenance` | [components.PlatformSkillSourceProvenance](../../models/components/platformskillsourceprovenance.md) | :heavy_minus_sign: | N/A | +| `owner` | [components.PlatformPersonReference](../../models/components/platformpersonreference.md) | :heavy_check_mark: | A lightweight reference to a person, used where a payload merely points at someone. | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Time the skill was created. | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Time the skill was last updated. | \ No newline at end of file diff --git a/docs/models/components/platformskillgetresponse.md b/docs/models/components/platformskillgetresponse.md new file mode 100644 index 00000000..f351362d --- /dev/null +++ b/docs/models/components/platformskillgetresponse.md @@ -0,0 +1,32 @@ +# PlatformSkillGetResponse + +## Example Usage + +```typescript +import { PlatformSkillGetResponse } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillGetResponse = { + skill: { + id: "", + display_name: "Eulah.Leffler", + description: "enhance toward flustered about", + latest_version: 281887, + latest_minor_version: 994194, + status: "ENABLED", + origin: "CUSTOM", + owner: { + name: "", + }, + created_at: new Date("2024-03-25T20:06:30.258Z"), + updated_at: new Date("2026-12-28T01:22:47.168Z"), + }, + request_id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `skill` | [components.PlatformSkill](../../models/components/platformskill.md) | :heavy_check_mark: | N/A | +| `requestId` | *string* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformskillorigin.md b/docs/models/components/platformskillorigin.md new file mode 100644 index 00000000..89cb7ecf --- /dev/null +++ b/docs/models/components/platformskillorigin.md @@ -0,0 +1,17 @@ +# PlatformSkillOrigin + +Source category for the skill. + +## Example Usage + +```typescript +import { PlatformSkillOrigin } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillOrigin = "CUSTOM"; +``` + +## Values + +```typescript +"CUSTOM" +``` \ No newline at end of file diff --git a/docs/models/components/platformskillslistresponse.md b/docs/models/components/platformskillslistresponse.md new file mode 100644 index 00000000..b4f6fedd --- /dev/null +++ b/docs/models/components/platformskillslistresponse.md @@ -0,0 +1,39 @@ +# PlatformSkillsListResponse + +## Example Usage + +```typescript +import { PlatformSkillsListResponse } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillsListResponse = { + skills: [ + { + id: "", + display_name: "Kameron36", + description: + "sedately scowl other yearningly aggravating anti heavily extract", + latest_version: 33039, + latest_minor_version: 380295, + status: "DRAFT", + origin: "CUSTOM", + owner: { + name: "", + }, + created_at: new Date("2024-11-30T20:43:59.162Z"), + updated_at: new Date("2024-07-06T04:25:41.450Z"), + }, + ], + has_more: true, + next_cursor: "", + request_id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `skills` | [components.PlatformSkill](../../models/components/platformskill.md)[] | :heavy_check_mark: | Skills available to the user. | +| `hasMore` | *boolean* | :heavy_check_mark: | Whether additional results are available. | +| `nextCursor` | *string* | :heavy_check_mark: | Cursor for the next page, or null when no more results are available. | +| `requestId` | *string* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformskillsourceprovenance.md b/docs/models/components/platformskillsourceprovenance.md new file mode 100644 index 00000000..b593b304 --- /dev/null +++ b/docs/models/components/platformskillsourceprovenance.md @@ -0,0 +1,20 @@ +# PlatformSkillSourceProvenance + +## Example Usage + +```typescript +import { PlatformSkillSourceProvenance } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillSourceProvenance = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `sourceUrl` | *string* | :heavy_minus_sign: | URL of the external source the skill was imported from. | +| `commitSha` | *string* | :heavy_minus_sign: | Source commit SHA for the imported skill. | +| `importedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Time the skill was imported. | +| `lastSyncedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Time the skill was last synced from its source. | +| `syncStatus` | [components.PlatformSkillSyncStatus](../../models/components/platformskillsyncstatus.md) | :heavy_minus_sign: | Current external-source sync status. | +| `syncError` | *string* | :heavy_minus_sign: | Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. | \ No newline at end of file diff --git a/docs/models/components/platformskillstatus.md b/docs/models/components/platformskillstatus.md new file mode 100644 index 00000000..5d552f7d --- /dev/null +++ b/docs/models/components/platformskillstatus.md @@ -0,0 +1,19 @@ +# PlatformSkillStatus + +Current skill status. + +## Example Usage + +```typescript +import { PlatformSkillStatus } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillStatus = "DISABLED"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"DRAFT" | "ENABLED" | "DISABLED" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/platformskillsyncstatus.md b/docs/models/components/platformskillsyncstatus.md new file mode 100644 index 00000000..52ad9e90 --- /dev/null +++ b/docs/models/components/platformskillsyncstatus.md @@ -0,0 +1,19 @@ +# PlatformSkillSyncStatus + +Current external-source sync status. + +## Example Usage + +```typescript +import { PlatformSkillSyncStatus } from "@gleanwork/api-client/models/components"; + +let value: PlatformSkillSyncStatus = "SYNC_FAILED"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"UP_TO_DATE" | "UPDATE_AVAILABLE" | "SYNC_FAILED" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/toolmetadata.md b/docs/models/components/toolmetadata.md index 8db965e1..94a16f97 100644 --- a/docs/models/components/toolmetadata.md +++ b/docs/models/components/toolmetadata.md @@ -18,23 +18,24 @@ let value: ToolMetadata = { ## Fields -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [components.ToolMetadataType](../../models/components/toolmetadatatype.md) | :heavy_check_mark: | The type of tool. | | -| `name` | *string* | :heavy_check_mark: | Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. | | -| `displayName` | *string* | :heavy_check_mark: | Human understandable name of the tool. Max 50 characters. | | -| `toolId` | *string* | :heavy_minus_sign: | An opaque id which is unique identifier for the tool. | | -| `displayDescription` | *string* | :heavy_check_mark: | Description of the tool meant for a human. | | -| `logoUrl` | *string* | :heavy_minus_sign: | URL used to fetch the logo. | | -| `objectName` | *string* | :heavy_minus_sign: | Name of the generated object. This will be used to indicate to the end user what the generated object contains. | [
"HR ticket",
"Email",
"Chat message"
] | -| `knowledgeType` | [components.KnowledgeType](../../models/components/knowledgetype.md) | :heavy_minus_sign: | Indicates the kind of knowledge a tool would access or modify. | | -| `createdBy` | [components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | -| `lastUpdatedBy` | [components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The time the tool was created in ISO format (ISO 8601) | | -| `lastUpdatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The time the tool was last updated in ISO format (ISO 8601) | | -| `writeActionType` | [components.WriteActionType](../../models/components/writeactiontype.md) | :heavy_minus_sign: | Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. | | -| `authType` | [components.AuthType](../../models/components/authtype.md) | :heavy_minus_sign: | The type of authentication being used.
Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token.
'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users.
'OAUTH_USER' uses individual user tokens for external API calls.
'DWD' refers to domain wide delegation.
| | -| `auth` | [components.AuthConfig](../../models/components/authconfig.md) | :heavy_minus_sign: | Config for tool's authentication method. | | -| `permissions` | [components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | -| `usageInstructions` | *string* | :heavy_minus_sign: | Usage instructions for the LLM to use this action. | | -| `isSetupFinished` | *boolean* | :heavy_minus_sign: | Whether this action has been fully configured and validated. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [components.ToolMetadataType](../../models/components/toolmetadatatype.md) | :heavy_check_mark: | The type of tool. | | +| `name` | *string* | :heavy_check_mark: | Unique identifier for the tool. Name should be understandable by the LLM, and will be used to invoke a tool. | | +| `displayName` | *string* | :heavy_check_mark: | Human understandable name of the tool. Max 50 characters. | | +| `toolId` | *string* | :heavy_minus_sign: | An opaque id which is unique identifier for the tool. | | +| `displayDescription` | *string* | :heavy_check_mark: | Description of the tool meant for a human. | | +| `logoUrl` | *string* | :heavy_minus_sign: | URL used to fetch the logo. | | +| `objectName` | *string* | :heavy_minus_sign: | Name of the generated object. This will be used to indicate to the end user what the generated object contains. | [
"HR ticket",
"Email",
"Chat message"
] | +| `knowledgeType` | [components.KnowledgeType](../../models/components/knowledgetype.md) | :heavy_minus_sign: | Indicates the kind of knowledge a tool would access or modify. | | +| `createdBy` | [components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | +| `lastUpdatedBy` | [components.PersonObject](../../models/components/personobject.md) | :heavy_minus_sign: | N/A | | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The time the tool was created in ISO format (ISO 8601) | | +| `lastUpdatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The time the tool was last updated in ISO format (ISO 8601) | | +| `writeActionType` | [components.WriteActionType](../../models/components/writeactiontype.md) | :heavy_minus_sign: | Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. | | +| `actionTypeSource` | [components.ActionTypeSource](../../models/components/actiontypesource.md) | :heavy_minus_sign: | Analytics-only signal (product snapshot) describing WHERE the action's
read/write determination came from. Complementary to the effective
read/write value (the tool's ToolType, which drives HITL): the value says
read-or-write, this says how confident that is. MCP_ANNOTATION = from the
tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it;
NONE = no usable hint (the effective value then defaults to write);
NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived).
Does not affect runtime behavior.
| | +| `authType` | [components.AuthType](../../models/components/authtype.md) | :heavy_minus_sign: | The type of authentication being used.
Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token.
'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users.
'OAUTH_USER' uses individual user tokens for external API calls.
'DWD' refers to domain wide delegation.
| | +| `auth` | [components.AuthConfig](../../models/components/authconfig.md) | :heavy_minus_sign: | Config for tool's authentication method. | | +| `permissions` | [components.ObjectPermissions](../../models/components/objectpermissions.md) | :heavy_minus_sign: | N/A | | +| `usageInstructions` | *string* | :heavy_minus_sign: | Usage instructions for the LLM to use this action. | | +| `isSetupFinished` | *boolean* | :heavy_minus_sign: | Whether this action has been fully configured and validated. | | \ No newline at end of file diff --git a/docs/models/operations/platformskillsgetrequest.md b/docs/models/operations/platformskillsgetrequest.md new file mode 100644 index 00000000..9e4d8cee --- /dev/null +++ b/docs/models/operations/platformskillsgetrequest.md @@ -0,0 +1,17 @@ +# PlatformSkillsGetRequest + +## Example Usage + +```typescript +import { PlatformSkillsGetRequest } from "@gleanwork/api-client/models/operations"; + +let value: PlatformSkillsGetRequest = { + skill_id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `skillId` | *string* | :heavy_check_mark: | Glean skill ID. | \ No newline at end of file diff --git a/docs/models/operations/platformskillslistrequest.md b/docs/models/operations/platformskillslistrequest.md new file mode 100644 index 00000000..6a07bb06 --- /dev/null +++ b/docs/models/operations/platformskillslistrequest.md @@ -0,0 +1,16 @@ +# PlatformSkillsListRequest + +## Example Usage + +```typescript +import { PlatformSkillsListRequest } from "@gleanwork/api-client/models/operations"; + +let value: PlatformSkillsListRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | +| `pageSize` | *number* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *string* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | \ No newline at end of file diff --git a/docs/sdks/skills/README.md b/docs/sdks/skills/README.md new file mode 100644 index 00000000..9d12a7e5 --- /dev/null +++ b/docs/sdks/skills/README.md @@ -0,0 +1,209 @@ +# Skills + +## Overview + +### Available Operations + +* [list](#list) - List skills +* [retrieve](#retrieve) - Retrieve skill + +## list + +List skills available to the authenticated user. + + +### Example Usage + + +```typescript +import { Glean } from "@gleanwork/api-client"; + +const glean = new Glean({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const result = await glean.skills.list(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { skillsList } from "@gleanwork/api-client/funcs/skillsList.js"; + +// Use `GleanCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const glean = new GleanCore({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const res = await skillsList(glean); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("skillsList failed:", res.error); + } +} + +run(); +``` + +### React hooks and utilities + +This method can be used in React components through the following hooks and +associated utilities. + +> Check out [this guide][hook-guide] for information about each of the utilities +> below and how to get started using React hooks. + +[hook-guide]: ../../../REACT_QUERY.md + +```tsx +import { + // Query hooks for fetching data. + useSkillsList, + useSkillsListSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchSkillsList, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidateSkillsList, + invalidateAllSkillsList, +} from "@gleanwork/api-client/react-query/skillsList.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `pageSize` | *number* | :heavy_minus_sign: | Maximum number of skills to return. | +| `cursor` | *string* | :heavy_minus_sign: | Opaque pagination cursor from a previous response. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PlatformSkillsListResponse](../../models/components/platformskillslistresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieve + +Retrieve metadata for a skill available to the authenticated user. + + +### Example Usage + + +```typescript +import { Glean } from "@gleanwork/api-client"; + +const glean = new Glean({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const result = await glean.skills.retrieve(""); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { skillsRetrieve } from "@gleanwork/api-client/funcs/skillsRetrieve.js"; + +// Use `GleanCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const glean = new GleanCore({ + apiToken: process.env["GLEAN_API_TOKEN"] ?? "", +}); + +async function run() { + const res = await skillsRetrieve(glean, ""); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("skillsRetrieve failed:", res.error); + } +} + +run(); +``` + +### React hooks and utilities + +This method can be used in React components through the following hooks and +associated utilities. + +> Check out [this guide][hook-guide] for information about each of the utilities +> below and how to get started using React hooks. + +[hook-guide]: ../../../REACT_QUERY.md + +```tsx +import { + // Query hooks for fetching data. + useSkillsRetrieve, + useSkillsRetrieveSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchSkillsRetrieve, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidateSkillsRetrieve, + invalidateAllSkillsRetrieve, +} from "@gleanwork/api-client/react-query/skillsRetrieve.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `skillId` | *string* | :heavy_check_mark: | Glean skill ID. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PlatformSkillGetResponse](../../models/components/platformskillgetresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/package-lock.json b/examples/package-lock.json index 97c22fca..17896732 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.18.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 46c99d73..8b5402c9 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.18.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 5b7347e0..016a169a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.18.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.18.0", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/package.json b/package.json index 9b387e1c..6f0ccb83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.18.0", "author": "Speakeasy", "tshy": { "sourceDialects": [ diff --git a/src/__tests__/messages.test.ts b/src/__tests__/messages.test.ts index a4785e31..12904134 100644 --- a/src/__tests__/messages.test.ts +++ b/src/__tests__/messages.test.ts @@ -20,7 +20,7 @@ test("Messages Messages", async () => { idType: "CONVERSATION_ID", id: "", timestampMillis: 558834, - datasource: "SLACK", + datasource: "MICROSOFTTEAMS", }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/mockserver/internal/handler/generated_handlers.go b/src/__tests__/mockserver/internal/handler/generated_handlers.go index e2e2fdc5..8ce40366 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -17,6 +17,8 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodDelete, "/rest/api/index/document/{docId}/custom-metadata/{groupName}", pathDeleteRestAPIIndexDocumentDocIDCustomMetadataGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}", pathGetAPIAgentsAgentID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/api/agents/{agent_id}/schemas", pathGetAPIAgentsAgentIDSchemas(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/skills", pathGetAPISkills(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/api/skills/{skill_id}", pathGetAPISkillsSkillID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/index/custom-metadata/schema/{groupName}", pathGetRestAPIIndexCustomMetadataSchemaGroupName(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/actions/actionpack/{actionPackId}/auth", pathGetRestAPIV1ActionsActionpackActionPackIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/agents/{agent_id}", pathGetRestAPIV1AgentsAgentID(dir, rt)), diff --git a/src/__tests__/mockserver/internal/handler/pathgetapiskills.go b/src/__tests__/mockserver/internal/handler/pathgetapiskills.go new file mode 100644 index 00000000..77c87bf1 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetapiskills.go @@ -0,0 +1,69 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 7a35981bf5e0 + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPISkills(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-skills-list[0]": + dir.HandlerFunc("platform-skills-list", testPlatformSkillsListPlatformSkillsList0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSkillsListPlatformSkillsList0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSkillsListResponse = &components.PlatformSkillsListResponse{ + Skills: []components.PlatformSkill{}, + HasMore: true, + NextCursor: types.String(""), + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathgetapiskillsskillid.go b/src/__tests__/mockserver/internal/handler/pathgetapiskillsskillid.go new file mode 100644 index 00000000..84afc7c5 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetapiskillsskillid.go @@ -0,0 +1,80 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 1eef14b2fbcb + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/types" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetAPISkillsSkillID(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-skills-get[0]": + dir.HandlerFunc("platform-skills-get", testPlatformSkillsGetPlatformSkillsGet0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSkillsGetPlatformSkillsGet0(w http.ResponseWriter, req *http.Request) { + if err := assert.SecurityAuthorizationHeader(req, false, "Bearer"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + if err := assert.AcceptHeader(req, []string{"application/json"}); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + if err := assert.HeaderExists(req, "User-Agent"); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + return + } + var respBody *components.PlatformSkillGetResponse = &components.PlatformSkillGetResponse{ + Skill: components.PlatformSkill{ + ID: "", + DisplayName: "Chad_Herzog", + Description: "whenever up aha controvert", + LatestVersion: 151495, + LatestMinorVersion: 170771, + Status: components.PlatformSkillStatusDisabled, + Origin: components.PlatformSkillOriginCustom, + Owner: components.PlatformPersonReference{ + Name: "", + }, + CreatedAt: types.MustTimeFromString("2024-12-25T16:41:00.099Z"), + UpdatedAt: types.MustTimeFromString("2026-12-07T21:59:59.375Z"), + }, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskill.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskill.go new file mode 100644 index 00000000..b7d510d4 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskill.go @@ -0,0 +1,121 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 9348b7a0ba5c + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformSkill struct { + // Glean skill ID. + ID string `json:"id"` + // Human-readable skill name. + DisplayName string `json:"display_name"` + // Human-readable skill description. + Description string `json:"description"` + // Latest major version number for the skill. + LatestVersion int64 `json:"latest_version"` + // Latest minor version number for the skill. + LatestMinorVersion int64 `json:"latest_minor_version"` + // Current skill status. + Status PlatformSkillStatus `json:"status"` + // Source category for the skill. + Origin PlatformSkillOrigin `json:"origin"` + SourceProvenance *PlatformSkillSourceProvenance `json:"source_provenance,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Owner PlatformPersonReference `json:"owner"` + // Time the skill was created. + CreatedAt time.Time `json:"created_at"` + // Time the skill was last updated. + UpdatedAt time.Time `json:"updated_at"` +} + +func (p PlatformSkill) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSkill) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"id", "display_name", "description", "latest_version", "latest_minor_version", "status", "origin", "owner", "created_at", "updated_at"}); err != nil { + return err + } + return nil +} + +func (o *PlatformSkill) GetID() string { + if o == nil { + return "" + } + return o.ID +} + +func (o *PlatformSkill) GetDisplayName() string { + if o == nil { + return "" + } + return o.DisplayName +} + +func (o *PlatformSkill) GetDescription() string { + if o == nil { + return "" + } + return o.Description +} + +func (o *PlatformSkill) GetLatestVersion() int64 { + if o == nil { + return 0 + } + return o.LatestVersion +} + +func (o *PlatformSkill) GetLatestMinorVersion() int64 { + if o == nil { + return 0 + } + return o.LatestMinorVersion +} + +func (o *PlatformSkill) GetStatus() PlatformSkillStatus { + if o == nil { + return PlatformSkillStatus("") + } + return o.Status +} + +func (o *PlatformSkill) GetOrigin() PlatformSkillOrigin { + if o == nil { + return PlatformSkillOrigin("") + } + return o.Origin +} + +func (o *PlatformSkill) GetSourceProvenance() *PlatformSkillSourceProvenance { + if o == nil { + return nil + } + return o.SourceProvenance +} + +func (o *PlatformSkill) GetOwner() PlatformPersonReference { + if o == nil { + return PlatformPersonReference{} + } + return o.Owner +} + +func (o *PlatformSkill) GetCreatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.CreatedAt +} + +func (o *PlatformSkill) GetUpdatedAt() time.Time { + if o == nil { + return time.Time{} + } + return o.UpdatedAt +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillgetresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillgetresponse.go new file mode 100644 index 00000000..e470cbc2 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillgetresponse.go @@ -0,0 +1,24 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: ce9faaafa240 + +package components + +type PlatformSkillGetResponse struct { + Skill PlatformSkill `json:"skill"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSkillGetResponse) GetSkill() PlatformSkill { + if o == nil { + return PlatformSkill{} + } + return o.Skill +} + +func (o *PlatformSkillGetResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillorigin.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillorigin.go new file mode 100644 index 00000000..91d4d1af --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillorigin.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 028d9e74ac5d + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillOrigin - Source category for the skill. +type PlatformSkillOrigin string + +const ( + PlatformSkillOriginCustom PlatformSkillOrigin = "CUSTOM" +) + +func (e PlatformSkillOrigin) ToPointer() *PlatformSkillOrigin { + return &e +} +func (e *PlatformSkillOrigin) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "CUSTOM": + *e = PlatformSkillOrigin(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillOrigin: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillslistresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillslistresponse.go new file mode 100644 index 00000000..7bf1e0b4 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillslistresponse.go @@ -0,0 +1,43 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: ea644abdd909 + +package components + +type PlatformSkillsListResponse struct { + // Skills available to the user. + Skills []PlatformSkill `json:"skills"` + // Whether additional results are available. + HasMore bool `json:"has_more"` + // Cursor for the next page, or null when no more results are available. + NextCursor *string `json:"next_cursor"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSkillsListResponse) GetSkills() []PlatformSkill { + if o == nil { + return []PlatformSkill{} + } + return o.Skills +} + +func (o *PlatformSkillsListResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformSkillsListResponse) GetNextCursor() *string { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformSkillsListResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go new file mode 100644 index 00000000..64b5f70f --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillsourceprovenance.go @@ -0,0 +1,77 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 312434003494 + +package components + +import ( + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformSkillSourceProvenance struct { + // URL of the external source the skill was imported from. + SourceURL *string `json:"source_url,omitempty"` + // Source commit SHA for the imported skill. + CommitSha *string `json:"commit_sha,omitempty"` + // Time the skill was imported. + ImportedAt *time.Time `json:"imported_at,omitempty"` + // Time the skill was last synced from its source. + LastSyncedAt *time.Time `json:"last_synced_at,omitempty"` + // Current external-source sync status. + SyncStatus *PlatformSkillSyncStatus `json:"sync_status,omitempty"` + // Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + SyncError *string `json:"sync_error,omitempty"` +} + +func (p PlatformSkillSourceProvenance) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSkillSourceProvenance) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformSkillSourceProvenance) GetSourceURL() *string { + if o == nil { + return nil + } + return o.SourceURL +} + +func (o *PlatformSkillSourceProvenance) GetCommitSha() *string { + if o == nil { + return nil + } + return o.CommitSha +} + +func (o *PlatformSkillSourceProvenance) GetImportedAt() *time.Time { + if o == nil { + return nil + } + return o.ImportedAt +} + +func (o *PlatformSkillSourceProvenance) GetLastSyncedAt() *time.Time { + if o == nil { + return nil + } + return o.LastSyncedAt +} + +func (o *PlatformSkillSourceProvenance) GetSyncStatus() *PlatformSkillSyncStatus { + if o == nil { + return nil + } + return o.SyncStatus +} + +func (o *PlatformSkillSourceProvenance) GetSyncError() *string { + if o == nil { + return nil + } + return o.SyncError +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillstatus.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillstatus.go new file mode 100644 index 00000000..8176be88 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillstatus.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 180ceed8be9b + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillStatus - Current skill status. +type PlatformSkillStatus string + +const ( + PlatformSkillStatusDraft PlatformSkillStatus = "DRAFT" + PlatformSkillStatusEnabled PlatformSkillStatus = "ENABLED" + PlatformSkillStatusDisabled PlatformSkillStatus = "DISABLED" +) + +func (e PlatformSkillStatus) ToPointer() *PlatformSkillStatus { + return &e +} +func (e *PlatformSkillStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "DRAFT": + fallthrough + case "ENABLED": + fallthrough + case "DISABLED": + *e = PlatformSkillStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillStatus: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformskillsyncstatus.go b/src/__tests__/mockserver/internal/sdk/models/components/platformskillsyncstatus.go new file mode 100644 index 00000000..1d30df91 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformskillsyncstatus.go @@ -0,0 +1,39 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: bc07f04da2f3 + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSkillSyncStatus - Current external-source sync status. +type PlatformSkillSyncStatus string + +const ( + PlatformSkillSyncStatusUpToDate PlatformSkillSyncStatus = "UP_TO_DATE" + PlatformSkillSyncStatusUpdateAvailable PlatformSkillSyncStatus = "UPDATE_AVAILABLE" + PlatformSkillSyncStatusSyncFailed PlatformSkillSyncStatus = "SYNC_FAILED" +) + +func (e PlatformSkillSyncStatus) ToPointer() *PlatformSkillSyncStatus { + return &e +} +func (e *PlatformSkillSyncStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "UP_TO_DATE": + fallthrough + case "UPDATE_AVAILABLE": + fallthrough + case "SYNC_FAILED": + *e = PlatformSkillSyncStatus(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSkillSyncStatus: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/toolmetadata.go b/src/__tests__/mockserver/internal/sdk/models/components/toolmetadata.go index 440a10f0..18410420 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/toolmetadata.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/toolmetadata.go @@ -97,6 +97,46 @@ func (e *WriteActionType) UnmarshalJSON(data []byte) error { } } +// ActionTypeSource - Analytics-only signal (product snapshot) describing WHERE the action's +// read/write determination came from. Complementary to the effective +// read/write value (the tool's ToolType, which drives HITL): the value says +// read-or-write, this says how confident that is. MCP_ANNOTATION = from the +// tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; +// NONE = no usable hint (the effective value then defaults to write); +// NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). +// Does not affect runtime behavior. +type ActionTypeSource string + +const ( + ActionTypeSourceMcpAnnotation ActionTypeSource = "MCP_ANNOTATION" + ActionTypeSourceAdminOverride ActionTypeSource = "ADMIN_OVERRIDE" + ActionTypeSourceNone ActionTypeSource = "NONE" + ActionTypeSourceNativeToolDefinition ActionTypeSource = "NATIVE_TOOL_DEFINITION" +) + +func (e ActionTypeSource) ToPointer() *ActionTypeSource { + return &e +} +func (e *ActionTypeSource) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "MCP_ANNOTATION": + fallthrough + case "ADMIN_OVERRIDE": + fallthrough + case "NONE": + fallthrough + case "NATIVE_TOOL_DEFINITION": + *e = ActionTypeSource(v) + return nil + default: + return fmt.Errorf("invalid value for ActionTypeSource: %v", v) + } +} + // AuthType - The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -166,6 +206,16 @@ type ToolMetadata struct { LastUpdatedAt *time.Time `json:"lastUpdatedAt,omitempty"` // Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. WriteActionType *WriteActionType `json:"writeActionType,omitempty"` + // Analytics-only signal (product snapshot) describing WHERE the action's + // read/write determination came from. Complementary to the effective + // read/write value (the tool's ToolType, which drives HITL): the value says + // read-or-write, this says how confident that is. MCP_ANNOTATION = from the + // tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + // NONE = no usable hint (the effective value then defaults to write); + // NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + // Does not affect runtime behavior. + // + ActionTypeSource *ActionTypeSource `json:"actionTypeSource,omitempty"` // The type of authentication being used. // Use 'OAUTH_*' when Glean calls an external API (e.g., Jira) on behalf of a user to obtain an OAuth token. // 'OAUTH_ADMIN' utilizes an admin token for external API calls on behalf all users. @@ -284,6 +334,13 @@ func (o *ToolMetadata) GetWriteActionType() *WriteActionType { return o.WriteActionType } +func (o *ToolMetadata) GetActionTypeSource() *ActionTypeSource { + if o == nil { + return nil + } + return o.ActionTypeSource +} + func (o *ToolMetadata) GetAuthType() *AuthType { if o == nil { return nil diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformskillsget.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformskillsget.go new file mode 100644 index 00000000..6fc2f6f0 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformskillsget.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 7cf3c9da1e9e + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSkillsGetRequest struct { + // Glean skill ID. + SkillID string `pathParam:"style=simple,explode=false,name=skill_id"` +} + +func (o *PlatformSkillsGetRequest) GetSkillID() string { + if o == nil { + return "" + } + return o.SkillID +} + +type PlatformSkillsGetResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillGetResponse *components.PlatformSkillGetResponse +} + +func (o *PlatformSkillsGetResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSkillsGetResponse) GetPlatformSkillGetResponse() *components.PlatformSkillGetResponse { + if o == nil { + return nil + } + return o.PlatformSkillGetResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformskillslist.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformskillslist.go new file mode 100644 index 00000000..4e0bdef1 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformskillslist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 8531b738e2ad + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSkillsListRequest struct { + // Maximum number of skills to return. + PageSize *int64 `queryParam:"style=form,explode=true,name=page_size"` + // Opaque pagination cursor from a previous response. + Cursor *string `queryParam:"style=form,explode=true,name=cursor"` +} + +func (o *PlatformSkillsListRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformSkillsListRequest) GetCursor() *string { + if o == nil { + return nil + } + return o.Cursor +} + +type PlatformSkillsListResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSkillsListResponse *components.PlatformSkillsListResponse +} + +func (o *PlatformSkillsListResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSkillsListResponse) GetPlatformSkillsListResponse() *components.PlatformSkillsListResponse { + if o == nil { + return nil + } + return o.PlatformSkillsListResponse +} diff --git a/src/__tests__/skills.test.ts b/src/__tests__/skills.test.ts new file mode 100644 index 00000000..9ee0b856 --- /dev/null +++ b/src/__tests__/skills.test.ts @@ -0,0 +1,34 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3fa6e540c659 + */ + +import { expect, test } from "vitest"; +import { Glean } from "../index.js"; +import { createTestHTTPClient } from "./testclient.js"; + +test("Skills Platform Skills List", async () => { + const testHttpClient = createTestHTTPClient("platform-skills-list"); + + const glean = new Glean({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", + }); + + const result = await glean.skills.list(); + expect(result).toBeDefined(); +}); + +test("Skills Platform Skills Get", async () => { + const testHttpClient = createTestHTTPClient("platform-skills-get"); + + const glean = new Glean({ + serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080", + httpClient: testHttpClient, + apiToken: process.env["GLEAN_API_TOKEN"] ?? "value", + }); + + const result = await glean.skills.retrieve(""); + expect(result).toBeDefined(); +}); diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index bb5e2b02..ea417cd5 100644 --- a/src/__tests__/summarize.test.ts +++ b/src/__tests__/summarize.test.ts @@ -19,10 +19,12 @@ test("Summarize Summarize", async () => { const result = await glean.client.documents.summarize({ documentSpecs: [ { - url: "https://dim-glider.com/", + ugcType: "ANNOUNCEMENTS", + ugcId: "", }, { - id: "", + ugcType: "ANNOUNCEMENTS", + ugcId: "", }, ], }); diff --git a/src/funcs/skillsList.ts b/src/funcs/skillsList.ts new file mode 100644 index 00000000..099d6983 --- /dev/null +++ b/src/funcs/skillsList.ts @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: a643d8a0c73b + */ + +import { GleanCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ +export function skillsList( + client: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + components.PlatformSkillsListResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + pageSize, + cursor, + options, + )); +} + +async function $do( + client: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + components.PlatformSkillsListResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.PlatformSkillsListRequest = { + page_size: pageSize, + cursor: cursor, + }; + + const parsed = safeParse( + input, + (value) => operations.PlatformSkillsListRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/api/skills")(); + + const query = encodeFormQuery({ + "cursor": payload.cursor, + "page_size": payload.page_size, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiToken); + const securityInput = secConfig == null ? {} : { apiToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "platform-skills-list", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.PlatformSkillsListResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PlatformSkillsListResponse$inboundSchema), + M.jsonErr( + [400, 401, 403, 404, 408, 429], + errors.PlatformProblemDetailError$inboundSchema, + { ctype: "application/problem+json" }, + ), + M.jsonErr([500, 503], errors.PlatformProblemDetailError$inboundSchema, { + ctype: "application/problem+json", + }), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/skillsRetrieve.ts b/src/funcs/skillsRetrieve.ts new file mode 100644 index 00000000..f942a289 --- /dev/null +++ b/src/funcs/skillsRetrieve.ts @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 7bff1ef0523e + */ + +import { GleanCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Retrieve skill + * + * @remarks + * Retrieve metadata for a skill available to the authenticated user. + */ +export function skillsRetrieve( + client: GleanCore, + skillId: string, + options?: RequestOptions, +): APIPromise< + Result< + components.PlatformSkillGetResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + skillId, + options, + )); +} + +async function $do( + client: GleanCore, + skillId: string, + options?: RequestOptions, +): Promise< + [ + Result< + components.PlatformSkillGetResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.PlatformSkillsGetRequest = { + skill_id: skillId, + }; + + const parsed = safeParse( + input, + (value) => operations.PlatformSkillsGetRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + skill_id: encodeSimple("skill_id", payload.skill_id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/api/skills/{skill_id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiToken); + const securityInput = secConfig == null ? {} : { apiToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "platform-skills-get", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.PlatformSkillGetResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PlatformSkillGetResponse$inboundSchema), + M.jsonErr( + [400, 401, 403, 404, 408, 429], + errors.PlatformProblemDetailError$inboundSchema, + { ctype: "application/problem+json" }, + ), + M.jsonErr([500, 503], errors.PlatformProblemDetailError$inboundSchema, { + ctype: "application/problem+json", + }), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 458dd7f8..1a7f82a1 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.9.0", - sdkVersion: "0.17.3", - genVersion: "2.916.4", + sdkVersion: "0.18.0", + genVersion: "2.918.1", userAgent: - "speakeasy-sdk/typescript 0.17.3 2.916.4 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.18.0 2.918.1 0.9.0 @gleanwork/api-client", } as const; diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 7e39bf7d..a62c5237 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -367,6 +367,13 @@ export * from "./platformproblemdetailerror.js"; export * from "./platformresult.js"; export * from "./platformsearchrequest.js"; export * from "./platformsearchresponse.js"; +export * from "./platformskill.js"; +export * from "./platformskillgetresponse.js"; +export * from "./platformskillorigin.js"; +export * from "./platformskillslistresponse.js"; +export * from "./platformskillsourceprovenance.js"; +export * from "./platformskillstatus.js"; +export * from "./platformskillsyncstatus.js"; export * from "./platformtimerange.js"; export * from "./possiblevalue.js"; export * from "./processalldocumentsrequest.js"; diff --git a/src/models/components/platformskill.ts b/src/models/components/platformskill.ts new file mode 100644 index 00000000..4d1a1f40 --- /dev/null +++ b/src/models/components/platformskill.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d34696ea810b + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PlatformPersonReference, + PlatformPersonReference$inboundSchema, +} from "./platformpersonreference.js"; +import { + PlatformSkillOrigin, + PlatformSkillOrigin$inboundSchema, +} from "./platformskillorigin.js"; +import { + PlatformSkillSourceProvenance, + PlatformSkillSourceProvenance$inboundSchema, +} from "./platformskillsourceprovenance.js"; +import { + PlatformSkillStatus, + PlatformSkillStatus$inboundSchema, +} from "./platformskillstatus.js"; + +export type PlatformSkill = { + /** + * Glean skill ID. + */ + id: string; + /** + * Human-readable skill name. + */ + display_name: string; + /** + * Human-readable skill description. + */ + description: string; + /** + * Latest major version number for the skill. + */ + latest_version: number; + /** + * Latest minor version number for the skill. + */ + latest_minor_version: number; + /** + * Current skill status. + */ + status: PlatformSkillStatus; + /** + * Source category for the skill. + */ + origin: PlatformSkillOrigin; + source_provenance?: PlatformSkillSourceProvenance | undefined; + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + owner: PlatformPersonReference; + /** + * Time the skill was created. + */ + created_at: Date; + /** + * Time the skill was last updated. + */ + updated_at: Date; +}; + +/** @internal */ +export const PlatformSkill$inboundSchema: z.ZodType< + PlatformSkill, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + display_name: z.string(), + description: z.string(), + latest_version: z.number().int(), + latest_minor_version: z.number().int(), + status: PlatformSkillStatus$inboundSchema, + origin: PlatformSkillOrigin$inboundSchema, + source_provenance: PlatformSkillSourceProvenance$inboundSchema.optional(), + owner: PlatformPersonReference$inboundSchema, + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), +}); + +export function platformSkillFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformSkill$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformSkill' from JSON`, + ); +} diff --git a/src/models/components/platformskillgetresponse.ts b/src/models/components/platformskillgetresponse.ts new file mode 100644 index 00000000..26177c0f --- /dev/null +++ b/src/models/components/platformskillgetresponse.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b9dd0e54b6c6 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { PlatformSkill, PlatformSkill$inboundSchema } from "./platformskill.js"; + +export type PlatformSkillGetResponse = { + skill: PlatformSkill; + /** + * Platform-generated request ID for support correlation. + */ + request_id: string; +}; + +/** @internal */ +export const PlatformSkillGetResponse$inboundSchema: z.ZodType< + PlatformSkillGetResponse, + z.ZodTypeDef, + unknown +> = z.object({ + skill: PlatformSkill$inboundSchema, + request_id: z.string(), +}); + +export function platformSkillGetResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformSkillGetResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformSkillGetResponse' from JSON`, + ); +} diff --git a/src/models/components/platformskillorigin.ts b/src/models/components/platformskillorigin.ts new file mode 100644 index 00000000..a2cd7a5f --- /dev/null +++ b/src/models/components/platformskillorigin.ts @@ -0,0 +1,23 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 5f9163750617 + */ + +import * as z from "zod/v3"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * Source category for the skill. + */ +export const PlatformSkillOrigin = { + Custom: "CUSTOM", +} as const; +/** + * Source category for the skill. + */ +export type PlatformSkillOrigin = ClosedEnum; + +/** @internal */ +export const PlatformSkillOrigin$inboundSchema: z.ZodNativeEnum< + typeof PlatformSkillOrigin +> = z.nativeEnum(PlatformSkillOrigin); diff --git a/src/models/components/platformskillslistresponse.ts b/src/models/components/platformskillslistresponse.ts new file mode 100644 index 00000000..584e1849 --- /dev/null +++ b/src/models/components/platformskillslistresponse.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 0b4832ec4dc7 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { PlatformSkill, PlatformSkill$inboundSchema } from "./platformskill.js"; + +export type PlatformSkillsListResponse = { + /** + * Skills available to the user. + */ + skills: Array; + /** + * Whether additional results are available. + */ + has_more: boolean; + /** + * Cursor for the next page, or null when no more results are available. + */ + next_cursor: string | null; + /** + * Platform-generated request ID for support correlation. + */ + request_id: string; +}; + +/** @internal */ +export const PlatformSkillsListResponse$inboundSchema: z.ZodType< + PlatformSkillsListResponse, + z.ZodTypeDef, + unknown +> = z.object({ + skills: z.array(PlatformSkill$inboundSchema), + has_more: z.boolean(), + next_cursor: z.nullable(z.string()), + request_id: z.string(), +}); + +export function platformSkillsListResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformSkillsListResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformSkillsListResponse' from JSON`, + ); +} diff --git a/src/models/components/platformskillsourceprovenance.ts b/src/models/components/platformskillsourceprovenance.ts new file mode 100644 index 00000000..be0b13f6 --- /dev/null +++ b/src/models/components/platformskillsourceprovenance.ts @@ -0,0 +1,67 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d205a4ca5eab + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PlatformSkillSyncStatus, + PlatformSkillSyncStatus$inboundSchema, +} from "./platformskillsyncstatus.js"; + +export type PlatformSkillSourceProvenance = { + /** + * URL of the external source the skill was imported from. + */ + source_url?: string | undefined; + /** + * Source commit SHA for the imported skill. + */ + commit_sha?: string | undefined; + /** + * Time the skill was imported. + */ + imported_at?: Date | undefined; + /** + * Time the skill was last synced from its source. + */ + last_synced_at?: Date | undefined; + /** + * Current external-source sync status. + */ + sync_status?: PlatformSkillSyncStatus | undefined; + /** + * Human-readable sync failure reason, present only when sync_status is SYNC_FAILED. + */ + sync_error?: string | undefined; +}; + +/** @internal */ +export const PlatformSkillSourceProvenance$inboundSchema: z.ZodType< + PlatformSkillSourceProvenance, + z.ZodTypeDef, + unknown +> = z.object({ + source_url: z.string().optional(), + commit_sha: z.string().optional(), + imported_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + last_synced_at: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ).optional(), + sync_status: PlatformSkillSyncStatus$inboundSchema.optional(), + sync_error: z.string().optional(), +}); + +export function platformSkillSourceProvenanceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformSkillSourceProvenance$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformSkillSourceProvenance' from JSON`, + ); +} diff --git a/src/models/components/platformskillstatus.ts b/src/models/components/platformskillstatus.ts new file mode 100644 index 00000000..43aaae8c --- /dev/null +++ b/src/models/components/platformskillstatus.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3239e840356d + */ + +import * as z from "zod/v3"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +/** + * Current skill status. + */ +export const PlatformSkillStatus = { + Draft: "DRAFT", + Enabled: "ENABLED", + Disabled: "DISABLED", +} as const; +/** + * Current skill status. + */ +export type PlatformSkillStatus = OpenEnum; + +/** @internal */ +export const PlatformSkillStatus$inboundSchema: z.ZodType< + PlatformSkillStatus, + z.ZodTypeDef, + unknown +> = openEnums.inboundSchema(PlatformSkillStatus); diff --git a/src/models/components/platformskillsyncstatus.ts b/src/models/components/platformskillsyncstatus.ts new file mode 100644 index 00000000..2efda9b8 --- /dev/null +++ b/src/models/components/platformskillsyncstatus.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 474e34580f2d + */ + +import * as z from "zod/v3"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +/** + * Current external-source sync status. + */ +export const PlatformSkillSyncStatus = { + UpToDate: "UP_TO_DATE", + UpdateAvailable: "UPDATE_AVAILABLE", + SyncFailed: "SYNC_FAILED", +} as const; +/** + * Current external-source sync status. + */ +export type PlatformSkillSyncStatus = OpenEnum; + +/** @internal */ +export const PlatformSkillSyncStatus$inboundSchema: z.ZodType< + PlatformSkillSyncStatus, + z.ZodTypeDef, + unknown +> = openEnums.inboundSchema(PlatformSkillSyncStatus); diff --git a/src/models/components/toolmetadata.ts b/src/models/components/toolmetadata.ts index 4fb9511c..7f4802a6 100644 --- a/src/models/components/toolmetadata.ts +++ b/src/models/components/toolmetadata.ts @@ -66,6 +66,38 @@ export const WriteActionType = { */ export type WriteActionType = OpenEnum; +/** + * Analytics-only signal (product snapshot) describing WHERE the action's + * + * @remarks + * read/write determination came from. Complementary to the effective + * read/write value (the tool's ToolType, which drives HITL): the value says + * read-or-write, this says how confident that is. MCP_ANNOTATION = from the + * tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + * NONE = no usable hint (the effective value then defaults to write); + * NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + * Does not affect runtime behavior. + */ +export const ActionTypeSource = { + McpAnnotation: "MCP_ANNOTATION", + AdminOverride: "ADMIN_OVERRIDE", + None: "NONE", + NativeToolDefinition: "NATIVE_TOOL_DEFINITION", +} as const; +/** + * Analytics-only signal (product snapshot) describing WHERE the action's + * + * @remarks + * read/write determination came from. Complementary to the effective + * read/write value (the tool's ToolType, which drives HITL): the value says + * read-or-write, this says how confident that is. MCP_ANNOTATION = from the + * tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + * NONE = no usable hint (the effective value then defaults to write); + * NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + * Does not affect runtime behavior. + */ +export type ActionTypeSource = OpenEnum; + /** * The type of authentication being used. * @@ -144,6 +176,19 @@ export type ToolMetadata = { * Valid only for write actions. Represents the type of write action. REDIRECT - The client renders the URL which contains information for carrying out the action. EXECUTION - Send a request to an external server and execute the action. MCP - Send a tools/call request to an MCP server to execute the action. */ writeActionType?: WriteActionType | undefined; + /** + * Analytics-only signal (product snapshot) describing WHERE the action's + * + * @remarks + * read/write determination came from. Complementary to the effective + * read/write value (the tool's ToolType, which drives HITL): the value says + * read-or-write, this says how confident that is. MCP_ANNOTATION = from the + * tool's read-only/destructive hints; ADMIN_OVERRIDE = an admin set it; + * NONE = no usable hint (the effective value then defaults to write); + * NATIVE_TOOL_DEFINITION = from a curated native tool (snapshot-derived). + * Does not affect runtime behavior. + */ + actionTypeSource?: ActionTypeSource | undefined; /** * The type of authentication being used. * @@ -208,6 +253,19 @@ export const WriteActionType$outboundSchema: z.ZodType< WriteActionType > = openEnums.outboundSchema(WriteActionType); +/** @internal */ +export const ActionTypeSource$inboundSchema: z.ZodType< + ActionTypeSource, + z.ZodTypeDef, + unknown +> = openEnums.inboundSchema(ActionTypeSource); +/** @internal */ +export const ActionTypeSource$outboundSchema: z.ZodType< + string, + z.ZodTypeDef, + ActionTypeSource +> = openEnums.outboundSchema(ActionTypeSource); + /** @internal */ export const AuthType$inboundSchema: z.ZodType< AuthType, @@ -243,6 +301,7 @@ export const ToolMetadata$inboundSchema: z.ZodType< new Date(v) ).optional(), writeActionType: WriteActionType$inboundSchema.optional(), + actionTypeSource: ActionTypeSource$inboundSchema.optional(), authType: AuthType$inboundSchema.optional(), auth: AuthConfig$inboundSchema.optional(), permissions: ObjectPermissions$inboundSchema.optional(), @@ -264,6 +323,7 @@ export type ToolMetadata$Outbound = { createdAt?: string | undefined; lastUpdatedAt?: string | undefined; writeActionType?: string | undefined; + actionTypeSource?: string | undefined; authType?: string | undefined; auth?: AuthConfig$Outbound | undefined; permissions?: ObjectPermissions$Outbound | undefined; @@ -290,6 +350,7 @@ export const ToolMetadata$outboundSchema: z.ZodType< createdAt: z.date().transform(v => v.toISOString()).optional(), lastUpdatedAt: z.date().transform(v => v.toISOString()).optional(), writeActionType: WriteActionType$outboundSchema.optional(), + actionTypeSource: ActionTypeSource$outboundSchema.optional(), authType: AuthType$outboundSchema.optional(), auth: AuthConfig$outboundSchema.optional(), permissions: ObjectPermissions$outboundSchema.optional(), diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 00caa4b0..e9f5e4f1 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -75,6 +75,8 @@ export * from "./pin.js"; export * from "./platformagentscreaterun.js"; export * from "./platformagentsget.js"; export * from "./platformagentsgetschemas.js"; +export * from "./platformskillsget.js"; +export * from "./platformskillslist.js"; export * from "./postapiindexv1debugdatasourcedocument.js"; export * from "./postapiindexv1debugdatasourcedocumentevents.js"; export * from "./postapiindexv1debugdatasourcedocuments.js"; diff --git a/src/models/operations/platformskillsget.ts b/src/models/operations/platformskillsget.ts new file mode 100644 index 00000000..c3d2123e --- /dev/null +++ b/src/models/operations/platformskillsget.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 24dc86e69e49 + */ + +import * as z from "zod/v3"; + +export type PlatformSkillsGetRequest = { + /** + * Glean skill ID. + */ + skill_id: string; +}; + +/** @internal */ +export type PlatformSkillsGetRequest$Outbound = { + skill_id: string; +}; + +/** @internal */ +export const PlatformSkillsGetRequest$outboundSchema: z.ZodType< + PlatformSkillsGetRequest$Outbound, + z.ZodTypeDef, + PlatformSkillsGetRequest +> = z.object({ + skill_id: z.string(), +}); + +export function platformSkillsGetRequestToJSON( + platformSkillsGetRequest: PlatformSkillsGetRequest, +): string { + return JSON.stringify( + PlatformSkillsGetRequest$outboundSchema.parse(platformSkillsGetRequest), + ); +} diff --git a/src/models/operations/platformskillslist.ts b/src/models/operations/platformskillslist.ts new file mode 100644 index 00000000..e081d779 --- /dev/null +++ b/src/models/operations/platformskillslist.ts @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 909cbd063812 + */ + +import * as z from "zod/v3"; + +export type PlatformSkillsListRequest = { + /** + * Maximum number of skills to return. + */ + page_size?: number | undefined; + /** + * Opaque pagination cursor from a previous response. + */ + cursor?: string | undefined; +}; + +/** @internal */ +export type PlatformSkillsListRequest$Outbound = { + page_size?: number | undefined; + cursor?: string | undefined; +}; + +/** @internal */ +export const PlatformSkillsListRequest$outboundSchema: z.ZodType< + PlatformSkillsListRequest$Outbound, + z.ZodTypeDef, + PlatformSkillsListRequest +> = z.object({ + page_size: z.number().int().optional(), + cursor: z.string().optional(), +}); + +export function platformSkillsListRequestToJSON( + platformSkillsListRequest: PlatformSkillsListRequest, +): string { + return JSON.stringify( + PlatformSkillsListRequest$outboundSchema.parse(platformSkillsListRequest), + ); +} diff --git a/src/react-query/index.ts b/src/react-query/index.ts index b8610dc0..f64f2ba6 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -143,3 +143,5 @@ export * from "./indexingPermissionsUpdatePermissions.js"; export * from "./indexingShortcutsBulkIndex.js"; export * from "./indexingShortcutsUpload.js"; export * from "./searchQuery.js"; +export * from "./skillsList.js"; +export * from "./skillsRetrieve.js"; diff --git a/src/react-query/skillsList.core.ts b/src/react-query/skillsList.core.ts new file mode 100644 index 00000000..9134b7a2 --- /dev/null +++ b/src/react-query/skillsList.core.ts @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e91168fc9e6b + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { skillsList } from "../funcs/skillsList.js"; +import { combineSignals } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; +export type SkillsListQueryData = components.PlatformSkillsListResponse; + +export function prefetchSkillsList( + queryClient: QueryClient, + client$: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildSkillsListQuery( + client$, + pageSize, + cursor, + options, + ), + }); +} + +export function buildSkillsListQuery( + client$: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: (context: QueryFunctionContext) => Promise; +} { + return { + queryKey: queryKeySkillsList({ pageSize, cursor }), + queryFn: async function skillsListQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(skillsList( + client$, + pageSize, + cursor, + mergedOptions, + )); + }, + }; +} + +export function queryKeySkillsList( + parameters: { pageSize?: number | undefined; cursor?: string | undefined }, +): QueryKey { + return ["@gleanwork/api-client", "skills", "list", parameters]; +} diff --git a/src/react-query/skillsList.ts b/src/react-query/skillsList.ts new file mode 100644 index 00000000..b911a654 --- /dev/null +++ b/src/react-query/skillsList.ts @@ -0,0 +1,134 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 3377edb65dda + */ + +import { + InvalidateQueryFilters, + QueryClient, + useQuery, + UseQueryResult, + useSuspenseQuery, + UseSuspenseQueryResult, +} from "@tanstack/react-query"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { useGleanContext } from "./_context.js"; +import { + QueryHookOptions, + SuspenseQueryHookOptions, + TupleToPrefixes, +} from "./_types.js"; +import { + buildSkillsListQuery, + prefetchSkillsList, + queryKeySkillsList, + SkillsListQueryData, +} from "./skillsList.core.js"; +export { + buildSkillsListQuery, + prefetchSkillsList, + queryKeySkillsList, + type SkillsListQueryData, +}; + +export type SkillsListQueryError = + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ +export function useSkillsList( + pageSize?: number | undefined, + cursor?: string | undefined, + options?: QueryHookOptions, +): UseQueryResult { + const client = useGleanContext(); + return useQuery({ + ...buildSkillsListQuery( + client, + pageSize, + cursor, + options, + ), + ...options, + }); +} + +/** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ +export function useSkillsListSuspense( + pageSize?: number | undefined, + cursor?: string | undefined, + options?: SuspenseQueryHookOptions, +): UseSuspenseQueryResult { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildSkillsListQuery( + client, + pageSize, + cursor, + options, + ), + ...options, + }); +} + +export function setSkillsListData( + client: QueryClient, + queryKeyBase: [ + parameters: { pageSize?: number | undefined; cursor?: string | undefined }, + ], + data: SkillsListQueryData, +): SkillsListQueryData | undefined { + const key = queryKeySkillsList(...queryKeyBase); + + return client.setQueryData(key, data); +} + +export function invalidateSkillsList( + client: QueryClient, + queryKeyBase: TupleToPrefixes< + [parameters: { pageSize?: number | undefined; cursor?: string | undefined }] + >, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "list", ...queryKeyBase], + }); +} + +export function invalidateAllSkillsList( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "list"], + }); +} diff --git a/src/react-query/skillsRetrieve.core.ts b/src/react-query/skillsRetrieve.core.ts new file mode 100644 index 00000000..3c4f811c --- /dev/null +++ b/src/react-query/skillsRetrieve.core.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b293a018b942 + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { skillsRetrieve } from "../funcs/skillsRetrieve.js"; +import { combineSignals } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; +export type SkillsRetrieveQueryData = components.PlatformSkillGetResponse; + +export function prefetchSkillsRetrieve( + queryClient: QueryClient, + client$: GleanCore, + skillId: string, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildSkillsRetrieveQuery( + client$, + skillId, + options, + ), + }); +} + +export function buildSkillsRetrieveQuery( + client$: GleanCore, + skillId: string, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: (context: QueryFunctionContext) => Promise; +} { + return { + queryKey: queryKeySkillsRetrieve(skillId), + queryFn: async function skillsRetrieveQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(skillsRetrieve( + client$, + skillId, + mergedOptions, + )); + }, + }; +} + +export function queryKeySkillsRetrieve(skillId: string): QueryKey { + return ["@gleanwork/api-client", "skills", "retrieve", skillId]; +} diff --git a/src/react-query/skillsRetrieve.ts b/src/react-query/skillsRetrieve.ts new file mode 100644 index 00000000..c3b68b13 --- /dev/null +++ b/src/react-query/skillsRetrieve.ts @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8bd7927c56aa + */ + +import { + InvalidateQueryFilters, + QueryClient, + useQuery, + UseQueryResult, + useSuspenseQuery, + UseSuspenseQueryResult, +} from "@tanstack/react-query"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { useGleanContext } from "./_context.js"; +import { + QueryHookOptions, + SuspenseQueryHookOptions, + TupleToPrefixes, +} from "./_types.js"; +import { + buildSkillsRetrieveQuery, + prefetchSkillsRetrieve, + queryKeySkillsRetrieve, + SkillsRetrieveQueryData, +} from "./skillsRetrieve.core.js"; +export { + buildSkillsRetrieveQuery, + prefetchSkillsRetrieve, + queryKeySkillsRetrieve, + type SkillsRetrieveQueryData, +}; + +export type SkillsRetrieveQueryError = + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * Retrieve skill + * + * @remarks + * Retrieve metadata for a skill available to the authenticated user. + */ +export function useSkillsRetrieve( + skillId: string, + options?: QueryHookOptions, +): UseQueryResult { + const client = useGleanContext(); + return useQuery({ + ...buildSkillsRetrieveQuery( + client, + skillId, + options, + ), + ...options, + }); +} + +/** + * Retrieve skill + * + * @remarks + * Retrieve metadata for a skill available to the authenticated user. + */ +export function useSkillsRetrieveSuspense( + skillId: string, + options?: SuspenseQueryHookOptions< + SkillsRetrieveQueryData, + SkillsRetrieveQueryError + >, +): UseSuspenseQueryResult { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildSkillsRetrieveQuery( + client, + skillId, + options, + ), + ...options, + }); +} + +export function setSkillsRetrieveData( + client: QueryClient, + queryKeyBase: [skillId: string], + data: SkillsRetrieveQueryData, +): SkillsRetrieveQueryData | undefined { + const key = queryKeySkillsRetrieve(...queryKeyBase); + + return client.setQueryData(key, data); +} + +export function invalidateSkillsRetrieve( + client: QueryClient, + queryKeyBase: TupleToPrefixes<[skillId: string]>, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "retrieve", ...queryKeyBase], + }); +} + +export function invalidateAllSkillsRetrieve( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "retrieve"], + }); +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 65e63fcc..2cca83bd 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -8,6 +8,7 @@ import { Agents } from "./agents.js"; import { Client } from "./client.js"; import { Indexing } from "./indexing.js"; import { Search } from "./search.js"; +import { Skills } from "./skills.js"; export class Glean extends ClientSDK { private _agents?: Agents; @@ -15,6 +16,11 @@ export class Glean extends ClientSDK { return (this._agents ??= new Agents(this._options)); } + private _skills?: Skills; + get skills(): Skills { + return (this._skills ??= new Skills(this._options)); + } + private _search?: Search; get search(): Search { return (this._search ??= new Search(this._options)); diff --git a/src/sdk/skills.ts b/src/sdk/skills.ts new file mode 100644 index 00000000..93d42981 --- /dev/null +++ b/src/sdk/skills.ts @@ -0,0 +1,48 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 847667a72f83 + */ + +import { skillsList } from "../funcs/skillsList.js"; +import { skillsRetrieve } from "../funcs/skillsRetrieve.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Skills extends ClientSDK { + /** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ + async list( + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(skillsList( + this, + pageSize, + cursor, + options, + )); + } + + /** + * Retrieve skill + * + * @remarks + * Retrieve metadata for a skill available to the authenticated user. + */ + async retrieve( + skillId: string, + options?: RequestOptions, + ): Promise { + return unwrapAsync(skillsRetrieve( + this, + skillId, + options, + )); + } +}