diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d2864659..b3f37156 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: de30adaa45770c1a3dd4fee14b4cc346 + docChecksum: 01a90b01e893a4ce756427c8d9283253 docVersion: 0.9.0 - speakeasyVersion: 1.808.1 - generationVersion: 2.960.8 - releaseVersion: 0.20.22 - configChecksum: 915bf000cb30d29253095a408e6c04aa + speakeasyVersion: 1.809.0 + generationVersion: 2.961.1 + releaseVersion: 0.20.23 + configChecksum: 5d2bcb1eb111011d9b5152c7ec768d7f repoURL: https://github.com/gleanwork/api-client-typescript.git installationURL: https://github.com/gleanwork/api-client-typescript published: true persistentEdits: - generation_id: 6b00c5fb-6086-40aa-ad67-21daa8682bfc - pristine_commit_hash: e61a576303a1489a6b2a13128e860af8f20b3a0c - pristine_tree_hash: b1b0b0c8a3f96e4cd0ce2f25b2b62e6d6fe74b9c + generation_id: cfd39e87-ce85-44fd-8d7c-b1f239337fcd + pristine_commit_hash: 44a751e804b56a274cdbd616efea07a81b721166 + pristine_tree_hash: 55b0ede2c12bc5988bc4b8ce271bb901dd24da7a features: typescript: acceptHeaders: 2.81.2 @@ -2137,10 +2137,6 @@ trackedFiles: id: d433e7bbef35 last_write_checksum: sha1:0b361bb9d55596a0022878ef1aa91c9e782c5870 pristine_git_object: 137d0c8608eb32b8672c234a91b6f18739ed2d21 - docs/models/components/platformchatjsonschemaformat.md: - id: 2c0f3b566ae6 - last_write_checksum: sha1:0ce9c5daa0a08fbff9e96e0d76e4f094c8430461 - pristine_git_object: d84f3bb520d168fd3891ee4e16c0dad02f4da3db docs/models/components/platformchatoutputmessage.md: id: 06f5e11e058a last_write_checksum: sha1:1be8e49ede9b8bc5cd2e0c6147a7a39384a61dda @@ -2155,8 +2151,8 @@ trackedFiles: pristine_git_object: c8d864be2b9327f48625725498c435ca5d7c69f6 docs/models/components/platformchatoutputtextcontent.md: id: 41ecc87e478f - last_write_checksum: sha1:76804e184de2f993af939bb93ba7e9b61db50732 - pristine_git_object: c2c05ca27928f89ce74931bb774701f903c6b801 + last_write_checksum: sha1:0cf363611390743f1e05a653e3a1f8a0e12705f8 + pristine_git_object: 9f1c7036acde7a2301713719d83e7240e677a73c docs/models/components/platformchatoutputtextcontenttype.md: id: 12dc2e11fdf6 last_write_checksum: sha1:e7a572736c4dd5b42dbb316dd1760f90cd779f7f @@ -2245,10 +2241,6 @@ trackedFiles: id: 2d12925cd635 last_write_checksum: sha1:a6742572666ef27e241ac6e9b503019c0f64f9aa pristine_git_object: 9913c75af077b020de46d856843c3cf0d5649903 - docs/models/components/platformchattextformat.md: - id: e5fc35b91179 - last_write_checksum: sha1:e4c6abd1a72983bc011729993041ad7fbb9c1b21 - pristine_git_object: 9b27fffc86c2184e2a1e551e281616f534d32009 docs/models/components/platformchatupdaterequest.md: id: bcf2be5fe851 last_write_checksum: sha1:1cf338623858089a1672c7f04e4e7e5ba5ace307 @@ -2301,6 +2293,10 @@ trackedFiles: id: cf30a61049bc last_write_checksum: sha1:fe7188f89c97f867bb26186c2f0dbd12e0464dd4 pristine_git_object: 38c911dfe8eea08e4c2c29d2a593b17aa2cb3921 + docs/models/components/platformdocumentreference.md: + id: 60be08cd43d2 + last_write_checksum: sha1:847aeb9af6d4aeafefb94162326493b7ab8bca02 + pristine_git_object: 7a260c3efeef816e8be45415ef8f701b2e3b3af8 docs/models/components/platformdocumentsbatchrequest.md: id: 0ae2a4ef7792 last_write_checksum: sha1:da9f14249db28f3a1099e69d1ed23640a3e219f7 @@ -2477,6 +2473,18 @@ trackedFiles: id: ad76c5d23cfa last_write_checksum: sha1:e3a2ec45ee14979c76068be13f3e742aaa861413 pristine_git_object: 0f3b08d48ac153b70a094aec096c70b22cce0f8e + docs/models/components/platformsearchenumerationinclude.md: + id: 80c4ec1c5527 + last_write_checksum: sha1:4f15b8d2e738762ab6c553033a04b31647c992ff + pristine_git_object: ba27c5c9cc65b83934bb906649dc045acb887351 + docs/models/components/platformsearchenumerationrequest.md: + id: 7925c7c3e5b3 + last_write_checksum: sha1:faf16def88e6fe619a5efedaecfb1b2d4f9f0077 + pristine_git_object: 6e834d7000c9e3b44f6f07a7fbb9070b2cc75223 + docs/models/components/platformsearchenumerationresponse.md: + id: 7e18dd61d67c + last_write_checksum: sha1:da59c90b66205b5a9b0226852840f7a0ef638c2b + pristine_git_object: e68357966ef27f9039c6bc145fa0ddece39ef88f docs/models/components/platformsearchfiltersresponse.md: id: b5bbeb0cb663 last_write_checksum: sha1:ac51e7f404a2235c4254eb5b29e2cfff0d1fd132 @@ -2723,8 +2731,8 @@ trackedFiles: pristine_git_object: 354c5c272838099805c06d1e76c33dee94484100 docs/models/components/platformtriggereventreason.md: id: 09d9f792a0e5 - last_write_checksum: sha1:d351dabf955de2fa21ad55e062a87c7531a7b309 - pristine_git_object: 17f67d6ed1628ff2327ce9aff65cceb3a67a08c5 + last_write_checksum: sha1:ce337e72c0be0ae2624659f5a018f7cee8e68433 + pristine_git_object: d1542a68672f66ea6a3cebdcb9653d2a24bcdcc5 docs/models/components/platformtriggereventsearchrequest.md: id: 61f9e0c276a4 last_write_checksum: sha1:6c2f08d7817fc6c21f572745b0c63812afe2c974 @@ -3149,10 +3157,6 @@ trackedFiles: id: 6f79f182392b last_write_checksum: sha1:1b5ac4410857b43ab7ec47d69a452dc5f2d0143c pristine_git_object: 36c4253cfbae64bbb6875faf2e8dbc3d7d042b50 - docs/models/components/structuredoutput.md: - id: ca8639e22ee5 - last_write_checksum: sha1:f32b3aee80df4be0f6309f7e8f6e11e0eaa18903 - pristine_git_object: fa655cfa3b2f3058bcff0c8ebf546bb3146b5112 docs/models/components/structuredresult.md: id: e48e5e4cdd13 last_write_checksum: sha1:14bee5629983464513a82e8aa7a5ff60a2b3ba65 @@ -3909,38 +3913,22 @@ trackedFiles: id: 58d615b7c78f last_write_checksum: sha1:fb7d9247173ad2c3f07def425cb55ad447f31006 pristine_git_object: 8afdfa5959f9d40e6bfae72293d9485fdd5f143a - docs/models/operations/platformchatcreateformat.md: - id: f472fd6ab7ef - last_write_checksum: sha1:7838c78255e048cf30bca1f202f1e6ec44e64a55 - pristine_git_object: 0079624bed9dc67e57488ea569647fc5e4a8911a docs/models/operations/platformchatcreateinput.md: id: 30dd49c63c34 last_write_checksum: sha1:b84e23b26eb042cfca1bcd894a12b11c4b7e9dd0 pristine_git_object: 50ceb94725f4ee275ef5430f8e6b756f44b2947a docs/models/operations/platformchatcreaterequest.md: id: e3b4683f75d8 - last_write_checksum: sha1:a805db02b7381859e005b51249066959f5df8418 - pristine_git_object: 6e7d38f1a7baecb7d468028ef6cfd5c8cf255483 - docs/models/operations/platformchatcreatestreamformat.md: - id: 9f0d72f05096 - last_write_checksum: sha1:bb4c3a598166fe6dd7996d135775af8b014a1d3c - pristine_git_object: acb9a86b99922381c5b3c2f3f3dedaba756a7bf5 + last_write_checksum: sha1:c74ac7dfa873b22a90428ab017cd47afcb38ab55 + pristine_git_object: 843bd336e3a24df84b7ef4c373901913724c9a88 docs/models/operations/platformchatcreatestreaminput.md: id: 4282b848314f last_write_checksum: sha1:c31769fe4d329e12861cf4d51567973b0271d8b2 pristine_git_object: a23ee7f283a439cf260082064534773e5eb7b99f docs/models/operations/platformchatcreatestreamrequest.md: id: bf073c591777 - last_write_checksum: sha1:d4e07acdfdcb1ab0ffa45d75efdb197208048740 - pristine_git_object: d06e7dadb8b87b1dc18da225f993430555fd785a - docs/models/operations/platformchatcreatestreamtext.md: - id: 5e6e2b9eeb59 - last_write_checksum: sha1:47fd813260b23400ad20f0c9690ef985a33f60bc - pristine_git_object: f7c9444fbc25717456347aeb3a84c707151b37d6 - docs/models/operations/platformchatcreatetext.md: - id: 419ceefc2ea7 - last_write_checksum: sha1:e9415f5cd77710ec94f691837c1026bd042ae477 - pristine_git_object: 9e53fb99223c8c53acbaa2a3187c526536e7bd97 + last_write_checksum: sha1:b40ffc56fa3db69ebab383917ff84a3c4317524d + pristine_git_object: 3bd03c23a921cd37442b3c577572b08a2ca473b4 docs/models/operations/platformchatupdaterequest.md: id: 4f2af29acf06 last_write_checksum: sha1:1343b1ef3856528c67cd08c4c418f0ee95bc1ec4 @@ -4179,8 +4167,8 @@ trackedFiles: pristine_git_object: fdf6d04776ed5c3336dbaf84813a783e3d7b5620 docs/sdks/chat/README.md: id: 393193527c2c - last_write_checksum: sha1:8d5cce0a571021bbd2b909826b8b5766cf3ea57e - pristine_git_object: 44ed532c17013756d09d88be0366795569e35be2 + last_write_checksum: sha1:f82c01a15a17ee3ee3dfb3e13d41522d4b4302ba + pristine_git_object: c4938aa0d7c450ea04bb6aa6825189650b4dd224 docs/sdks/clientagents/README.md: id: 8e00e6d6b64e last_write_checksum: sha1:abbda5fa02447e90a47f933b543666bf94f3ed97 @@ -4291,8 +4279,8 @@ trackedFiles: pristine_git_object: 6025b94e7355f974a45c9c00c892db4ad5f11bd0 docs/sdks/search/README.md: id: 5c534716244c - last_write_checksum: sha1:fc6f73f27c4a7c510f9408ca9b7bdda5552f3efb - pristine_git_object: bb8666982fe835860364141a7cdaa22e4472cd4d + last_write_checksum: sha1:628c8791409e998bee1f06b25795294433cdb70d + pristine_git_object: 93726a1a5f3ddb728dc95bc50d6c45bb70bf9dc1 docs/sdks/skills/README.md: id: 3a14a5c90791 last_write_checksum: sha1:336ae5c9fedbd38af43f2bafde1c967af5882efa @@ -4343,12 +4331,12 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:539f052e0c4efcb6a2c1c8a053c3dee5fbdc398f - pristine_git_object: c20719967e020164a2265f521bccedb42e077297 + last_write_checksum: sha1:fa67d99463a0042de33e720108948d6e017f147d + pristine_git_object: 9c0989432fc5602d173ebaf9ae32f79d1fb8bc0e package.json: id: 7030d0b2f71b - last_write_checksum: sha1:9e4cb99f63defbf3f60f1d1386afaf24358bd004 - pristine_git_object: 24feadd04760d5b7a44c6c711e20daa4fc0815f6 + last_write_checksum: sha1:c6a257a8572423ce64cf9434520e13f400544512 + pristine_git_object: 30f1c410489d867843ed09e382c8a033813037ea src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 @@ -4379,8 +4367,8 @@ trackedFiles: pristine_git_object: fa4dad795dadc97500b9b2c5971bfc00b040b7e4 src/__tests__/chat.test.ts: id: bf83434eb7e7 - last_write_checksum: sha1:0baf22e1c6c3f4fee2e0bdca73db26878b2d4087 - pristine_git_object: fd4c0ceabdcd6898b1129c5161f618005b097bb2 + last_write_checksum: sha1:dbe2b40bc78aa3e7ceb71c4c2041bbb1238949c0 + pristine_git_object: d597d24bdd38ed839292fc9991083c841cdbd1a0 src/__tests__/clientactivity.test.ts: id: 763dd50c7493 last_write_checksum: sha1:ba2524258d92b2768d107c5f3492552e317ff471 @@ -4483,8 +4471,8 @@ trackedFiles: pristine_git_object: d252821b825c62856886e3ab9287181d7ef7f9de src/__tests__/messages.test.ts: id: 39e293f09219 - last_write_checksum: sha1:c78b09c09e64da0655a3e0ecbadabe82980ef7d1 - pristine_git_object: f390543460d7bd3c678c17579e755b9e06faac16 + last_write_checksum: sha1:d71d67d8ed6743e623401b4101f70705c2eb5172 + pristine_git_object: a4785e3180745bef1ba299e2191e9c49bec1da88 src/__tests__/mockserver/.gitignore: id: 4a7fc421b6b6 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -4539,8 +4527,8 @@ trackedFiles: pristine_git_object: af3a6d136d837850b34ed893a8faf800ea114721 src/__tests__/mockserver/internal/handler/generated_handlers.go: id: e6f590a8ce11 - last_write_checksum: sha1:4c2eaffe9ea6ebd9f100f956511b6328257d8a4d - pristine_git_object: 5b5fb53b8321c71868adf73aaa63ec12fe1bcdad + last_write_checksum: sha1:690681156adf9e55d3d157a5ff3a12dbdc8067d7 + pristine_git_object: f400575d03482a43afe060ae2b83c688c3996320 src/__tests__/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: ef047f0e0f32 last_write_checksum: sha1:187ff16d05efa1c937632f61dd3f49e49691d5ff @@ -4869,6 +4857,10 @@ trackedFiles: id: 53fb32000093 last_write_checksum: sha1:b54b6d91bb75e3e8d0b4eee44dbbef94c75b5271 pristine_git_object: eec216ead5ddcff56fd1a98021189e09ade1c128 + src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go: + id: c504bfd60b2c + last_write_checksum: sha1:3cbc85e57fd7cdf87046911f4f084d121724c178 + pristine_git_object: 07cddab8b353d7e862f40340067b9d514d5df44a src/__tests__/mockserver/internal/handler/pathpostapiskills.go: id: 3ea49d94d44f last_write_checksum: sha1:e7bb6d9487444f22337cdbb16ec0f23aca1a1bba @@ -4963,8 +4955,8 @@ trackedFiles: pristine_git_object: 759610d9e14b656b2a8671c25618d94bd6dd13fb src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go: id: a5a57be97594 - last_write_checksum: sha1:018cc7286107290e649b6b3b03aa3dbb954fac49 - pristine_git_object: 673b01bb8e674296a9eaae2e614c08d07b3700a2 + last_write_checksum: sha1:9b962c4ca4d653411bc410023c49401518b209fe + pristine_git_object: a4b193767e8924ecc8a22aa8df6d0030f8786874 src/__tests__/mockserver/internal/handler/pathpostrestapiv1createshortcut.go: id: 440deca160f6 last_write_checksum: sha1:e2bba9884dd04f8d9b158c88fb32ff9f06687846 @@ -6757,18 +6749,14 @@ trackedFiles: id: 3073b8cf092d last_write_checksum: sha1:6340f73e5bffac9a724f8eb9f6a73082273cf080 pristine_git_object: 27fa64cbf8a93a7d9825b49f1637ae119e78315e - src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go: - id: 894f1f95fef3 - last_write_checksum: sha1:10e586048b7f30b47bc97cee22dd28bfca02e371 - pristine_git_object: af91cf875d24c490c927294bf3b4f5b97cc01bb8 src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputmessage.go: id: b4782e0cffe9 last_write_checksum: sha1:c28b34c8f32a7306dfd8521ec87741281c09d13c pristine_git_object: 39e8b75049e28450aee57a7e7655d2cd254330e4 src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go: id: 3bd4856d4753 - last_write_checksum: sha1:75dab771147cd287c989446ce8955714e6002b55 - pristine_git_object: 94d84904ce58f8066e0bdbc4a4a2c20689f805e7 + last_write_checksum: sha1:5880a1f9527a41dd0d8b1f91ded48bad9e7f932f + pristine_git_object: 7b5437eb4ffb05b35d98d706bd6896089def9771 src/__tests__/mockserver/internal/sdk/models/components/platformchatpersonsource.go: id: 3b8c301f9600 last_write_checksum: sha1:9e5f72c1a5d130516f17326db5ea40100385e413 @@ -6829,10 +6817,6 @@ trackedFiles: id: d479ff5cdb9b last_write_checksum: sha1:d8d94a820f7d0ad33d97f08745ecebc525649491 pristine_git_object: c237c010741a1d07f7b0ee645761232f9967e2d8 - src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go: - id: 26e47a3c7596 - last_write_checksum: sha1:e3d5de0a1aad36226a8a852a8c07f4d4b962b85e - pristine_git_object: 580903ad493bf182419fe34ec942ab2c7147f1ef src/__tests__/mockserver/internal/sdk/models/components/platformchatupdaterequest.go: id: 76007746f32b last_write_checksum: sha1:bf4fbeec58f415517ff29e0042dc5cac5758d04b @@ -6881,6 +6865,10 @@ trackedFiles: id: 8de809cdd893 last_write_checksum: sha1:aed74c796bf849e74a110489a4778c724cd3f2b4 pristine_git_object: 5a79992d108f86580a9db9ad84a57f4d6307b2e1 + src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go: + id: e80c0c41df88 + last_write_checksum: sha1:362e904db84011e5fd6f0fdf7473d78131ae67b9 + pristine_git_object: 7b49d044aa0e9c1b4a12065493125a49de1fe478 src/__tests__/mockserver/internal/sdk/models/components/platformdocumentsbatchrequest.go: id: a59084f51a9a last_write_checksum: sha1:3f79a566ba3c4743427afce150609444243949e6 @@ -7045,6 +7033,18 @@ trackedFiles: id: ac8208a62711 last_write_checksum: sha1:ef6879eef1170ffd1687e4e81e5724d035469aab pristine_git_object: e28a4cbc913eb5b65a9ecf22048da5c380b8363d + src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go: + id: dac298c4cccb + last_write_checksum: sha1:2ad03942a1898e83e1c36ad35a2ce7d2d6b16129 + pristine_git_object: 99b23d22a406d97b5df1cc0b1d2f0b5fb8ac7e49 + src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go: + id: a0cf40c6bfa1 + last_write_checksum: sha1:6bc64dbef95c63bff337af875eef8f1cefdff585 + pristine_git_object: 7177befcd7486cc303fae25a70cdbf5cb9dd45a9 + src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go: + id: ba154247063b + last_write_checksum: sha1:9c9fb479981514d98cd9b5b9f2f1328d13823282 + pristine_git_object: f2c50dfd5f176de6e83f9f4ea664ec17f6716a6a src/__tests__/mockserver/internal/sdk/models/components/platformsearchfiltersresponse.go: id: f7cfacf23cce last_write_checksum: sha1:6a7d047710220c84d2ef81ae8c1997a8209b5aa1 @@ -7251,8 +7251,8 @@ trackedFiles: pristine_git_object: a756a2969f141ad0b949df030be2216d211bb47e src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventreason.go: id: 405ea0e78cf3 - last_write_checksum: sha1:a36d8800ca2047eb35aa65ed915c72e3324f998a - pristine_git_object: 2f9c18dea94d8d29ec847c7ee583e51ec5fec6f7 + last_write_checksum: sha1:9a7478b09f3810c98a3773244f6912a579060695 + pristine_git_object: b05ff0d01ee0395392318427df980fe819e6dd5a src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventsearchrequest.go: id: d25ba9f345f0 last_write_checksum: sha1:584fc0abba8bcff84af699600b634312fbb45ec3 @@ -8255,12 +8255,12 @@ trackedFiles: pristine_git_object: 400797ac0ae0d3518c1e2fd0e75fad70ad0e9373 src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go: id: d7591a37d7a3 - last_write_checksum: sha1:7a009b5742642df30ca9511fae5ec1b59d9ce877 - pristine_git_object: 12c116d75651b774880c630d995425300d6b544d + last_write_checksum: sha1:090ca9e2b300412ae5bb0a992896767786572a53 + pristine_git_object: 439b883ac06eecea9bc1b9915c423577c8034842 src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go: id: cb5c539bf53d - last_write_checksum: sha1:5ef470df5c006a512a3f9281cae9be175dadc1e8 - pristine_git_object: 68b74befa78b34fe9bc9deefdf0b8a6545c07ecf + last_write_checksum: sha1:876a7bb48f2e7b1f1c302b114ff98b03dccb6d45 + pristine_git_object: b4b32f8fbcdbb138a0d340ba8dda8c46abff392e src/__tests__/mockserver/internal/sdk/models/operations/platformchatupdate.go: id: 9ba6814ed166 last_write_checksum: sha1:ce75695ea200db5a3bef226ec003b1a23f41b529 @@ -8289,6 +8289,10 @@ trackedFiles: id: 8d5d0787d271 last_write_checksum: sha1:9fd7d66f3b3832e327c5943481aabf7a8f81578d pristine_git_object: ed8ec6f66350d807dfc7c490b149ca47f44d644f + src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go: + id: 56ee8b1f6493 + last_write_checksum: sha1:487103745716d9fdc4ee3bc2f93307b6c073b0dc + pristine_git_object: 53f74be383240e596a3e7ce80afcc83778cfba91 src/__tests__/mockserver/internal/sdk/models/operations/platformsearchfilters.go: id: 7a1841a46be9 last_write_checksum: sha1:7815f56d3f25cc592775e0a06bb06a74b4750dbb @@ -8759,16 +8763,16 @@ trackedFiles: pristine_git_object: 7ce8f5effc329f11e78343356b16576bf94b9fed src/__tests__/search.test.ts: id: 97f2005515d0 - last_write_checksum: sha1:0caffb8a18345afdccbb6bf083547451fbe897b7 - pristine_git_object: 976a5e8d5b782d68ae02a68ff752f153746a4416 + last_write_checksum: sha1:38ceb4d6f75de72f65c5338a3480536826ead85d + pristine_git_object: 312cb93f527ae6f011c5a4e320e59d67ce2a0033 src/__tests__/skills.test.ts: id: 3fa6e540c659 last_write_checksum: sha1:84f9b02b6376707d515a2598c9a09f84db5f8d03 pristine_git_object: 80853fce6d86d20766336fb2fd27c8669cd12ca8 src/__tests__/summarize.test.ts: id: 3105d6ebc7eb - last_write_checksum: sha1:37097d218fbcf2407d7b826a42bf5bad00e4078e - pristine_git_object: 140c6a17e1b4efaba2c8ef51dab0089d3ce42b60 + last_write_checksum: sha1:f6c5ccdecf6c2d5e26a8fcbf2d5a0ae0cec630e5 + pristine_git_object: a1e0e25193b0208e52a29719cbac410d307dc165 src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 @@ -9421,6 +9425,10 @@ trackedFiles: id: d3415b0af8c7 last_write_checksum: sha1:5d1ec60b7b232f01db017d50c7de0bdd3be15e7d pristine_git_object: 8ac792c66214838901f88f279840f31cb33b1472 + src/funcs/searchEnumerate.ts: + id: 74e4f005bf76 + last_write_checksum: sha1:fc1a379f0be6e551434e3ea7abdab3993f10769b + pristine_git_object: 95a50dcf3ec77296d8df16318f51c4bf16a61c40 src/funcs/searchListFilters.ts: id: 16efa68fb063 last_write_checksum: sha1:8531ba23678748489d04f4fd584ce0a1c823e85e @@ -9559,8 +9567,8 @@ trackedFiles: pristine_git_object: 42d9739ab67c2fec0689f83777ffa5e1f875e5d5 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:0a454b170c40e39fec6e746baffd66fd21fd0a94 - pristine_git_object: 3db1b4249d87f2f1f57cb909ccdace9455d699f3 + last_write_checksum: sha1:863682d28e34cdfd080444d0bbb9d63805a642a2 + pristine_git_object: 0d2091d188993f1bc61772c1110610533fc1423a src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:d1917169abb226ccb0d2e93fd211a1d2987822b4 @@ -10783,8 +10791,8 @@ trackedFiles: pristine_git_object: dcb8bad1c6e1addd393690e78a63631baa47f7be src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:25ea346e93020306f54efdb4758456bd01539eca - pristine_git_object: 1f33f00ca23cad4a501e3d0876852cfa6ee3bc22 + last_write_checksum: sha1:a1f61f299dc7173982db6939a83fe2700b27a6d0 + pristine_git_object: 10e440ae672239fb97d38a3af2a94369ef1ec54e src/models/components/indexdocumentrequest.ts: id: deb13e2cdc65 last_write_checksum: sha1:33e2093c7fcdd3c90ef45c48e7b79c4cb2aea6e5 @@ -11181,18 +11189,14 @@ trackedFiles: id: 3cfc29b0d268 last_write_checksum: sha1:469269643f005fe9038eb96ce7122acc34a9795e pristine_git_object: 1705d965980a233631e8aa0cfadc750cbf2bc92f - src/models/components/platformchatjsonschemaformat.ts: - id: c7086d714c13 - last_write_checksum: sha1:207d4424bd93bc927c12b5601edda6bde0ae0023 - pristine_git_object: e620df58caee56b51cf50c47d9f4c4aa39019bd0 src/models/components/platformchatoutputmessage.ts: id: 99912ae2c54e last_write_checksum: sha1:a318403ec231b9664f318bcbd1f9d9238f303cfc pristine_git_object: ee68330ac7c2f750966d893ff0c78b60a2557191 src/models/components/platformchatoutputtextcontent.ts: id: aef245149405 - last_write_checksum: sha1:21ad531df92141e2609250c4b55d192c43de4e2b - pristine_git_object: 02f6a05c0a65a1ae09b2df60f8d11aac628576c4 + last_write_checksum: sha1:a5dbe41374fc347e2fb7d79844128425c5c098d6 + pristine_git_object: fef0736f1c1e63f44de0703246d5c2aca6967850 src/models/components/platformchatpersonsource.ts: id: 9e78924ff10b last_write_checksum: sha1:6923603f31b0958784cbb488d30f338a647b74d4 @@ -11253,10 +11257,6 @@ trackedFiles: id: bd824a2d14c5 last_write_checksum: sha1:f58efc8e0f817bf68a2f2c77f90e9811de06f9cd pristine_git_object: 6982973162a59ae209ee7b8558608826463d1de1 - src/models/components/platformchattextformat.ts: - id: 6dad34f1fc6d - last_write_checksum: sha1:81df9379ed107b5d358bfa84d911ad24fe5db19d - pristine_git_object: f76809c9f884f886334e20d2c752173cccb52ca8 src/models/components/platformchatupdaterequest.ts: id: f2177316b022 last_write_checksum: sha1:3691dd012738f7ff452b2f79c1b4e4d6175759dc @@ -11305,6 +11305,10 @@ trackedFiles: id: 9c530f634cd4 last_write_checksum: sha1:271a71af769470e7b1559f67f404ff6c76b1e4dc pristine_git_object: 2ff1c42a92cadf90e15aab75f9299760adb7bfa1 + src/models/components/platformdocumentreference.ts: + id: b75ba04814f1 + last_write_checksum: sha1:5ae7bdd3101d7d7e217520a05d934ba7999227d8 + pristine_git_object: 67180a273c513358b63c0d7b45d2f00b1b071cef src/models/components/platformdocumentsbatchrequest.ts: id: 1c38d220465e last_write_checksum: sha1:b8e3d318d76bd0e2695ef11bc6c00914dbca37f7 @@ -11469,6 +11473,18 @@ trackedFiles: id: ace03f2ab3c3 last_write_checksum: sha1:438db2a13138375013262e4359e81f6551c67ef9 pristine_git_object: 62382bf8119e55a4b5cef1e0bcb577c554e0b8fc + src/models/components/platformsearchenumerationinclude.ts: + id: 04978b7d7ecc + last_write_checksum: sha1:6701059b620e6e2271747d51079aaa42633c274a + pristine_git_object: 51344e30cdd55f38ae246f165b75a3c37d45c7ec + src/models/components/platformsearchenumerationrequest.ts: + id: 824bb7175ac7 + last_write_checksum: sha1:b2f61a8526b92df6ef374b20b38da162bd5ea8af + pristine_git_object: 480f7b2dea53ff6636b358e20a930ff66ad0bab5 + src/models/components/platformsearchenumerationresponse.ts: + id: ec3571f2b09d + last_write_checksum: sha1:6d3d4dcfbc8b508198bfd4610193f26b730891ff + pristine_git_object: 4e4563b9bae167fa26e07af702e125e0dffa1ddc src/models/components/platformsearchfiltersresponse.ts: id: 47e0d72542f6 last_write_checksum: sha1:cc7b9e149e09bc719acf4212115d36e8e6616b3a @@ -11675,8 +11691,8 @@ trackedFiles: pristine_git_object: 75d54421f1ef4d9bb285967ca1e401385557460c src/models/components/platformtriggereventreason.ts: id: 3e21a733137e - last_write_checksum: sha1:61b761fa8927eac8fe010815438face4582aaa20 - pristine_git_object: 08b360a882b5ae79199bfe3f0f2ab39f487aaafb + last_write_checksum: sha1:f2c0c4884bc4de40cd232da58223012738a19df8 + pristine_git_object: 7a07f9f9dc1592aae0f1278331f41c6bb6b15ec7 src/models/components/platformtriggereventsearchrequest.ts: id: 65684ccd7f59 last_write_checksum: sha1:6340400a6dce446ef95b8700fece4ef8cc96199e @@ -12699,12 +12715,12 @@ trackedFiles: pristine_git_object: 69bd1349edebd305537e0ec66afbe70db4e9aa14 src/models/operations/platformchatcreate.ts: id: 61f71943248c - last_write_checksum: sha1:d3244864e0902598b85daa1f50f1aa9dd2d2d797 - pristine_git_object: abdc52608f4df3e1fa0d4e9542efc6786c8e4295 + last_write_checksum: sha1:d7ad67c4d2e69fe5bb895fc673f6bea5da3fe8b5 + pristine_git_object: c78b6a8a106faab54a2b3f105c9550eb70a61d77 src/models/operations/platformchatcreatestream.ts: id: 7b911127469b - last_write_checksum: sha1:b52047d6e39ad9d833c4b68b257f910da7c25591 - pristine_git_object: 3b1f8a1721afd5c7c8940117c1a22ae94073f1a2 + last_write_checksum: sha1:6530528ad97a315746ac9fb44940e3e92cddbcef + pristine_git_object: c06337a78b72bb729bb64238ee910c997610e5eb src/models/operations/platformchatupdate.ts: id: d0729eeda542 last_write_checksum: sha1:c4c742a2803e570eb97a9b47460406e9438da8b6 @@ -13471,8 +13487,8 @@ trackedFiles: pristine_git_object: a9f37ea69f54d7c1072f42f8990e3f25d9d984e5 src/react-query/index.ts: id: 9e975471aa65 - last_write_checksum: sha1:2a2a963eb228ecf8b635218164b478b3d98feb55 - pristine_git_object: 57530d10c931665bb56c98a4c7c65add2a63bd6d + last_write_checksum: sha1:f6658eec3331550b5f35cfb89cdd642c50d9a4ba + pristine_git_object: 5faf47a128f7c7a8c3c26521389ab90410ffe197 src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -13653,6 +13669,10 @@ trackedFiles: id: f539f36cd532 last_write_checksum: sha1:91e8ee4d5848461ccc058920574bd1658c96a7da pristine_git_object: 60853a79fd3d357b9c225d1469569ba18e4bb834 + src/react-query/searchEnumerate.ts: + id: 43725e058698 + last_write_checksum: sha1:791cc2aa98070e93429280eefb0f54e9db544e15 + pristine_git_object: 2c965d5b8ec75eb470f10acee076f0ee2561a7bd src/react-query/searchListFilters.core.ts: id: c09038b64f46 last_write_checksum: sha1:a102aaea3217d552637d897ddd5084317b76814d @@ -13995,8 +14015,8 @@ trackedFiles: pristine_git_object: 321c4dc3caa8cbfbe518fa42e44bbacf3437e71c src/sdk/search.ts: id: b88871d87236 - last_write_checksum: sha1:f9a6896781f5884e76434b7d93c7db7758edfb1f - pristine_git_object: a4ecf2ede22740e3ccd9b84253b0e065d934c916 + last_write_checksum: sha1:964d57571a161e0f03b7bc5c69bb24f76b790a34 + pristine_git_object: d3f5c0cadfbf12b8d32ac6a4aab301ca1e4d4f8a src/sdk/skills.ts: id: 847667a72f83 last_write_checksum: sha1:e23d82dd8085fddb43df980064c40bed969c8b8a @@ -15222,7 +15242,7 @@ examples: platform-chat-create: speakeasy-default-platform-chat-create: requestBody: - application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": false, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} + application/json: {"input": "Summarize our parental leave policy.", "stream": false, "store": true} responses: "200": application/json: {"id": "", "object": "RESPONSE", "created_at": "2026-05-19T05:32:52.505Z", "status": "COMPLETED", "output": [{"type": "MESSAGE", "role": "ASSISTANT", "content": [{"type": "OUTPUT_TEXT", "text": ""}]}], "store": false, "request_id": ""} @@ -15457,7 +15477,7 @@ examples: platform-chat-create-stream: speakeasy-default-platform-chat-create-stream: requestBody: - application/json: {"input": "Summarize our parental leave policy as JSON.", "stream": true, "store": true, "text": {"format": {"type": "JSON_SCHEMA", "name": "policy_summary", "schema": {"type": "object", "properties": {"eligible_employees": {"type": "string"}, "duration_weeks": {"type": "integer"}}, "required": ["eligible_employees", "duration_weeks"]}, "strict": true}}} + application/json: {"input": "Summarize our parental leave policy.", "stream": true, "store": true} responses: "400": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} @@ -15692,6 +15712,17 @@ examples: application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} "500": application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + platform-search-enumeration: + speakeasy-default-platform-search-enumeration: + requestBody: + application/json: {"query": "amoxicillin", "datasources": ["gdrive"], "page_size": 500} + responses: + "200": + application/json: {"results": [], "has_more": false, "next_cursor": null, "request_id": ""} + "400": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} + "500": + application/problem+json: {"type": "https://developers.glean.com/errors/invalid-cursor", "title": "Invalid Pagination Cursor", "status": 400, "detail": "The provided cursor has expired. Start a new search to get a fresh cursor.\n", "code": "invalid_cursor", "documentation_url": "https://developers.glean.com/errors/invalid-cursor", "request_id": "req_7f8a9b0c1d2e", "errors": [{"pointer": "/messages/0/role", "detail": "Must be one of: USER, GLEAN_AI.", "code": "invalid_cursor"}]} examplesVersion: 1.0.2 generatedTests: activity: "2025-05-05T15:08:35-05:00" @@ -15908,6 +15939,8 @@ generatedTests: platform-documents-get-by-url: "2026-11-06T19:47:41Z" platform-documents-get: "2026-11-06T19:47:41Z" platform-documents-batch: "2026-11-06T19:47:41Z" + platform-search-enumeration: "2026-11-16T11:53:18Z" +releaseNotes: "## Typescript SDK Changes:\n* `glean.chat.create()`: \n * `request.text` **Removed** (Breaking ⚠️)\n * `response.output[].content[].structuredOutput` **Removed** (Breaking ⚠️)\n* `glean.chat.createStream()`: \n * `request.text` **Removed** (Breaking ⚠️)\n * `response.[].union(RESPONSE_COMPLETED).data.response.output[].content[].structuredOutput` **Removed** (Breaking ⚠️)\n* `glean.search.enumerate()`: **Added**\n* `glean.triggers.searchEvents()`: `response.results[].reason` **Changed**\n* `glean.triggers.searchPresetEvents()`: `response.results[].reason` **Changed**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 591fea7b..d8fe8223 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true typescript: - version: 0.20.22 + version: 0.20.23 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 58ef91e2..c2f3e3ce 100644 --- a/.speakeasy/glean-merged-spec.yaml +++ b/.speakeasy/glean-merged-spec.yaml @@ -2,8 +2,8 @@ openapi: 3.1.0 info: version: "0.9.0" title: Glean API - x-source-commit-sha: 77999be6fb7bac7ce1b740a5f554037282298b5d - x-open-api-commit-sha: ea654b06c64649ac0076b89cdcea6e0792daec11 + x-source-commit-sha: 74225def94ec0e1d0281e9ed827c93f85ccb2152 + x-open-api-commit-sha: d781217a7cfce20ac740646c1b7242f059d850cb 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. @@ -1496,6 +1496,63 @@ paths: x-speakeasy-name-override: listFilters security: - APIToken: [] + /api/search/enumeration: + post: + tags: + - Search + summary: Enumerate matching documents + description: | + Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + operationId: platform-search-enumeration + x-glean-scopes: + legacy: + - SEARCH + platform: + - search:query + x-visibility: Public + x-glean-experimental: + id: 9ce7bb73-1e30-460a-a917-cae09ac3a3ea + introduced: "2026-11-02" + x-codegen-request-body-name: payload + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchEnumerationRequest" + responses: + "200": + description: Successful response. + content: + application/json: + schema: + $ref: "#/components/schemas/PlatformSearchEnumerationResponse" + "400": + $ref: "#/components/responses/PlatformBadRequest" + "401": + $ref: "#/components/responses/PlatformUnauthorized" + "403": + $ref: "#/components/responses/PlatformForbidden" + "404": + $ref: "#/components/responses/PlatformNotFound" + "408": + $ref: "#/components/responses/PlatformRequestTimeout" + "413": + $ref: "#/components/responses/PlatformRequestTooLarge" + "422": + $ref: "#/components/responses/PlatformUnprocessableEntity" + "429": + $ref: "#/components/responses/PlatformTooManyRequests" + "500": + $ref: "#/components/responses/PlatformInternalServerError" + "503": + $ref: "#/components/responses/PlatformServiceUnavailable" + x-speakeasy-group: search + x-speakeasy-name-override: enumerate + security: + - APIToken: [] /api/admin/usage/settings: get: tags: @@ -9840,72 +9897,13 @@ components: content: type: string minLength: 1 - PlatformChatTextFormat: - type: object - additionalProperties: false - description: Unconstrained plain-text assistant output. - required: - - type - properties: - type: - type: string - description: Discriminator. Must be TEXT. - enum: - - TEXT - PlatformChatJsonSchemaFormat: - type: object - additionalProperties: false - description: Constrains the assistant response to a caller-supplied JSON Schema. - required: - - type - - name - - schema - properties: - type: - type: string - description: Discriminator. Must be JSON_SCHEMA. - enum: - - JSON_SCHEMA - name: - type: string - minLength: 1 - maxLength: 64 - description: A stable identifier for the schema. - description: - type: string - maxLength: 1024 - description: An optional human-readable description of the schema. - schema: - type: object - additionalProperties: true - description: A JSON Schema object describing the desired output shape. - strict: - type: boolean - default: true - description: | - When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. PlatformChatCreateRequest: type: object additionalProperties: false required: - input example: - input: Summarize our parental leave policy as JSON. - text: - format: - type: JSON_SCHEMA - name: policy_summary - schema: - type: object - properties: - eligible_employees: - type: string - duration_weeks: - type: integer - required: - - eligible_employees - - duration_weeks - strict: true + input: Summarize our parental leave policy. properties: input: description: | @@ -9932,18 +9930,6 @@ components: minLength: 1 description: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. - text: - type: object - additionalProperties: false - description: | - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - properties: - format: - description: | - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - oneOf: - - $ref: "#/components/schemas/PlatformChatTextFormat" - - $ref: "#/components/schemas/PlatformChatJsonSchemaFormat" PlatformChatStreamResponseId: type: string minLength: 1 @@ -9963,12 +9949,6 @@ components: - OUTPUT_TEXT text: type: string - structured_output: - type: - - object - - "null" - description: | - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. annotations: type: array items: @@ -11144,6 +11124,158 @@ components: type: string minLength: 1 description: Platform-generated request ID for support correlation. + PlatformSearchEnumerationInclude: + type: string + description: Optional document reference projection. + enum: + - SNIPPETS + x-enumDescriptions: + SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + x-speakeasy-enum-descriptions: + SNIPPETS: Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + PlatformSearchEnumerationRequest: + type: object + additionalProperties: false + description: | + Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. + example: + query: amoxicillin + datasources: + - gdrive + page_size: 500 + properties: + query: + type: string + minLength: 1 + description: | + The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + datasources: + type: array + minItems: 1 + items: + type: string + minLength: 1 + description: | + Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + filters: + type: array + minItems: 1 + items: + $ref: "#/components/schemas/PlatformFilter" + description: | + Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + time_range: + $ref: "#/components/schemas/PlatformTimeRange" + page_size: + type: integer + minimum: 1 + maximum: 1000 + default: 100 + description: Number of results to return per page. + cursor: + type: + - string + - "null" + description: | + Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + include: + type: array + minItems: 1 + uniqueItems: true + items: + $ref: "#/components/schemas/PlatformSearchEnumerationInclude" + description: | + Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + PlatformDocumentReference: + type: object + additionalProperties: false + required: + - document_id + - url + - title + - datasource + properties: + document_id: + type: string + minLength: 1 + description: | + Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + example: doc_123 + url: + type: string + format: uri + minLength: 1 + description: Canonical URL of the result. + example: https://docs.google.com/spreadsheets/d/abc + title: + type: string + minLength: 1 + description: Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. + example: Amoxicillin inventory + datasource: + type: string + minLength: 1 + description: The datasource this result originates from. + example: gdrive + document_type: + type: + - string + - "null" + minLength: 1 + description: The document type within the datasource. + example: spreadsheet + creator: + $ref: "#/components/schemas/PlatformPersonReference" + owner: + $ref: "#/components/schemas/PlatformPersonReference" + updated_at: + type: + - string + - "null" + format: date-time + description: When the result was last modified. + created_at: + type: + - string + - "null" + format: date-time + description: When the result was created. + snippets: + type: array + items: + type: string + minLength: 1 + description: | + Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + example: + - Amoxicillin 500mg inventory was last counted on... + PlatformSearchEnumerationResponse: + type: object + additionalProperties: false + required: + - results + - has_more + - next_cursor + - request_id + properties: + results: + type: array + items: + $ref: "#/components/schemas/PlatformDocumentReference" + description: Document references at this cursor position. + has_more: + type: boolean + description: Indicates whether additional pages of results are available. + next_cursor: + type: + - string + - "null" + description: | + Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + request_id: + type: string + minLength: 1 + description: Platform-generated request ID for support correlation. PlatformPerMemberSettings: type: object additionalProperties: false @@ -14288,6 +14420,8 @@ components: - CONVERTED_TO_DRAFT - WEBHOOK_UPDATED - WEBHOOK_CREATED + - CLOSED + - COMMENT_ADDED x-enumDescriptions: CREATED: The document was created. UPDATED: The document was updated. @@ -14303,6 +14437,8 @@ components: CONVERTED_TO_DRAFT: The item was converted back to a draft. WEBHOOK_UPDATED: The source system sent a webhook update. WEBHOOK_CREATED: The source system sent a webhook creation event. + CLOSED: The item was closed. + COMMENT_ADDED: A comment was added to the item. x-speakeasy-enum-descriptions: CREATED: The document was created. UPDATED: The document was updated. @@ -14318,6 +14454,8 @@ components: CONVERTED_TO_DRAFT: The item was converted back to a draft. WEBHOOK_UPDATED: The source system sent a webhook update. WEBHOOK_CREATED: The source system sent a webhook creation event. + CLOSED: The item was closed. + COMMENT_ADDED: A comment was added to the item. PlatformTriggerEvent: type: object required: diff --git a/.speakeasy/tests.arazzo.yaml b/.speakeasy/tests.arazzo.yaml index a63fecee..d71c43d7 100644 --- a/.speakeasy/tests.arazzo.yaml +++ b/.speakeasy/tests.arazzo.yaml @@ -164941,24 +164941,9 @@ workflows: requestBody: contentType: application/json payload: - input: Summarize our parental leave policy as JSON. + input: Summarize our parental leave policy. store: true stream: false - text: - format: - name: policy_summary - schema: - properties: - duration_weeks: - type: integer - eligible_employees: - type: string - required: - - eligible_employees - - duration_weeks - type: object - strict: true - type: JSON_SCHEMA successCriteria: - condition: $statusCode == 200 - condition: $response.header.Content-Type == application/json @@ -165690,3 +165675,23 @@ workflows: type: simple x-speakeasy-test-group: documents x-speakeasy-test-rebuild: true + - workflowId: platform-search-enumeration + steps: + - stepId: test + operationId: platform-search-enumeration + requestBody: + contentType: application/json + payload: + datasources: + - gdrive + page_size: 500 + query: amoxicillin + successCriteria: + - condition: $statusCode == 200 + - condition: $response.header.Content-Type == application/json + - context: $response.body + condition: | + {"results":[],"has_more":false,"next_cursor":null,"request_id":""} + type: simple + x-speakeasy-test-group: search + x-speakeasy-test-rebuild: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 4c0bb8a4..f5720478 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.808.1 +speakeasyVersion: 1.809.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:509e25a8ae0bbaf6e23c95c58de651349216086a13278a3792b2e3f8be68fc6b - sourceBlobDigest: sha256:15ce4e757fd8eb3c2a3857cb15740c718b57c969342223ccc0de7437748a8609 + sourceRevisionDigest: sha256:872476237575ccc7e2720d7a31a66fc38ec7c561cfd2e33459cf33e1a45d9949 + sourceBlobDigest: sha256:7d5c308c3a1ba3c2dc2486a0006d48995e1618f3be0673c7e9422fd5eb582f2a tags: - latest Glean Client API: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:509e25a8ae0bbaf6e23c95c58de651349216086a13278a3792b2e3f8be68fc6b - sourceBlobDigest: sha256:15ce4e757fd8eb3c2a3857cb15740c718b57c969342223ccc0de7437748a8609 + sourceRevisionDigest: sha256:872476237575ccc7e2720d7a31a66fc38ec7c561cfd2e33459cf33e1a45d9949 + sourceBlobDigest: sha256:7d5c308c3a1ba3c2dc2486a0006d48995e1618f3be0673c7e9422fd5eb582f2a codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:afa74f964f8738e3e77ad38f0945241ac4840ba055c56c9f7b2b62275020937d + codeSamplesRevisionDigest: sha256:9d0e45c230b0b42872cd2ed14e8a2dee57fe89569e7162989f676f0607269608 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 3a948e94..dc068bf6 100644 --- a/README.md +++ b/README.md @@ -532,6 +532,7 @@ For more information on obtaining the appropriate token type, please contact you * [query](docs/sdks/search/README.md#query) - Search * [listFilters](docs/sdks/search/README.md#listfilters) - List search filters +* [enumerate](docs/sdks/search/README.md#enumerate) - Enumerate matching documents ### [Skills](docs/sdks/skills/README.md) @@ -737,6 +738,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`indexingPermissionsUpdatePermissions`](docs/sdks/permissions/README.md#updatepermissions) - Update document permissions - [`indexingShortcutsBulkIndex`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`indexingShortcutsUpload`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +- [`searchEnumerate`](docs/sdks/search/README.md#enumerate) - Enumerate matching documents - [`searchListFilters`](docs/sdks/search/README.md#listfilters) - List search filters - [`searchQuery`](docs/sdks/search/README.md#query) - Search - [`skillsCreate`](docs/sdks/skills/README.md#create) - Create skill @@ -952,6 +954,7 @@ To learn about this feature and how to get started, check - [`useIndexingPermissionsUpdatePermissionsMutation`](docs/sdks/permissions/README.md#updatepermissions) - Update document permissions - [`useIndexingShortcutsBulkIndexMutation`](docs/sdks/indexingshortcuts/README.md#bulkindex) - Bulk index external shortcuts - [`useIndexingShortcutsUploadMutation`](docs/sdks/indexingshortcuts/README.md#upload) - Upload shortcuts +- [`useSearchEnumerateMutation`](docs/sdks/search/README.md#enumerate) - Enumerate matching documents - [`useSearchListFilters`](docs/sdks/search/README.md#listfilters) - List search filters - [`useSearchQueryMutation`](docs/sdks/search/README.md#query) - Search - [`useSkillsCreateMutation`](docs/sdks/skills/README.md#create) - Create skill @@ -1013,29 +1016,7 @@ const glean = new Glean({ async function run() { const result = await glean.chat.createStream({ - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); for await (const event of result) { diff --git a/RELEASES.md b/RELEASES.md index dc5e4e62..da0ad77d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1108,4 +1108,14 @@ Based on: ### Generated - [typescript v0.20.22] . ### Releases -- [NPM v0.20.22] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.22 - . \ No newline at end of file +- [NPM v0.20.22] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.22 - . + +## 2026-11-16 11:50:15 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.809.0 (2.961.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.20.23] . +### Releases +- [NPM v0.20.23] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.23 - . \ No newline at end of file diff --git a/docs/models/components/platformchatjsonschemaformat.md b/docs/models/components/platformchatjsonschemaformat.md deleted file mode 100644 index d84f3bb5..00000000 --- a/docs/models/components/platformchatjsonschemaformat.md +++ /dev/null @@ -1,29 +0,0 @@ -# PlatformChatJsonSchemaFormat - -Constrains the assistant response to a caller-supplied JSON Schema. - -## Example Usage - -```typescript -import { PlatformChatJsonSchemaFormat } from "@gleanwork/api-client/models/components"; - -let value: PlatformChatJsonSchemaFormat = { - type: "JSON_SCHEMA", - name: "", - schema: { - "key": "", - "key1": "", - "key2": "", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| `type` | *"JSON_SCHEMA"* | :heavy_check_mark: | Discriminator. Must be JSON_SCHEMA. | -| `name` | *string* | :heavy_check_mark: | A stable identifier for the schema. | -| `description` | *string* | :heavy_minus_sign: | An optional human-readable description of the schema. | -| `schema` | Record | :heavy_check_mark: | A JSON Schema object describing the desired output shape. | -| `strict` | *boolean* | :heavy_minus_sign: | When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true.
| \ No newline at end of file diff --git a/docs/models/components/platformchatoutputtextcontent.md b/docs/models/components/platformchatoutputtextcontent.md index c2c05ca2..9f1c7036 100644 --- a/docs/models/components/platformchatoutputtextcontent.md +++ b/docs/models/components/platformchatoutputtextcontent.md @@ -13,9 +13,8 @@ let value: PlatformChatOutputTextContent = { ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | -| `text` | *string* | :heavy_check_mark: | N/A | -| `structuredOutput` | [components.StructuredOutput](../../models/components/structuredoutput.md) | :heavy_minus_sign: | Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`.
| -| `annotations` | [components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `type` | [components.PlatformChatOutputTextContentType](../../models/components/platformchatoutputtextcontenttype.md) | :heavy_check_mark: | N/A | +| `text` | *string* | :heavy_check_mark: | N/A | +| `annotations` | [components.PlatformChatCitationAnnotation](../../models/components/platformchatcitationannotation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/platformchattextformat.md b/docs/models/components/platformchattextformat.md deleted file mode 100644 index 9b27fffc..00000000 --- a/docs/models/components/platformchattextformat.md +++ /dev/null @@ -1,19 +0,0 @@ -# PlatformChatTextFormat - -Unconstrained plain-text assistant output. - -## Example Usage - -```typescript -import { PlatformChatTextFormat } from "@gleanwork/api-client/models/components"; - -let value: PlatformChatTextFormat = { - type: "TEXT", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `type` | *"TEXT"* | :heavy_check_mark: | Discriminator. Must be TEXT. | \ No newline at end of file diff --git a/docs/models/components/platformdocumentreference.md b/docs/models/components/platformdocumentreference.md new file mode 100644 index 00000000..7a260c3e --- /dev/null +++ b/docs/models/components/platformdocumentreference.md @@ -0,0 +1,33 @@ +# PlatformDocumentReference + +## Example Usage + +```typescript +import { PlatformDocumentReference } from "@gleanwork/api-client/models/components"; + +let value: PlatformDocumentReference = { + document_id: "doc_123", + url: "https://docs.google.com/spreadsheets/d/abc", + title: "Amoxicillin inventory", + datasource: "gdrive", + document_type: "spreadsheet", + snippets: [ + "Amoxicillin 500mg inventory was last counted on...", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `documentId` | *string* | :heavy_check_mark: | Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`.
| doc_123 | +| `url` | *string* | :heavy_check_mark: | Canonical URL of the result. | https://docs.google.com/spreadsheets/d/abc | +| `title` | *string* | :heavy_check_mark: | Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. | Amoxicillin inventory | +| `datasource` | *string* | :heavy_check_mark: | The datasource this result originates from. | gdrive | +| `documentType` | *string* | :heavy_minus_sign: | The document type within the datasource. | spreadsheet | +| `creator` | [components.PlatformPersonReference](../../models/components/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `owner` | [components.PlatformPersonReference](../../models/components/platformpersonreference.md) | :heavy_minus_sign: | A lightweight reference to a person, used where a payload merely points at someone. | | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | When the result was last modified. | | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | When the result was created. | | +| `snippets` | *string*[] | :heavy_minus_sign: | Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set.
| [
"Amoxicillin 500mg inventory was last counted on..."
] | \ No newline at end of file diff --git a/docs/models/components/platformsearchenumerationinclude.md b/docs/models/components/platformsearchenumerationinclude.md new file mode 100644 index 00000000..ba27c5c9 --- /dev/null +++ b/docs/models/components/platformsearchenumerationinclude.md @@ -0,0 +1,17 @@ +# PlatformSearchEnumerationInclude + +Optional document reference projection. + +## Example Usage + +```typescript +import { PlatformSearchEnumerationInclude } from "@gleanwork/api-client/models/components"; + +let value: PlatformSearchEnumerationInclude = "SNIPPETS"; +``` + +## Values + +```typescript +"SNIPPETS" +``` \ No newline at end of file diff --git a/docs/models/components/platformsearchenumerationrequest.md b/docs/models/components/platformsearchenumerationrequest.md new file mode 100644 index 00000000..6e834d70 --- /dev/null +++ b/docs/models/components/platformsearchenumerationrequest.md @@ -0,0 +1,30 @@ +# PlatformSearchEnumerationRequest + +Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. + + +## Example Usage + +```typescript +import { PlatformSearchEnumerationRequest } from "@gleanwork/api-client/models/components"; + +let value: PlatformSearchEnumerationRequest = { + query: "amoxicillin", + datasources: [ + "gdrive", + ], + page_size: 500, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `query` | *string* | :heavy_minus_sign: | The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`.
| +| `datasources` | *string*[] | :heavy_minus_sign: | Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`.
| +| `filters` | [components.PlatformFilter](../../models/components/platformfilter.md)[] | :heavy_minus_sign: | Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources.
| +| `timeRange` | [components.PlatformTimeRange](../../models/components/platformtimerange.md) | :heavy_minus_sign: | Filter results to those last updated within this range. | +| `pageSize` | *number* | :heavy_minus_sign: | Number of results to return per page. | +| `cursor` | *string* | :heavy_minus_sign: | Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection.
| +| `include` | [components.PlatformSearchEnumerationInclude](../../models/components/platformsearchenumerationinclude.md)[] | :heavy_minus_sign: | Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned.
| \ No newline at end of file diff --git a/docs/models/components/platformsearchenumerationresponse.md b/docs/models/components/platformsearchenumerationresponse.md new file mode 100644 index 00000000..e6835796 --- /dev/null +++ b/docs/models/components/platformsearchenumerationresponse.md @@ -0,0 +1,34 @@ +# PlatformSearchEnumerationResponse + +## Example Usage + +```typescript +import { PlatformSearchEnumerationResponse } from "@gleanwork/api-client/models/components"; + +let value: PlatformSearchEnumerationResponse = { + results: [ + { + document_id: "doc_123", + url: "https://docs.google.com/spreadsheets/d/abc", + title: "Amoxicillin inventory", + datasource: "gdrive", + document_type: "spreadsheet", + snippets: [ + "Amoxicillin 500mg inventory was last counted on...", + ], + }, + ], + has_more: false, + next_cursor: "", + request_id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `results` | [components.PlatformDocumentReference](../../models/components/platformdocumentreference.md)[] | :heavy_check_mark: | Document references at this cursor position. | +| `hasMore` | *boolean* | :heavy_check_mark: | Indicates whether additional pages of results are available. | +| `nextCursor` | *string* | :heavy_check_mark: | Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false.
| +| `requestId` | *string* | :heavy_check_mark: | Platform-generated request ID for support correlation. | \ No newline at end of file diff --git a/docs/models/components/platformtriggereventreason.md b/docs/models/components/platformtriggereventreason.md index 17f67d6e..d1542a68 100644 --- a/docs/models/components/platformtriggereventreason.md +++ b/docs/models/components/platformtriggereventreason.md @@ -15,5 +15,5 @@ let value: PlatformTriggerEventReason = "REVIEW_REQUESTED"; ## Values ```typescript -"CREATED" | "UPDATED" | "DELETED" | "MEETS_CONDITION" | "ASSIGNED" | "UNASSIGNED" | "LABELED" | "UNLABELED" | "REVIEW_REQUESTED" | "REVIEW_REQUEST_REMOVED" | "READY_FOR_REVIEW" | "CONVERTED_TO_DRAFT" | "WEBHOOK_UPDATED" | "WEBHOOK_CREATED" | Unrecognized +"CREATED" | "UPDATED" | "DELETED" | "MEETS_CONDITION" | "ASSIGNED" | "UNASSIGNED" | "LABELED" | "UNLABELED" | "REVIEW_REQUESTED" | "REVIEW_REQUEST_REMOVED" | "READY_FOR_REVIEW" | "CONVERTED_TO_DRAFT" | "WEBHOOK_UPDATED" | "WEBHOOK_CREATED" | "CLOSED" | "COMMENT_ADDED" | Unrecognized ``` \ No newline at end of file diff --git a/docs/models/components/structuredoutput.md b/docs/models/components/structuredoutput.md deleted file mode 100644 index fa655cfa..00000000 --- a/docs/models/components/structuredoutput.md +++ /dev/null @@ -1,17 +0,0 @@ -# StructuredOutput - -Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - - -## Example Usage - -```typescript -import { StructuredOutput } from "@gleanwork/api-client/models/components"; - -let value: StructuredOutput = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/operations/platformchatcreateformat.md b/docs/models/operations/platformchatcreateformat.md deleted file mode 100644 index 0079624b..00000000 --- a/docs/models/operations/platformchatcreateformat.md +++ /dev/null @@ -1,30 +0,0 @@ -# PlatformChatCreateFormat - -Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - - -## Supported Types - -### `components.PlatformChatTextFormat` - -```typescript -const value: components.PlatformChatTextFormat = { - type: "TEXT", -}; -``` - -### `components.PlatformChatJsonSchemaFormat` - -```typescript -const value: components.PlatformChatJsonSchemaFormat = { - type: "JSON_SCHEMA", - name: "", - schema: { - "key": "", - "key1": "", - "key2": "", - }, -}; -``` - diff --git a/docs/models/operations/platformchatcreaterequest.md b/docs/models/operations/platformchatcreaterequest.md index 6e7d38f1..843bd336 100644 --- a/docs/models/operations/platformchatcreaterequest.md +++ b/docs/models/operations/platformchatcreaterequest.md @@ -6,38 +6,15 @@ import { PlatformChatCreateRequest } from "@gleanwork/api-client/models/operations"; let value: PlatformChatCreateRequest = { - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *operations.PlatformChatCreateInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *false* | :heavy_minus_sign: | N/A | -| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [operations.PlatformChatCreateText](../../models/operations/platformchatcreatetext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | *operations.PlatformChatCreateInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *false* | :heavy_minus_sign: | N/A | +| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamformat.md b/docs/models/operations/platformchatcreatestreamformat.md deleted file mode 100644 index acb9a86b..00000000 --- a/docs/models/operations/platformchatcreatestreamformat.md +++ /dev/null @@ -1,30 +0,0 @@ -# PlatformChatCreateStreamFormat - -Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - - - -## Supported Types - -### `components.PlatformChatTextFormat` - -```typescript -const value: components.PlatformChatTextFormat = { - type: "TEXT", -}; -``` - -### `components.PlatformChatJsonSchemaFormat` - -```typescript -const value: components.PlatformChatJsonSchemaFormat = { - type: "JSON_SCHEMA", - name: "", - schema: { - "key": "", - "key1": "", - "key2": "", - }, -}; -``` - diff --git a/docs/models/operations/platformchatcreatestreamrequest.md b/docs/models/operations/platformchatcreatestreamrequest.md index d06e7dad..3bd03c23 100644 --- a/docs/models/operations/platformchatcreatestreamrequest.md +++ b/docs/models/operations/platformchatcreatestreamrequest.md @@ -6,38 +6,15 @@ import { PlatformChatCreateStreamRequest } from "@gleanwork/api-client/models/operations"; let value: PlatformChatCreateStreamRequest = { - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `input` | *operations.PlatformChatCreateStreamInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| -| `stream` | *true* | :heavy_minus_sign: | N/A | -| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| -| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| -| `text` | [operations.PlatformChatCreateStreamText](../../models/operations/platformchatcreatestreamtext.md) | :heavy_minus_sign: | Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true.
| \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------ | +| `input` | *operations.PlatformChatCreateStreamInput* | :heavy_check_mark: | Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`.
| +| `stream` | *true* | :heavy_minus_sign: | N/A | +| `store` | *boolean* | :heavy_minus_sign: | When true (default), persist the interaction and return a `conversation_id`. When false, run ephemerally with no persistence.
| +| `conversationId` | *string* | :heavy_minus_sign: | Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatestreamtext.md b/docs/models/operations/platformchatcreatestreamtext.md deleted file mode 100644 index f7c9444f..00000000 --- a/docs/models/operations/platformchatcreatestreamtext.md +++ /dev/null @@ -1,18 +0,0 @@ -# PlatformChatCreateStreamText - -Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - -## Example Usage - -```typescript -import { PlatformChatCreateStreamText } from "@gleanwork/api-client/models/operations"; - -let value: PlatformChatCreateStreamText = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `format` | *operations.PlatformChatCreateStreamFormat* | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/models/operations/platformchatcreatetext.md b/docs/models/operations/platformchatcreatetext.md deleted file mode 100644 index 9e53fb99..00000000 --- a/docs/models/operations/platformchatcreatetext.md +++ /dev/null @@ -1,18 +0,0 @@ -# PlatformChatCreateText - -Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - - -## Example Usage - -```typescript -import { PlatformChatCreateText } from "@gleanwork/api-client/models/operations"; - -let value: PlatformChatCreateText = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | -| `format` | *operations.PlatformChatCreateFormat* | :heavy_minus_sign: | Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema.
| \ No newline at end of file diff --git a/docs/sdks/chat/README.md b/docs/sdks/chat/README.md index 44ed532c..c4938aa0 100644 --- a/docs/sdks/chat/README.md +++ b/docs/sdks/chat/README.md @@ -25,29 +25,7 @@ const glean = new Glean({ async function run() { const result = await glean.chat.create({ - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); console.log(result); @@ -72,29 +50,7 @@ const glean = new GleanCore({ async function run() { const res = await chatCreate(glean, { - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); if (res.ok) { const { value: result } = res; @@ -255,29 +211,7 @@ const glean = new Glean({ async function run() { const result = await glean.chat.createStream({ - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); for await (const event of result) { @@ -304,29 +238,7 @@ const glean = new GleanCore({ async function run() { const res = await chatCreateStream(glean, { - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "type": "object", - "properties": { - "eligible_employees": { - "type": "string", - }, - "duration_weeks": { - "type": "integer", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); if (res.ok) { const { value: result } = res; diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index bb866698..93726a1a 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -6,6 +6,7 @@ * [query](#query) - Search * [listFilters](#listfilters) - List search filters +* [enumerate](#enumerate) - Enumerate matching documents ## query @@ -201,4 +202,107 @@ import { | --------------------------------- | --------------------------------- | --------------------------------- | | errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file +| errors.GleanError | 4XX, 5XX | \*/\* | + +## enumerate + +Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. +Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. +A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + + +### 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.search.enumerate({ + query: "amoxicillin", + datasources: [ + "gdrive", + ], + page_size: 500, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { GleanCore } from "@gleanwork/api-client/core.js"; +import { searchEnumerate } from "@gleanwork/api-client/funcs/searchEnumerate.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 searchEnumerate(glean, { + query: "amoxicillin", + datasources: [ + "gdrive", + ], + page_size: 500, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("searchEnumerate 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. + useSearchEnumerateMutation +} from "@gleanwork/api-client/react-query/searchEnumerate.js"; +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.PlatformSearchEnumerationRequest](../../models/components/platformsearchenumerationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `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.PlatformSearchEnumerationResponse](../../models/components/platformsearchenumerationresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 413, 422, 429 | application/problem+json | +| errors.PlatformProblemDetailError | 500, 503 | application/problem+json | +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/package-lock.json b/examples/package-lock.json index 9f8c0b04..f378e0c4 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@gleanwork/api-client", - "version": "0.20.22", + "version": "0.20.23", "dependencies": { "zod": "^3.25.0 || ^4.6.6" }, diff --git a/jsr.json b/jsr.json index c2071996..9c098943 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.20.22", + "version": "0.20.23", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 7aa30fe6..f7110462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.20.22", + "version": "0.20.23", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.20.22", + "version": "0.20.23", "dependencies": { "zod": "^3.25.0 || ^4.6.6" }, diff --git a/package.json b/package.json index 24feadd0..30f1c410 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.20.22", + "version": "0.20.23", "author": "Speakeasy", "tshy": { "sourceDialects": [ diff --git a/src/__tests__/chat.test.ts b/src/__tests__/chat.test.ts index fd4c0cea..d597d24b 100644 --- a/src/__tests__/chat.test.ts +++ b/src/__tests__/chat.test.ts @@ -17,29 +17,7 @@ test("Chat Platform Chat Create", async () => { }); const result = await glean.chat.create({ - input: "Summarize our parental leave policy as JSON.", - text: { - format: { - type: "JSON_SCHEMA", - name: "policy_summary", - schema: { - "properties": { - "duration_weeks": { - "type": "integer", - }, - "eligible_employees": { - "type": "string", - }, - }, - "required": [ - "eligible_employees", - "duration_weeks", - ], - "type": "object", - }, - strict: true, - }, - }, + input: "Summarize our parental leave policy.", }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/messages.test.ts b/src/__tests__/messages.test.ts index f3905434..a4785e31 100644 --- a/src/__tests__/messages.test.ts +++ b/src/__tests__/messages.test.ts @@ -20,7 +20,7 @@ test("Messages Messages", async () => { idType: "CONVERSATION_ID", id: "", timestampMillis: 558834, - datasource: "FACEBOOKWORKPLACE", + datasource: "SLACK", }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/mockserver/internal/handler/generated_handlers.go b/src/__tests__/mockserver/internal/handler/generated_handlers.go index 5b5fb53b..f400575d 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -95,6 +95,7 @@ func GeneratedHandlers(ctx context.Context, dir *logging.HTTPFileDirectory, rt * NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/rotatetoken", pathPostAPIIndexV1Rotatetoken(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/index/v1/updatepermissions", pathPostAPIIndexV1Updatepermissions(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/search", pathPostAPISearch(dir, rt)), + NewGeneratedHandler(ctx, http.MethodPost, "/api/search/enumeration", pathPostAPISearchEnumeration(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills", pathPostAPISkills(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills/import", pathPostAPISkillsImport(dir, rt)), NewGeneratedHandler(ctx, http.MethodPost, "/api/skills/sources/preview", pathPostAPISkillsSourcesPreview(dir, rt)), diff --git a/src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go b/src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go new file mode 100644 index 00000000..07cddab8 --- /dev/null +++ b/src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go @@ -0,0 +1,73 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: c504bfd60b2c + +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 pathPostAPISearchEnumeration(dir *logging.HTTPFileDirectory, rt *tracking.RequestTracker) http.HandlerFunc { + return func(w http.ResponseWriter, req *http.Request) { + test := req.Header.Get("x-speakeasy-test-name") + instanceID := req.Header.Get("x-speakeasy-test-instance-id") + + count := rt.GetRequestCount(test, instanceID) + + switch fmt.Sprintf("%s[%d]", test, count) { + case "platform-search-enumeration[0]": + dir.HandlerFunc("platform-search-enumeration", testPlatformSearchEnumerationPlatformSearchEnumeration0)(w, req) + default: + http.Error(w, fmt.Sprintf("Unknown test: %s[%d]", test, count), http.StatusBadRequest) + } + } +} + +func testPlatformSearchEnumerationPlatformSearchEnumeration0(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.PlatformSearchEnumerationResponse = &components.PlatformSearchEnumerationResponse{ + Results: []components.PlatformDocumentReference{}, + HasMore: false, + NextCursor: nil, + RequestID: "", + } + respBodyBytes, err := utils.MarshalJSON(respBody, "", true) + + if err != nil { + http.Error( + w, + "Unable to encode response body as JSON: "+err.Error(), + http.StatusInternalServerError, + ) + return + } + w.Header().Set("Content-Type", "application/json") + w.WriteHeader(http.StatusOK) + _, _ = w.Write(respBodyBytes) +} diff --git a/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go index 673b01bb..a4b19376 100644 --- a/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go +++ b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1createcollection.go @@ -57,14 +57,14 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ operations.ResponseBody2{ Collection: &components.Collection{ Name: "", - Description: "whole busily jive hawk gee basic minus hence", + Description: "motionless whenever paintwork import over cuckoo", AddedRoles: []components.UserRoleSpecification{ components.UserRoleSpecification{ Person: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleAnswerModerator, + Role: components.UserRoleOwner, }, }, RemovedRoles: []components.UserRoleSpecification{ @@ -91,7 +91,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 158969, + ID: 363711, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -102,7 +102,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, Items: []components.CollectionItem{ components.CollectionItem{ - CollectionID: 110375, + CollectionID: 570197, CreatedBy: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -279,13 +279,13 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Name: "George Clooney", ObfuscatedID: "abc123", }, - Role: components.UserRoleEditor, + Role: components.UserRoleAnswerModerator, }, }, }, Collection: &components.Collection{ Name: "", - Description: "wedge colorfully orientate rally", + Description: "athwart skateboard newsstand farm bourgeoisie ah how elliptical aha well-to-do", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -301,7 +301,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 131797, + ID: 643990, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -313,7 +313,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ Children: []components.Collection{ components.Collection{ Name: "", - Description: "outside yippee sidetrack mature regularly mouser inject worth", + Description: "woot purse salty even as advanced", AudienceFilters: []components.FacetFilter{ components.FacetFilter{ FieldName: types.String("type"), @@ -329,7 +329,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ID: 149448, + ID: 359978, Creator: &components.Person{ Name: "George Clooney", ObfuscatedID: "abc123", @@ -341,7 +341,7 @@ func testCreatecollectionCreatecollection0(w http.ResponseWriter, req *http.Requ }, }, }, - ItemType: components.CollectionItemItemTypeCollection, + ItemType: components.CollectionItemItemTypeURL, }, }, }, diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go deleted file mode 100644 index af91cf87..00000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformchatjsonschemaformat.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 894f1f95fef3 - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PlatformChatJSONSchemaFormatType - Discriminator. Must be JSON_SCHEMA. -type PlatformChatJSONSchemaFormatType string - -const ( - PlatformChatJSONSchemaFormatTypeJSONSchema PlatformChatJSONSchemaFormatType = "JSON_SCHEMA" -) - -func (e PlatformChatJSONSchemaFormatType) ToPointer() *PlatformChatJSONSchemaFormatType { - return &e -} -func (e *PlatformChatJSONSchemaFormatType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "JSON_SCHEMA": - *e = PlatformChatJSONSchemaFormatType(v) - return nil - default: - return fmt.Errorf("invalid value for PlatformChatJSONSchemaFormatType: %v", v) - } -} - -// PlatformChatJSONSchemaFormat - Constrains the assistant response to a caller-supplied JSON Schema. -type PlatformChatJSONSchemaFormat struct { - // Discriminator. Must be JSON_SCHEMA. - Type PlatformChatJSONSchemaFormatType `json:"type"` - // A stable identifier for the schema. - Name string `json:"name"` - // An optional human-readable description of the schema. - Description *string `json:"description,omitempty"` - // A JSON Schema object describing the desired output shape. - Schema map[string]any `json:"schema"` - // When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. - // - Strict *bool `default:"true" json:"strict"` -} - -func (p PlatformChatJSONSchemaFormat) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PlatformChatJSONSchemaFormat) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type", "name", "schema"}); err != nil { - return err - } - return nil -} - -func (o *PlatformChatJSONSchemaFormat) GetType() PlatformChatJSONSchemaFormatType { - if o == nil { - return PlatformChatJSONSchemaFormatType("") - } - return o.Type -} - -func (o *PlatformChatJSONSchemaFormat) GetName() string { - if o == nil { - return "" - } - return o.Name -} - -func (o *PlatformChatJSONSchemaFormat) GetDescription() *string { - if o == nil { - return nil - } - return o.Description -} - -func (o *PlatformChatJSONSchemaFormat) GetSchema() map[string]any { - if o == nil { - return map[string]any{} - } - return o.Schema -} - -func (o *PlatformChatJSONSchemaFormat) GetStrict() *bool { - if o == nil { - return nil - } - return o.Strict -} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go index 94d84904..7b5437eb 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformchatoutputtextcontent.go @@ -6,7 +6,6 @@ package components import ( "encoding/json" "fmt" - "mockserver/internal/sdk/optionalnullable" "mockserver/internal/sdk/utils" ) @@ -33,28 +32,10 @@ func (e *PlatformChatOutputTextContentType) UnmarshalJSON(data []byte) error { } } -// StructuredOutput - Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. -type StructuredOutput struct { -} - -func (s StructuredOutput) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(s, "", false) -} - -func (s *StructuredOutput) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &s, "", false, nil); err != nil { - return err - } - return nil -} - type PlatformChatOutputTextContent struct { - Type PlatformChatOutputTextContentType `json:"type"` - Text string `json:"text"` - // Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - // - StructuredOutput optionalnullable.OptionalNullable[StructuredOutput] `json:"structured_output,omitempty"` - Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` + Type PlatformChatOutputTextContentType `json:"type"` + Text string `json:"text"` + Annotations []PlatformChatCitationAnnotation `json:"annotations,omitempty"` } func (p PlatformChatOutputTextContent) MarshalJSON() ([]byte, error) { @@ -82,13 +63,6 @@ func (o *PlatformChatOutputTextContent) GetText() string { return o.Text } -func (o *PlatformChatOutputTextContent) GetStructuredOutput() optionalnullable.OptionalNullable[StructuredOutput] { - if o == nil { - return nil - } - return o.StructuredOutput -} - func (o *PlatformChatOutputTextContent) GetAnnotations() []PlatformChatCitationAnnotation { if o == nil { return nil diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go b/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go deleted file mode 100644 index 580903ad..00000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformchattextformat.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. -// @generated-id: 26e47a3c7596 - -package components - -import ( - "encoding/json" - "fmt" - "mockserver/internal/sdk/utils" -) - -// PlatformChatTextFormatType - Discriminator. Must be TEXT. -type PlatformChatTextFormatType string - -const ( - PlatformChatTextFormatTypeText PlatformChatTextFormatType = "TEXT" -) - -func (e PlatformChatTextFormatType) ToPointer() *PlatformChatTextFormatType { - return &e -} -func (e *PlatformChatTextFormatType) UnmarshalJSON(data []byte) error { - var v string - if err := json.Unmarshal(data, &v); err != nil { - return err - } - switch v { - case "TEXT": - *e = PlatformChatTextFormatType(v) - return nil - default: - return fmt.Errorf("invalid value for PlatformChatTextFormatType: %v", v) - } -} - -// PlatformChatTextFormat - Unconstrained plain-text assistant output. -type PlatformChatTextFormat struct { - // Discriminator. Must be TEXT. - Type PlatformChatTextFormatType `json:"type"` -} - -func (p PlatformChatTextFormat) MarshalJSON() ([]byte, error) { - return utils.MarshalJSON(p, "", false) -} - -func (p *PlatformChatTextFormat) UnmarshalJSON(data []byte) error { - if err := utils.UnmarshalJSON(data, &p, "", false, []string{"type"}); err != nil { - return err - } - return nil -} - -func (o *PlatformChatTextFormat) GetType() PlatformChatTextFormatType { - if o == nil { - return PlatformChatTextFormatType("") - } - return o.Type -} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go b/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go new file mode 100644 index 00000000..7b49d044 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: e80c0c41df88 + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" + "time" +) + +type PlatformDocumentReference struct { + // Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + // + DocumentID string `json:"document_id"` + // Canonical URL of the result. + URL string `json:"url"` + // Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. + Title string `json:"title"` + // The datasource this result originates from. + Datasource string `json:"datasource"` + // The document type within the datasource. + DocumentType optionalnullable.OptionalNullable[string] `json:"document_type,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Creator *PlatformPersonReference `json:"creator,omitempty"` + // A lightweight reference to a person, used where a payload merely points at someone. + Owner *PlatformPersonReference `json:"owner,omitempty"` + // When the result was last modified. + UpdatedAt optionalnullable.OptionalNullable[time.Time] `json:"updated_at,omitempty"` + // When the result was created. + CreatedAt optionalnullable.OptionalNullable[time.Time] `json:"created_at,omitempty"` + // Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + // + Snippets []string `json:"snippets,omitempty"` +} + +func (p PlatformDocumentReference) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformDocumentReference) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, []string{"document_id", "url", "title", "datasource"}); err != nil { + return err + } + return nil +} + +func (o *PlatformDocumentReference) GetDocumentID() string { + if o == nil { + return "" + } + return o.DocumentID +} + +func (o *PlatformDocumentReference) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *PlatformDocumentReference) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *PlatformDocumentReference) GetDatasource() string { + if o == nil { + return "" + } + return o.Datasource +} + +func (o *PlatformDocumentReference) GetDocumentType() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.DocumentType +} + +func (o *PlatformDocumentReference) GetCreator() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Creator +} + +func (o *PlatformDocumentReference) GetOwner() *PlatformPersonReference { + if o == nil { + return nil + } + return o.Owner +} + +func (o *PlatformDocumentReference) GetUpdatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *PlatformDocumentReference) GetCreatedAt() optionalnullable.OptionalNullable[time.Time] { + if o == nil { + return nil + } + return o.CreatedAt +} + +func (o *PlatformDocumentReference) GetSnippets() []string { + if o == nil { + return nil + } + return o.Snippets +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go new file mode 100644 index 00000000..99b23d22 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: dac298c4cccb + +package components + +import ( + "encoding/json" + "fmt" +) + +// PlatformSearchEnumerationInclude - Optional document reference projection. +type PlatformSearchEnumerationInclude string + +const ( + PlatformSearchEnumerationIncludeSnippets PlatformSearchEnumerationInclude = "SNIPPETS" +) + +func (e PlatformSearchEnumerationInclude) ToPointer() *PlatformSearchEnumerationInclude { + return &e +} +func (e *PlatformSearchEnumerationInclude) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "SNIPPETS": + *e = PlatformSearchEnumerationInclude(v) + return nil + default: + return fmt.Errorf("invalid value for PlatformSearchEnumerationInclude: %v", v) + } +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go new file mode 100644 index 00000000..7177befc --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go @@ -0,0 +1,92 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: a0cf40c6bfa1 + +package components + +import ( + "mockserver/internal/sdk/optionalnullable" + "mockserver/internal/sdk/utils" +) + +// PlatformSearchEnumerationRequest - Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. +type PlatformSearchEnumerationRequest struct { + // The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + // + Query *string `json:"query,omitempty"` + // Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + // + Datasources []string `json:"datasources,omitempty"` + // Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + // + Filters []PlatformFilter `json:"filters,omitempty"` + // Filter results to those last updated within this range. + TimeRange *PlatformTimeRange `json:"time_range,omitempty"` + // Number of results to return per page. + PageSize *int64 `default:"100" json:"page_size"` + // Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + // + Cursor optionalnullable.OptionalNullable[string] `json:"cursor,omitempty"` + // Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + // + Include []PlatformSearchEnumerationInclude `json:"include,omitempty"` +} + +func (p PlatformSearchEnumerationRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PlatformSearchEnumerationRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, nil); err != nil { + return err + } + return nil +} + +func (o *PlatformSearchEnumerationRequest) GetQuery() *string { + if o == nil { + return nil + } + return o.Query +} + +func (o *PlatformSearchEnumerationRequest) GetDatasources() []string { + if o == nil { + return nil + } + return o.Datasources +} + +func (o *PlatformSearchEnumerationRequest) GetFilters() []PlatformFilter { + if o == nil { + return nil + } + return o.Filters +} + +func (o *PlatformSearchEnumerationRequest) GetTimeRange() *PlatformTimeRange { + if o == nil { + return nil + } + return o.TimeRange +} + +func (o *PlatformSearchEnumerationRequest) GetPageSize() *int64 { + if o == nil { + return nil + } + return o.PageSize +} + +func (o *PlatformSearchEnumerationRequest) GetCursor() optionalnullable.OptionalNullable[string] { + if o == nil { + return nil + } + return o.Cursor +} + +func (o *PlatformSearchEnumerationRequest) GetInclude() []PlatformSearchEnumerationInclude { + if o == nil { + return nil + } + return o.Include +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go new file mode 100644 index 00000000..f2c50dfd --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go @@ -0,0 +1,44 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: ba154247063b + +package components + +type PlatformSearchEnumerationResponse struct { + // Document references at this cursor position. + Results []PlatformDocumentReference `json:"results"` + // Indicates whether additional pages of results are available. + HasMore bool `json:"has_more"` + // Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + // + NextCursor *string `json:"next_cursor"` + // Platform-generated request ID for support correlation. + RequestID string `json:"request_id"` +} + +func (o *PlatformSearchEnumerationResponse) GetResults() []PlatformDocumentReference { + if o == nil { + return []PlatformDocumentReference{} + } + return o.Results +} + +func (o *PlatformSearchEnumerationResponse) GetHasMore() bool { + if o == nil { + return false + } + return o.HasMore +} + +func (o *PlatformSearchEnumerationResponse) GetNextCursor() *string { + if o == nil { + return nil + } + return o.NextCursor +} + +func (o *PlatformSearchEnumerationResponse) GetRequestID() string { + if o == nil { + return "" + } + return o.RequestID +} diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventreason.go b/src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventreason.go index 2f9c18de..b05ff0d0 100644 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventreason.go +++ b/src/__tests__/mockserver/internal/sdk/models/components/platformtriggereventreason.go @@ -26,6 +26,8 @@ const ( PlatformTriggerEventReasonConvertedToDraft PlatformTriggerEventReason = "CONVERTED_TO_DRAFT" PlatformTriggerEventReasonWebhookUpdated PlatformTriggerEventReason = "WEBHOOK_UPDATED" PlatformTriggerEventReasonWebhookCreated PlatformTriggerEventReason = "WEBHOOK_CREATED" + PlatformTriggerEventReasonClosed PlatformTriggerEventReason = "CLOSED" + PlatformTriggerEventReasonCommentAdded PlatformTriggerEventReason = "COMMENT_ADDED" ) func (e PlatformTriggerEventReason) ToPointer() *PlatformTriggerEventReason { @@ -64,6 +66,10 @@ func (e *PlatformTriggerEventReason) UnmarshalJSON(data []byte) error { case "WEBHOOK_UPDATED": fallthrough case "WEBHOOK_CREATED": + fallthrough + case "CLOSED": + fallthrough + case "COMMENT_ADDED": *e = PlatformTriggerEventReason(v) return nil default: diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go index 12c116d7..439b883a 100644 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreate.go @@ -4,7 +4,6 @@ package operations import ( - "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -76,120 +75,6 @@ func (u PlatformChatCreateInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateInput: all fields are null") } -type PlatformChatCreateFormatType string - -const ( - PlatformChatCreateFormatTypeText PlatformChatCreateFormatType = "TEXT" - PlatformChatCreateFormatTypeJSONSchema PlatformChatCreateFormatType = "JSON_SCHEMA" -) - -// PlatformChatCreateFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. -type PlatformChatCreateFormat struct { - PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` - PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` - - Type PlatformChatCreateFormatType -} - -func CreatePlatformChatCreateFormatText(text components.PlatformChatTextFormat) PlatformChatCreateFormat { - typ := PlatformChatCreateFormatTypeText - - typStr := components.PlatformChatTextFormatType(typ) - text.Type = typStr - - return PlatformChatCreateFormat{ - PlatformChatTextFormat: &text, - Type: typ, - } -} - -func CreatePlatformChatCreateFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateFormat { - typ := PlatformChatCreateFormatTypeJSONSchema - - typStr := components.PlatformChatJSONSchemaFormatType(typ) - jsonSchema.Type = typStr - - return PlatformChatCreateFormat{ - PlatformChatJSONSchemaFormat: &jsonSchema, - Type: typ, - } -} - -func (u *PlatformChatCreateFormat) UnmarshalJSON(data []byte) error { - - type discriminator struct { - Type string `json:"type"` - } - - dis := new(discriminator) - if err := json.Unmarshal(data, &dis); err != nil { - return fmt.Errorf("could not unmarshal discriminator: %w", err) - } - - switch dis.Type { - case "TEXT": - platformChatTextFormat := new(components.PlatformChatTextFormat) - if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateFormat: %w", string(data), err) - } - - u.PlatformChatTextFormat = platformChatTextFormat - u.Type = PlatformChatCreateFormatTypeText - return nil - case "JSON_SCHEMA": - platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) - if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateFormat: %w", string(data), err) - } - - u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat - u.Type = PlatformChatCreateFormatTypeJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateFormat", string(data)) -} - -func (u PlatformChatCreateFormat) MarshalJSON() ([]byte, error) { - if u.PlatformChatTextFormat != nil { - return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) - } - - if u.PlatformChatJSONSchemaFormat != nil { - return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) - } - - return nil, errors.New("could not marshal union type PlatformChatCreateFormat: all fields are null") -} - -// PlatformChatCreateText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. -type PlatformChatCreateText struct { - // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - // - Format *PlatformChatCreateFormat `json:"format,omitempty"` -} - -func (o *PlatformChatCreateText) GetFormat() *PlatformChatCreateFormat { - if o == nil { - return nil - } - return o.Format -} - -func (o *PlatformChatCreateText) GetFormatText() *components.PlatformChatTextFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatTextFormat - } - return nil -} - -func (o *PlatformChatCreateText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatJSONSchemaFormat - } - return nil -} - type PlatformChatCreateRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -201,9 +86,6 @@ type PlatformChatCreateRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` - // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - // - Text *PlatformChatCreateText `json:"text,omitempty"` } func (p PlatformChatCreateRequest) MarshalJSON() ([]byte, error) { @@ -242,13 +124,6 @@ func (o *PlatformChatCreateRequest) GetConversationID() *string { return o.ConversationID } -func (o *PlatformChatCreateRequest) GetText() *PlatformChatCreateText { - if o == nil { - return nil - } - return o.Text -} - type PlatformChatCreateResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go index 68b74bef..b4b32f8f 100644 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformchatcreatestream.go @@ -4,7 +4,6 @@ package operations import ( - "encoding/json" "errors" "fmt" "mockserver/internal/sdk/models/components" @@ -77,120 +76,6 @@ func (u PlatformChatCreateStreamInput) MarshalJSON() ([]byte, error) { return nil, errors.New("could not marshal union type PlatformChatCreateStreamInput: all fields are null") } -type PlatformChatCreateStreamFormatType string - -const ( - PlatformChatCreateStreamFormatTypeText PlatformChatCreateStreamFormatType = "TEXT" - PlatformChatCreateStreamFormatTypeJSONSchema PlatformChatCreateStreamFormatType = "JSON_SCHEMA" -) - -// PlatformChatCreateStreamFormat - Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. -type PlatformChatCreateStreamFormat struct { - PlatformChatTextFormat *components.PlatformChatTextFormat `queryParam:"inline"` - PlatformChatJSONSchemaFormat *components.PlatformChatJSONSchemaFormat `queryParam:"inline"` - - Type PlatformChatCreateStreamFormatType -} - -func CreatePlatformChatCreateStreamFormatText(text components.PlatformChatTextFormat) PlatformChatCreateStreamFormat { - typ := PlatformChatCreateStreamFormatTypeText - - typStr := components.PlatformChatTextFormatType(typ) - text.Type = typStr - - return PlatformChatCreateStreamFormat{ - PlatformChatTextFormat: &text, - Type: typ, - } -} - -func CreatePlatformChatCreateStreamFormatJSONSchema(jsonSchema components.PlatformChatJSONSchemaFormat) PlatformChatCreateStreamFormat { - typ := PlatformChatCreateStreamFormatTypeJSONSchema - - typStr := components.PlatformChatJSONSchemaFormatType(typ) - jsonSchema.Type = typStr - - return PlatformChatCreateStreamFormat{ - PlatformChatJSONSchemaFormat: &jsonSchema, - Type: typ, - } -} - -func (u *PlatformChatCreateStreamFormat) UnmarshalJSON(data []byte) error { - - type discriminator struct { - Type string `json:"type"` - } - - dis := new(discriminator) - if err := json.Unmarshal(data, &dis); err != nil { - return fmt.Errorf("could not unmarshal discriminator: %w", err) - } - - switch dis.Type { - case "TEXT": - platformChatTextFormat := new(components.PlatformChatTextFormat) - if err := utils.UnmarshalJSON(data, &platformChatTextFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == TEXT) type components.PlatformChatTextFormat within PlatformChatCreateStreamFormat: %w", string(data), err) - } - - u.PlatformChatTextFormat = platformChatTextFormat - u.Type = PlatformChatCreateStreamFormatTypeText - return nil - case "JSON_SCHEMA": - platformChatJSONSchemaFormat := new(components.PlatformChatJSONSchemaFormat) - if err := utils.UnmarshalJSON(data, &platformChatJSONSchemaFormat, "", true, nil); err != nil { - return fmt.Errorf("could not unmarshal `%s` into expected (Type == JSON_SCHEMA) type components.PlatformChatJSONSchemaFormat within PlatformChatCreateStreamFormat: %w", string(data), err) - } - - u.PlatformChatJSONSchemaFormat = platformChatJSONSchemaFormat - u.Type = PlatformChatCreateStreamFormatTypeJSONSchema - return nil - } - - return fmt.Errorf("could not unmarshal `%s` into any supported union types for PlatformChatCreateStreamFormat", string(data)) -} - -func (u PlatformChatCreateStreamFormat) MarshalJSON() ([]byte, error) { - if u.PlatformChatTextFormat != nil { - return utils.MarshalJSON(u.PlatformChatTextFormat, "", true) - } - - if u.PlatformChatJSONSchemaFormat != nil { - return utils.MarshalJSON(u.PlatformChatJSONSchemaFormat, "", true) - } - - return nil, errors.New("could not marshal union type PlatformChatCreateStreamFormat: all fields are null") -} - -// PlatformChatCreateStreamText - Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. -type PlatformChatCreateStreamText struct { - // Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - // - Format *PlatformChatCreateStreamFormat `json:"format,omitempty"` -} - -func (o *PlatformChatCreateStreamText) GetFormat() *PlatformChatCreateStreamFormat { - if o == nil { - return nil - } - return o.Format -} - -func (o *PlatformChatCreateStreamText) GetFormatText() *components.PlatformChatTextFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatTextFormat - } - return nil -} - -func (o *PlatformChatCreateStreamText) GetFormatJSONSchema() *components.PlatformChatJSONSchemaFormat { - if v := o.GetFormat(); v != nil { - return v.PlatformChatJSONSchemaFormat - } - return nil -} - type PlatformChatCreateStreamRequest struct { // Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. // @@ -202,9 +87,6 @@ type PlatformChatCreateStreamRequest struct { // Continue an existing stored conversation. Incompatible with message-array `input` and with `store: false`. // ConversationID *string `json:"conversation_id,omitempty"` - // Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - // - Text *PlatformChatCreateStreamText `json:"text,omitempty"` } func (p PlatformChatCreateStreamRequest) MarshalJSON() ([]byte, error) { @@ -243,13 +125,6 @@ func (o *PlatformChatCreateStreamRequest) GetConversationID() *string { return o.ConversationID } -func (o *PlatformChatCreateStreamRequest) GetText() *PlatformChatCreateStreamText { - if o == nil { - return nil - } - return o.Text -} - type PlatformChatCreateStreamResponse struct { HTTPMeta components.HTTPMetadata `json:"-"` // Successful response. diff --git a/src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go new file mode 100644 index 00000000..53f74be3 --- /dev/null +++ b/src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go @@ -0,0 +1,28 @@ +// Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +// @generated-id: 56ee8b1f6493 + +package operations + +import ( + "mockserver/internal/sdk/models/components" +) + +type PlatformSearchEnumerationResponse struct { + HTTPMeta components.HTTPMetadata `json:"-"` + // Successful response. + PlatformSearchEnumerationResponse *components.PlatformSearchEnumerationResponse +} + +func (o *PlatformSearchEnumerationResponse) GetHTTPMeta() components.HTTPMetadata { + if o == nil { + return components.HTTPMetadata{} + } + return o.HTTPMeta +} + +func (o *PlatformSearchEnumerationResponse) GetPlatformSearchEnumerationResponse() *components.PlatformSearchEnumerationResponse { + if o == nil { + return nil + } + return o.PlatformSearchEnumerationResponse +} diff --git a/src/__tests__/search.test.ts b/src/__tests__/search.test.ts index 976a5e8d..312cb93f 100644 --- a/src/__tests__/search.test.ts +++ b/src/__tests__/search.test.ts @@ -2078,3 +2078,22 @@ test("Search Platform Search Filters", async () => { const result = await glean.search.listFilters(); expect(result).toBeDefined(); }); + +test("Search Platform Search Enumeration", async () => { + const testHttpClient = createTestHTTPClient("platform-search-enumeration"); + + 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.search.enumerate({ + query: "amoxicillin", + datasources: [ + "gdrive", + ], + page_size: 500, + }); + expect(result).toBeDefined(); +}); diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index 140c6a17..a1e0e251 100644 --- a/src/__tests__/summarize.test.ts +++ b/src/__tests__/summarize.test.ts @@ -19,11 +19,11 @@ test("Summarize Summarize", async () => { const result = await glean.client.documents.summarize({ documentSpecs: [ { - ugcType: "ANNOUNCEMENTS", - contentId: 634958, + id: "", }, { - url: "https://internal-sustenance.info/", + ugcType: "CHATS", + contentId: 593816, }, ], }); diff --git a/src/funcs/searchEnumerate.ts b/src/funcs/searchEnumerate.ts new file mode 100644 index 00000000..95a50dcf --- /dev/null +++ b/src/funcs/searchEnumerate.ts @@ -0,0 +1,182 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 74e4f005bf76 + */ + +import { GleanCore } from "../core.js"; +import { encodeJSON } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { GleanBaseError } from "../models/errors/gleanbaseerror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Enumerate matching documents + * + * @remarks + * Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + * Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + * A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + */ +export function searchEnumerate( + client: GleanCore, + request: components.PlatformSearchEnumerationRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.PlatformSearchEnumerationResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: GleanCore, + request: components.PlatformSearchEnumerationRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.PlatformSearchEnumerationResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + components.PlatformSearchEnumerationRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload, { explode: true }); + + const path = pathToFunc("/api/search/enumeration")(); + + 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: "platform-search-enumeration", + 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 responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.PlatformSearchEnumerationResponse, + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PlatformSearchEnumerationResponse$inboundSchema), + M.jsonErr( + [400, 401, 403, 404, 408, 413, 422, 429], + errors.PlatformProblemDetailError$inboundSchema, + { ctype: "application/problem+json" }, + ), + M.jsonErr([500, 503], errors.PlatformProblemDetailError$inboundSchema, { + ctype: "application/problem+json", + }), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 986a1711..0ce42950 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.20.22", - genVersion: "2.960.8", + sdkVersion: "0.20.23", + genVersion: "2.961.1", userAgent: - "speakeasy-sdk/typescript 0.20.22 2.960.8 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.20.23 2.961.1 0.9.0 @gleanwork/api-client", } as const; diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 1f33f00c..10e440ae 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -392,7 +392,6 @@ export * from "./platformchatdocumentsource.js"; export * from "./platformchatfailedresponse.js"; export * from "./platformchatfilesource.js"; export * from "./platformchatinputmessage.js"; -export * from "./platformchatjsonschemaformat.js"; export * from "./platformchatoutputmessage.js"; export * from "./platformchatoutputtextcontent.js"; export * from "./platformchatpersonsource.js"; @@ -410,7 +409,6 @@ export * from "./platformchatstreamresponsecreated.js"; export * from "./platformchatstreamresponsecreatedserversentevent.js"; export * from "./platformchatstreamresponsefailed.js"; export * from "./platformchatstreamresponsefailedserversentevent.js"; -export * from "./platformchattextformat.js"; export * from "./platformchatupdaterequest.js"; export * from "./platformchatupdateresponse.js"; export * from "./platformcontentschedulewebhookevent.js"; @@ -423,6 +421,7 @@ export * from "./platformdocumentchangewebhookevent.js"; export * from "./platformdocumentcontent.js"; export * from "./platformdocumentgetresponse.js"; export * from "./platformdocumentinclude.js"; +export * from "./platformdocumentreference.js"; export * from "./platformdocumentsbatchrequest.js"; export * from "./platformdocumentsbatchresponse.js"; export * from "./platformdocumentsbatchresult.js"; @@ -464,6 +463,9 @@ export * from "./platformproblemdetail.js"; export * from "./platformproblemdetailcode.js"; export * from "./platformproblemdetailerror.js"; export * from "./platformresult.js"; +export * from "./platformsearchenumerationinclude.js"; +export * from "./platformsearchenumerationrequest.js"; +export * from "./platformsearchenumerationresponse.js"; export * from "./platformsearchfiltersresponse.js"; export * from "./platformsearchrequest.js"; export * from "./platformsearchresponse.js"; diff --git a/src/models/components/platformchatjsonschemaformat.ts b/src/models/components/platformchatjsonschemaformat.ts deleted file mode 100644 index e620df58..00000000 --- a/src/models/components/platformchatjsonschemaformat.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: c7086d714c13 - */ - -import * as z from "zod/v3"; - -/** - * Constrains the assistant response to a caller-supplied JSON Schema. - */ -export type PlatformChatJsonSchemaFormat = { - /** - * Discriminator. Must be JSON_SCHEMA. - */ - type: "JSON_SCHEMA"; - /** - * A stable identifier for the schema. - */ - name: string; - /** - * An optional human-readable description of the schema. - */ - description?: string | undefined; - /** - * A JSON Schema object describing the desired output shape. - */ - schema: { [k: string]: any }; - /** - * When true, the provider validates the response against the schema. Unsupported by some providers; defaults to true. - * - * @remarks - */ - strict?: boolean | undefined; -}; - -/** @internal */ -export type PlatformChatJsonSchemaFormat$Outbound = { - type: "JSON_SCHEMA"; - name: string; - description?: string | undefined; - schema: { [k: string]: any }; - strict: boolean; -}; - -/** @internal */ -export const PlatformChatJsonSchemaFormat$outboundSchema: z.ZodType< - PlatformChatJsonSchemaFormat$Outbound, - z.ZodTypeDef, - PlatformChatJsonSchemaFormat -> = z.object({ - type: z.literal("JSON_SCHEMA"), - name: z.string(), - description: z.string().optional(), - schema: z.record(z.any()), - strict: z.boolean().default(true), -}); - -export function platformChatJsonSchemaFormatToJSON( - platformChatJsonSchemaFormat: PlatformChatJsonSchemaFormat, -): string { - return JSON.stringify( - PlatformChatJsonSchemaFormat$outboundSchema.parse( - platformChatJsonSchemaFormat, - ), - ); -} diff --git a/src/models/components/platformchatoutputtextcontent.ts b/src/models/components/platformchatoutputtextcontent.ts index 02f6a05c..fef0736f 100644 --- a/src/models/components/platformchatoutputtextcontent.ts +++ b/src/models/components/platformchatoutputtextcontent.ts @@ -20,22 +20,9 @@ export type PlatformChatOutputTextContentType = ClosedEnum< typeof PlatformChatOutputTextContentType >; -/** - * Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - * - * @remarks - */ -export type StructuredOutput = {}; - export type PlatformChatOutputTextContent = { type: PlatformChatOutputTextContentType; text: string; - /** - * Parsed and validated JSON object when structured output was requested. Present only when the request included `text.format.type: JSON_SCHEMA`. - * - * @remarks - */ - structured_output?: StructuredOutput | null | undefined; annotations?: Array | undefined; }; @@ -44,23 +31,6 @@ export const PlatformChatOutputTextContentType$inboundSchema: z.ZodNativeEnum< typeof PlatformChatOutputTextContentType > = z.nativeEnum(PlatformChatOutputTextContentType); -/** @internal */ -export const StructuredOutput$inboundSchema: z.ZodType< - StructuredOutput, - z.ZodTypeDef, - unknown -> = z.object({}); - -export function structuredOutputFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => StructuredOutput$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'StructuredOutput' from JSON`, - ); -} - /** @internal */ export const PlatformChatOutputTextContent$inboundSchema: z.ZodType< PlatformChatOutputTextContent, @@ -69,8 +39,6 @@ export const PlatformChatOutputTextContent$inboundSchema: z.ZodType< > = z.object({ type: PlatformChatOutputTextContentType$inboundSchema, text: z.string(), - structured_output: z.nullable(z.lazy(() => StructuredOutput$inboundSchema)) - .optional(), annotations: z.array(PlatformChatCitationAnnotation$inboundSchema).optional(), }); diff --git a/src/models/components/platformchattextformat.ts b/src/models/components/platformchattextformat.ts deleted file mode 100644 index f76809c9..00000000 --- a/src/models/components/platformchattextformat.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - * @generated-id: 6dad34f1fc6d - */ - -import * as z from "zod/v3"; - -/** - * Unconstrained plain-text assistant output. - */ -export type PlatformChatTextFormat = { - /** - * Discriminator. Must be TEXT. - */ - type: "TEXT"; -}; - -/** @internal */ -export type PlatformChatTextFormat$Outbound = { - type: "TEXT"; -}; - -/** @internal */ -export const PlatformChatTextFormat$outboundSchema: z.ZodType< - PlatformChatTextFormat$Outbound, - z.ZodTypeDef, - PlatformChatTextFormat -> = z.object({ - type: z.literal("TEXT"), -}); - -export function platformChatTextFormatToJSON( - platformChatTextFormat: PlatformChatTextFormat, -): string { - return JSON.stringify( - PlatformChatTextFormat$outboundSchema.parse(platformChatTextFormat), - ); -} diff --git a/src/models/components/platformdocumentreference.ts b/src/models/components/platformdocumentreference.ts new file mode 100644 index 00000000..67180a27 --- /dev/null +++ b/src/models/components/platformdocumentreference.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: b75ba04814f1 + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PlatformPersonReference, + PlatformPersonReference$inboundSchema, +} from "./platformpersonreference.js"; + +export type PlatformDocumentReference = { + /** + * Indexed Glean store ID. Stable identity for deduplication and the selector accepted by `POST /api/documents/batch`. + * + * @remarks + */ + document_id: string; + /** + * Canonical URL of the result. + */ + url: string; + /** + * Display title. For a conversation, this is a title built from the participants, such as "Alice and Bob", including when the indexed title is the message body. When the result has no title, the server returns Untitled. + */ + title: string; + /** + * The datasource this result originates from. + */ + datasource: string; + /** + * The document type within the datasource. + */ + document_type?: string | null | undefined; + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + creator?: PlatformPersonReference | undefined; + /** + * A lightweight reference to a person, used where a payload merely points at someone. + */ + owner?: PlatformPersonReference | undefined; + /** + * When the result was last modified. + */ + updated_at?: Date | null | undefined; + /** + * When the result was created. + */ + created_at?: Date | null | undefined; + /** + * Query-relevant plain-text excerpts from the document body. Present only when the request's `include` contains `SNIPPETS` and `query` is set. + * + * @remarks + */ + snippets?: Array | undefined; +}; + +/** @internal */ +export const PlatformDocumentReference$inboundSchema: z.ZodType< + PlatformDocumentReference, + z.ZodTypeDef, + unknown +> = z.object({ + document_id: z.string(), + url: z.string(), + title: z.string(), + datasource: z.string(), + document_type: z.nullable(z.string()).optional(), + creator: PlatformPersonReference$inboundSchema.optional(), + owner: PlatformPersonReference$inboundSchema.optional(), + updated_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + created_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + snippets: z.array(z.string()).optional(), +}); + +export function platformDocumentReferenceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformDocumentReference$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformDocumentReference' from JSON`, + ); +} diff --git a/src/models/components/platformsearchenumerationinclude.ts b/src/models/components/platformsearchenumerationinclude.ts new file mode 100644 index 00000000..51344e30 --- /dev/null +++ b/src/models/components/platformsearchenumerationinclude.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 04978b7d7ecc + */ + +import * as z from "zod/v3"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * Optional document reference projection. + */ +export const PlatformSearchEnumerationInclude = { + /** + * Add snippets, query-relevant plain-text excerpts from the document body. Only produced when `query` is present; a scope-only scan has nothing to excerpt. + */ + Snippets: "SNIPPETS", +} as const; +/** + * Optional document reference projection. + */ +export type PlatformSearchEnumerationInclude = ClosedEnum< + typeof PlatformSearchEnumerationInclude +>; + +/** @internal */ +export const PlatformSearchEnumerationInclude$outboundSchema: z.ZodNativeEnum< + typeof PlatformSearchEnumerationInclude +> = z.nativeEnum(PlatformSearchEnumerationInclude); diff --git a/src/models/components/platformsearchenumerationrequest.ts b/src/models/components/platformsearchenumerationrequest.ts new file mode 100644 index 00000000..480f7b2d --- /dev/null +++ b/src/models/components/platformsearchenumerationrequest.ts @@ -0,0 +1,102 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 824bb7175ac7 + */ + +import * as z from "zod/v3"; +import { + PlatformFilter, + PlatformFilter$Outbound, + PlatformFilter$outboundSchema, +} from "./platformfilter.js"; +import { + PlatformSearchEnumerationInclude, + PlatformSearchEnumerationInclude$outboundSchema, +} from "./platformsearchenumerationinclude.js"; +import { + PlatformTimeRange, + PlatformTimeRange$Outbound, + PlatformTimeRange$outboundSchema, +} from "./platformtimerange.js"; + +/** + * Selection to enumerate. At least one of `datasources`, `query`, or `filters` must be set. + * + * @remarks + */ +export type PlatformSearchEnumerationRequest = { + /** + * The search query string. Supports inline operators such as `from:jane type:document app:confluence`. Inline operators are AND'd with structured `filters`. + * + * @remarks + */ + query?: string | undefined; + /** + * Restrict results to specific datasource identifiers returned by `GET /api/search/filters`. Scopes by datasource type and may include results from multiple instances of that type. Omit to enumerate across all visible datasources matching `query` or `filters`. + * + * @remarks + */ + datasources?: Array | undefined; + /** + * Structured filters applied to search results. Multiple values within a filter with `EQUALS` are OR'd; separate filters are AND'd. Conflicting constraints on the same field (for example, `type:document` in `query` and `type:spreadsheet` in a filter) return an empty result set. See `Filter.field` for built-in field names and operators. Other nonblank field names are accepted as custom filters without validation; behavior depends on your connected sources. + * + * @remarks + */ + filters?: Array | undefined; + /** + * Filter results to those last updated within this range. + */ + time_range?: PlatformTimeRange | undefined; + /** + * Number of results to return per page. + */ + page_size?: number | undefined; + /** + * Opaque pagination token from a previous response's `next_cursor` field. Omit on the first request. Cursors do not expire and are valid only for the original selection. + * + * @remarks + */ + cursor?: string | null | undefined; + /** + * Optional field groups to add to each document reference. Each value only adds fields; it does not change which documents are returned. + * + * @remarks + */ + include?: Array | undefined; +}; + +/** @internal */ +export type PlatformSearchEnumerationRequest$Outbound = { + query?: string | undefined; + datasources?: Array | undefined; + filters?: Array | undefined; + time_range?: PlatformTimeRange$Outbound | undefined; + page_size: number; + cursor?: string | null | undefined; + include?: Array | undefined; +}; + +/** @internal */ +export const PlatformSearchEnumerationRequest$outboundSchema: z.ZodType< + PlatformSearchEnumerationRequest$Outbound, + z.ZodTypeDef, + PlatformSearchEnumerationRequest +> = z.object({ + query: z.string().optional(), + datasources: z.array(z.string()).optional(), + filters: z.array(PlatformFilter$outboundSchema).optional(), + time_range: PlatformTimeRange$outboundSchema.optional(), + page_size: z.number().int().default(100), + cursor: z.nullable(z.string()).optional(), + include: z.array(PlatformSearchEnumerationInclude$outboundSchema).optional(), +}); + +export function platformSearchEnumerationRequestToJSON( + platformSearchEnumerationRequest: PlatformSearchEnumerationRequest, +): string { + return JSON.stringify( + PlatformSearchEnumerationRequest$outboundSchema.parse( + platformSearchEnumerationRequest, + ), + ); +} diff --git a/src/models/components/platformsearchenumerationresponse.ts b/src/models/components/platformsearchenumerationresponse.ts new file mode 100644 index 00000000..4e4563b9 --- /dev/null +++ b/src/models/components/platformsearchenumerationresponse.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: ec3571f2b09d + */ + +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 { + PlatformDocumentReference, + PlatformDocumentReference$inboundSchema, +} from "./platformdocumentreference.js"; + +export type PlatformSearchEnumerationResponse = { + /** + * Document references at this cursor position. + */ + results: Array; + /** + * Indicates whether additional pages of results are available. + */ + has_more: boolean; + /** + * Opaque token to pass as `cursor` in the next request. Null exactly when `has_more` is false. + * + * @remarks + */ + next_cursor: string | null; + /** + * Platform-generated request ID for support correlation. + */ + request_id: string; +}; + +/** @internal */ +export const PlatformSearchEnumerationResponse$inboundSchema: z.ZodType< + PlatformSearchEnumerationResponse, + z.ZodTypeDef, + unknown +> = z.object({ + results: z.array(PlatformDocumentReference$inboundSchema), + has_more: z.boolean(), + next_cursor: z.nullable(z.string()), + request_id: z.string(), +}); + +export function platformSearchEnumerationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlatformSearchEnumerationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlatformSearchEnumerationResponse' from JSON`, + ); +} diff --git a/src/models/components/platformtriggereventreason.ts b/src/models/components/platformtriggereventreason.ts index 08b360a8..7a07f9f9 100644 --- a/src/models/components/platformtriggereventreason.ts +++ b/src/models/components/platformtriggereventreason.ts @@ -67,6 +67,14 @@ export const PlatformTriggerEventReason = { * The source system sent a webhook creation event. */ WebhookCreated: "WEBHOOK_CREATED", + /** + * The item was closed. + */ + Closed: "CLOSED", + /** + * A comment was added to the item. + */ + CommentAdded: "COMMENT_ADDED", } as const; /** * Why the event fired. diff --git a/src/models/operations/platformchatcreate.ts b/src/models/operations/platformchatcreate.ts index abdc5260..c78b6a8a 100644 --- a/src/models/operations/platformchatcreate.ts +++ b/src/models/operations/platformchatcreate.ts @@ -15,32 +15,6 @@ export type PlatformChatCreateInput = | string | Array; -/** - * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - * - * @remarks - */ -export type PlatformChatCreateFormat = - | components.PlatformChatTextFormat - | components.PlatformChatJsonSchemaFormat; - -/** - * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - * - * @remarks - */ -export type PlatformChatCreateText = { - /** - * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - * - * @remarks - */ - format?: - | components.PlatformChatTextFormat - | components.PlatformChatJsonSchemaFormat - | undefined; -}; - export type PlatformChatCreateRequest = { /** * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -61,12 +35,6 @@ export type PlatformChatCreateRequest = { * @remarks */ conversation_id?: string | undefined; - /** - * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - * - * @remarks - */ - text?: PlatformChatCreateText | undefined; }; /** @internal */ @@ -92,64 +60,12 @@ export function platformChatCreateInputToJSON( ); } -/** @internal */ -export type PlatformChatCreateFormat$Outbound = - | components.PlatformChatTextFormat$Outbound - | components.PlatformChatJsonSchemaFormat$Outbound; - -/** @internal */ -export const PlatformChatCreateFormat$outboundSchema: z.ZodType< - PlatformChatCreateFormat$Outbound, - z.ZodTypeDef, - PlatformChatCreateFormat -> = z.union([ - components.PlatformChatTextFormat$outboundSchema, - components.PlatformChatJsonSchemaFormat$outboundSchema, -]); - -export function platformChatCreateFormatToJSON( - platformChatCreateFormat: PlatformChatCreateFormat, -): string { - return JSON.stringify( - PlatformChatCreateFormat$outboundSchema.parse(platformChatCreateFormat), - ); -} - -/** @internal */ -export type PlatformChatCreateText$Outbound = { - format?: - | components.PlatformChatTextFormat$Outbound - | components.PlatformChatJsonSchemaFormat$Outbound - | undefined; -}; - -/** @internal */ -export const PlatformChatCreateText$outboundSchema: z.ZodType< - PlatformChatCreateText$Outbound, - z.ZodTypeDef, - PlatformChatCreateText -> = z.object({ - format: z.union([ - components.PlatformChatTextFormat$outboundSchema, - components.PlatformChatJsonSchemaFormat$outboundSchema, - ]).optional(), -}); - -export function platformChatCreateTextToJSON( - platformChatCreateText: PlatformChatCreateText, -): string { - return JSON.stringify( - PlatformChatCreateText$outboundSchema.parse(platformChatCreateText), - ); -} - /** @internal */ export type PlatformChatCreateRequest$Outbound = { input: string | Array; stream: false; store: boolean; conversation_id?: string | undefined; - text?: PlatformChatCreateText$Outbound | undefined; }; /** @internal */ @@ -165,7 +81,6 @@ export const PlatformChatCreateRequest$outboundSchema: z.ZodType< stream: z.literal(false).default(false as const), store: z.boolean().default(true), conversation_id: z.string().optional(), - text: z.lazy(() => PlatformChatCreateText$outboundSchema).optional(), }); export function platformChatCreateRequestToJSON( diff --git a/src/models/operations/platformchatcreatestream.ts b/src/models/operations/platformchatcreatestream.ts index 3b1f8a17..c06337a7 100644 --- a/src/models/operations/platformchatcreatestream.ts +++ b/src/models/operations/platformchatcreatestream.ts @@ -15,32 +15,6 @@ export type PlatformChatCreateStreamInput = | string | Array; -/** - * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - * - * @remarks - */ -export type PlatformChatCreateStreamFormat = - | components.PlatformChatTextFormat - | components.PlatformChatJsonSchemaFormat; - -/** - * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - * - * @remarks - */ -export type PlatformChatCreateStreamText = { - /** - * Output format for the assistant text. TEXT is unconstrained. JSON_SCHEMA constrains the response to the supplied schema. - * - * @remarks - */ - format?: - | components.PlatformChatTextFormat - | components.PlatformChatJsonSchemaFormat - | undefined; -}; - export type PlatformChatCreateStreamRequest = { /** * Either a plain string (single user turn) or a chronological array of `USER`/`ASSISTANT` messages. The final array message must be `USER`. @@ -61,12 +35,6 @@ export type PlatformChatCreateStreamRequest = { * @remarks */ conversation_id?: string | undefined; - /** - * Optional configuration for the assistant's text response. When `format.type` is `JSON_SCHEMA`, the response is constrained to the supplied JSON schema and returned in `output[*].content[*].structured_output`. Structured output is not supported when `stream` is true. - * - * @remarks - */ - text?: PlatformChatCreateStreamText | undefined; }; /** @internal */ @@ -94,68 +62,12 @@ export function platformChatCreateStreamInputToJSON( ); } -/** @internal */ -export type PlatformChatCreateStreamFormat$Outbound = - | components.PlatformChatTextFormat$Outbound - | components.PlatformChatJsonSchemaFormat$Outbound; - -/** @internal */ -export const PlatformChatCreateStreamFormat$outboundSchema: z.ZodType< - PlatformChatCreateStreamFormat$Outbound, - z.ZodTypeDef, - PlatformChatCreateStreamFormat -> = z.union([ - components.PlatformChatTextFormat$outboundSchema, - components.PlatformChatJsonSchemaFormat$outboundSchema, -]); - -export function platformChatCreateStreamFormatToJSON( - platformChatCreateStreamFormat: PlatformChatCreateStreamFormat, -): string { - return JSON.stringify( - PlatformChatCreateStreamFormat$outboundSchema.parse( - platformChatCreateStreamFormat, - ), - ); -} - -/** @internal */ -export type PlatformChatCreateStreamText$Outbound = { - format?: - | components.PlatformChatTextFormat$Outbound - | components.PlatformChatJsonSchemaFormat$Outbound - | undefined; -}; - -/** @internal */ -export const PlatformChatCreateStreamText$outboundSchema: z.ZodType< - PlatformChatCreateStreamText$Outbound, - z.ZodTypeDef, - PlatformChatCreateStreamText -> = z.object({ - format: z.union([ - components.PlatformChatTextFormat$outboundSchema, - components.PlatformChatJsonSchemaFormat$outboundSchema, - ]).optional(), -}); - -export function platformChatCreateStreamTextToJSON( - platformChatCreateStreamText: PlatformChatCreateStreamText, -): string { - return JSON.stringify( - PlatformChatCreateStreamText$outboundSchema.parse( - platformChatCreateStreamText, - ), - ); -} - /** @internal */ export type PlatformChatCreateStreamRequest$Outbound = { input: string | Array; stream: true; store: boolean; conversation_id?: string | undefined; - text?: PlatformChatCreateStreamText$Outbound | undefined; }; /** @internal */ @@ -171,7 +83,6 @@ export const PlatformChatCreateStreamRequest$outboundSchema: z.ZodType< stream: z.literal(true).default(true as const), store: z.boolean().default(true), conversation_id: z.string().optional(), - text: z.lazy(() => PlatformChatCreateStreamText$outboundSchema).optional(), }); export function platformChatCreateStreamRequestToJSON( diff --git a/src/react-query/index.ts b/src/react-query/index.ts index 57530d10..5faf47a1 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -161,6 +161,7 @@ export * from "./indexingPermissionsProcessMemberships.js"; export * from "./indexingPermissionsUpdatePermissions.js"; export * from "./indexingShortcutsBulkIndex.js"; export * from "./indexingShortcutsUpload.js"; +export * from "./searchEnumerate.js"; export * from "./searchListFilters.js"; export * from "./searchQuery.js"; export * from "./skillsCreate.js"; diff --git a/src/react-query/searchEnumerate.ts b/src/react-query/searchEnumerate.ts new file mode 100644 index 00000000..2c965d5b --- /dev/null +++ b/src/react-query/searchEnumerate.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + * @generated-id: 43725e058698 + */ + +import { + MutationKey, + useMutation, + UseMutationResult, +} from "@tanstack/react-query"; +import { GleanCore } from "../core.js"; +import { searchEnumerate } from "../funcs/searchEnumerate.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 * as errors from "../models/errors/index.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 SearchEnumerateMutationVariables = { + request: components.PlatformSearchEnumerationRequest; + options?: RequestOptions; +}; + +export type SearchEnumerateMutationData = + components.PlatformSearchEnumerationResponse; + +export type SearchEnumerateMutationError = + | errors.PlatformProblemDetailError + | GleanBaseError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError; + +/** + * Enumerate matching documents + * + * @remarks + * Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + * Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + * A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + */ +export function useSearchEnumerateMutation( + options?: MutationHookOptions< + SearchEnumerateMutationData, + SearchEnumerateMutationError, + SearchEnumerateMutationVariables + >, +): UseMutationResult< + SearchEnumerateMutationData, + SearchEnumerateMutationError, + SearchEnumerateMutationVariables +> { + const client = useGleanContext(); + return useMutation({ + ...buildSearchEnumerateMutation(client, options), + ...options, + }); +} + +export function mutationKeySearchEnumerate(): MutationKey { + return ["@gleanwork/api-client", "search", "enumerate"]; +} + +export function buildSearchEnumerateMutation( + client$: GleanCore, + hookOptions?: RequestOptions, +): { + mutationKey: MutationKey; + mutationFn: ( + variables: SearchEnumerateMutationVariables, + ) => Promise; +} { + return { + mutationKey: mutationKeySearchEnumerate(), + mutationFn: function searchEnumerateMutationFn({ + request, + options, + }): Promise { + const mergedOptions = { + ...hookOptions, + ...options, + fetchOptions: { + ...hookOptions?.fetchOptions, + ...options?.fetchOptions, + signal: combineSignals( + hookOptions?.fetchOptions?.signal, + options?.fetchOptions?.signal, + ), + }, + }; + return unwrapAsync(searchEnumerate( + client$, + request, + mergedOptions, + )); + }, + }; +} diff --git a/src/sdk/search.ts b/src/sdk/search.ts index a4ecf2ed..d3f5c0ca 100644 --- a/src/sdk/search.ts +++ b/src/sdk/search.ts @@ -3,6 +3,7 @@ * @generated-id: b88871d87236 */ +import { searchEnumerate } from "../funcs/searchEnumerate.js"; import { searchListFilters } from "../funcs/searchListFilters.js"; import { searchQuery } from "../funcs/searchQuery.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; @@ -48,4 +49,23 @@ export class Search extends ClientSDK { options, )); } + + /** + * Enumerate matching documents + * + * @remarks + * Walk every indexed document that matches a selection and that the caller is permitted to see. Returns document references with minimal metadata and never bodies; request `SNIPPETS` via `include` for query-relevant excerpts, and hydrate full documents with `POST /api/documents/batch`. Unlike `POST /api/search`, `query` is optional: omit it to enumerate by `datasources`, `filters`, and `time_range` alone. Results are ordered for completeness, not relevance. + * Follow `next_cursor` until `has_more` is `false`, regardless of page size. This is a live scan, not a snapshot: concurrent index changes can cause duplicates or omissions. Deduplicate by `document_id`. + * A page is either complete at its cursor position or an error. A shard or datasource failure returns HTTP 503 and the same cursor stays valid for retry; this endpoint never returns a partial page. A cursor reused with a different selection returns HTTP 400 `invalid_cursor`. + */ + async enumerate( + request: components.PlatformSearchEnumerationRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(searchEnumerate( + this, + request, + options, + )); + } }