From 8dfac598248e7908e1d2908b1a025f2ee7f4df43 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Tue, 17 Nov 2026 20:30:56 +0000 Subject: [PATCH 1/2] =?UTF-8?q?##=20Typescript=20SDK=20Changes:=20*=20`gle?= =?UTF-8?q?an.search.enumerate()`:=20**Removed**=20(Breaking=20=E2=9A=A0?= =?UTF-8?q?=EF=B8=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .speakeasy/gen.lock | 128 ++------ .speakeasy/gen.yaml | 2 +- .speakeasy/glean-merged-spec.yaml | 306 ++++++------------ .speakeasy/workflow.lock | 12 +- README.md | 3 - RELEASES.md | 12 +- .../components/platformdocumentreference.md | 33 -- .../platformsearchenumerationinclude.md | 17 - .../platformsearchenumerationrequest.md | 30 -- .../platformsearchenumerationresponse.md | 34 -- docs/sdks/search/README.md | 106 +----- examples/package-lock.json | 2 +- jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/__tests__/messages.test.ts | 2 +- .../internal/handler/generated_handlers.go | 1 - .../handler/pathpostapisearchenumeration.go | 73 ----- .../handler/pathpostrestapiv1getchat.go | 4 +- .../components/platformdocumentreference.go | 116 ------- .../platformsearchenumerationinclude.go | 33 -- .../platformsearchenumerationrequest.go | 92 ------ .../platformsearchenumerationresponse.go | 44 --- .../operations/platformsearchenumeration.go | 28 -- src/__tests__/search.test.ts | 21 +- src/__tests__/summarize.test.ts | 6 +- src/funcs/searchEnumerate.ts | 182 ----------- src/lib/config.ts | 4 +- src/models/components/index.ts | 4 - .../components/platformdocumentreference.ts | 92 ------ .../platformsearchenumerationinclude.ts | 28 -- .../platformsearchenumerationrequest.ts | 102 ------ .../platformsearchenumerationresponse.ts | 56 ---- src/react-query/index.ts | 1 - src/react-query/searchEnumerate.ts | 114 ------- src/sdk/search.ts | 20 -- 36 files changed, 158 insertions(+), 1558 deletions(-) delete mode 100644 docs/models/components/platformdocumentreference.md delete mode 100644 docs/models/components/platformsearchenumerationinclude.md delete mode 100644 docs/models/components/platformsearchenumerationrequest.md delete mode 100644 docs/models/components/platformsearchenumerationresponse.md delete mode 100644 src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go delete mode 100644 src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go delete mode 100644 src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go delete mode 100644 src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go delete mode 100644 src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go delete mode 100644 src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go delete mode 100644 src/funcs/searchEnumerate.ts delete mode 100644 src/models/components/platformdocumentreference.ts delete mode 100644 src/models/components/platformsearchenumerationinclude.ts delete mode 100644 src/models/components/platformsearchenumerationrequest.ts delete mode 100644 src/models/components/platformsearchenumerationresponse.ts delete mode 100644 src/react-query/searchEnumerate.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index d34505f91..57fc6e351 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: 9d8ec68225b876cf9682078cfb491edd + docChecksum: b5e6aaf09569e076c7321d15cf12c515 docVersion: 0.9.0 - speakeasyVersion: 1.809.0 + speakeasyVersion: 1.810.0 generationVersion: 2.961.1 - releaseVersion: 0.20.24 - configChecksum: 62b2c49f7a0a0f2004edc739815ad9de + releaseVersion: 0.20.25 + configChecksum: 08e8962bfef820a2365a0caaf92dbfd6 repoURL: https://github.com/gleanwork/api-client-typescript.git installationURL: https://github.com/gleanwork/api-client-typescript published: true persistentEdits: - generation_id: 881c7f72-1678-47ba-9374-c179d9818692 - pristine_commit_hash: 5b7d3b9db5402ee1550d70bf72f1d4f5ad935232 - pristine_tree_hash: 66412fc77e56cf15b381827e29a63803542c3beb + generation_id: 1ecfd04f-7299-4e9b-a27e-5bc110672613 + pristine_commit_hash: 46a83c7679ec4f4308997d5cff1a59a02e7b6d4f + pristine_tree_hash: eba423e4682dafa8cf99ed7212ee6a46efcf191c features: typescript: acceptHeaders: 2.81.2 @@ -2293,10 +2293,6 @@ 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 @@ -2473,18 +2469,6 @@ 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 @@ -4279,8 +4263,8 @@ trackedFiles: pristine_git_object: 6025b94e7355f974a45c9c00c892db4ad5f11bd0 docs/sdks/search/README.md: id: 5c534716244c - last_write_checksum: sha1:628c8791409e998bee1f06b25795294433cdb70d - pristine_git_object: 93726a1a5f3ddb728dc95bc50d6c45bb70bf9dc1 + last_write_checksum: sha1:fc6f73f27c4a7c510f9408ca9b7bdda5552f3efb + pristine_git_object: bb8666982fe835860364141a7cdaa22e4472cd4d docs/sdks/skills/README.md: id: 3a14a5c90791 last_write_checksum: sha1:336ae5c9fedbd38af43f2bafde1c967af5882efa @@ -4331,12 +4315,12 @@ trackedFiles: pristine_git_object: 5a2797590d4be351d62915017d5b2a0f853537c8 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:b90e184517da1b7d5631f2c67af569f9b831beb3 - pristine_git_object: 90860770423bbaf4da8360331dfc810523648bf6 + last_write_checksum: sha1:7672139b5f00e1d069467814dc693809d4e75552 + pristine_git_object: d506de751f0fb4a2dbfdd5b88f5816b7071f47b3 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:ec274b2c353b0a521d1f0164b61c83fdfc645901 - pristine_git_object: fc12f16b042712b7abafcfd27c6ce3220d063cd0 + last_write_checksum: sha1:11b1d1296ee142ac23ddcc73312ccf9e9b142bb2 + pristine_git_object: fdad49ed6072c03e32346c2d99549e17717f1e40 src/__tests__/activities.test.ts: id: 65fa859b8f59 last_write_checksum: sha1:756bc40095f4495bbf62739b8218bb4a559a24f2 @@ -4471,8 +4455,8 @@ trackedFiles: pristine_git_object: d252821b825c62856886e3ab9287181d7ef7f9de src/__tests__/messages.test.ts: id: 39e293f09219 - last_write_checksum: sha1:35170c1c2c6d5e4a4dca5a35ae5d74d602f5294c - pristine_git_object: 01382f0c48dc70391beb3802de74c92eb8480822 + last_write_checksum: sha1:c78b09c09e64da0655a3e0ecbadabe82980ef7d1 + pristine_git_object: f390543460d7bd3c678c17579e755b9e06faac16 src/__tests__/mockserver/.gitignore: id: 4a7fc421b6b6 last_write_checksum: sha1:228e1b05712a973948fd771323a2140a3b355ff4 @@ -4527,8 +4511,8 @@ trackedFiles: pristine_git_object: af3a6d136d837850b34ed893a8faf800ea114721 src/__tests__/mockserver/internal/handler/generated_handlers.go: id: e6f590a8ce11 - last_write_checksum: sha1:690681156adf9e55d3d157a5ff3a12dbdc8067d7 - pristine_git_object: f400575d03482a43afe060ae2b83c688c3996320 + last_write_checksum: sha1:4c2eaffe9ea6ebd9f100f956511b6328257d8a4d + pristine_git_object: 5b5fb53b8321c71868adf73aaa63ec12fe1bcdad src/__tests__/mockserver/internal/handler/pathdeleterestapiindexcustommetadataschemagroupname.go: id: ef047f0e0f32 last_write_checksum: sha1:187ff16d05efa1c937632f61dd3f49e49691d5ff @@ -4857,10 +4841,6 @@ 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 @@ -5027,8 +5007,8 @@ trackedFiles: pristine_git_object: 2e612d4143e02dd5e90750945b781302230969b3 src/__tests__/mockserver/internal/handler/pathpostrestapiv1getchat.go: id: 4a9c64bf3a68 - last_write_checksum: sha1:bd92836a7e38740708f76f52b19704fda11d9ab7 - pristine_git_object: a7e16d16bf67e08174b9a7ec990934165ce72f6a + last_write_checksum: sha1:2766e6a943d9c18dc4d8a7f9e3bc7122a76bde0c + pristine_git_object: e2243868c4ccfbb9c80e49f9ca99c92735f4978f src/__tests__/mockserver/internal/handler/pathpostrestapiv1getchatapplication.go: id: 069e6f3638f9 last_write_checksum: sha1:fe7b6e94356f030628f826fdaa494f1f87bcba8a @@ -6865,10 +6845,6 @@ 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 @@ -7033,18 +7009,6 @@ 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 @@ -8289,10 +8253,6 @@ 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 @@ -8763,16 +8723,16 @@ trackedFiles: pristine_git_object: 7ce8f5effc329f11e78343356b16576bf94b9fed src/__tests__/search.test.ts: id: 97f2005515d0 - last_write_checksum: sha1:38ceb4d6f75de72f65c5338a3480536826ead85d - pristine_git_object: 312cb93f527ae6f011c5a4e320e59d67ce2a0033 + last_write_checksum: sha1:19377c43c7d9aa68f98bcbb09b655465e7fccd6a + pristine_git_object: 5a7da7db25766e530bcde7c78eb175159e166f70 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:67be024ebbe55b10203a82520ad310a5afe11690 - pristine_git_object: 7b1ea9e95fbd712bf879f84047150b91056da3da + last_write_checksum: sha1:f8b1ac06da928f5ff27c1f48119753f085864297 + pristine_git_object: f5f3af07582f537ee59b55dc600c9219dfec9229 src/__tests__/testclient.ts: id: f142c080bff8 last_write_checksum: sha1:3a38647391f52221c009a9273eebf90793b3d430 @@ -9425,10 +9385,6 @@ 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 @@ -9567,8 +9523,8 @@ trackedFiles: pristine_git_object: 42d9739ab67c2fec0689f83777ffa5e1f875e5d5 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:c6da8191c5a3455a9f451f1c01f1016f99b5a20e - pristine_git_object: 41b2d69ea37f953ac093f9e369ae9b12d4afa5fe + last_write_checksum: sha1:cb548faa23efc7276f12426a380114a17ef12bfc + pristine_git_object: 923c7d0806b9ad55a08796dd30d234adf77e2f09 src/lib/encodings.ts: id: 3bd8ead98afd last_write_checksum: sha1:d1917169abb226ccb0d2e93fd211a1d2987822b4 @@ -10791,8 +10747,8 @@ trackedFiles: pristine_git_object: dcb8bad1c6e1addd393690e78a63631baa47f7be src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:a1f61f299dc7173982db6939a83fe2700b27a6d0 - pristine_git_object: 10e440ae672239fb97d38a3af2a94369ef1ec54e + last_write_checksum: sha1:86f01285f9b73ba3960697c081e283fa3bb1ce7e + pristine_git_object: 0d5f1769d87aab961216cd5d42413578bc88ebbe src/models/components/indexdocumentrequest.ts: id: deb13e2cdc65 last_write_checksum: sha1:33e2093c7fcdd3c90ef45c48e7b79c4cb2aea6e5 @@ -11305,10 +11261,6 @@ 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 @@ -11473,18 +11425,6 @@ 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 @@ -13487,8 +13427,8 @@ trackedFiles: pristine_git_object: a9f37ea69f54d7c1072f42f8990e3f25d9d984e5 src/react-query/index.ts: id: 9e975471aa65 - last_write_checksum: sha1:f6658eec3331550b5f35cfb89cdd642c50d9a4ba - pristine_git_object: 5faf47a128f7c7a8c3c26521389ab90410ffe197 + last_write_checksum: sha1:2a2a963eb228ecf8b635218164b478b3d98feb55 + pristine_git_object: 57530d10c931665bb56c98a4c7c65add2a63bd6d src/react-query/indexingAuthenticationRotateToken.ts: id: e56c0845e38e last_write_checksum: sha1:035d7baae9a7fd7c32f69211cfe85b0f6ccbbf8c @@ -13669,10 +13609,6 @@ 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 @@ -14015,8 +13951,8 @@ trackedFiles: pristine_git_object: 321c4dc3caa8cbfbe518fa42e44bbacf3437e71c src/sdk/search.ts: id: b88871d87236 - last_write_checksum: sha1:964d57571a161e0f03b7bc5c69bb24f76b790a34 - pristine_git_object: d3f5c0cadfbf12b8d32ac6a4aab301ca1e4d4f8a + last_write_checksum: sha1:f9a6896781f5884e76434b7d93c7db7758edfb1f + pristine_git_object: a4ecf2ede22740e3ccd9b84253b0e065d934c916 src/sdk/skills.ts: id: 847667a72f83 last_write_checksum: sha1:e23d82dd8085fddb43df980064c40bed969c8b8a @@ -15942,7 +15878,7 @@ generatedTests: platform-search-enumeration: "2026-11-16T11:53:18Z" releaseNotes: | ## Typescript SDK Changes: - * `glean.client.insights.retrieve()`: `response.overviewResponse.totalSignupsWeekAgo` **Added** + * `glean.search.enumerate()`: **Removed** (Breaking ⚠️) generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index b1459e240..eb63802ae 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -36,7 +36,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: true typescript: - version: 0.20.24 + version: 0.20.25 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/glean-merged-spec.yaml b/.speakeasy/glean-merged-spec.yaml index 678935a31..ad10f2967 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: 92084e408d64f4792098b2dcd1013e0af7abe611 - x-open-api-commit-sha: fee2a7ed1565ad90159fb31b1a05283058c83f3f + x-source-commit-sha: 2f6fc4fe9fed01ad76ee9aa694041c743bd74875 + x-open-api-commit-sha: 241062eca12866ea62b6e58d504ef481935fcf48 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,63 +1496,6 @@ 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: @@ -11124,158 +11067,6 @@ 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 @@ -12227,6 +12018,38 @@ components: source: $ref: "#/components/schemas/PlatformUsagePolicySourceTarget" description: Configured policy supplying this restriction. + PlatformUsageUsedValue: + type: object + additionalProperties: false + description: Accrued usage in one unit, without combining or converting units. + required: + - used + - unit + properties: + used: + type: string + minLength: 1 + maxLength: 24 + pattern: ^(0|[1-9][0-9]*)(\.[0-9]{1,6})?$ + description: Nonnegative decimal usage with at most six fractional digits. + unit: + $ref: "#/components/schemas/PlatformUsageUnit" + description: Unit of accrued usage. + PlatformUsageAggregateUsage: + type: object + additionalProperties: false + description: | + Existing clientless AGENT counter usage in the current UTC calendar month, independent of agent/default policies and the selected spend client. This records aggregate attribution, not certified run lineage or exact app usage. Counter failures omit aggregate_usage, never fabricate zero amounts. + required: + - used_by_unit + properties: + used_by_unit: + type: array + minItems: 2 + maxItems: 2 + description: Existing aggregate counters in USD then CREDITS, including zero amounts. + items: + $ref: "#/components/schemas/PlatformUsageUsedValue" PlatformUsageLimitDecision: type: string description: Configured-budget status for the target, independent of runtime admission switches. @@ -12366,6 +12189,7 @@ components: - period - value - used + - used_unit - decision - active_actions properties: @@ -12392,7 +12216,13 @@ components: description: Configured cap before approved one-period grants; value.amount is not remaining headroom. used: type: string - description: Decimal amount of accrued usage for this limit. + description: Decimal amount of accrued usage for this limit in used_unit. + used_unit: + $ref: "#/components/schemas/PlatformUsageUnit" + x-glean-experimental: + id: 5c21ff70-7182-49f9-89c7-9c8f4929695f + introduced: "2026-11-16" + description: Resolved counter denomination, including when value.mode is UNLIMITED. current_period_amount: type: string minLength: 1 @@ -12453,7 +12283,7 @@ components: type: object additionalProperties: false description: | - Configured-budget evaluation for a concrete target and period, not runtime admission, model eligibility, or agent-run preflight. AVAILABLE can mean that no configured policy applies; inspect applicable_policy_count and the normalized target and exact period echo. Configured caps are evaluated_limits[].value.amount, accrued usage is evaluated_limits[].used, the cap enforced this period is evaluated_limits[].current_period_amount, per-rule headroom is evaluated_limits[].remaining, and tightest headroom is effective_limits[].remaining. Approved one-period grants raise the current-period amount and headroom without changing the configured cap. Units are never combined or converted. Non-admin evaluation omits shared budgets from applicable_policy_count, evaluated_limits, and effective_limits; decision can be BLOCKED by a shared budget even when the target's own limits show remaining headroom. decision_causes explains every non-AVAILABLE decision, including one caused by a budget that is not listed. + Configured-budget evaluation for a concrete target and period, not runtime admission, model eligibility, or agent-run preflight. AVAILABLE can mean that no configured policy applies; inspect applicable_policy_count and the normalized target and exact period echo. Optional used_by_unit reports exact subject and app usage for USER and ORGANIZATION, independent of policies; AGENT omits it and instead returns clientless aggregate_usage independent of configured policies. Both are omitted, as unknown, when their counters are unavailable; a counter failure returns 503 only when an applicable policy needs a counter. Non-admin evaluation omits shared budgets regardless of the caller's permissions. Hidden shared budgets can block the decision but never contribute counts or soft warnings. Configured caps are evaluated_limits[].value.amount, policy counter usage is evaluated_limits[].used, the cap enforced this period is evaluated_limits[].current_period_amount, per-rule headroom is evaluated_limits[].remaining, and tightest headroom is effective_limits[].remaining. Approved one-period grants raise the current-period amount and headroom without changing the configured cap. Units are never combined or converted. Non-admin evaluation omits shared budgets from applicable_policy_count, evaluated_limits, and effective_limits; decision can be BLOCKED by a shared budget even when the target's own limits show remaining headroom. decision_causes explains every non-AVAILABLE decision, including one caused by a budget that is not listed. example: target: type: USER @@ -12462,6 +12292,11 @@ components: period: type: RECURRING_CALENDAR_MONTH applicable_policy_count: 1 + used_by_unit: + - used: "20" + unit: USD + - used: "0" + unit: CREDITS decision: BLOCKED decision_causes: - decision: BLOCKED @@ -12484,6 +12319,7 @@ components: unit: USD enforcement: HARD used: "20" + used_unit: USD current_period_amount: "80" remaining: "60" decision: AVAILABLE @@ -12543,6 +12379,25 @@ components: minimum: 0 description: | Number of applicable configured policies returned in evaluated_limits, including UNLIMITED policies. Zero explicitly means no returned policy matched, not an unlimited configured rule. Non-admin evaluation excludes shared budgets. Included even when zero. + aggregate_usage: + $ref: "#/components/schemas/PlatformUsageAggregateUsage" + x-glean-experimental: + id: 3a6dcfc9-9429-45da-ba71-945c43c1dfd7 + introduced: "2026-11-16" + description: | + Present only for AGENT, including without configured policies. Existing clientless AGENT counters, never relabeled as selected-client usage. Omitted, as unknown, when the counters are unavailable. + used_by_unit: + type: array + x-go-type-skip-optional-pointer: true + x-glean-experimental: + id: 9d805f36-84ee-43de-a21a-a41426dce590 + introduced: "2026-11-16" + minItems: 2 + maxItems: 2 + items: + $ref: "#/components/schemas/PlatformUsageUsedValue" + description: | + Live accrued usage for exactly the normalized USER or ORGANIZATION and selected app in the current UTC calendar month. When present, contains USD then CREDITS, including zero amounts and when no policy applies. AGENT omits this field until exact per-app counters are ready; existing agent policy evaluation, usage, headroom and decisions remain available. Also omitted when the counters are unavailable. Absence is unknown, not zero or relabeled aggregate usage. This field is not a sum of policy counters or workspace constraints. decision: $ref: "#/components/schemas/PlatformUsageLimitDecision" description: | @@ -12560,7 +12415,7 @@ components: items: $ref: "#/components/schemas/PlatformUsageHeadroomValue" description: | - Tightest remaining budget per finite unit, ordered USD then CREDITS. remaining is headroom after accrued usage and approved one-period grants, not a configured cap. Units are never combined or converted. When no finite policy applies, contains a single UNLIMITED entry without remaining, unit, or enforcement, including when applicable_policy_count is zero. Covers only returned evaluated_limits, so non-admin headroom excludes shared budgets. This configured-budget result is not a runtime admission guarantee. + Tightest visible remaining budget per finite unit, ordered USD then CREDITS. remaining is headroom after accrued usage and approved one-period grants, not a configured cap. Units are never combined or converted. When no visible finite policy applies, contains a single UNLIMITED entry without remaining, unit, or enforcement, including when applicable_policy_count is zero. Covers only returned evaluated_limits, so non-admin headroom excludes shared budgets and is not evidence that they are unlimited or available. This configured-budget result is not a runtime admission guarantee. evaluated_limits: type: array items: @@ -12754,6 +12609,11 @@ components: next_cursor: type: "null" description: If present on the last page, the cursor must be null. + PlatformDesiredLimitAmount: + type: string + pattern: ^([1-9][0-9]*(\.[0-9]+)?|0\.[0-9]*[1-9][0-9]*)$ + description: | + Desired new total monthly limit in the applicable limit's denomination, encoded as a positive plain decimal string, not an additive increase. Required on creation when the workspace requires an amount and business justification; otherwise optional. The backend stores float32 values, not arbitrary-precision decimals. This is a request, not an approval. PlatformRequestEntityType: type: string enum: @@ -12784,6 +12644,9 @@ components: description: | A request as its requester or agent editor sees it: the outcome, approved amount, and note, but not who resolved it or how broadly. The Glean app shows those details only to billing readers, through AdministrativeLimitIncreaseRequest. properties: + desired_limit_amount: + $ref: "#/components/schemas/PlatformDesiredLimitAmount" + description: Stored desired total monthly limit, when supplied; older requests may omit it. request_id: type: string description: Server-assigned resource identifier, distinct from the response's trace request_id. @@ -12894,7 +12757,11 @@ components: type: string maxLength: 4096 description: | - Explanation of why the increase is needed. Required, and nonblank, when the workspace's request-more configuration requires a business justification. + Explanation of why the increase is needed. Required, and nonblank, when the workspace's request-more configuration requires an amount and business justification. + desired_limit_amount: + $ref: "#/components/schemas/PlatformDesiredLimitAmount" + description: | + Desired total limit for the current UTC month. Required when the workspace requires an amount and justification. PlatformPersonalRequestResponse: type: object additionalProperties: false @@ -12984,6 +12851,9 @@ components: description: | A request as a billing reader sees it: every PersonalLimitIncreaseRequest field, plus who resolved it and the approval's scope and breadth. properties: + desired_limit_amount: + $ref: "#/components/schemas/PlatformDesiredLimitAmount" + description: Stored desired total monthly limit, when supplied; older requests may omit it. request_id: type: string description: Server-assigned resource identifier, distinct from the response's trace request_id. @@ -13128,7 +12998,11 @@ components: type: string maxLength: 4096 description: | - Explanation of why the increase is needed. Required, and nonblank, when the workspace's request-more configuration requires a business justification. + Explanation of why the increase is needed. Required, and nonblank, when the workspace's request-more configuration requires an amount and business justification. + desired_limit_amount: + $ref: "#/components/schemas/PlatformDesiredLimitAmount" + description: | + Desired total agent limit for the current UTC month. Required when the workspace requires an amount and justification. PlatformAdministrativeRequestResponse: type: object additionalProperties: false diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index eb4d90fd8..a31f6ba74 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.809.0 +speakeasyVersion: 1.810.0 sources: Glean API: sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:9520eaea4f882d898719574ee75afc5c9289562b08a4ddbf337693f3041aaae3 - sourceBlobDigest: sha256:d1b9b1adb0aa1d72885cc0bd86db9adc236a161f7f0b70b9f5cc61cf5c7052bd + sourceRevisionDigest: sha256:0ce4e9b2b8560aa2004ea154dba75c6bb685cccc1fc5dd9a0b10c8825182e0b5 + sourceBlobDigest: sha256:4f89567ad6174b01fa95ea0e4c705bcfe303ad158f8935313105767ec9cd3492 tags: - latest Glean Client API: @@ -17,10 +17,10 @@ targets: glean: source: Glean API sourceNamespace: glean-api-specs - sourceRevisionDigest: sha256:9520eaea4f882d898719574ee75afc5c9289562b08a4ddbf337693f3041aaae3 - sourceBlobDigest: sha256:d1b9b1adb0aa1d72885cc0bd86db9adc236a161f7f0b70b9f5cc61cf5c7052bd + sourceRevisionDigest: sha256:0ce4e9b2b8560aa2004ea154dba75c6bb685cccc1fc5dd9a0b10c8825182e0b5 + sourceBlobDigest: sha256:4f89567ad6174b01fa95ea0e4c705bcfe303ad158f8935313105767ec9cd3492 codeSamplesNamespace: glean-api-specs-typescript-code-samples - codeSamplesRevisionDigest: sha256:06e19673f43fc0e8e220f86b9eaf6e47eafc4edc7b98683bcab8f783496ae8b3 + codeSamplesRevisionDigest: sha256:14659b00bfa333c3c46b56bef3e89e3c04eed1683bc609c57a859de67b8fa53c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index dc068bf63..018644545 100644 --- a/README.md +++ b/README.md @@ -532,7 +532,6 @@ 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) @@ -738,7 +737,6 @@ 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 @@ -954,7 +952,6 @@ 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 diff --git a/RELEASES.md b/RELEASES.md index c5e3f68c7..46f040687 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1128,4 +1128,14 @@ Based on: ### Generated - [typescript v0.20.24] . ### Releases -- [NPM v0.20.24] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.24 - . \ No newline at end of file +- [NPM v0.20.24] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.24 - . + +## 2026-11-17 20:22:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.810.0 (2.961.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.20.25] . +### Releases +- [NPM v0.20.25] https://www.npmjs.com/package/@gleanwork/api-client/v/0.20.25 - . \ No newline at end of file diff --git a/docs/models/components/platformdocumentreference.md b/docs/models/components/platformdocumentreference.md deleted file mode 100644 index 7a260c3ef..000000000 --- a/docs/models/components/platformdocumentreference.md +++ /dev/null @@ -1,33 +0,0 @@ -# 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 deleted file mode 100644 index ba27c5c9c..000000000 --- a/docs/models/components/platformsearchenumerationinclude.md +++ /dev/null @@ -1,17 +0,0 @@ -# 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 deleted file mode 100644 index 6e834d700..000000000 --- a/docs/models/components/platformsearchenumerationrequest.md +++ /dev/null @@ -1,30 +0,0 @@ -# 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 deleted file mode 100644 index e68357966..000000000 --- a/docs/models/components/platformsearchenumerationresponse.md +++ /dev/null @@ -1,34 +0,0 @@ -# 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/sdks/search/README.md b/docs/sdks/search/README.md index 93726a1a5..bb8666982 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -6,7 +6,6 @@ * [query](#query) - Search * [listFilters](#listfilters) - List search filters -* [enumerate](#enumerate) - Enumerate matching documents ## query @@ -202,107 +201,4 @@ import { | --------------------------------- | --------------------------------- | --------------------------------- | | errors.PlatformProblemDetailError | 400, 401, 403, 404, 408, 429 | application/problem+json | | errors.PlatformProblemDetailError | 500, 503 | application/problem+json | -| 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 +| errors.GleanError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/package-lock.json b/examples/package-lock.json index 0e142c691..60c663de4 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@gleanwork/api-client", - "version": "0.20.24", + "version": "0.20.25", "dependencies": { "zod": "^3.25.0 || ^4.6.6" }, diff --git a/jsr.json b/jsr.json index 908607704..d506de751 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@gleanwork/api-client", - "version": "0.20.24", + "version": "0.20.25", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 5f121354b..7661a881f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@gleanwork/api-client", - "version": "0.20.24", + "version": "0.20.25", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@gleanwork/api-client", - "version": "0.20.24", + "version": "0.20.25", "dependencies": { "zod": "^3.25.0 || ^4.6.6" }, diff --git a/package.json b/package.json index fc12f16b0..fdad49ed6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gleanwork/api-client", - "version": "0.20.24", + "version": "0.20.25", "author": "Speakeasy", "tshy": { "sourceDialects": [ diff --git a/src/__tests__/messages.test.ts b/src/__tests__/messages.test.ts index 01382f0c4..f39054346 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: "SLACKENTGRID", + datasource: "FACEBOOKWORKPLACE", }); expect(result).toBeDefined(); }); diff --git a/src/__tests__/mockserver/internal/handler/generated_handlers.go b/src/__tests__/mockserver/internal/handler/generated_handlers.go index f400575d0..5b5fb53b8 100644 --- a/src/__tests__/mockserver/internal/handler/generated_handlers.go +++ b/src/__tests__/mockserver/internal/handler/generated_handlers.go @@ -95,7 +95,6 @@ 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 deleted file mode 100644 index 07cddab8b..000000000 --- a/src/__tests__/mockserver/internal/handler/pathpostapisearchenumeration.go +++ /dev/null @@ -1,73 +0,0 @@ -// 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/pathpostrestapiv1getchat.go b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1getchat.go index a7e16d16b..e2243868c 100644 --- a/src/__tests__/mockserver/internal/handler/pathpostrestapiv1getchat.go +++ b/src/__tests__/mockserver/internal/handler/pathpostrestapiv1getchat.go @@ -629,8 +629,8 @@ func testGetchatGetchat0(w http.ResponseWriter, req *http.Request) { Roles: []components.UserRoleSpecification{}, SourceDocumentSpec: types.Pointer(components.CreateDocumentSpecUnionDocumentSpec3( components.DocumentSpec3{ - UgcType: components.DocumentSpecUgcType1Announcements, - ContentID: 848009, + UgcType: components.DocumentSpecUgcType1Shortcuts, + ContentID: 602763, }, )), SourceType: components.AnswerSourceTypeAssistant.ToPointer(), diff --git a/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go b/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go deleted file mode 100644 index 7b49d044a..000000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformdocumentreference.go +++ /dev/null @@ -1,116 +0,0 @@ -// 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 deleted file mode 100644 index 99b23d22a..000000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationinclude.go +++ /dev/null @@ -1,33 +0,0 @@ -// 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 deleted file mode 100644 index 7177befcd..000000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationrequest.go +++ /dev/null @@ -1,92 +0,0 @@ -// 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 deleted file mode 100644 index f2c50dfd5..000000000 --- a/src/__tests__/mockserver/internal/sdk/models/components/platformsearchenumerationresponse.go +++ /dev/null @@ -1,44 +0,0 @@ -// 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/operations/platformsearchenumeration.go b/src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go deleted file mode 100644 index 53f74be38..000000000 --- a/src/__tests__/mockserver/internal/sdk/models/operations/platformsearchenumeration.go +++ /dev/null @@ -1,28 +0,0 @@ -// 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 312cb93f5..5a7da7db2 100644 --- a/src/__tests__/search.test.ts +++ b/src/__tests__/search.test.ts @@ -2079,21 +2079,8 @@ test("Search Platform Search Filters", async () => { 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(); +it.skip("Search Platform Search Enumeration", async () => { + assert.fail( + "incomplete test found please make sure to address the following errors: [`workflow step platform-search-enumeration.test referencing operation platform-search-enumeration not found in document`]", + ); }); diff --git a/src/__tests__/summarize.test.ts b/src/__tests__/summarize.test.ts index 7b1ea9e95..f5f3af075 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: "CHATS", - ugcId: "", + id: "", }, { - url: "https://heavy-castanet.name", + ugcType: "CHATS", + contentId: 668664, }, ], }); diff --git a/src/funcs/searchEnumerate.ts b/src/funcs/searchEnumerate.ts deleted file mode 100644 index 95a50dcf3..000000000 --- a/src/funcs/searchEnumerate.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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 923a67372..5bd45856a 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.24", + sdkVersion: "0.20.25", genVersion: "2.961.1", userAgent: - "speakeasy-sdk/typescript 0.20.24 2.961.1 0.9.0 @gleanwork/api-client", + "speakeasy-sdk/typescript 0.20.25 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 10e440ae6..0d5f1769d 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -421,7 +421,6 @@ 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"; @@ -463,9 +462,6 @@ 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/platformdocumentreference.ts b/src/models/components/platformdocumentreference.ts deleted file mode 100644 index 67180a273..000000000 --- a/src/models/components/platformdocumentreference.ts +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 deleted file mode 100644 index 51344e30c..000000000 --- a/src/models/components/platformsearchenumerationinclude.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 deleted file mode 100644 index 480f7b2de..000000000 --- a/src/models/components/platformsearchenumerationrequest.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 deleted file mode 100644 index 4e4563b9b..000000000 --- a/src/models/components/platformsearchenumerationresponse.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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/react-query/index.ts b/src/react-query/index.ts index 5faf47a12..57530d10c 100644 --- a/src/react-query/index.ts +++ b/src/react-query/index.ts @@ -161,7 +161,6 @@ 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 deleted file mode 100644 index 2c965d5b8..000000000 --- a/src/react-query/searchEnumerate.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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 d3f5c0cad..a4ecf2ede 100644 --- a/src/sdk/search.ts +++ b/src/sdk/search.ts @@ -3,7 +3,6 @@ * @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"; @@ -49,23 +48,4 @@ 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, - )); - } } From 7ebe2378a1a7e381c800c7fa3e6afff7719eb9cd Mon Sep 17 00:00:00 2001 From: "speakeasy-github[bot]" <128539517+speakeasy-github[bot]@users.noreply.github.com> Date: Tue, 17 Nov 2026 20:31:04 +0000 Subject: [PATCH 2/2] empty commit to trigger [run-tests] workflow