diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d4797aa0..db61634a 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: cba6d168870630c0bc23385e98ab7d5c docVersion: 0.9.0 speakeasyVersion: 1.789.2 generationVersion: 2.916.4 - releaseVersion: 0.17.3 - configChecksum: ceee23da0b77c78087da10f0482d460b + releaseVersion: 0.17.4 + configChecksum: 8a1ed0fc4c337d94bc12e9ff94e94bf7 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: dbf418cb-589f-455a-8495-8d0cf5dd8f98 + pristine_commit_hash: d00defb81ab56d51518b776b17c92fa1a086c92a + pristine_tree_hash: e5be0cd14136194db69f1cf4f9a3584eff16b316 features: typescript: acceptHeaders: 2.81.2 @@ -1942,6 +1942,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 @@ -2946,6 +2974,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 +3174,10 @@ trackedFiles: id: 5c534716244c last_write_checksum: sha1:8a3c41c736e3ce7dfd9b0f5d733beed5f7446648 pristine_git_object: 233dcbff8035e0284a82067af91f627201db89df + docs/sdks/skills/README.md: + id: 3a14a5c90791 + last_write_checksum: sha1:8fa153e19d624dc37b17a2cec9122f93f6caab4f + pristine_git_object: ca6217242a51a9dae76d2bc10f7b864ce5c65eb6 docs/sdks/tools/README.md: id: 044286549bac last_write_checksum: sha1:15085522c8371637004ea441fe579e3ab1f0b47b @@ -3176,12 +3216,12 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:29bee120baea5f4cec8750e18851255bb91b26d0 - pristine_git_object: 46c99d73c4de09443131fcead0e0c89f2ab2df1c + last_write_checksum: sha1:69f72a780c9cd9e04d5da81988a3cefd732ea5d5 + pristine_git_object: 16f6d476ee63a05c38932569b6df57e7c08971f2 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:9f8c2067f0b5cf9f70f0f34671b64db143a81be8 - pristine_git_object: 9b387e1c7de105beaed38d17e160a0f6bd696f30 + last_write_checksum: sha1:4f654de976b0e6f55a1a2122ed48b6a4a3f3ed05 + pristine_git_object: f364b0fd508b4232a7bfc1a4de71bffef61844de src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 @@ -3348,8 +3388,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 +3406,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 +5322,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 @@ -6130,6 +6206,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 +6554,14 @@ trackedFiles: id: 97f2005515d0 last_write_checksum: sha1:ddd72ab0c544d9bdc041891b5d6c85921c1f4a5b pristine_git_object: e36f1fde9af40fca3a6eee03a93a8c9c43e424bd + src/__tests__/skills.test.ts: + id: 3fa6e540c659 + last_write_checksum: sha1:cd21ca4f0493576e9efe21fa493fb6e3efa2b490 + pristine_git_object: 4f112ffa5841fb07ae3b64915d876774d92dbeee src/__tests__/summarize.test.ts: id: 3105d6ebc7eb - last_write_checksum: sha1:bb2dba46f1d4304d8236c52e0355a53081ab6119 - pristine_git_object: bb5e2b02fd92c4bc218d0a791e8786a14448f109 + last_write_checksum: sha1:7d6ae08c5669503017e5809e025d72736a04ca7a + pristine_git_object: 8f1488ba09ec6fab5fd74abd4c1ab4a8b4155de9 src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 @@ -7038,6 +7126,14 @@ trackedFiles: id: d3415b0af8c7 last_write_checksum: sha1:5d1ec60b7b232f01db017d50c7de0bdd3be15e7d pristine_git_object: 8ac792c66214838901f88f279840f31cb33b1472 + src/funcs/platformSkillsList.ts: + id: 8409ec79fd89 + last_write_checksum: sha1:8b7b7ad3c1b4a0f851ad2c08cefc0f4c66bcebb9 + pristine_git_object: 61488952eccff11a5719771a820a5590016024b5 + src/funcs/platformSkillsRetrieve.ts: + id: e440960f777e + last_write_checksum: sha1:c676bdc67d29ff4065b219d55b4c1ebe6a51704b + pristine_git_object: 28590ddb20858062c8a53a5a6f6eef23efdb6aeb src/funcs/searchQuery.ts: id: cc6075d2a5d0 last_write_checksum: sha1:2b013dc9368701f9b40ca2cd755094fcd72aba45 @@ -7064,8 +7160,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:ad687b42c1191c018ad13c32d1b4c521e4253b73 + pristine_git_object: 61f3912de553a391d2653463e35c6eb6d1f80850 src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:a74725064d06b6994b95873c037975d2f2e63467 @@ -8212,8 +8308,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 +8670,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 @@ -9372,8 +9496,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 +9558,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 +10096,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:f9b4f897a9c7e5d648d2958e49c1b4daf96a1dca + pristine_git_object: 550a0fb0d4c1fefa1eed504b2a84d712e898037c src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -10142,6 +10274,22 @@ trackedFiles: id: f539f36cd532 last_write_checksum: sha1:91e8ee4d5848461ccc058920574bd1658c96a7da pristine_git_object: 60853a79fd3d357b9c225d1469569ba18e4bb834 + src/react-query/platformSkillsList.core.ts: + id: d8037477d6a9 + last_write_checksum: sha1:2fa028804e0dfa76e5aac0ffb96a0d7b11c5e7c6 + pristine_git_object: e83a220d7b3a0bf1d6787022ef83b594841e1617 + src/react-query/platformSkillsList.ts: + id: 2305abf4b3a4 + last_write_checksum: sha1:08cff50e4c05e68db2fcb8e4c6f00bc3e695d4f1 + pristine_git_object: 654410e85b1451cf70e7cdb0cfeeb6427e2bcca3 + src/react-query/platformSkillsRetrieve.core.ts: + id: 093bd4d05890 + last_write_checksum: sha1:344185c1f1576b04b48d4f3fe0ec0e4016c29526 + pristine_git_object: ebb6377dc3e7ff78ab1a69a2832c75da1b9a0836 + src/react-query/platformSkillsRetrieve.ts: + id: 6f9d94844564 + last_write_checksum: sha1:96e64f06157160381f2c634213e383824b099e25 + pristine_git_object: d46af087952472bc86ef8f6f6c2b1c9a70ceec88 src/react-query/searchQuery.ts: id: a67629da8040 last_write_checksum: sha1:5ce8b5811af2d6dd5bc95afd2e9358c16d7c7a99 @@ -10270,6 +10418,10 @@ trackedFiles: id: 681d3a98b73a last_write_checksum: sha1:ca81ba1a1fc56c394a9adcacaff05ab83344b0b6 pristine_git_object: 347c130bd8aed085358248a8d25d403d09c2a41c + src/sdk/platform.ts: + id: 86d659f7229d + last_write_checksum: sha1:9ae3db966ca7a312381f3d8e569c8bc06ffabefa + pristine_git_object: 8b0a358628c9e0eaad82d934fa8e01d80dd613e3 src/sdk/policies.ts: id: 56c143102e2a last_write_checksum: sha1:35d0cabfce15a4da7167ede7e79a2d5bc7c69a0b @@ -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:06ff7d45227c12718f9c63ceace4855e993ce43b + pristine_git_object: 0bdb5f6c4d2f03b4140938e7b748dc77b76e087a 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:c68bb2982d2395d590ecbb89d1ffff6d1adc0a70 + pristine_git_object: c6580ac4b0efd123878c967f10e875678a2f73c5 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,12 @@ 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-11T02:16:34Z" + platform-skills-get: "2026-07-11T02:16:34Z" +releaseNotes: | + ## Typescript SDK Changes: + * `glean.platform.skills.list()`: **Added** + * `glean.platform.skills.retrieve()`: **Added** generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 91028514..192483b2 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.17.4 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a1f493a7..290a17c8 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: a6a475757a3799d2146d7b0d0db2ae609b6bdc0f + x-open-api-commit-sha: 3f74e993e22cee24401a816dc24063d4e4bec47b 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: platform.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: platform.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: 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..e7673cf2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.789.2 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:145236c33451e6e87cf1507a4d8829678b0df02af59afc9341330627e33ed760 - sourceBlobDigest: sha256:862b1370a65d146eac83f86c6fbd2d787f04ea93c2cf28259af5ded934f9fb3b + sourceRevisionDigest: sha256:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d 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:f5ae8d5309190d64c093519c5102cb3d4d6da1315a4fc86be83598d33185a55a + sourceBlobDigest: sha256:4473e76be6cb393aa28cf300cb3aee22d91366e47b0c1afebc1ab79a1f4dd36d codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:3926e0a4287d60c4246139ee2a719a81878de8c9e8716c7c1f962b062706e5aa + codeSamplesRevisionDigest: sha256:80b2c10f9e314a4091e35296ce94da6ddaafb4f822d8dbad86d41f49b80760ad workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 17a81aaa..b6d8bd50 100644 --- a/README.md +++ b/README.md @@ -490,6 +490,11 @@ For more information on obtaining the appropriate token type, please contact you * [bulkIndex](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts * [upload](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +### [Platform.Skills](docs/sdks/skills/README.md) + +* [list](docs/sdks/skills/README.md#list) - List skills +* [retrieve](docs/sdks/skills/README.md#retrieve) - Retrieve skill + ### [Search](docs/sdks/search/README.md) * [query](docs/sdks/search/README.md#query) - Search @@ -648,6 +653,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`indexingPermissionsUpdatePermissions`](docs/sdks/permissions/README.md#updatepermissions) - Update document permissions - [`indexingShortcutsBulkIndex`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`indexingShortcutsUpload`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +- [`platformSkillsList`](docs/sdks/skills/README.md#list) - List skills +- [`platformSkillsRetrieve`](docs/sdks/skills/README.md#retrieve) - Retrieve skill - [`searchQuery`](docs/sdks/search/README.md#query) - Search - ~~[`clientAnswersList`](docs/sdks/answers/README.md#list)~~ - List Answers :warning: **Deprecated** - ~~[`indexingDocumentsCount`](docs/sdks/indexingdocuments/README.md#count)~~ - Get document count :warning: **Deprecated** @@ -816,6 +823,8 @@ To learn about this feature and how to get started, check - [`useIndexingPermissionsUpdatePermissionsMutation`](docs/sdks/permissions/README.md#updatepermissions) - Update document permissions - [`useIndexingShortcutsBulkIndexMutation`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`useIndexingShortcutsUploadMutation`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +- [`usePlatformSkillsList`](docs/sdks/skills/README.md#list) - List skills +- [`usePlatformSkillsRetrieve`](docs/sdks/skills/README.md#retrieve) - Retrieve skill - [`useSearchQueryMutation`](docs/sdks/search/README.md#query) - Search - ~~[`useClientAnswersListMutation`](docs/sdks/answers/README.md#list)~~ - List Answers :warning: **Deprecated** - ~~[`useIndexingDocumentsCountMutation`](docs/sdks/indexingdocuments/README.md#count)~~ - Get document count :warning: **Deprecated** diff --git a/RELEASES.md b/RELEASES.md index 916acaf5..3bbaf78e 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-11 02:13:00 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.2 (2.916.4) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.17.4] . +### Releases +- [NPM v0.17.4] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.4 - . \ 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/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..ca621724 --- /dev/null +++ b/docs/sdks/skills/README.md @@ -0,0 +1,209 @@ +# Platform.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.platform.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 { platformSkillsList } from "@gleanwork/api-client/funcs/platformSkillsList.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 platformSkillsList(glean); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("platformSkillsList 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. + usePlatformSkillsList, + usePlatformSkillsListSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchPlatformSkillsList, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidatePlatformSkillsList, + invalidateAllPlatformSkillsList, +} from "@gleanwork/api-client/react-query/platformSkillsList.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.platform.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 { platformSkillsRetrieve } from "@gleanwork/api-client/funcs/platformSkillsRetrieve.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 platformSkillsRetrieve(glean, ""); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("platformSkillsRetrieve 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. + usePlatformSkillsRetrieve, + usePlatformSkillsRetrieveSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchPlatformSkillsRetrieve, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidatePlatformSkillsRetrieve, + invalidateAllPlatformSkillsRetrieve, +} from "@gleanwork/api-client/react-query/platformSkillsRetrieve.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..3742e293 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.17.4", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 46c99d73..16f6d476 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.17.4", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 5b7347e0..f4c1d06a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.17.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.17.4", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/package.json b/package.json index 9b387e1c..f364b0fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.17.3", + "version": "0.17.4", "author": "Speakeasy", "tshy": { "sourceDialects": [ 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/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..4f112ffa --- /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.platform.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.platform.skills.retrieve(""); + expect(result).toBeDefined(); +}); diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index bb5e2b02..8f1488ba 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: "ARTIFACTS", + ugcId: "", }, { - id: "", + ugcType: "ARTIFACTS", + ugcId: "", }, ], }); diff --git a/src/funcs/platformSkillsList.ts b/src/funcs/platformSkillsList.ts new file mode 100644 index 00000000..61488952 --- /dev/null +++ b/src/funcs/platformSkillsList.ts @@ -0,0 +1,193 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 8409ec79fd89 + */ + +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 platformSkillsList( + 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/platformSkillsRetrieve.ts b/src/funcs/platformSkillsRetrieve.ts new file mode 100644 index 00000000..28590ddb --- /dev/null +++ b/src/funcs/platformSkillsRetrieve.ts @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e440960f777e + */ + +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 platformSkillsRetrieve( + 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..02f573f5 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", + sdkVersion: "0.17.4", genVersion: "2.916.4", userAgent: - "speakeasy-sdk/typescript 0.17.3 2.916.4 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.17.4 2.916.4 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/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..550a0fb0 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -142,4 +142,6 @@ export * from "./indexingPermissionsProcessMemberships.js"; export * from "./indexingPermissionsUpdatePermissions.js"; export * from "./indexingShortcutsBulkIndex.js"; export * from "./indexingShortcutsUpload.js"; +export * from "./platformSkillsList.js"; +export * from "./platformSkillsRetrieve.js"; export * from "./searchQuery.js"; diff --git a/src/react-query/platformSkillsList.core.ts b/src/react-query/platformSkillsList.core.ts new file mode 100644 index 00000000..e83a220d --- /dev/null +++ b/src/react-query/platformSkillsList.core.ts @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d8037477d6a9 + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { platformSkillsList } from "../funcs/platformSkillsList.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 PlatformSkillsListQueryData = components.PlatformSkillsListResponse; + +export function prefetchPlatformSkillsList( + queryClient: QueryClient, + client$: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildPlatformSkillsListQuery( + client$, + pageSize, + cursor, + options, + ), + }); +} + +export function buildPlatformSkillsListQuery( + client$: GleanCore, + pageSize?: number | undefined, + cursor?: string | undefined, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: ( + context: QueryFunctionContext, + ) => Promise; +} { + return { + queryKey: queryKeyPlatformSkillsList({ pageSize, cursor }), + queryFn: async function platformSkillsListQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(platformSkillsList( + client$, + pageSize, + cursor, + mergedOptions, + )); + }, + }; +} + +export function queryKeyPlatformSkillsList( + parameters: { pageSize?: number | undefined; cursor?: string | undefined }, +): QueryKey { + return ["@gleanwork/api-client", "skills", "list", parameters]; +} diff --git a/src/react-query/platformSkillsList.ts b/src/react-query/platformSkillsList.ts new file mode 100644 index 00000000..654410e8 --- /dev/null +++ b/src/react-query/platformSkillsList.ts @@ -0,0 +1,143 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 2305abf4b3a4 + */ + +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 { + buildPlatformSkillsListQuery, + PlatformSkillsListQueryData, + prefetchPlatformSkillsList, + queryKeyPlatformSkillsList, +} from "./platformSkillsList.core.js"; +export { + buildPlatformSkillsListQuery, + type PlatformSkillsListQueryData, + prefetchPlatformSkillsList, + queryKeyPlatformSkillsList, +}; + +export type PlatformSkillsListQueryError = + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ +export function usePlatformSkillsList( + pageSize?: number | undefined, + cursor?: string | undefined, + options?: QueryHookOptions< + PlatformSkillsListQueryData, + PlatformSkillsListQueryError + >, +): UseQueryResult { + const client = useGleanContext(); + return useQuery({ + ...buildPlatformSkillsListQuery( + client, + pageSize, + cursor, + options, + ), + ...options, + }); +} + +/** + * List skills + * + * @remarks + * List skills available to the authenticated user. + */ +export function usePlatformSkillsListSuspense( + pageSize?: number | undefined, + cursor?: string | undefined, + options?: SuspenseQueryHookOptions< + PlatformSkillsListQueryData, + PlatformSkillsListQueryError + >, +): UseSuspenseQueryResult< + PlatformSkillsListQueryData, + PlatformSkillsListQueryError +> { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildPlatformSkillsListQuery( + client, + pageSize, + cursor, + options, + ), + ...options, + }); +} + +export function setPlatformSkillsListData( + client: QueryClient, + queryKeyBase: [ + parameters: { pageSize?: number | undefined; cursor?: string | undefined }, + ], + data: PlatformSkillsListQueryData, +): PlatformSkillsListQueryData | undefined { + const key = queryKeyPlatformSkillsList(...queryKeyBase); + + return client.setQueryData(key, data); +} + +export function invalidatePlatformSkillsList( + 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 invalidateAllPlatformSkillsList( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "list"], + }); +} diff --git a/src/react-query/platformSkillsRetrieve.core.ts b/src/react-query/platformSkillsRetrieve.core.ts new file mode 100644 index 00000000..ebb6377d --- /dev/null +++ b/src/react-query/platformSkillsRetrieve.core.ts @@ -0,0 +1,72 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 093bd4d05890 + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { platformSkillsRetrieve } from "../funcs/platformSkillsRetrieve.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 PlatformSkillsRetrieveQueryData = + components.PlatformSkillGetResponse; + +export function prefetchPlatformSkillsRetrieve( + queryClient: QueryClient, + client$: GleanCore, + skillId: string, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildPlatformSkillsRetrieveQuery( + client$, + skillId, + options, + ), + }); +} + +export function buildPlatformSkillsRetrieveQuery( + client$: GleanCore, + skillId: string, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: ( + context: QueryFunctionContext, + ) => Promise; +} { + return { + queryKey: queryKeyPlatformSkillsRetrieve(skillId), + queryFn: async function platformSkillsRetrieveQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(platformSkillsRetrieve( + client$, + skillId, + mergedOptions, + )); + }, + }; +} + +export function queryKeyPlatformSkillsRetrieve(skillId: string): QueryKey { + return ["@gleanwork/api-client", "skills", "retrieve", skillId]; +} diff --git a/src/react-query/platformSkillsRetrieve.ts b/src/react-query/platformSkillsRetrieve.ts new file mode 100644 index 00000000..d46af087 --- /dev/null +++ b/src/react-query/platformSkillsRetrieve.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6f9d94844564 + */ + +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 { + buildPlatformSkillsRetrieveQuery, + PlatformSkillsRetrieveQueryData, + prefetchPlatformSkillsRetrieve, + queryKeyPlatformSkillsRetrieve, +} from "./platformSkillsRetrieve.core.js"; +export { + buildPlatformSkillsRetrieveQuery, + type PlatformSkillsRetrieveQueryData, + prefetchPlatformSkillsRetrieve, + queryKeyPlatformSkillsRetrieve, +}; + +export type PlatformSkillsRetrieveQueryError = + | 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 usePlatformSkillsRetrieve( + skillId: string, + options?: QueryHookOptions< + PlatformSkillsRetrieveQueryData, + PlatformSkillsRetrieveQueryError + >, +): UseQueryResult< + PlatformSkillsRetrieveQueryData, + PlatformSkillsRetrieveQueryError +> { + const client = useGleanContext(); + return useQuery({ + ...buildPlatformSkillsRetrieveQuery( + client, + skillId, + options, + ), + ...options, + }); +} + +/** + * Retrieve skill + * + * @remarks + * Retrieve metadata for a skill available to the authenticated user. + */ +export function usePlatformSkillsRetrieveSuspense( + skillId: string, + options?: SuspenseQueryHookOptions< + PlatformSkillsRetrieveQueryData, + PlatformSkillsRetrieveQueryError + >, +): UseSuspenseQueryResult< + PlatformSkillsRetrieveQueryData, + PlatformSkillsRetrieveQueryError +> { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildPlatformSkillsRetrieveQuery( + client, + skillId, + options, + ), + ...options, + }); +} + +export function setPlatformSkillsRetrieveData( + client: QueryClient, + queryKeyBase: [skillId: string], + data: PlatformSkillsRetrieveQueryData, +): PlatformSkillsRetrieveQueryData | undefined { + const key = queryKeyPlatformSkillsRetrieve(...queryKeyBase); + + return client.setQueryData(key, data); +} + +export function invalidatePlatformSkillsRetrieve( + client: QueryClient, + queryKeyBase: TupleToPrefixes<[skillId: string]>, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "retrieve", ...queryKeyBase], + }); +} + +export function invalidateAllPlatformSkillsRetrieve( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: ["@gleanwork/api-client", "skills", "retrieve"], + }); +} diff --git a/src/sdk/platform.ts b/src/sdk/platform.ts new file mode 100644 index 00000000..8b0a3586 --- /dev/null +++ b/src/sdk/platform.ts @@ -0,0 +1,14 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 86d659f7229d + */ + +import { ClientSDK } from "../lib/sdks.js"; +import { Skills } from "./skills.js"; + +export class Platform extends ClientSDK { + private _skills?: Skills; + get skills(): Skills { + return (this._skills ??= new Skills(this._options)); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 65e63fcc..0bdb5f6c 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -7,6 +7,7 @@ import { ClientSDK } from "../lib/sdks.js"; import { Agents } from "./agents.js"; import { Client } from "./client.js"; import { Indexing } from "./indexing.js"; +import { Platform } from "./platform.js"; import { Search } from "./search.js"; export class Glean extends ClientSDK { @@ -15,6 +16,11 @@ export class Glean extends ClientSDK { return (this._agents ??= new Agents(this._options)); } + private _platform?: Platform; + get platform(): Platform { + return (this._platform ??= new Platform(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..c6580ac4 --- /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 { platformSkillsList } from "../funcs/platformSkillsList.js"; +import { platformSkillsRetrieve } from "../funcs/platformSkillsRetrieve.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(platformSkillsList( + 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(platformSkillsRetrieve( + this, + skillId, + options, + )); + } +}