From 90c8a274df71024c33c178424db1d4d810b40833 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 8 Jul 2026 02:29:23 +0000 Subject: [PATCH 1/2] ## Typescript SDK Changes: * `glean.client.tools.retrieveToolServerAuthStatus()`: **Added** * `glean.client.tools.authorizeToolServer()`: **Added** * `glean.client.search.retrieveFeed()`: * `request.feedRequest.categories[].enum(adminHealthCenter)` **Added** * `response.results[]` **Changed** --- .speakeasy/gen.lock | 222 ++++++++++++++---- .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 200 +++++++++++++++- .speakeasy/tests.arazzo.yaml | 38 +++ .speakeasy/workflow.lock | 12 +- README.md | 6 + RELEASES.md | 12 +- .../components/authorizetoolserverrequest.md | 17 ++ .../components/authorizetoolserverresponse.md | 17 ++ docs/models/components/feedrequestcategory.md | 2 +- docs/models/components/feedresultcategory.md | 4 +- docs/models/components/justificationtype.md | 4 +- .../models/components/toolserverauthstatus.md | 19 ++ .../toolserverauthstatusresponse.md | 22 ++ .../errors/platformproblemdetailerror.md | 4 +- .../operations/authorizetoolserverrequest.md | 21 ++ .../gettoolserverauthstatusrequest.md | 17 ++ docs/sdks/tools/README.md | 199 ++++++++++++++++ examples/package-lock.json | 2 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- .../internal/handler/generated_handlers.go | 2 + ...pathgetrestapiv1toolserversserveridauth.go | 66 ++++++ ...athpostrestapiv1toolserversserveridauth.go | 70 ++++++ .../components/authorizetoolserverrequest.go | 18 ++ .../components/authorizetoolserverresponse.go | 18 ++ .../sdk/models/components/feedentry.go | 3 + .../sdk/models/components/feedrequest.go | 3 + .../sdk/models/components/feedresult.go | 3 + .../models/components/toolserverauthstatus.go | 36 +++ .../toolserverauthstatusresponse.go | 56 +++++ .../models/operations/authorizetoolserver.go | 48 ++++ .../operations/gettoolserverauthstatus.go | 40 ++++ src/__tests__/summarize.test.ts | 7 +- src/__tests__/tools.test.ts | 28 +++ src/funcs/clientToolsAuthorizeToolServer.ts | 189 +++++++++++++++ ...clientToolsRetrieveToolServerAuthStatus.ts | 177 ++++++++++++++ src/lib/config.ts | 6 +- .../components/authorizetoolserverrequest.ts | 38 +++ .../components/authorizetoolserverresponse.ts | 38 +++ src/models/components/feedentry.ts | 1 + src/models/components/feedrequest.ts | 1 + src/models/components/feedresult.ts | 1 + src/models/components/index.ts | 4 + src/models/components/toolserverauthstatus.ts | 27 +++ .../toolserverauthstatusresponse.ts | 68 ++++++ src/models/operations/authorizetoolserver.ts | 45 ++++ .../operations/gettoolserverauthstatus.ts | 37 +++ src/models/operations/index.ts | 2 + .../clientToolsAuthorizeToolServer.ts | 119 ++++++++++ ...tToolsRetrieveToolServerAuthStatus.core.ts | 79 +++++++ ...clientToolsRetrieveToolServerAuthStatus.ts | 150 ++++++++++++ src/react-query/index.ts | 2 + src/sdk/tools.ts | 45 ++++ 55 files changed, 2174 insertions(+), 81 deletions(-) create mode 100644 docs/models/components/authorizetoolserverrequest.md create mode 100644 docs/models/components/authorizetoolserverresponse.md create mode 100644 docs/models/components/toolserverauthstatus.md create mode 100644 docs/models/components/toolserverauthstatusresponse.md create mode 100644 docs/models/operations/authorizetoolserverrequest.md create mode 100644 docs/models/operations/gettoolserverauthstatusrequest.md create mode 100644 src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolserversserveridauth.go create mode 100644 src/__tests__/mockserver/internal/handler/pathpostrestapiv1toolserversserveridauth.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverrequest.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverresponse.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatus.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatusresponse.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/operations/authorizetoolserver.go create mode 100644 src/__tests__/mockserver/internal/sdk/models/operations/gettoolserverauthstatus.go create mode 100644 src/funcs/clientToolsAuthorizeToolServer.ts create mode 100644 src/funcs/clientToolsRetrieveToolServerAuthStatus.ts create mode 100644 src/models/components/authorizetoolserverrequest.ts create mode 100644 src/models/components/authorizetoolserverresponse.ts create mode 100644 src/models/components/toolserverauthstatus.ts create mode 100644 src/models/components/toolserverauthstatusresponse.ts create mode 100644 src/models/operations/authorizetoolserver.ts create mode 100644 src/models/operations/gettoolserverauthstatus.ts create mode 100644 src/react-query/clientToolsAuthorizeToolServer.ts create mode 100644 src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts create mode 100644 src/react-query/clientToolsRetrieveToolServerAuthStatus.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 493ce58c..8308e933 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: 6718837b4405c131be50d0c12e238d38 + docChecksum: 379d9fd3275f5f9782fa0b945862dee2 docVersion: 0.9.0 - speakeasyVersion: 1.788.1 - generationVersion: 2.915.1 - releaseVersion: 0.17.1 - configChecksum: 1c642d3c01e90cccec878a27a454c3cd + speakeasyVersion: 1.789.0 + generationVersion: 2.916.2 + releaseVersion: 0.17.2 + configChecksum: 0f5b96bc61904ac5a097863d6ae4c3a7 repoURL: https://github.com/gleanwork/api-client-typescript.git installationURL: https://github.com/gleanwork/api-client-typescript published: true persistentEdits: - generation_id: b535baf1-0373-4095-9fe1-cca4568f5540 - pristine_commit_hash: e3a27edcd4de4b768c552aaeb6171cbe1dd769d5 - pristine_tree_hash: 0f83c55c579a2bd07bfdf3e3fa64c704e6263eca + generation_id: b81b00de-68a2-48dd-9443-f654bfc81d08 + pristine_commit_hash: 51f6908620cb21538880dee165e0f82b4d8d633d + pristine_tree_hash: c308f4a41b41b0ab8e31eb2d5fc0527c6ffc0479 features: typescript: acceptHeaders: 2.81.2 @@ -294,6 +294,14 @@ trackedFiles: id: cf75beca77d8 last_write_checksum: sha1:df4ff21b8619ac7717e820eb01c736b6a9e4e455 pristine_git_object: 464ad4c1f8c0a0226dfb69d3b0373c3af7975e08 + docs/models/components/authorizetoolserverrequest.md: + id: c7bba5fd32c2 + last_write_checksum: sha1:1dbc07a23adccdeb2b2138894e20068bebe4b292 + pristine_git_object: f91b29ce4e18bfd40ee1411caa1f02621e030247 + docs/models/components/authorizetoolserverresponse.md: + id: 8820100e66fb + last_write_checksum: sha1:71aa9c0d8cb4bf0f1c9db22d75a1b4149456ead5 + pristine_git_object: bc8ed451aa2de7e80a2bfc41f67c0ef40f36ed58 docs/models/components/authstatus.md: id: 88b44e84336b last_write_checksum: sha1:e4a1ea9af5467a442150042514259c39466eec88 @@ -1216,8 +1224,8 @@ trackedFiles: pristine_git_object: 2d773c43730426ba979a2509498cc8367493d9e6 docs/models/components/feedrequestcategory.md: id: 801f1c3c64d4 - last_write_checksum: sha1:eb7296d1e8b66ebb41f6e5fc274c1ce434d787d8 - pristine_git_object: 91b07b42d3069c8fec092662185775525b88b6ae + last_write_checksum: sha1:a2b57ab7323170a9e27a4d4f89621d62026b7458 + pristine_git_object: 8dbd52d991ed94bbe468c88245cc4bab62888c87 docs/models/components/feedrequestoptions.md: id: 76c5e4412304 last_write_checksum: sha1:9d026d140bef548159ac576066007ccc73ab5cee @@ -1232,8 +1240,8 @@ trackedFiles: pristine_git_object: ce6c99ef0f2118ed2398af6fe3094ecff667acac docs/models/components/feedresultcategory.md: id: 94c0249352b4 - last_write_checksum: sha1:7c10da994e736d630387dfd4dfea9d2f24a1245b - pristine_git_object: b5e3411e6ac2b5a9072d71a539d8bb98fa3d4260 + last_write_checksum: sha1:3279a844b950f28c389dd43c00d9ae244f64323b + pristine_git_object: 3c488377da927532064d88cb377ad629f959bba5 docs/models/components/fieldscope.md: id: 23caffb85bb7 last_write_checksum: sha1:b90b2a0fba0f78b414366202e56a1637a8a8793f @@ -1548,8 +1556,8 @@ trackedFiles: pristine_git_object: 7930d76ffc147c35dd7c2f1d5fb78fadcd2e844a docs/models/components/justificationtype.md: id: 5a15880767a5 - last_write_checksum: sha1:79662d10f889178cfede94814d0229353c6b3738 - pristine_git_object: 318ef388b42bca4dc04154b1a6817eea4a1862c0 + last_write_checksum: sha1:714dbf416ffeb07141e7442d9d4b161da9d8f449 + pristine_git_object: abd7afc5a6e987b95d892bf2eb959400311807ca docs/models/components/knowledgetype.md: id: cf27a7cefa69 last_write_checksum: sha1:6e94f203bb1d3a0d12f0bdb0119bf36301536e8d @@ -2366,6 +2374,14 @@ trackedFiles: id: 699b312c376a last_write_checksum: sha1:f06e7d2999b20ccadfa3bea060dcf66666557350 pristine_git_object: 8b87d2693d6b8d39688e03dd0d87b077406fab48 + docs/models/components/toolserverauthstatus.md: + id: 7c054e893415 + last_write_checksum: sha1:8daa92ba95094f52e4c7686a26844363e046edd9 + pristine_git_object: 826082b99df8532d008a2e82a9edfefd309f31b7 + docs/models/components/toolserverauthstatusresponse.md: + id: 635d680d7d13 + last_write_checksum: sha1:8fb2c1d7efe7216e6983b68da166dcd5ba76f772 + pristine_git_object: 3db67e7788b102655e7336a67ed9625285c66f28 docs/models/components/toolsets.md: id: bb508a7ac0ec last_write_checksum: sha1:5469356e145b189832e297f3eeebc01c98765de2 @@ -2592,8 +2608,8 @@ trackedFiles: pristine_git_object: 3c5ffc6c63530a3a37d1dacf5c3d7857ff18dd7e docs/models/errors/platformproblemdetailerror.md: id: c153e881759b - last_write_checksum: sha1:eabe20d5c8c82ea957cbe1b17f977e433a4b4221 - pristine_git_object: 703f8473da45446022777f88533427eb3b6c05a8 + last_write_checksum: sha1:28cbdf070666bd24cf1126869df4c1384dbe89df + pristine_git_object: 71f6e5b2b75d32c8bdba33c121bda412c237a9eb docs/models/operations/addcollectionitemsrequest.md: id: f81175bea05e last_write_checksum: sha1:40c047c7aca4aedb681a36f3e47f6b166a5187a6 @@ -2610,6 +2626,10 @@ trackedFiles: id: "131637320050" last_write_checksum: sha1:6e72d7d708e0ddc69367cb633407464529863a89 pristine_git_object: 907b4dde22d0b21102254d8ee1cb29ba588ba3b6 + docs/models/operations/authorizetoolserverrequest.md: + id: d3631d90688a + last_write_checksum: sha1:dd889940fe1440ac5a15670a0fe498c89e201537 + pristine_git_object: 1c30dc776faf47cfdfd1fcc15a973b35fea0db1d docs/models/operations/autocompleterequest.md: id: 752ede2ff9a7 last_write_checksum: sha1:16ced18832ed83bcdb1a7900464633988f30bdd2 @@ -2826,6 +2846,10 @@ trackedFiles: id: 6e8c58109d41 last_write_checksum: sha1:56fa690f4f3f2aa465628bb320ac31891360dd30 pristine_git_object: 9cf02cab63e3993faa7ce171ca621fb66ebad59b + docs/models/operations/gettoolserverauthstatusrequest.md: + id: 33d43b4b0b0c + last_write_checksum: sha1:398ea2d533d69a2fa180222c00f837923038e197 + pristine_git_object: b1de9998f67ba3e54ed336259dfec811421885c6 docs/models/operations/insightsrequest.md: id: 95f929c56d86 last_write_checksum: sha1:ceae2e87368bde999e8e001a7c1d282cccb418e0 @@ -3088,8 +3112,8 @@ trackedFiles: pristine_git_object: 3809e7653df09e0c2c60328175a30110898eaf91 docs/sdks/tools/README.md: id: 044286549bac - last_write_checksum: sha1:d15f9630eed856761c1aaa3185be056b58171163 - pristine_git_object: 2f3919d048068e734a2f2bd24dcfa7aa974b41c7 + last_write_checksum: sha1:15085522c8371637004ea441fe579e3ab1f0b47b + pristine_git_object: 533f1d8982f061cadad1d78a261a843300b214ed docs/sdks/verification/README.md: id: 8148670b64d3 last_write_checksum: sha1:5dae6116a97c546dd5d203beddd266ded05cdeec @@ -3124,12 +3148,12 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:ed7bc8aa64c81a83154b6cc077d6f93b8c5dc682 - pristine_git_object: 9ab73b6f855f266f66a926ed65d6c84a97491255 + last_write_checksum: sha1:7fea50363c71f86d098de706361870f7b903b4e3 + pristine_git_object: 1f92e6df5e8cd8d615e85e9a5bf4b27995ff421b package.json: id: 7030d0b2f71b - last_write_checksum: sha1:009949e17ff5c331a9833a14209db42c6f74d9f9 - pristine_git_object: 93e32c00fd58ecdaf3851f1a638b007eadd67706 + last_write_checksum: sha1:3871f5b36e09505627090f931e5c7d2a0a328c2f + pristine_git_object: fc8e223b9878c7cbc2039a941563797683e83aa9 src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 @@ -3296,8 +3320,8 @@ trackedFiles: pristine_git_object: af3a6d136d837850b34ed893a8faf800ea114721 src/__tests__/mockserver/internal/handler/generated_handlers.go: id: e6f590a8ce11 - last_write_checksum: sha1:b09114bb3690ed7df811621caa4007f761cd7dde - pristine_git_object: ac274cdacaa88224dcc7d71fcd148a8780ac84e6 + last_write_checksum: sha1:00f15028ea6d680d0a826975bc93d6e4b3c2b2f6 + pristine_git_object: e2e2fdc55bb8561e1c8e80b9ddd28a805195a2cb src/__tests__/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: ef047f0e0f32 last_write_checksum: sha1:187ff16d05efa1c937632f61dd3f49e49691d5ff @@ -3358,6 +3382,10 @@ trackedFiles: id: 3b059ad09057 last_write_checksum: sha1:368d58499a71f55025964389832d0fc5c34b66b2 pristine_git_object: ee3427280c3cc5d948cc755e4193dbbff5ac3ee9 + src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolserversserveridauth.go: + id: 2b6ca857921b + last_write_checksum: sha1:638d9b3f6e73f478612997731ecec4e9f7fce4d9 + pristine_git_object: 0a96f7dfd529179ee21b04e5fbcc79d9bb1dca97 src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolslist.go: id: ff6366c93e84 last_write_checksum: sha1:76b315d72f8ed70773ffda031d3668948bbda043 @@ -3694,6 +3722,10 @@ trackedFiles: id: 2f6924084302 last_write_checksum: sha1:b957287876a01c76e2fe9090c80e8b891f2bac4a pristine_git_object: 8dbc6b6cb772ac3135465e2d85a93980e939bb43 + src/__tests__/mockserver/internal/handler/pathpostrestapiv1toolserversserveridauth.go: + id: 03ffeb98a0e0 + last_write_checksum: sha1:dd3bceaf9b58feecc6c6f4a8927fc515e1bbd777 + pristine_git_object: 216824da68064bbdaa770bb10486f9981caeb0ac src/__tests__/mockserver/internal/handler/pathpostrestapiv1unpin.go: id: 92d5d2a70699 last_write_checksum: sha1:b38c52bdc3db6f92c360cda72504ee067ca07705 @@ -3902,6 +3934,14 @@ trackedFiles: id: 9fbec925f40d last_write_checksum: sha1:b3e062269d11d7e6911a6c430d9e1d4284b82ced pristine_git_object: 153960ddf411e936b5a4f7da064c467dddc35310 + src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverrequest.go: + id: bf0c8d39f94c + last_write_checksum: sha1:b33ba7872457bf5d8bf4ed524d339466c8b8e7c5 + pristine_git_object: 54a1642590f3f2ed1f8db8c74a2043b0a4f05dc9 + src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverresponse.go: + id: 2b228bda70a6 + last_write_checksum: sha1:616eaf0573f748c5dcb19480747eb1bd47c46b69 + pristine_git_object: 28188f1e1c3c88da4facd43d2cae4fc8ac5cbfd2 src/__tests__/mockserver/internal/sdk/models/components/authstatus.go: id: 664731bbbd4e last_write_checksum: sha1:11c285e8a778d59aeb898ded25c9feada2ff2ca3 @@ -4644,12 +4684,12 @@ trackedFiles: pristine_git_object: eaa87413391e44f74a2647a75d861904a051a1af src/__tests__/mockserver/internal/sdk/models/components/feedentry.go: id: 809547cb5c68 - last_write_checksum: sha1:843e05dd805e2be370f6bd10b2d55bac6dcda815 - pristine_git_object: cc32cc7f565b08e2c450f4777f205596f932f257 + last_write_checksum: sha1:5b4840fbb9a6d103a7446d34d90e6a63dd417b37 + pristine_git_object: 589a502dcba5178e34e04f2c31c97a50e93a1ab1 src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go: id: f7bd2c505cff - last_write_checksum: sha1:7cd503e4f652d2414ca2e4fa34b4d4c2c4a51355 - pristine_git_object: 34e83d6dedfd144252300b6ab51d17214123586d + last_write_checksum: sha1:5d44c5ae23322eadbbee40293cde5c517e6ca206 + pristine_git_object: 15932521775566526bc14650bce1a4f19ea1dcec src/__tests__/mockserver/internal/sdk/models/components/feedrequestoptions.go: id: d6a1872334df last_write_checksum: sha1:1ab14ce889dc4f6a8cd018f5ef731ee05e3c4f3a @@ -4660,8 +4700,8 @@ trackedFiles: pristine_git_object: c92a344643e978700da31b2f24afaf9d14fd8d69 src/__tests__/mockserver/internal/sdk/models/components/feedresult.go: id: 90772ce61c8a - last_write_checksum: sha1:79cff8ac5fb6184a2cceecbe9f9adfa06171fd66 - pristine_git_object: d5ccd17f264ade897380e130fe340066951e3f91 + last_write_checksum: sha1:46b8ec49f16c42302b9c2bec2d52a6f754af5a33 + pristine_git_object: 908902a9503e457ce8d12f0707a8f05465058960 src/__tests__/mockserver/internal/sdk/models/components/followupaction.go: id: b87db474fc6a last_write_checksum: sha1:94c11e6ccb0d238213354241dff0baa101808b64 @@ -5546,6 +5586,14 @@ trackedFiles: id: 900c2f74e0fe last_write_checksum: sha1:d6ed015f5e1fc9fee4c41c20255d643c7f8e43c0 pristine_git_object: 43377993d0f0a0f566175bb0524b0bd48d1e7db5 + src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatus.go: + id: 816224e228e4 + last_write_checksum: sha1:194e6c054d8446aac3bc0f1b1119897743591849 + pristine_git_object: 8611dea6bd2a17ad6fb73ab9ed28918217c36305 + src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatusresponse.go: + id: 9290b06b0e8e + last_write_checksum: sha1:42be2b2e653e993058d26313f6b37e45c2629b2c + pristine_git_object: 23cf72d21e9a5561f00011701f24abf97ab8c9db src/__tests__/mockserver/internal/sdk/models/components/toolsets.go: id: 21060638600f last_write_checksum: sha1:609967192f667a5a4e129d3f146fe8e205376b05 @@ -5726,6 +5774,10 @@ trackedFiles: id: 3e30b97495c0 last_write_checksum: sha1:dbab8cd0425d920d1dac987285568c37b07e3932 pristine_git_object: 1e54931a733a27976e84a050be36721578168230 + src/__tests__/mockserver/internal/sdk/models/operations/authorizetoolserver.go: + id: 32540ec18ae8 + last_write_checksum: sha1:5470b6873d49f343979dca5f852c3c3e4679ab46 + pristine_git_object: f54e88a9688f440401dadff47bff6dec40fe7a76 src/__tests__/mockserver/internal/sdk/models/operations/autocomplete.go: id: 76642d3e2c9f last_write_checksum: sha1:a4c5064bd3275d1906b187d1386623f1a31cf30c @@ -5958,6 +6010,10 @@ trackedFiles: id: a51b6b3b7eeb last_write_checksum: sha1:5adce3efef1be18ee7dcf08087c10a37bb0bf705 pristine_git_object: 1630b12c40ecbe3d967cffaf6f6e69ffe535845e + src/__tests__/mockserver/internal/sdk/models/operations/gettoolserverauthstatus.go: + id: 64e5fc8d4817 + last_write_checksum: sha1:1c7805e0fbd0689fbf172d8560eee10c7914ac02 + pristine_git_object: c7871b88acded66a78ccd5f8eb189961cb6c990d src/__tests__/mockserver/internal/sdk/models/operations/insights.go: id: b3ef37ee813d last_write_checksum: sha1:573941f6fe05d5b51a2b151658dbf85958938ed3 @@ -6372,16 +6428,16 @@ trackedFiles: pristine_git_object: 91665302605d91cf7f941899c0c213fed0cd854a src/__tests__/summarize.test.ts: id: 3105d6ebc7eb - last_write_checksum: sha1:70dabdc96f8b2448e53bb9c22aecef8290fe1778 - pristine_git_object: 4ea7aff020e33d65ee1f1c3db406f070650dadff + last_write_checksum: sha1:1e95e1b90340a78c75fff0ad8c359e2bb6aa63a9 + pristine_git_object: 05ec6a88629b5f9b55c270e74c4158318d3a5334 src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 pristine_git_object: a5c1edbea36b134262690c848dea7a7522fcf479 src/__tests__/tools.test.ts: id: f56d59823ef8 - last_write_checksum: sha1:e7151ee33663c54614558fd50125c140911afcba - pristine_git_object: b597fc4d7278e84e2be124339f51f4dc752e2771 + last_write_checksum: sha1:8ed8ff18b219c7ba1be0164348afe29ba9fbfc02 + pristine_git_object: 8fb8d99db3a85f9bddc296dedba3db2d62bcbcc7 src/__tests__/troubleshooting.test.ts: id: 1f0f352d1c2f last_write_checksum: sha1:ae012c71aed121aeaf98640aca35ba5acf4d251c @@ -6734,6 +6790,10 @@ trackedFiles: id: dc605eda5aff last_write_checksum: sha1:89e92e6b46d797edfa678420f6eef2e3a361f142 pristine_git_object: 4439ae4b7f24db1c34d6f224163c70e1d348034f + src/funcs/clientToolsAuthorizeToolServer.ts: + id: d3f54c35c5a2 + last_write_checksum: sha1:7c0d47066dea817853d6f3ed1faacd6aabfc3457 + pristine_git_object: 3dfa08db301f59467cfa5484c44cb77b93ff2ddf src/funcs/clientToolsList.ts: id: 6d9c352c5a56 last_write_checksum: sha1:fa945ca1b2d8b118e4e481b889d4afd6fc5b1189 @@ -6742,6 +6802,10 @@ trackedFiles: id: 005f9b5127d8 last_write_checksum: sha1:0898338d162311b9f8da7e10f645b970e8196e28 pristine_git_object: e27d551a2e053cee5ec52b38ac1dbf11975e05b1 + src/funcs/clientToolsRetrieveToolServerAuthStatus.ts: + id: e991c3e9afec + last_write_checksum: sha1:4f57f5aed30b1c83303523fec5fcaa10b067961e + pristine_git_object: 577a36e7dfb9e5cf662627c49209b44d50e39fd9 src/funcs/clientToolsRun.ts: id: ff6b51691d7d last_write_checksum: sha1:cf3f1a58663045eb2408f8cd13f49a10b573b72a @@ -6956,8 +7020,8 @@ trackedFiles: pristine_git_object: 42d9739ab67c2fec0689f83777ffa5e1f875e5d5 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:132765409cf7a91b759d3b7d7c920aa8cc21de2f - pristine_git_object: e68ea7019a25af882037d49de252af166eb66533 + last_write_checksum: sha1:7e7fa01b6289cb0221690193c580103ff4597e98 + pristine_git_object: 9ff45f58e5160dda04e5464fe1ec3987e4f25f87 src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:a74725064d06b6994b95873c037975d2f2e63467 @@ -7154,6 +7218,14 @@ trackedFiles: id: 4ced499bee97 last_write_checksum: sha1:9179089f1c8bba7e79efe5b8886e0d3ecbe066e9 pristine_git_object: 48ee25cbf00feda14de153fa9c7bc9432ffad5ed + src/models/components/authorizetoolserverrequest.ts: + id: db98d96ed2da + last_write_checksum: sha1:9c7b759badc9ade8d669aff0e2b7b6f5257689f2 + pristine_git_object: 40b8327f239b420e061a85cd0d27c3b8f31a68b9 + src/models/components/authorizetoolserverresponse.ts: + id: 216073fe950b + last_write_checksum: sha1:eb99e314e224b0288626cb3a1f01b0d16f14b5e9 + pristine_git_object: e45acb2b07308a580b7a144151858e51de288f47 src/models/components/authstatus.ts: id: f4b0162e26f3 last_write_checksum: sha1:e6253ded67537cdca9c1a623d8a3b1fce039bfe1 @@ -7896,12 +7968,12 @@ trackedFiles: pristine_git_object: 3fb6f14548eb0f546d0fdfcbac4ea9af834b9687 src/models/components/feedentry.ts: id: 47faae0fec45 - last_write_checksum: sha1:c9b73973a2fba310d14b0ba2290f51bd94f38739 - pristine_git_object: ae89fc8a5090d47a3e418f80566406f2f237126a + last_write_checksum: sha1:6b89f346d951286248eaa1a5fb5d7d5669903bfd + pristine_git_object: a2dc1e398be6df062f7e5e46de7da1fcde69d33c src/models/components/feedrequest.ts: id: e18410d4ffd4 - last_write_checksum: sha1:dac2325572556898fc0bc5338cb9687d4990251b - pristine_git_object: 7c03163e04dda96f667b531449cea9884329c5ca + last_write_checksum: sha1:5d95fc81a6f21f7fcafac1825d1e0e933b270d40 + pristine_git_object: ef46f03fd8e64eff5f9a08ca9c101493f0401c62 src/models/components/feedrequestoptions.ts: id: 684c93eb4ff3 last_write_checksum: sha1:339180c553629e9c992c1f5819612effd7d692e7 @@ -7912,8 +7984,8 @@ trackedFiles: pristine_git_object: ec512af99670430c927b57b2fcb360c620f56cf7 src/models/components/feedresult.ts: id: 94d90ce484f6 - last_write_checksum: sha1:baba3097416df15dfef25ca5262a99b56fc7bfd3 - pristine_git_object: c98dfb85537968d413952dc4148a10cc3e62cfda + last_write_checksum: sha1:0a0301ff285042d4d44318afcbbe5240a74ed3bc + pristine_git_object: b990fe98bf61ece1c313992e9d0ca4f4cf939ec7 src/models/components/followupaction.ts: id: 0b8a71fb6ea2 last_write_checksum: sha1:ea9d1e5a53384164dc8d63d3ff831a332a5f2fed @@ -8088,8 +8160,8 @@ trackedFiles: pristine_git_object: c1b51fb164e5fddc23f344a60899933a91902f4c src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:b56858967683e7c5505aa7c7982118fb155bb971 - pristine_git_object: 390b3f8c8d81aaced327e0bfecdfa69da8a7e8c4 + last_write_checksum: sha1:99966c7ddd7649c09d311296d64ee8771484a90b + pristine_git_object: bf5da92c6df304383618a5a9f23e69185bd17129 src/models/components/indexdocumentrequest.ts: id: deb13e2cdc65 last_write_checksum: sha1:33e2093c7fcdd3c90ef45c48e7b79c4cb2aea6e5 @@ -8798,6 +8870,14 @@ trackedFiles: id: 896b7dfd2301 last_write_checksum: sha1:b761e73b4905b40581967f2b454abe2323a03d86 pristine_git_object: 7b0d67dd87ee01d332c9dde22ae89c2cc4d660e9 + src/models/components/toolserverauthstatus.ts: + id: 071ce1b5ce41 + last_write_checksum: sha1:f5ac48cf4712fca5b2d106137aeb49b76796b526 + pristine_git_object: a95a71d998652970db97c1e92bde0ce984fe329f + src/models/components/toolserverauthstatusresponse.ts: + id: 9b8d34bb7e2d + last_write_checksum: sha1:155e80bf3a6137dc55f283be0c96a18239063ab4 + pristine_git_object: 4e147464950ba97b500c4f7e2eb2c501f3ea88d1 src/models/components/toolsets.ts: id: 0adc0f38f0b0 last_write_checksum: sha1:6d8419590d36d46eb2fabd9a5a50777149fddd97 @@ -9018,6 +9098,10 @@ trackedFiles: id: 6e5416c09efb last_write_checksum: sha1:d305d98e791c7aceffe694e2e012019adea80c2c pristine_git_object: aac5254815a2e392a7f4224ee7817bf0110aa5e0 + src/models/operations/authorizetoolserver.ts: + id: d7057ee40a5b + last_write_checksum: sha1:3541befdf76b25e7088dc722d794309dee432fad + pristine_git_object: 551e501c8b15a6ee546c42d4d26e30b98ae4a6f4 src/models/operations/autocomplete.ts: id: 29a0f394c222 last_write_checksum: sha1:00a7258b764a852bf2606b12c0a704ff07e9a7b4 @@ -9222,10 +9306,14 @@ trackedFiles: id: fcad6fa47dd8 last_write_checksum: sha1:5eb9bd6ebd28133ad1ca42f8accee9cea3b7049a pristine_git_object: 1b3cfa0bc2cf2bbaee395c614cfc4b84e4de23e7 + src/models/operations/gettoolserverauthstatus.ts: + id: b9399d9292cf + last_write_checksum: sha1:276e13045bacf4c9c84614acf0bc9ca62b9bff5a + pristine_git_object: ddf76652b5d27d602a300b5909b728b59be4ad73 src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:9296aa74ab38f4c830a7157b0eb39080b7500a7d - pristine_git_object: 5640a11a25941b994a0df2bdd544a4b96aebcb41 + last_write_checksum: sha1:eb38833bba483438a754cf3c4f9bde1be5cfe51d + pristine_git_object: 00caa4b04d57c7835e9f8aa4e79d1eea79c4e2a5 src/models/operations/insights.ts: id: 7bef0edaab32 last_write_checksum: sha1:37db16bc7603defd715210dfd8c12de88bde8b72 @@ -9770,6 +9858,10 @@ trackedFiles: id: c7b4e5bbd98e last_write_checksum: sha1:0d069ac0715a8a99e63d3b67fd3b4c05eb2f7cab pristine_git_object: 08274e9519c57639087ee928c8f35643ed8a2a25 + src/react-query/clientToolsAuthorizeToolServer.ts: + id: 6ea6bcf043da + last_write_checksum: sha1:f93bfa38ee336b9684d1069dff9c319be25f8076 + pristine_git_object: afcb2b8ac2bbeca7e8ae5442a8b9bce148da5881 src/react-query/clientToolsList.core.ts: id: 7370fc27f545 last_write_checksum: sha1:52921614fcb461fa356c5f9b2875f6943ff704c5 @@ -9786,6 +9878,14 @@ trackedFiles: id: 52f40f93c161 last_write_checksum: sha1:d750a81888369da8fd74338328e786d4bcd3556a pristine_git_object: d7e800286e90924cac31358909a26d869e4775e3 + src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts: + id: 53a6c8e7c68e + last_write_checksum: sha1:92da39992d67d7ae3f699137ae796485b2497665 + pristine_git_object: 03dda9abbad28a339cdc6e28cc81aae77f3467f7 + src/react-query/clientToolsRetrieveToolServerAuthStatus.ts: + id: 961b3d891d21 + last_write_checksum: sha1:1992116dceed693b8c3992ede5b2cbe380ee9ba9 + pristine_git_object: 9c737371dd909d5c3f006a1b949ca9c3e623efda src/react-query/clientToolsRun.ts: id: 21ad61918713 last_write_checksum: sha1:9fea887d594b8df92c29257b10acc7088f9f4b8b @@ -9804,8 +9904,8 @@ trackedFiles: pristine_git_object: 7ea1d5c56f074fe08998790eed62e014c840891b src/react-query/index.ts: id: 9e975471aa65 - last_write_checksum: sha1:11f6416e0f2f105e6db88c846eb2387a293fef70 - pristine_git_object: 666ec298de31ddb37c1e86e0b079777cb9f46d4e + last_write_checksum: sha1:f1bb81fe81124fd2745365a4935321633020ffcf + pristine_git_object: b8610dc067e62e80f6b22bf039feaac1bb348b73 src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -10128,8 +10228,8 @@ trackedFiles: pristine_git_object: d8b2b8c62743cb5b2e9d524fe24884ac23681858 src/sdk/tools.ts: id: f997ccdd9dd9 - last_write_checksum: sha1:3d78acf3ebfc47795bd59bfe9e8ad8fda90bc3ee - pristine_git_object: 9dd1f13d439c9e234b542f6a627d5004a92a9920 + last_write_checksum: sha1:803cc691fc4535aba26609bc73553dcef9edda58 + pristine_git_object: cd812e8aad5e17166cf84a23e90739c8058c29f5 src/sdk/verification.ts: id: 414a84063545 last_write_checksum: sha1:6b40cb828921b4db77d058738f5040885e6acf15 @@ -11168,6 +11268,24 @@ examples: application/problem+json: {"type": "https://developer.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://developer.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://developer.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://developer.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"}]} + getToolServerAuthStatus: + speakeasy-default-get-tool-server-auth-status: + parameters: + path: + serverId: "" + responses: + "200": + application/json: {"authStatus": "AUTHORIZED", "authType": "AUTH_NONE"} + authorizeToolServer: + speakeasy-default-authorize-tool-server: + parameters: + path: + serverId: "" + requestBody: + application/json: {"returnUrl": "https://lucky-disadvantage.com"} + responses: + "200": + application/json: {"authorizationUrl": "https://shocked-casket.name/"} examplesVersion: 1.0.2 generatedTests: activity: "2025-05-05T15:08:35-05:00" @@ -11333,7 +11451,9 @@ generatedTests: platform-agents-get-schemas: "2026-07-02T17:51:23Z" platform-agents-create-run: "2026-07-02T17:51:23Z" platform-search: "2026-07-02T17:51:23Z" -releaseNotes: "## Typescript SDK Changes:\n* `glean.agents.search()`: `error` **Changed**\n* `glean.agents.get()`: `error.code.enum(requestTooLarge)` **Added**\n* `glean.agents.getSchemas()`: `error.code.enum(requestTooLarge)` **Added**\n* `glean.agents.createRun()`: `error` **Changed**\n* `glean.search.query()`: `error` **Changed**\n* `glean.client.announcements.create()`: \n * `request.createAnnouncementRequest.body.structuredList[].document.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response` **Changed**\n* `glean.client.announcements.update()`: \n * `request.updateAnnouncementRequest.body.structuredList[].document.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response` **Changed**\n* `glean.client.answers.create()`: \n * `request.createAnswerRequest.data.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.answers.update()`: \n * `request.editAnswerRequest.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.answers.retrieve()`: `response.answerResult` **Changed**\n* `glean.client.answers.list()`: `response.answerResults[]` **Changed**\n* `glean.client.chat.create()`: \n * `request.chatRequest.messages[].citations[].sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response.messages[].citations[].sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n* `glean.client.chat.retrieve()`: `response.chatResult.chat.createdBy.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.chat.list()`: `response.chatResults[].chat.createdBy.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.chat.createStream()`: \n * `request.chatRequest.messages[].citations[].sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n* `glean.client.agents.create()`: `response.workflow.author.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.collections.addItems()`: `response.collection` **Changed**\n* `glean.client.collections.create()`: \n * `request.createCollectionRequest.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response.union(class (0)).collection` **Changed**\n* `glean.client.collections.deleteItem()`: `response.collection` **Changed**\n* `glean.client.collections.update()`: \n * `request.editCollectionRequest.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response` **Changed**\n* `glean.client.collections.updateItem()`: `response.collection` **Changed**\n* `glean.client.collections.retrieve()`: `response.collection` **Changed**\n* `glean.client.collections.list()`: `response.collections[]` **Changed**\n* `glean.client.documents.retrieve()`: `response.documents.Map.union(Document).metadata.author.relatedDocuments[].results[]` **Changed**\n* `glean.client.documents.retrieveByFacets()`: `response.documents[].metadata.author.relatedDocuments[].results[]` **Changed**\n* `glean.client.insights.retrieve()`: `response.gleanAssist.activityInsights[].user.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.messages.retrieve()`: `response.searchResponse.results[].structuredResults[].document.metadata` **Changed**\n* `glean.client.pins.update()`: `response` **Changed**\n* `glean.client.pins.retrieve()`: `response.pin` **Changed**\n* `glean.client.pins.list()`: `response.pins[]` **Changed**\n* `glean.client.pins.create()`: `response` **Changed**\n* `glean.client.search.queryAsAdmin()`: \n * `request.searchRequest.sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response.results[].structuredResults[].document.metadata` **Changed**\n* `glean.client.search.autocomplete()`: `response.results[].document.metadata.author.relatedDocuments[].results[]` **Changed**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[].enum(podcast)` **Added**\n * `response.results[]` **Changed**\n* `glean.client.search.recommendations()`: \n * `request.recommendationsRequest.sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response.results[].structuredResults[].document.metadata` **Changed**\n* `glean.client.search.query()`: \n * `request.searchRequest.sourceDocument.metadata.author.relatedDocuments[].results[]` **Changed**\n * `response.results[].structuredResults[].document.metadata` **Changed**\n* `glean.client.entities.list()`: `response.results[].relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.entities.readPeople()`: `response.results[].relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.shortcuts.create()`: \n * `request.createShortcutRequest.data.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response.shortcut` **Changed**\n* `glean.client.shortcuts.retrieve()`: `response.shortcut` **Changed**\n* `glean.client.shortcuts.list()`: `response.shortcuts[]` **Changed**\n* `glean.client.shortcuts.update()`: \n * `request.updateShortcutRequest.addedRoles[].person.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n * `response.shortcut` **Changed**\n* `glean.client.verification.addReminder()`: `response.metadata.lastVerifier.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.verification.list()`: `response.documents[].metadata.lastVerifier.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n* `glean.client.verification.verify()`: `response.metadata.lastVerifier.relatedDocuments[].querySuggestion.ranges[].document.metadata` **Changed**\n" + getToolServerAuthStatus: "2026-07-08T02:25:28Z" + authorizeToolServer: "2026-07-08T02:25:28Z" +releaseNotes: "## Typescript SDK Changes:\n* `glean.client.tools.retrieveToolServerAuthStatus()`: **Added**\n* `glean.client.tools.authorizeToolServer()`: **Added**\n* `glean.client.search.retrieveFeed()`: \n * `request.feedRequest.categories[].enum(adminHealthCenter)` **Added**\n * `response.results[]` **Changed**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 7ac1b446..2619f6df 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -35,7 +35,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true typescript: - version: 0.17.1 + version: 0.17.2 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index a7a10ca3..8a9c80a4 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: 33bf057cf0f948a83126e81582717aebdb622bfa - x-open-api-commit-sha: 4f3a4abf8f003a4edc5522021b22184c76d051ad + x-source-commit-sha: 07b3632b09de332d35eeedd6280e30a1edf95243 + x-open-api-commit-sha: 4bc8dc442566ab2952b8e3c7a86fafff9c042aa9 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. @@ -2973,6 +2973,89 @@ paths: required: true schema: type: string + /rest/api/v1/tool-servers/{serverId}/auth: + get: + operationId: getToolServerAuthStatus + summary: Get end-user authentication status for a tool server. + description: | + Returns display information and the calling user's current authentication status + for the specified tool server. + tags: + - Tools + security: + - APIToken: [] + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ToolServerAuthStatusResponse' + "400": + description: Bad Request + "401": + description: Unauthorized + "404": + description: Tool server not found + "429": + description: Too Many Requests + x-visibility: Preview + x-glean-experimental: + id: 52fde6ec-c18b-4de6-b761-f82008542ae7 + introduced: "2026-07-02" + x-speakeasy-name-override: retrieveToolServerAuthStatus + x-speakeasy-group: client.tools + post: + operationId: authorizeToolServer + summary: Start the OAuth authorization flow for a tool server. + description: | + Initiates the third-party OAuth flow for the specified tool server and returns the + authorization URL that the client should navigate the end user to. After the OAuth + callback completes, the user's browser is redirected back to `returnUrl` with query + parameters indicating the result. + + `returnUrl` must match the tenant's configured return URL allowlist; otherwise the + request is rejected with 400. + tags: + - Tools + security: + - APIToken: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizeToolServerRequest' + required: true + responses: + "200": + description: Successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/AuthorizeToolServerResponse' + "400": + description: Invalid request (e.g. returnUrl not in allowlist, unsupported auth type) + "401": + description: Unauthorized + "403": + description: User not entitled to the tool server + "404": + description: Tool server not found + "429": + description: Too Many Requests + x-visibility: Preview + x-glean-experimental: + id: 1935476e-ecaf-4c1f-a9fd-1e768cf68f30 + introduced: "2026-07-02" + x-speakeasy-name-override: authorizeToolServer + x-speakeasy-group: client.tools + parameters: + - name: serverId + in: path + description: Unique identifier of the tool server. + required: true + schema: + type: string /api/index/v1/indexdocument: post: summary: Index document @@ -5091,6 +5174,67 @@ components: - rate_limit_exceeded - internal_error - service_unavailable + x-glean-problem-detail-codes: + invalid_request: + status: 400 + title: Invalid Request + missing_required_field: + status: 400 + title: Missing Required Field + invalid_parameter: + status: 400 + title: Invalid Parameter + invalid_cursor: + status: 400 + title: Invalid Pagination Cursor + expired_cursor: + status: 400 + title: Expired Pagination Cursor + invalid_filter: + status: 400 + title: Invalid Filter + invalid_datasource: + status: 400 + title: Invalid Datasource + authentication_required: + status: 401 + title: Authentication Required + token_expired: + status: 401 + title: Token Expired + insufficient_permissions: + status: 403 + title: Insufficient Permissions + resource_not_found: + status: 404 + title: Resource Not Found + method_not_allowed: + status: 405 + title: Method Not Allowed + request_timeout: + status: 408 + title: Request Timeout + request_too_large: + status: 413 + title: Request Too Large + conflict: + status: 409 + title: Conflict + gone: + status: 410 + title: Gone + unprocessable_query: + status: 422 + title: Unprocessable Query + rate_limit_exceeded: + status: 429 + title: Rate Limit Exceeded + internal_error: + status: 500 + title: Internal Error + service_unavailable: + status: 503 + title: Service Unavailable example: invalid_cursor PlatformProblemDetailError: type: object @@ -5125,7 +5269,7 @@ components: type: string format: uri description: URI identifying the error type. - example: https://developer.glean.com/errors/invalid-cursor + example: https://developers.glean.com/errors/invalid-cursor title: type: string description: Short, human-readable summary of the error. @@ -5145,7 +5289,7 @@ components: type: string format: uri description: Direct URL to documentation for this error code. - example: https://developer.glean.com/errors/invalid-cursor + example: https://developers.glean.com/errors/invalid-cursor request_id: type: string description: Platform-generated request ID for support correlation. @@ -11970,6 +12114,7 @@ components: - DEMO_CARD - OOO_PLANNER - OOO_CATCH_UP + - ADMIN_HEALTH_CENTER description: Categories of content requested. An allowlist gives flexibility to request content separately or together. requestOptions: $ref: '#/components/schemas/FeedRequestOptions' @@ -12413,6 +12558,7 @@ components: - DEMO_CARD - OOO_PLANNER - OOO_CATCH_UP + - ADMIN_HEALTH_CENTER description: Type of the justification. justification: type: string @@ -12502,6 +12648,7 @@ components: - DEMO_CARD - OOO_PLANNER - OOO_CATCH_UP + - ADMIN_HEALTH_CENTER description: Category of the result, one of the requested categories in incoming request. primaryEntry: $ref: '#/components/schemas/FeedEntry' @@ -13135,6 +13282,51 @@ components: After the user consents, control returns to `returnUrl` from the request. required: - redirectUrl + ToolServerAuthStatus: + type: string + enum: + - AWAITING_AUTH + - AUTHORIZED + description: Authentication status for the calling user. + ToolServerAuthStatusResponse: + type: object + properties: + displayName: + type: string + description: Human-readable name of the tool server. + logoUrl: + type: string + description: Logo URL for the tool server. + description: + type: string + description: Brief description of the tool server. + authStatus: + $ref: '#/components/schemas/ToolServerAuthStatus' + authType: + $ref: '#/components/schemas/ActionAuthType' + required: + - authStatus + - authType + AuthorizeToolServerRequest: + type: object + properties: + returnUrl: + type: string + description: | + URL to redirect the end user's browser back to after the OAuth flow completes. + Must be present in the tenant's configured return URL allowlist. + required: + - returnUrl + AuthorizeToolServerResponse: + type: object + properties: + authorizationUrl: + type: string + description: | + URL that the client should navigate the end user to in order to begin the OAuth flow. + After the user consents, control returns to `returnUrl` from the request. + required: + - authorizationUrl IndexDocumentRequest: type: object properties: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index e4d0670f..2accd204 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164712,3 +164712,41 @@ workflows: type: simple x-speakeasy-test-group: search x-speakeasy-test-rebuild: true + - workflowId: getToolServerAuthStatus + steps: + - stepId: test + operationId: getToolServerAuthStatus + parameters: + - name: serverId + in: path + value: + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"authStatus":"AUTHORIZED","authType":"AUTH_NONE"} + type: simple + x-speakeasy-test-group: tools + x-speakeasy-test-rebuild: true + - workflowId: authorizeToolServer + steps: + - stepId: test + operationId: authorizeToolServer + parameters: + - name: serverId + in: path + value: + requestBody: + contentType: application/json + payload: + returnUrl: https://lucky-disadvantage.com + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"authorizationUrl":"https://shocked-casket.name/"} + type: simple + x-speakeasy-test-group: tools + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 654be067..8b15f119 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.788.1 +speakeasyVersion: 1.789.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8b1b5374e6d5c2f98bc7cddfa619249cd150deba48f6c8b9f2637f723ff73fd2 - sourceBlobDigest: sha256:3373213fc1a05b08aad1cf828d00ce46e1da651645fc1ccde24fcdf3efca5861 + sourceRevisionDigest: sha256:eaebe7be5b8f0f68b1331b223088ad140bf7caa28b87534a807a902b82f0e715 + sourceBlobDigest: sha256:fdd2d2ee23d11786186f25ae9270c19355398694eb3aedbfe02e7687c9e8c2e3 tags: - latest Glean Client API: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:8b1b5374e6d5c2f98bc7cddfa619249cd150deba48f6c8b9f2637f723ff73fd2 - sourceBlobDigest: sha256:3373213fc1a05b08aad1cf828d00ce46e1da651645fc1ccde24fcdf3efca5861 + sourceRevisionDigest: sha256:eaebe7be5b8f0f68b1331b223088ad140bf7caa28b87534a807a902b82f0e715 + sourceBlobDigest: sha256:fdd2d2ee23d11786186f25ae9270c19355398694eb3aedbfe02e7687c9e8c2e3 codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:0f479edeeeb954c2a19e382360290300e8277e3263ac780aaa8e440632e4f1ac + codeSamplesRevisionDigest: sha256:fb3a480264e9000f0db3a2dc858fec35fdf9849a27eea5ee85b641a560887668 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 91f91a9a..17a81aaa 100644 --- a/README.md +++ b/README.md @@ -409,6 +409,8 @@ For more information on obtaining the appropriate token type, please contact you * [run](docs/sdks/tools/README.md#run) - Execute the specified tool * [retrieveActionPackAuthStatus](docs/sdks/tools/README.md#retrieveactionpackauthstatus) - Get end-user authentication status for an action pack. * [authorizeActionPack](docs/sdks/tools/README.md#authorizeactionpack) - Start the OAuth authorization flow for an action pack. +* [retrieveToolServerAuthStatus](docs/sdks/tools/README.md#retrievetoolserverauthstatus) - Get end-user authentication status for a tool server. +* [authorizeToolServer](docs/sdks/tools/README.md#authorizetoolserver) - Start the OAuth authorization flow for a tool server. ### [Client.Verification](docs/sdks/verification/README.md) @@ -594,8 +596,10 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`clientShortcutsRetrieve`](docs/sdks/clientshortcuts/README.md#retrieve) - Read shortcut - [`clientShortcutsUpdate`](docs/sdks/clientshortcuts/README.md#update) - Update shortcut - [`clientToolsAuthorizeActionPack`](docs/sdks/tools/README.md#authorizeactionpack) - Start the OAuth authorization flow for an action pack. +- [`clientToolsAuthorizeToolServer`](docs/sdks/tools/README.md#authorizetoolserver) - Start the OAuth authorization flow for a tool server. - [`clientToolsList`](docs/sdks/tools/README.md#list) - List available tools - [`clientToolsRetrieveActionPackAuthStatus`](docs/sdks/tools/README.md#retrieveactionpackauthstatus) - Get end-user authentication status for an action pack. +- [`clientToolsRetrieveToolServerAuthStatus`](docs/sdks/tools/README.md#retrievetoolserverauthstatus) - Get end-user authentication status for a tool server. - [`clientToolsRun`](docs/sdks/tools/README.md#run) - Execute the specified tool - [`clientVerificationAddReminder`](docs/sdks/verification/README.md#addreminder) - Create verification - [`clientVerificationList`](docs/sdks/verification/README.md#list) - List verifications @@ -760,8 +764,10 @@ To learn about this feature and how to get started, check - [`useClientShortcutsRetrieveMutation`](docs/sdks/clientshortcuts/README.md#retrieve) - Read shortcut - [`useClientShortcutsUpdateMutation`](docs/sdks/clientshortcuts/README.md#update) - Update shortcut - [`useClientToolsAuthorizeActionPackMutation`](docs/sdks/tools/README.md#authorizeactionpack) - Start the OAuth authorization flow for an action pack. +- [`useClientToolsAuthorizeToolServerMutation`](docs/sdks/tools/README.md#authorizetoolserver) - Start the OAuth authorization flow for a tool server. - [`useClientToolsList`](docs/sdks/tools/README.md#list) - List available tools - [`useClientToolsRetrieveActionPackAuthStatus`](docs/sdks/tools/README.md#retrieveactionpackauthstatus) - Get end-user authentication status for an action pack. +- [`useClientToolsRetrieveToolServerAuthStatus`](docs/sdks/tools/README.md#retrievetoolserverauthstatus) - Get end-user authentication status for a tool server. - [`useClientToolsRunMutation`](docs/sdks/tools/README.md#run) - Execute the specified tool - [`useClientVerificationAddReminderMutation`](docs/sdks/verification/README.md#addreminder) - Create verification - [`useClientVerificationListMutation`](docs/sdks/verification/README.md#list) - List verifications diff --git a/RELEASES.md b/RELEASES.md index ded1505d..2fcaf17b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -808,4 +808,14 @@ Based on: ### Generated - [typescript v0.17.1] . ### Releases -- [NPM v0.17.1] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.1 - . \ No newline at end of file +- [NPM v0.17.1] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.1 - . + +## 2026-07-08 02:22:00 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.789.0 (2.916.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.17.2] . +### Releases +- [NPM v0.17.2] https://www.npmjs.com/package/@gleanwork/api-client/v/0.17.2 - . \ No newline at end of file diff --git a/docs/models/components/authorizetoolserverrequest.md b/docs/models/components/authorizetoolserverrequest.md new file mode 100644 index 00000000..f91b29ce --- /dev/null +++ b/docs/models/components/authorizetoolserverrequest.md @@ -0,0 +1,17 @@ +# AuthorizeToolServerRequest + +## Example Usage + +```typescript +import { AuthorizeToolServerRequest } from "@gleanwork/api-client/models/components"; + +let value: AuthorizeToolServerRequest = { + returnUrl: "https://timely-jazz.biz", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `returnUrl` | *string* | :heavy_check_mark: | URL to redirect the end user's browser back to after the OAuth flow completes.
Must be present in the tenant's configured return URL allowlist.
| \ No newline at end of file diff --git a/docs/models/components/authorizetoolserverresponse.md b/docs/models/components/authorizetoolserverresponse.md new file mode 100644 index 00000000..bc8ed451 --- /dev/null +++ b/docs/models/components/authorizetoolserverresponse.md @@ -0,0 +1,17 @@ +# AuthorizeToolServerResponse + +## Example Usage + +```typescript +import { AuthorizeToolServerResponse } from "@gleanwork/api-client/models/components"; + +let value: AuthorizeToolServerResponse = { + authorizationUrl: "https://talkative-folklore.info/", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `authorizationUrl` | *string* | :heavy_check_mark: | URL that the client should navigate the end user to in order to begin the OAuth flow.
After the user consents, control returns to `returnUrl` from the request.
| \ No newline at end of file diff --git a/docs/models/components/feedrequestcategory.md b/docs/models/components/feedrequestcategory.md index 91b07b42..8dbd52d9 100644 --- a/docs/models/components/feedrequestcategory.md +++ b/docs/models/components/feedrequestcategory.md @@ -11,5 +11,5 @@ let value: FeedRequestCategory = "TASK"; ## Values ```typescript -"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "DISPLAYABLE_LIST" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "WORKFLOW_COLLECTIONS" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" +"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "DISPLAYABLE_LIST" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "WORKFLOW_COLLECTIONS" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" ``` \ No newline at end of file diff --git a/docs/models/components/feedresultcategory.md b/docs/models/components/feedresultcategory.md index b5e3411e..3c488377 100644 --- a/docs/models/components/feedresultcategory.md +++ b/docs/models/components/feedresultcategory.md @@ -7,7 +7,7 @@ Category of the result, one of the requested categories in incoming request. ```typescript import { FeedResultCategory } from "@gleanwork/api-client/models/components"; -let value: FeedResultCategory = "END_MY_DAY"; +let value: FeedResultCategory = "STARTER_KIT"; // Open enum: unrecognized values are captured as Unrecognized ``` @@ -15,5 +15,5 @@ let value: FeedResultCategory = "END_MY_DAY"; ## Values ```typescript -"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "USE_CASE" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "DISPLAYABLE_LIST" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" | Unrecognized +"DOCUMENT_SUGGESTION" | "DOCUMENT_SUGGESTION_SCENARIO" | "TRENDING_DOCUMENT" | "USE_CASE" | "VERIFICATION_REMINDER" | "EVENT" | "ANNOUNCEMENT" | "MENTION" | "DATASOURCE_AFFINITY" | "RECENT" | "COMPANY_RESOURCE" | "EXPERIMENTAL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "EXTERNAL_TASKS" | "DISPLAYABLE_LIST" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_WORKFLOW_CREATED_BY_ME" | "ZERO_STATE_WORKFLOW_FAVORITES" | "ZERO_STATE_WORKFLOW_POPULAR" | "ZERO_STATE_WORKFLOW_RECENT" | "ZERO_STATE_WORKFLOW_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/components/justificationtype.md b/docs/models/components/justificationtype.md index 318ef388..abd7afc5 100644 --- a/docs/models/components/justificationtype.md +++ b/docs/models/components/justificationtype.md @@ -7,7 +7,7 @@ Type of the justification. ```typescript import { JustificationType } from "@gleanwork/api-client/models/components"; -let value: JustificationType = "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION"; +let value: JustificationType = "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION"; // Open enum: unrecognized values are captured as Unrecognized ``` @@ -15,5 +15,5 @@ let value: JustificationType = "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION"; ## Values ```typescript -"FREQUENTLY_ACCESSED" | "RECENTLY_ACCESSED" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "SUGGESTED_DOCUMENT" | "EMPTY_STATE_SUGGESTION" | "FRECENCY_SCORED" | "SERVER_GENERATED" | "USE_CASE" | "UPDATE_SINCE_LAST_VIEW" | "RECENTLY_STARTED" | "EVENT" | "USER_MENTION" | "ANNOUNCEMENT" | "EXTERNAL_ANNOUNCEMENT" | "POPULARITY_BASED_TRENDING" | "COMPANY_RESOURCE" | "EVENT_DOCUMENT_FROM_CONTENT" | "EVENT_DOCUMENT_FROM_SEARCH" | "VISIT_AFFINITY_SCORED" | "SUGGESTED_APP" | "SUGGESTED_PERSON" | "ACTIVITY_HIGHLIGHT" | "SAVED_SEARCH" | "SUGGESTED_CHANNEL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION" | "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION" | "ZERO_STATE_AGENT_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT_EXTENSION" | "STARTER_KIT_ORG_CHART" | "STARTER_KIT_ADD_DOC" | "MEETING_RECAP" | "ACTIVE_DISCUSSION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" | Unrecognized +"FREQUENTLY_ACCESSED" | "RECENTLY_ACCESSED" | "TRENDING_DOCUMENT" | "VERIFICATION_REMINDER" | "SUGGESTED_DOCUMENT" | "EMPTY_STATE_SUGGESTION" | "FRECENCY_SCORED" | "SERVER_GENERATED" | "USE_CASE" | "UPDATE_SINCE_LAST_VIEW" | "RECENTLY_STARTED" | "EVENT" | "USER_MENTION" | "ANNOUNCEMENT" | "EXTERNAL_ANNOUNCEMENT" | "POPULARITY_BASED_TRENDING" | "COMPANY_RESOURCE" | "EVENT_DOCUMENT_FROM_CONTENT" | "EVENT_DOCUMENT_FROM_SEARCH" | "VISIT_AFFINITY_SCORED" | "SUGGESTED_APP" | "SUGGESTED_PERSON" | "ACTIVITY_HIGHLIGHT" | "SAVED_SEARCH" | "SUGGESTED_CHANNEL" | "PEOPLE_CELEBRATIONS" | "SOCIAL_LINK" | "ZERO_STATE_CHAT_SUGGESTION" | "ZERO_STATE_CHAT_TOOL_SUGGESTION" | "ZERO_STATE_PROMPT_TEMPLATE_SUGGESTION" | "ZERO_STATE_STATIC_WORKFLOW_SUGGESTION" | "ZERO_STATE_AGENT_SUGGESTION" | "PERSONALIZED_CHAT_SUGGESTION" | "DAILY_DIGEST" | "PODCAST" | "TASK" | "PLAN_MY_DAY" | "END_MY_DAY" | "STARTER_KIT_EXTENSION" | "STARTER_KIT_ORG_CHART" | "STARTER_KIT_ADD_DOC" | "MEETING_RECAP" | "ACTIVE_DISCUSSION" | "MID_DAY_CATCH_UP" | "QUERY_SUGGESTION" | "COWORK_CUJ_PROMO" | "CARD_STACK_PROMO" | "WEEKLY_MEETINGS" | "FOLLOW_UP" | "MILESTONE_TIMELINE_CHECK" | "PROJECT_DISCUSSION_DIGEST" | "PROJECT_FOCUS_BLOCK" | "PROJECT_NEXT_STEP" | "DEMO_CARD" | "OOO_PLANNER" | "OOO_CATCH_UP" | "ADMIN_HEALTH_CENTER" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/components/toolserverauthstatus.md b/docs/models/components/toolserverauthstatus.md new file mode 100644 index 00000000..826082b9 --- /dev/null +++ b/docs/models/components/toolserverauthstatus.md @@ -0,0 +1,19 @@ +# ToolServerAuthStatus + +Authentication status for the calling user. + +## Example Usage + +```typescript +import { ToolServerAuthStatus } from "@gleanwork/api-client/models/components"; + +let value: ToolServerAuthStatus = "AUTHORIZED"; + +// Open enum: unrecognized values are captured as Unrecognized +``` + +## Values + +```typescript +"AWAITING_AUTH" | "AUTHORIZED" | Unrecognized +``` \ No newline at end of file diff --git a/docs/models/components/toolserverauthstatusresponse.md b/docs/models/components/toolserverauthstatusresponse.md new file mode 100644 index 00000000..3db67e77 --- /dev/null +++ b/docs/models/components/toolserverauthstatusresponse.md @@ -0,0 +1,22 @@ +# ToolServerAuthStatusResponse + +## Example Usage + +```typescript +import { ToolServerAuthStatusResponse } from "@gleanwork/api-client/models/components"; + +let value: ToolServerAuthStatusResponse = { + authStatus: "AWAITING_AUTH", + authType: "AUTH_ADMIN", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `displayName` | *string* | :heavy_minus_sign: | Human-readable name of the tool server. | +| `logoUrl` | *string* | :heavy_minus_sign: | Logo URL for the tool server. | +| `description` | *string* | :heavy_minus_sign: | Brief description of the tool server. | +| `authStatus` | [components.ToolServerAuthStatus](../../models/components/toolserverauthstatus.md) | :heavy_check_mark: | Authentication status for the calling user. | +| `authType` | [components.ActionAuthType](../../models/components/actionauthtype.md) | :heavy_check_mark: | Authentication mechanism used by an action pack.
- `AUTH_USER_OAUTH`: Requires per-user OAuth consent to the third-party tool.
- `AUTH_ADMIN`: Uses a service-account / admin-owned credential. End users do not authorize individually.
- `AUTH_NONE`: Action pack requires no authentication.
| \ No newline at end of file diff --git a/docs/models/errors/platformproblemdetailerror.md b/docs/models/errors/platformproblemdetailerror.md index 703f8473..71f6e5b2 100644 --- a/docs/models/errors/platformproblemdetailerror.md +++ b/docs/models/errors/platformproblemdetailerror.md @@ -15,11 +15,11 @@ import { PlatformProblemDetailError } from "@gleanwork/api-client/models/errors" | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `type` | *string* | :heavy_check_mark: | URI identifying the error type. | https://developer.glean.com/errors/invalid-cursor | +| `type` | *string* | :heavy_check_mark: | URI identifying the error type. | https://developers.glean.com/errors/invalid-cursor | | `title` | *string* | :heavy_check_mark: | Short, human-readable summary of the error. | Invalid Pagination Cursor | | `status` | *number* | :heavy_check_mark: | HTTP status code mirrored from the response. | 400 | | `detail` | *string* | :heavy_check_mark: | Human-readable explanation specific to this occurrence. | The provided cursor has expired. Start a new search to get a fresh cursor.
| | `code` | [components.PlatformProblemDetailCode](../../models/components/platformproblemdetailcode.md) | :heavy_check_mark: | Stable machine-readable error code. | invalid_cursor | -| `documentationUrl` | *string* | :heavy_minus_sign: | Direct URL to documentation for this error code. | https://developer.glean.com/errors/invalid-cursor | +| `documentationUrl` | *string* | :heavy_minus_sign: | Direct URL to documentation for this error code. | https://developers.glean.com/errors/invalid-cursor | | `requestId` | *string* | :heavy_check_mark: | Platform-generated request ID for support correlation. | req_7f8a9b0c1d2e | | `errors` | [components.PlatformProblemDetailError](../../models/components/platformproblemdetailerror.md)[] | :heavy_minus_sign: | Field-level validation problems, one entry per offending field. | | \ No newline at end of file diff --git a/docs/models/operations/authorizetoolserverrequest.md b/docs/models/operations/authorizetoolserverrequest.md new file mode 100644 index 00000000..1c30dc77 --- /dev/null +++ b/docs/models/operations/authorizetoolserverrequest.md @@ -0,0 +1,21 @@ +# AuthorizeToolServerRequest + +## Example Usage + +```typescript +import { AuthorizeToolServerRequest } from "@gleanwork/api-client/models/operations"; + +let value: AuthorizeToolServerRequest = { + serverId: "", + authorizeToolServerRequest: { + returnUrl: "https://timely-jazz.biz", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `serverId` | *string* | :heavy_check_mark: | Unique identifier of the tool server. | +| `authorizeToolServerRequest` | [components.AuthorizeToolServerRequest](../../models/components/authorizetoolserverrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettoolserverauthstatusrequest.md b/docs/models/operations/gettoolserverauthstatusrequest.md new file mode 100644 index 00000000..b1de9998 --- /dev/null +++ b/docs/models/operations/gettoolserverauthstatusrequest.md @@ -0,0 +1,17 @@ +# GetToolServerAuthStatusRequest + +## Example Usage + +```typescript +import { GetToolServerAuthStatusRequest } from "@gleanwork/api-client/models/operations"; + +let value: GetToolServerAuthStatusRequest = { + serverId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +| `serverId` | *string* | :heavy_check_mark: | Unique identifier of the tool server. | \ No newline at end of file diff --git a/docs/sdks/tools/README.md b/docs/sdks/tools/README.md index 2f3919d0..533f1d89 100644 --- a/docs/sdks/tools/README.md +++ b/docs/sdks/tools/README.md @@ -8,6 +8,8 @@ * [run](#run) - Execute the specified tool * [retrieveActionPackAuthStatus](#retrieveactionpackauthstatus) - Get end-user authentication status for an action pack. * [authorizeActionPack](#authorizeactionpack) - Start the OAuth authorization flow for an action pack. +* [retrieveToolServerAuthStatus](#retrievetoolserverauthstatus) - Get end-user authentication status for a tool server. +* [authorizeToolServer](#authorizetoolserver) - Start the OAuth authorization flow for a tool server. ## list @@ -402,6 +404,203 @@ import { ### Errors +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## retrieveToolServerAuthStatus + +Returns display information and the calling user's current authentication status +for the specified tool server. + + +### 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.client.tools.retrieveToolServerAuthStatus(""); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { clientToolsRetrieveToolServerAuthStatus } from "@gleanwork/api-client/funcs/clientToolsRetrieveToolServerAuthStatus.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 clientToolsRetrieveToolServerAuthStatus(glean, ""); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("clientToolsRetrieveToolServerAuthStatus 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. + useClientToolsRetrieveToolServerAuthStatus, + useClientToolsRetrieveToolServerAuthStatusSuspense, + + // Utility for prefetching data during server-side rendering and in React + // Server Components that will be immediately available to client components + // using the hooks. + prefetchClientToolsRetrieveToolServerAuthStatus, + + // Utilities to invalidate the query cache for this query in response to + // mutations and other user actions. + invalidateClientToolsRetrieveToolServerAuthStatus, + invalidateAllClientToolsRetrieveToolServerAuthStatus, +} from "@gleanwork/api-client/react-query/clientToolsRetrieveToolServerAuthStatus.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serverId` | *string* | :heavy_check_mark: | Unique identifier of the tool server. | +| `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.ToolServerAuthStatusResponse](../../models/components/toolserverauthstatusresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------- | ----------------- | ----------------- | +| errors.GleanError | 4XX, 5XX | \*/\* | + +## authorizeToolServer + +Initiates the third-party OAuth flow for the specified tool server and returns the +authorization URL that the client should navigate the end user to. After the OAuth +callback completes, the user's browser is redirected back to `returnUrl` with query +parameters indicating the result. + +`returnUrl` must match the tenant's configured return URL allowlist; otherwise the +request is rejected with 400. + + +### 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.client.tools.authorizeToolServer({ + returnUrl: "https://lucky-disadvantage.com", + }, ""); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { clientToolsAuthorizeToolServer } from "@gleanwork/api-client/funcs/clientToolsAuthorizeToolServer.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 clientToolsAuthorizeToolServer(glean, { + returnUrl: "https://lucky-disadvantage.com", + }, ""); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("clientToolsAuthorizeToolServer 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 { + // Mutation hook for triggering the API call. + useClientToolsAuthorizeToolServerMutation +} from "@gleanwork/api-client/react-query/clientToolsAuthorizeToolServer.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `serverId` | *string* | :heavy_check_mark: | Unique identifier of the tool server. | +| `authorizeToolServerRequest` | [components.AuthorizeToolServerRequest](../../models/components/authorizetoolserverrequest.md) | :heavy_check_mark: | N/A | +| `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.AuthorizeToolServerResponse](../../models/components/authorizetoolserverresponse.md)\>** + +### Errors + | Error Type | Status Code | Content Type | | ----------------- | ----------------- | ----------------- | | errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/package-lock.json b/examples/package-lock.json index 7232a1c0..e83e43da 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@gleanwork/api-client", - "version": "0.17.1", + "version": "0.17.2", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/jsr.json b/jsr.json index 9ab73b6f..1f92e6df 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.17.1", + "version": "0.17.2", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 4695ecb9..267fdbf1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.17.1", + "version": "0.17.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.17.1", + "version": "0.17.2", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, diff --git a/package.json b/package.json index 93e32c00..fc8e223b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.17.1", + "version": "0.17.2", "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 ac274cda..e2e2fdc5 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -28,6 +28,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/governance/data/policies", pathGetRestAPIV1GovernanceDataPolicies(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/governance/data/policies/{id}", pathGetRestAPIV1GovernanceDataPoliciesID(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/people/{person_id}/photo", pathGetRestAPIV1PeoplePersonIDPhoto(dir, rt)), + NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/tool-servers/{serverId}/auth", pathGetRestAPIV1ToolServersServerIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodGet, "/rest/api/v1/tools/list", pathGetRestAPIV1ToolsList(dir, rt)), NewGeneratedHandler(ctx, http.MethodPatch, "/rest/api/v1/configure/datasources/{datasourceId}/instances/{instanceId}", pathPatchRestAPIV1ConfigureDatasourcesDatasourceIDInstancesInstanceID(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/agents/search", pathPostAPIAgentsSearch(dir, rt)), @@ -111,6 +112,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/recommendations", pathPostRestAPIV1Recommendations(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/search", pathPostRestAPIV1Search(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/summarize", pathPostRestAPIV1Summarize(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/tool-servers/{serverId}/auth", pathPostRestAPIV1ToolServersServerIDAuth(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/tools/call", pathPostRestAPIV1ToolsCall(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/unpin", pathPostRestAPIV1Unpin(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/rest/api/v1/updateannouncement", pathPostRestAPIV1Updateannouncement(dir, rt)), diff --git a/src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolserversserveridauth.go b/src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolserversserveridauth.go new file mode 100644 index 00000000..0a96f7df --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathgetrestapiv1toolserversserveridauth.go @@ -0,0 +1,66 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 2b6ca857921b + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathGetRestAPIV1ToolServersServerIDAuth(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 "getToolServerAuthStatus[0]": + dir.HandlerFunc("getToolServerAuthStatus", testGetToolServerAuthStatusGetToolServerAuthStatus0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testGetToolServerAuthStatusGetToolServerAuthStatus0(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.ToolServerAuthStatusResponse = &components.ToolServerAuthStatusResponse{ + AuthStatus: components.ToolServerAuthStatusAuthorized, + AuthType: components.ActionAuthTypeAuthNone, + } + 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/pathpostrestapiv1toolserversserveridauth.go b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1toolserversserveridauth.go new file mode 100644 index 00000000..216824da --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1toolserversserveridauth.go @@ -0,0 +1,70 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 03ffeb98a0e0 + +package handler + +import ( + "fmt" + "log" + "mockserver/internal/handler/assert" + "mockserver/internal/logging" + "mockserver/internal/sdk/models/components" + "mockserver/internal/sdk/utils" + "mockserver/internal/tracking" + "net/http" +) + +func pathPostRestAPIV1ToolServersServerIDAuth(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 "authorizeToolServer[0]": + dir.HandlerFunc("authorizeToolServer", testAuthorizeToolServerAuthorizeToolServer0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testAuthorizeToolServerAuthorizeToolServer0(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.ContentType(req, "application/json", true); err != nil { + log.Printf("assertion error: %s\n", err) + http.Error(w, err.Error(), http.StatusBadRequest) + 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.AuthorizeToolServerResponse = &components.AuthorizeToolServerResponse{ + AuthorizationURL: "https://shocked-casket.name/", + } + 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/authorizetoolserverrequest.go b/src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverrequest.go new file mode 100644 index 00000000..54a16425 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverrequest.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: bf0c8d39f94c + +package components + +type AuthorizeToolServerRequest struct { + // URL to redirect the end user's browser back to after the OAuth flow completes. + // Must be present in the tenant's configured return URL allowlist. + // + ReturnURL string `json:"returnUrl"` +} + +func (o *AuthorizeToolServerRequest) GetReturnURL() string { + if o == nil { + return "" + } + return o.ReturnURL +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverresponse.go new file mode 100644 index 00000000..28188f1e --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/authorizetoolserverresponse.go @@ -0,0 +1,18 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 2b228bda70a6 + +package components + +type AuthorizeToolServerResponse struct { + // URL that the client should navigate the end user to in order to begin the OAuth flow. + // After the user consents, control returns to `returnUrl` from the request. + // + AuthorizationURL string `json:"authorizationUrl"` +} + +func (o *AuthorizeToolServerResponse) GetAuthorizationURL() string { + if o == nil { + return "" + } + return o.AuthorizationURL +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go b/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go index cc32cc7f..589a502d 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedentry.go @@ -113,6 +113,7 @@ const ( JustificationTypeDemoCard JustificationType = "DEMO_CARD" JustificationTypeOooPlanner JustificationType = "OOO_PLANNER" JustificationTypeOooCatchUp JustificationType = "OOO_CATCH_UP" + JustificationTypeAdminHealthCenter JustificationType = "ADMIN_HEALTH_CENTER" ) func (e JustificationType) ToPointer() *JustificationType { @@ -235,6 +236,8 @@ func (e *JustificationType) UnmarshalJSON(data []byte) error { case "OOO_PLANNER": fallthrough case "OOO_CATCH_UP": + fallthrough + case "ADMIN_HEALTH_CENTER": *e = JustificationType(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go b/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go index 34e83d6d..15932521 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedrequest.go @@ -54,6 +54,7 @@ const ( FeedRequestCategoryDemoCard FeedRequestCategory = "DEMO_CARD" FeedRequestCategoryOooPlanner FeedRequestCategory = "OOO_PLANNER" FeedRequestCategoryOooCatchUp FeedRequestCategory = "OOO_CATCH_UP" + FeedRequestCategoryAdminHealthCenter FeedRequestCategory = "ADMIN_HEALTH_CENTER" ) func (e FeedRequestCategory) ToPointer() *FeedRequestCategory { @@ -150,6 +151,8 @@ func (e *FeedRequestCategory) UnmarshalJSON(data []byte) error { case "OOO_PLANNER": fallthrough case "OOO_CATCH_UP": + fallthrough + case "ADMIN_HEALTH_CENTER": *e = FeedRequestCategory(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go b/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go index d5ccd17f..908902a9 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/feedresult.go @@ -55,6 +55,7 @@ const ( FeedResultCategoryDemoCard FeedResultCategory = "DEMO_CARD" FeedResultCategoryOooPlanner FeedResultCategory = "OOO_PLANNER" FeedResultCategoryOooCatchUp FeedResultCategory = "OOO_CATCH_UP" + FeedResultCategoryAdminHealthCenter FeedResultCategory = "ADMIN_HEALTH_CENTER" ) func (e FeedResultCategory) ToPointer() *FeedResultCategory { @@ -151,6 +152,8 @@ func (e *FeedResultCategory) UnmarshalJSON(data []byte) error { case "OOO_PLANNER": fallthrough case "OOO_CATCH_UP": + fallthrough + case "ADMIN_HEALTH_CENTER": *e = FeedResultCategory(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatus.go b/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatus.go new file mode 100644 index 00000000..8611dea6 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatus.go @@ -0,0 +1,36 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 816224e228e4 + +package components + +import ( + "encoding/json" + "fmt" +) + +// ToolServerAuthStatus - Authentication status for the calling user. +type ToolServerAuthStatus string + +const ( + ToolServerAuthStatusAwaitingAuth ToolServerAuthStatus = "AWAITING_AUTH" + ToolServerAuthStatusAuthorized ToolServerAuthStatus = "AUTHORIZED" +) + +func (e ToolServerAuthStatus) ToPointer() *ToolServerAuthStatus { + return &e +} +func (e *ToolServerAuthStatus) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "AWAITING_AUTH": + fallthrough + case "AUTHORIZED": + *e = ToolServerAuthStatus(v) + return nil + default: + return fmt.Errorf("invalid value for ToolServerAuthStatus: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatusresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatusresponse.go new file mode 100644 index 00000000..23cf72d2 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/toolserverauthstatusresponse.go @@ -0,0 +1,56 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 9290b06b0e8e + +package components + +type ToolServerAuthStatusResponse struct { + // Human-readable name of the tool server. + DisplayName *string `json:"displayName,omitempty"` + // Logo URL for the tool server. + LogoURL *string `json:"logoUrl,omitempty"` + // Brief description of the tool server. + Description *string `json:"description,omitempty"` + // Authentication status for the calling user. + AuthStatus ToolServerAuthStatus `json:"authStatus"` + // Authentication mechanism used by an action pack. + // - `AUTH_USER_OAUTH`: Requires per-user OAuth consent to the third-party tool. + // - `AUTH_ADMIN`: Uses a service-account / admin-owned credential. End users do not authorize individually. + // - `AUTH_NONE`: Action pack requires no authentication. + // + AuthType ActionAuthType `json:"authType"` +} + +func (o *ToolServerAuthStatusResponse) GetDisplayName() *string { + if o == nil { + return nil + } + return o.DisplayName +} + +func (o *ToolServerAuthStatusResponse) GetLogoURL() *string { + if o == nil { + return nil + } + return o.LogoURL +} + +func (o *ToolServerAuthStatusResponse) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +func (o *ToolServerAuthStatusResponse) GetAuthStatus() ToolServerAuthStatus { + if o == nil { + return ToolServerAuthStatus("") + } + return o.AuthStatus +} + +func (o *ToolServerAuthStatusResponse) GetAuthType() ActionAuthType { + if o == nil { + return ActionAuthType("") + } + return o.AuthType +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/authorizetoolserver.go b/src/__tests__/mockserver/internal/sdk/models/operations/authorizetoolserver.go new file mode 100644 index 00000000..f54e88a9 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/authorizetoolserver.go @@ -0,0 +1,48 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 32540ec18ae8 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type AuthorizeToolServerRequest struct { + // Unique identifier of the tool server. + ServerID string `pathParam:"style=simple,explode=false,name=serverId"` + Body components.AuthorizeToolServerRequest `request:"mediaType=application/json"` +} + +func (o *AuthorizeToolServerRequest) GetServerID() string { + if o == nil { + return "" + } + return o.ServerID +} + +func (o *AuthorizeToolServerRequest) GetBody() components.AuthorizeToolServerRequest { + if o == nil { + return components.AuthorizeToolServerRequest{} + } + return o.Body +} + +type AuthorizeToolServerResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful operation + AuthorizeToolServerResponse *components.AuthorizeToolServerResponse +} + +func (o *AuthorizeToolServerResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *AuthorizeToolServerResponse) GetAuthorizeToolServerResponse() *components.AuthorizeToolServerResponse { + if o == nil { + return nil + } + return o.AuthorizeToolServerResponse +} diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/gettoolserverauthstatus.go b/src/__tests__/mockserver/internal/sdk/models/operations/gettoolserverauthstatus.go new file mode 100644 index 00000000..c7871b88 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/gettoolserverauthstatus.go @@ -0,0 +1,40 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 64e5fc8d4817 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type GetToolServerAuthStatusRequest struct { + // Unique identifier of the tool server. + ServerID string `pathParam:"style=simple,explode=false,name=serverId"` +} + +func (o *GetToolServerAuthStatusRequest) GetServerID() string { + if o == nil { + return "" + } + return o.ServerID +} + +type GetToolServerAuthStatusResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful operation + ToolServerAuthStatusResponse *components.ToolServerAuthStatusResponse +} + +func (o *GetToolServerAuthStatusResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *GetToolServerAuthStatusResponse) GetToolServerAuthStatusResponse() *components.ToolServerAuthStatusResponse { + if o == nil { + return nil + } + return o.ToolServerAuthStatusResponse +} diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index 4ea7aff0..05ec6a88 100644 --- a/src/__tests__/summarize.test.ts +++ b/src/__tests__/summarize.test.ts @@ -19,11 +19,12 @@ test("Summarize Summarize", async () => { const result = await glean.client.documents.summarize({ documentSpecs: [ { - ugcType: "COLLECTIONS", - contentId: 993975, + ugcType: "SHORTCUTS", + contentId: 602763, }, { - id: "", + ugcType: "SHORTCUTS", + contentId: 602763, }, ], }); diff --git a/src/__tests__/tools.test.ts b/src/__tests__/tools.test.ts index b597fc4d..8fb8d99d 100644 --- a/src/__tests__/tools.test.ts +++ b/src/__tests__/tools.test.ts @@ -68,3 +68,31 @@ test("Tools Authorize Action Pack", async () => { }, ""); expect(result).toBeDefined(); }); + +test("Tools Get Tool Server Auth Status", async () => { + const testHttpClient = createTestHTTPClient("getToolServerAuthStatus"); + + 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.client.tools.retrieveToolServerAuthStatus(""); + expect(result).toBeDefined(); +}); + +test("Tools Authorize Tool Server", async () => { + const testHttpClient = createTestHTTPClient("authorizeToolServer"); + + 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.client.tools.authorizeToolServer({ + returnUrl: "https://lucky-disadvantage.com", + }, ""); + expect(result).toBeDefined(); +}); diff --git a/src/funcs/clientToolsAuthorizeToolServer.ts b/src/funcs/clientToolsAuthorizeToolServer.ts new file mode 100644 index 00000000..3dfa08db --- /dev/null +++ b/src/funcs/clientToolsAuthorizeToolServer.ts @@ -0,0 +1,189 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d3f54c35c5a2 + */ + +import { GleanCore } from "../core.js"; +import { encodeJSON, 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 { 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"; + +/** + * Start the OAuth authorization flow for a tool server. + * + * @remarks + * Initiates the third-party OAuth flow for the specified tool server and returns the + * authorization URL that the client should navigate the end user to. After the OAuth + * callback completes, the user's browser is redirected back to `returnUrl` with query + * parameters indicating the result. + * + * `returnUrl` must match the tenant's configured return URL allowlist; otherwise the + * request is rejected with 400. + */ +export function clientToolsAuthorizeToolServer( + client: GleanCore, + authorizeToolServerRequest: components.AuthorizeToolServerRequest, + serverId: string, + options?: RequestOptions, +): APIPromise< + Result< + components.AuthorizeToolServerResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + authorizeToolServerRequest, + serverId, + options, + )); +} + +async function $do( + client: GleanCore, + authorizeToolServerRequest: components.AuthorizeToolServerRequest, + serverId: string, + options?: RequestOptions, +): Promise< + [ + Result< + components.AuthorizeToolServerResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.AuthorizeToolServerRequest = { + authorizeToolServerRequest: authorizeToolServerRequest, + serverId: serverId, + }; + + const parsed = safeParse( + input, + (value) => + operations.AuthorizeToolServerRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.AuthorizeToolServerRequest, { + explode: true, + }); + + const pathParams = { + serverId: encodeSimple("serverId", payload.serverId, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/rest/api/v1/tool-servers/{serverId}/auth")( + pathParams, + ); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + 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: "authorizeToolServer", + 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: "POST", + 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 [result] = await M.match< + components.AuthorizeToolServerResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.AuthorizeToolServerResponse$inboundSchema), + M.fail([400, 401, 403, 404, 429, "4XX"]), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/clientToolsRetrieveToolServerAuthStatus.ts b/src/funcs/clientToolsRetrieveToolServerAuthStatus.ts new file mode 100644 index 00000000..577a36e7 --- /dev/null +++ b/src/funcs/clientToolsRetrieveToolServerAuthStatus.ts @@ -0,0 +1,177 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: e991c3e9afec + */ + +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 { 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"; + +/** + * Get end-user authentication status for a tool server. + * + * @remarks + * Returns display information and the calling user's current authentication status + * for the specified tool server. + */ +export function clientToolsRetrieveToolServerAuthStatus( + client: GleanCore, + serverId: string, + options?: RequestOptions, +): APIPromise< + Result< + components.ToolServerAuthStatusResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + serverId, + options, + )); +} + +async function $do( + client: GleanCore, + serverId: string, + options?: RequestOptions, +): Promise< + [ + Result< + components.ToolServerAuthStatusResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.GetToolServerAuthStatusRequest = { + serverId: serverId, + }; + + const parsed = safeParse( + input, + (value) => + operations.GetToolServerAuthStatusRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + serverId: encodeSimple("serverId", payload.serverId, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/rest/api/v1/tool-servers/{serverId}/auth")( + 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: "getToolServerAuthStatus", + 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 [result] = await M.match< + components.ToolServerAuthStatusResponse, + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.ToolServerAuthStatusResponse$inboundSchema), + M.fail([400, 401, 404, 429, "4XX"]), + M.fail("5XX"), + )(response, req); + 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 d2abb16a..f6ea75d6 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.1", - genVersion: "2.915.1", + sdkVersion: "0.17.2", + genVersion: "2.916.2", userAgent: - "speakeasy-sdk/typescript 0.17.1 2.915.1 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.17.2 2.916.2 0.9.0 @gleanwork/api-client", } as const; diff --git a/src/models/components/authorizetoolserverrequest.ts b/src/models/components/authorizetoolserverrequest.ts new file mode 100644 index 00000000..40b8327f --- /dev/null +++ b/src/models/components/authorizetoolserverrequest.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: db98d96ed2da + */ + +import * as z from "zod/v3"; + +export type AuthorizeToolServerRequest = { + /** + * URL to redirect the end user's browser back to after the OAuth flow completes. + * + * @remarks + * Must be present in the tenant's configured return URL allowlist. + */ + returnUrl: string; +}; + +/** @internal */ +export type AuthorizeToolServerRequest$Outbound = { + returnUrl: string; +}; + +/** @internal */ +export const AuthorizeToolServerRequest$outboundSchema: z.ZodType< + AuthorizeToolServerRequest$Outbound, + z.ZodTypeDef, + AuthorizeToolServerRequest +> = z.object({ + returnUrl: z.string(), +}); + +export function authorizeToolServerRequestToJSON( + authorizeToolServerRequest: AuthorizeToolServerRequest, +): string { + return JSON.stringify( + AuthorizeToolServerRequest$outboundSchema.parse(authorizeToolServerRequest), + ); +} diff --git a/src/models/components/authorizetoolserverresponse.ts b/src/models/components/authorizetoolserverresponse.ts new file mode 100644 index 00000000..e45acb2b --- /dev/null +++ b/src/models/components/authorizetoolserverresponse.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 216073fe950b + */ + +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"; + +export type AuthorizeToolServerResponse = { + /** + * URL that the client should navigate the end user to in order to begin the OAuth flow. + * + * @remarks + * After the user consents, control returns to `returnUrl` from the request. + */ + authorizationUrl: string; +}; + +/** @internal */ +export const AuthorizeToolServerResponse$inboundSchema: z.ZodType< + AuthorizeToolServerResponse, + z.ZodTypeDef, + unknown +> = z.object({ + authorizationUrl: z.string(), +}); + +export function authorizeToolServerResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AuthorizeToolServerResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AuthorizeToolServerResponse' from JSON`, + ); +} diff --git a/src/models/components/feedentry.ts b/src/models/components/feedentry.ts index ae89fc8a..a2dc1e39 100644 --- a/src/models/components/feedentry.ts +++ b/src/models/components/feedentry.ts @@ -122,6 +122,7 @@ export const JustificationType = { DemoCard: "DEMO_CARD", OooPlanner: "OOO_PLANNER", OooCatchUp: "OOO_CATCH_UP", + AdminHealthCenter: "ADMIN_HEALTH_CENTER", } as const; /** * Type of the justification. diff --git a/src/models/components/feedrequest.ts b/src/models/components/feedrequest.ts index 7c03163e..ef46f03f 100644 --- a/src/models/components/feedrequest.ts +++ b/src/models/components/feedrequest.ts @@ -60,6 +60,7 @@ export const FeedRequestCategory = { DemoCard: "DEMO_CARD", OooPlanner: "OOO_PLANNER", OooCatchUp: "OOO_CATCH_UP", + AdminHealthCenter: "ADMIN_HEALTH_CENTER", } as const; export type FeedRequestCategory = ClosedEnum; diff --git a/src/models/components/feedresult.ts b/src/models/components/feedresult.ts index c98dfb85..b990fe98 100644 --- a/src/models/components/feedresult.ts +++ b/src/models/components/feedresult.ts @@ -58,6 +58,7 @@ export const FeedResultCategory = { DemoCard: "DEMO_CARD", OooPlanner: "OOO_PLANNER", OooCatchUp: "OOO_CATCH_UP", + AdminHealthCenter: "ADMIN_HEALTH_CENTER", } as const; /** * Category of the result, one of the requested categories in incoming request. diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 390b3f8c..bf5da92c 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -40,6 +40,8 @@ export * from "./assistantinsightsresponse.js"; export * from "./authconfig.js"; export * from "./authorizeactionpackrequest.js"; export * from "./authorizeactionpackresponse.js"; +export * from "./authorizetoolserverrequest.js"; +export * from "./authorizetoolserverresponse.js"; export * from "./authstatus.js"; export * from "./authtoken.js"; export * from "./autocompleterequest.js"; @@ -450,6 +452,8 @@ export * from "./toolparameter.js"; export * from "./toolscallparameter.js"; export * from "./toolscallrequest.js"; export * from "./toolscallresponse.js"; +export * from "./toolserverauthstatus.js"; +export * from "./toolserverauthstatusresponse.js"; export * from "./toolsets.js"; export * from "./toolslistresponse.js"; export * from "./ugctype.js"; diff --git a/src/models/components/toolserverauthstatus.ts b/src/models/components/toolserverauthstatus.ts new file mode 100644 index 00000000..a95a71d9 --- /dev/null +++ b/src/models/components/toolserverauthstatus.ts @@ -0,0 +1,27 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 071ce1b5ce41 + */ + +import * as z from "zod/v3"; +import * as openEnums from "../../types/enums.js"; +import { OpenEnum } from "../../types/enums.js"; + +/** + * Authentication status for the calling user. + */ +export const ToolServerAuthStatus = { + AwaitingAuth: "AWAITING_AUTH", + Authorized: "AUTHORIZED", +} as const; +/** + * Authentication status for the calling user. + */ +export type ToolServerAuthStatus = OpenEnum; + +/** @internal */ +export const ToolServerAuthStatus$inboundSchema: z.ZodType< + ToolServerAuthStatus, + z.ZodTypeDef, + unknown +> = openEnums.inboundSchema(ToolServerAuthStatus); diff --git a/src/models/components/toolserverauthstatusresponse.ts b/src/models/components/toolserverauthstatusresponse.ts new file mode 100644 index 00000000..4e147464 --- /dev/null +++ b/src/models/components/toolserverauthstatusresponse.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 9b8d34bb7e2d + */ + +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 { + ActionAuthType, + ActionAuthType$inboundSchema, +} from "./actionauthtype.js"; +import { + ToolServerAuthStatus, + ToolServerAuthStatus$inboundSchema, +} from "./toolserverauthstatus.js"; + +export type ToolServerAuthStatusResponse = { + /** + * Human-readable name of the tool server. + */ + displayName?: string | undefined; + /** + * Logo URL for the tool server. + */ + logoUrl?: string | undefined; + /** + * Brief description of the tool server. + */ + description?: string | undefined; + /** + * Authentication status for the calling user. + */ + authStatus: ToolServerAuthStatus; + /** + * Authentication mechanism used by an action pack. + * + * @remarks + * - `AUTH_USER_OAUTH`: Requires per-user OAuth consent to the third-party tool. + * - `AUTH_ADMIN`: Uses a service-account / admin-owned credential. End users do not authorize individually. + * - `AUTH_NONE`: Action pack requires no authentication. + */ + authType: ActionAuthType; +}; + +/** @internal */ +export const ToolServerAuthStatusResponse$inboundSchema: z.ZodType< + ToolServerAuthStatusResponse, + z.ZodTypeDef, + unknown +> = z.object({ + displayName: z.string().optional(), + logoUrl: z.string().optional(), + description: z.string().optional(), + authStatus: ToolServerAuthStatus$inboundSchema, + authType: ActionAuthType$inboundSchema, +}); + +export function toolServerAuthStatusResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ToolServerAuthStatusResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ToolServerAuthStatusResponse' from JSON`, + ); +} diff --git a/src/models/operations/authorizetoolserver.ts b/src/models/operations/authorizetoolserver.ts new file mode 100644 index 00000000..551e501c --- /dev/null +++ b/src/models/operations/authorizetoolserver.ts @@ -0,0 +1,45 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: d7057ee40a5b + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import * as components from "../components/index.js"; + +export type AuthorizeToolServerRequest = { + /** + * Unique identifier of the tool server. + */ + serverId: string; + authorizeToolServerRequest: components.AuthorizeToolServerRequest; +}; + +/** @internal */ +export type AuthorizeToolServerRequest$Outbound = { + serverId: string; + AuthorizeToolServerRequest: components.AuthorizeToolServerRequest$Outbound; +}; + +/** @internal */ +export const AuthorizeToolServerRequest$outboundSchema: z.ZodType< + AuthorizeToolServerRequest$Outbound, + z.ZodTypeDef, + AuthorizeToolServerRequest +> = z.object({ + serverId: z.string(), + authorizeToolServerRequest: + components.AuthorizeToolServerRequest$outboundSchema, +}).transform((v) => { + return remap$(v, { + authorizeToolServerRequest: "AuthorizeToolServerRequest", + }); +}); + +export function authorizeToolServerRequestToJSON( + authorizeToolServerRequest: AuthorizeToolServerRequest, +): string { + return JSON.stringify( + AuthorizeToolServerRequest$outboundSchema.parse(authorizeToolServerRequest), + ); +} diff --git a/src/models/operations/gettoolserverauthstatus.ts b/src/models/operations/gettoolserverauthstatus.ts new file mode 100644 index 00000000..ddf76652 --- /dev/null +++ b/src/models/operations/gettoolserverauthstatus.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b9399d9292cf + */ + +import * as z from "zod/v3"; + +export type GetToolServerAuthStatusRequest = { + /** + * Unique identifier of the tool server. + */ + serverId: string; +}; + +/** @internal */ +export type GetToolServerAuthStatusRequest$Outbound = { + serverId: string; +}; + +/** @internal */ +export const GetToolServerAuthStatusRequest$outboundSchema: z.ZodType< + GetToolServerAuthStatusRequest$Outbound, + z.ZodTypeDef, + GetToolServerAuthStatusRequest +> = z.object({ + serverId: z.string(), +}); + +export function getToolServerAuthStatusRequestToJSON( + getToolServerAuthStatusRequest: GetToolServerAuthStatusRequest, +): string { + return JSON.stringify( + GetToolServerAuthStatusRequest$outboundSchema.parse( + getToolServerAuthStatusRequest, + ), + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index 5640a11a..00caa4b0 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -7,6 +7,7 @@ export * from "./addcollectionitems.js"; export * from "./addverificationreminder.js"; export * from "./adminsearch.js"; export * from "./authorizeactionpack.js"; +export * from "./authorizetoolserver.js"; export * from "./autocomplete.js"; export * from "./chat.js"; export * from "./chatstream.js"; @@ -58,6 +59,7 @@ export * from "./getreportstatus.js"; export * from "./getrestapiindexcustommetadataschemagroupname.js"; export * from "./getrestapiv1toolslist.js"; export * from "./getshortcut.js"; +export * from "./gettoolserverauthstatus.js"; export * from "./insights.js"; export * from "./listanswers.js"; export * from "./listchats.js"; diff --git a/src/react-query/clientToolsAuthorizeToolServer.ts b/src/react-query/clientToolsAuthorizeToolServer.ts new file mode 100644 index 00000000..afcb2b8a --- /dev/null +++ b/src/react-query/clientToolsAuthorizeToolServer.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 6ea6bcf043da + */ + +import { + MutationKey, + useMutation, + UseMutationResult, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { clientToolsAuthorizeToolServer } from "../funcs/clientToolsAuthorizeToolServer.js"; +import { combineSignals } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.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 { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { unwrapAsync } from "../types/fp.js"; +import { useGleanContext } from "./_context.js"; +import { MutationHookOptions } from "./_types.js"; + +export type ClientToolsAuthorizeToolServerMutationVariables = { + authorizeToolServerRequest: components.AuthorizeToolServerRequest; + serverId: string; + options?: RequestOptions; +}; + +export type ClientToolsAuthorizeToolServerMutationData = + components.AuthorizeToolServerResponse; + +export type ClientToolsAuthorizeToolServerMutationError = + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * Start the OAuth authorization flow for a tool server. + * + * @remarks + * Initiates the third-party OAuth flow for the specified tool server and returns the + * authorization URL that the client should navigate the end user to. After the OAuth + * callback completes, the user's browser is redirected back to `returnUrl` with query + * parameters indicating the result. + * + * `returnUrl` must match the tenant's configured return URL allowlist; otherwise the + * request is rejected with 400. + */ +export function useClientToolsAuthorizeToolServerMutation( + options?: MutationHookOptions< + ClientToolsAuthorizeToolServerMutationData, + ClientToolsAuthorizeToolServerMutationError, + ClientToolsAuthorizeToolServerMutationVariables + >, +): UseMutationResult< + ClientToolsAuthorizeToolServerMutationData, + ClientToolsAuthorizeToolServerMutationError, + ClientToolsAuthorizeToolServerMutationVariables +> { + const client = useGleanContext(); + return useMutation({ + ...buildClientToolsAuthorizeToolServerMutation(client, options), + ...options, + }); +} + +export function mutationKeyClientToolsAuthorizeToolServer(): MutationKey { + return ["@gleanwork/api-client", "tools", "authorizeToolServer"]; +} + +export function buildClientToolsAuthorizeToolServerMutation( + client$: GleanCore, + hookOptions?: RequestOptions, +): { + mutationKey: MutationKey; + mutationFn: ( + variables: ClientToolsAuthorizeToolServerMutationVariables, + ) => Promise; +} { + return { + mutationKey: mutationKeyClientToolsAuthorizeToolServer(), + mutationFn: function clientToolsAuthorizeToolServerMutationFn({ + authorizeToolServerRequest, + serverId, + options, + }): Promise { + const mergedOptions = { + ...hookOptions, + ...options, + fetchOptions: { + ...hookOptions?.fetchOptions, + ...options?.fetchOptions, + signal: combineSignals( + hookOptions?.fetchOptions?.signal, + options?.fetchOptions?.signal, + ), + }, + }; + return unwrapAsync(clientToolsAuthorizeToolServer( + client$, + authorizeToolServerRequest, + serverId, + mergedOptions, + )); + }, + }; +} diff --git a/src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts b/src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts new file mode 100644 index 00000000..03dda9ab --- /dev/null +++ b/src/react-query/clientToolsRetrieveToolServerAuthStatus.core.ts @@ -0,0 +1,79 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 53a6c8e7c68e + */ + +import { + QueryClient, + QueryFunctionContext, + QueryKey, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { clientToolsRetrieveToolServerAuthStatus } from "../funcs/clientToolsRetrieveToolServerAuthStatus.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 ClientToolsRetrieveToolServerAuthStatusQueryData = + components.ToolServerAuthStatusResponse; + +export function prefetchClientToolsRetrieveToolServerAuthStatus( + queryClient: QueryClient, + client$: GleanCore, + serverId: string, + options?: RequestOptions, +): Promise { + return queryClient.prefetchQuery({ + ...buildClientToolsRetrieveToolServerAuthStatusQuery( + client$, + serverId, + options, + ), + }); +} + +export function buildClientToolsRetrieveToolServerAuthStatusQuery( + client$: GleanCore, + serverId: string, + options?: RequestOptions, +): { + queryKey: QueryKey; + queryFn: ( + context: QueryFunctionContext, + ) => Promise; +} { + return { + queryKey: queryKeyClientToolsRetrieveToolServerAuthStatus(serverId), + queryFn: async function clientToolsRetrieveToolServerAuthStatusQueryFn( + ctx, + ): Promise { + const sig = combineSignals( + ctx.signal, + options?.signal, + options?.fetchOptions?.signal, + ); + const mergedOptions = { + ...options?.fetchOptions, + ...options, + signal: sig, + }; + + return unwrapAsync(clientToolsRetrieveToolServerAuthStatus( + client$, + serverId, + mergedOptions, + )); + }, + }; +} + +export function queryKeyClientToolsRetrieveToolServerAuthStatus( + serverId: string, +): QueryKey { + return [ + "@gleanwork/api-client", + "tools", + "retrieveToolServerAuthStatus", + serverId, + ]; +} diff --git a/src/react-query/clientToolsRetrieveToolServerAuthStatus.ts b/src/react-query/clientToolsRetrieveToolServerAuthStatus.ts new file mode 100644 index 00000000..9c737371 --- /dev/null +++ b/src/react-query/clientToolsRetrieveToolServerAuthStatus.ts @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 961b3d891d21 + */ + +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 { 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 { + buildClientToolsRetrieveToolServerAuthStatusQuery, + ClientToolsRetrieveToolServerAuthStatusQueryData, + prefetchClientToolsRetrieveToolServerAuthStatus, + queryKeyClientToolsRetrieveToolServerAuthStatus, +} from "./clientToolsRetrieveToolServerAuthStatus.core.js"; +export { + buildClientToolsRetrieveToolServerAuthStatusQuery, + type ClientToolsRetrieveToolServerAuthStatusQueryData, + prefetchClientToolsRetrieveToolServerAuthStatus, + queryKeyClientToolsRetrieveToolServerAuthStatus, +}; + +export type ClientToolsRetrieveToolServerAuthStatusQueryError = + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * Get end-user authentication status for a tool server. + * + * @remarks + * Returns display information and the calling user's current authentication status + * for the specified tool server. + */ +export function useClientToolsRetrieveToolServerAuthStatus( + serverId: string, + options?: QueryHookOptions< + ClientToolsRetrieveToolServerAuthStatusQueryData, + ClientToolsRetrieveToolServerAuthStatusQueryError + >, +): UseQueryResult< + ClientToolsRetrieveToolServerAuthStatusQueryData, + ClientToolsRetrieveToolServerAuthStatusQueryError +> { + const client = useGleanContext(); + return useQuery({ + ...buildClientToolsRetrieveToolServerAuthStatusQuery( + client, + serverId, + options, + ), + ...options, + }); +} + +/** + * Get end-user authentication status for a tool server. + * + * @remarks + * Returns display information and the calling user's current authentication status + * for the specified tool server. + */ +export function useClientToolsRetrieveToolServerAuthStatusSuspense( + serverId: string, + options?: SuspenseQueryHookOptions< + ClientToolsRetrieveToolServerAuthStatusQueryData, + ClientToolsRetrieveToolServerAuthStatusQueryError + >, +): UseSuspenseQueryResult< + ClientToolsRetrieveToolServerAuthStatusQueryData, + ClientToolsRetrieveToolServerAuthStatusQueryError +> { + const client = useGleanContext(); + return useSuspenseQuery({ + ...buildClientToolsRetrieveToolServerAuthStatusQuery( + client, + serverId, + options, + ), + ...options, + }); +} + +export function setClientToolsRetrieveToolServerAuthStatusData( + client: QueryClient, + queryKeyBase: [serverId: string], + data: ClientToolsRetrieveToolServerAuthStatusQueryData, +): ClientToolsRetrieveToolServerAuthStatusQueryData | undefined { + const key = queryKeyClientToolsRetrieveToolServerAuthStatus(...queryKeyBase); + + return client.setQueryData( + key, + data, + ); +} + +export function invalidateClientToolsRetrieveToolServerAuthStatus( + client: QueryClient, + queryKeyBase: TupleToPrefixes<[serverId: string]>, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: [ + "@gleanwork/api-client", + "tools", + "retrieveToolServerAuthStatus", + ...queryKeyBase, + ], + }); +} + +export function invalidateAllClientToolsRetrieveToolServerAuthStatus( + client: QueryClient, + filters?: Omit, +): Promise { + return client.invalidateQueries({ + ...filters, + queryKey: [ + "@gleanwork/api-client", + "tools", + "retrieveToolServerAuthStatus", + ], + }); +} diff --git a/src/react-query/index.ts b/src/react-query/index.ts index 666ec298..b8610dc0 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -91,8 +91,10 @@ export * from "./clientShortcutsList.js"; export * from "./clientShortcutsRetrieve.js"; export * from "./clientShortcutsUpdate.js"; export * from "./clientToolsAuthorizeActionPack.js"; +export * from "./clientToolsAuthorizeToolServer.js"; export * from "./clientToolsList.js"; export * from "./clientToolsRetrieveActionPackAuthStatus.js"; +export * from "./clientToolsRetrieveToolServerAuthStatus.js"; export * from "./clientToolsRun.js"; export * from "./clientVerificationAddReminder.js"; export * from "./clientVerificationList.js"; diff --git a/src/sdk/tools.ts b/src/sdk/tools.ts index 9dd1f13d..cd812e8a 100644 --- a/src/sdk/tools.ts +++ b/src/sdk/tools.ts @@ -4,8 +4,10 @@ */ import { clientToolsAuthorizeActionPack } from "../funcs/clientToolsAuthorizeActionPack.js"; +import { clientToolsAuthorizeToolServer } from "../funcs/clientToolsAuthorizeToolServer.js"; import { clientToolsList } from "../funcs/clientToolsList.js"; import { clientToolsRetrieveActionPackAuthStatus } from "../funcs/clientToolsRetrieveActionPackAuthStatus.js"; +import { clientToolsRetrieveToolServerAuthStatus } from "../funcs/clientToolsRetrieveToolServerAuthStatus.js"; import { clientToolsRun } from "../funcs/clientToolsRun.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; @@ -89,4 +91,47 @@ export class Tools extends ClientSDK { options, )); } + + /** + * Get end-user authentication status for a tool server. + * + * @remarks + * Returns display information and the calling user's current authentication status + * for the specified tool server. + */ + async retrieveToolServerAuthStatus( + serverId: string, + options?: RequestOptions, + ): Promise { + return unwrapAsync(clientToolsRetrieveToolServerAuthStatus( + this, + serverId, + options, + )); + } + + /** + * Start the OAuth authorization flow for a tool server. + * + * @remarks + * Initiates the third-party OAuth flow for the specified tool server and returns the + * authorization URL that the client should navigate the end user to. After the OAuth + * callback completes, the user's browser is redirected back to `returnUrl` with query + * parameters indicating the result. + * + * `returnUrl` must match the tenant's configured return URL allowlist; otherwise the + * request is rejected with 400. + */ + async authorizeToolServer( + authorizeToolServerRequest: components.AuthorizeToolServerRequest, + serverId: string, + options?: RequestOptions, + ): Promise { + return unwrapAsync(clientToolsAuthorizeToolServer( + this, + authorizeToolServerRequest, + serverId, + options, + )); + } } From 6385c00ab3c840e697af614b087447c1ce879386 Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Wed, 8 Jul 2026 02:29:32 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow