@gleanwork/api-client 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/README.md +9 -0
  2. package/dist/commonjs/__tests__/indexing.test-d.d.ts +2 -0
  3. package/dist/commonjs/__tests__/indexing.test-d.d.ts.map +1 -0
  4. package/dist/commonjs/__tests__/indexing.test-d.js +39 -0
  5. package/dist/commonjs/__tests__/indexing.test-d.js.map +1 -0
  6. package/dist/commonjs/__tests__/policies.test.js +8 -5
  7. package/dist/commonjs/__tests__/policies.test.js.map +1 -1
  8. package/dist/commonjs/__tests__/tools.test.d.ts +2 -0
  9. package/dist/commonjs/__tests__/tools.test.d.ts.map +1 -0
  10. package/dist/commonjs/__tests__/tools.test.js +37 -0
  11. package/dist/commonjs/__tests__/tools.test.js.map +1 -0
  12. package/dist/commonjs/funcs/clientGovernanceDataPoliciesList.js +2 -2
  13. package/dist/commonjs/funcs/clientGovernanceDataPoliciesList.js.map +1 -1
  14. package/dist/commonjs/funcs/clientSearchQuery.d.ts +1 -1
  15. package/dist/commonjs/funcs/clientSearchQuery.d.ts.map +1 -1
  16. package/dist/commonjs/funcs/clientSearchQuery.js +2 -4
  17. package/dist/commonjs/funcs/clientSearchQuery.js.map +1 -1
  18. package/dist/commonjs/funcs/clientSearchQueryAsAdmin.d.ts +1 -1
  19. package/dist/commonjs/funcs/clientSearchQueryAsAdmin.d.ts.map +1 -1
  20. package/dist/commonjs/funcs/clientSearchQueryAsAdmin.js +2 -4
  21. package/dist/commonjs/funcs/clientSearchQueryAsAdmin.js.map +1 -1
  22. package/dist/commonjs/funcs/clientSearchRecommendations.d.ts +1 -1
  23. package/dist/commonjs/funcs/clientSearchRecommendations.d.ts.map +1 -1
  24. package/dist/commonjs/funcs/clientSearchRecommendations.js +2 -4
  25. package/dist/commonjs/funcs/clientSearchRecommendations.js.map +1 -1
  26. package/dist/commonjs/funcs/clientToolsList.d.ts +16 -0
  27. package/dist/commonjs/funcs/clientToolsList.d.ts.map +1 -0
  28. package/dist/commonjs/funcs/clientToolsList.js +119 -0
  29. package/dist/commonjs/funcs/clientToolsList.js.map +1 -0
  30. package/dist/commonjs/funcs/clientToolsRun.d.ts +16 -0
  31. package/dist/commonjs/funcs/clientToolsRun.d.ts.map +1 -0
  32. package/dist/commonjs/funcs/clientToolsRun.js +112 -0
  33. package/dist/commonjs/funcs/clientToolsRun.js.map +1 -0
  34. package/dist/commonjs/lib/config.d.ts +3 -3
  35. package/dist/commonjs/lib/config.js +3 -3
  36. package/dist/commonjs/models/components/agentrun.d.ts +6 -26
  37. package/dist/commonjs/models/components/agentrun.d.ts.map +1 -1
  38. package/dist/commonjs/models/components/agentrun.js +3 -26
  39. package/dist/commonjs/models/components/agentrun.js.map +1 -1
  40. package/dist/commonjs/models/components/agentruncreate.d.ts +6 -26
  41. package/dist/commonjs/models/components/agentruncreate.d.ts.map +1 -1
  42. package/dist/commonjs/models/components/agentruncreate.js +3 -26
  43. package/dist/commonjs/models/components/agentruncreate.js.map +1 -1
  44. package/dist/commonjs/models/components/index.d.ts +6 -0
  45. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/index.js +6 -0
  47. package/dist/commonjs/models/components/index.js.map +1 -1
  48. package/dist/commonjs/models/components/tool.d.ts +89 -0
  49. package/dist/commonjs/models/components/tool.d.ts.map +1 -0
  50. package/dist/commonjs/models/components/tool.js +102 -0
  51. package/dist/commonjs/models/components/tool.js.map +1 -0
  52. package/dist/commonjs/models/components/toolparameter.d.ts +104 -0
  53. package/dist/commonjs/models/components/toolparameter.d.ts.map +1 -0
  54. package/dist/commonjs/models/components/toolparameter.js +106 -0
  55. package/dist/commonjs/models/components/toolparameter.js.map +1 -0
  56. package/dist/commonjs/models/components/toolscallparameter.d.ts +51 -0
  57. package/dist/commonjs/models/components/toolscallparameter.d.ts.map +1 -0
  58. package/dist/commonjs/models/components/toolscallparameter.js +77 -0
  59. package/dist/commonjs/models/components/toolscallparameter.js.map +1 -0
  60. package/dist/commonjs/models/components/toolscallrequest.d.ts +42 -0
  61. package/dist/commonjs/models/components/toolscallrequest.d.ts.map +1 -0
  62. package/dist/commonjs/models/components/toolscallrequest.js +72 -0
  63. package/dist/commonjs/models/components/toolscallrequest.js.map +1 -0
  64. package/dist/commonjs/models/components/toolscallresponse.d.ts +41 -0
  65. package/dist/commonjs/models/components/toolscallresponse.d.ts.map +1 -0
  66. package/dist/commonjs/models/components/toolscallresponse.js +71 -0
  67. package/dist/commonjs/models/components/toolscallresponse.js.map +1 -0
  68. package/dist/commonjs/models/components/toolslistresponse.d.ts +30 -0
  69. package/dist/commonjs/models/components/toolslistresponse.d.ts.map +1 -0
  70. package/dist/commonjs/models/components/toolslistresponse.js +70 -0
  71. package/dist/commonjs/models/components/toolslistresponse.js.map +1 -0
  72. package/dist/commonjs/models/operations/getrestapiv1toolslist.d.ts +32 -0
  73. package/dist/commonjs/models/operations/getrestapiv1toolslist.d.ts.map +1 -0
  74. package/dist/commonjs/models/operations/getrestapiv1toolslist.js +69 -0
  75. package/dist/commonjs/models/operations/getrestapiv1toolslist.js.map +1 -0
  76. package/dist/commonjs/models/operations/index.d.ts +2 -1
  77. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  78. package/dist/commonjs/models/operations/index.js +2 -1
  79. package/dist/commonjs/models/operations/index.js.map +1 -1
  80. package/dist/commonjs/models/operations/listpolicies.d.ts +37 -0
  81. package/dist/commonjs/models/operations/listpolicies.d.ts.map +1 -0
  82. package/dist/commonjs/models/operations/{getpolicies.js → listpolicies.js} +17 -17
  83. package/dist/commonjs/models/operations/listpolicies.js.map +1 -0
  84. package/dist/commonjs/react-query/clientSearchQuery.d.ts +1 -1
  85. package/dist/commonjs/react-query/clientSearchQuery.d.ts.map +1 -1
  86. package/dist/commonjs/react-query/clientSearchQueryAsAdmin.d.ts +1 -1
  87. package/dist/commonjs/react-query/clientSearchQueryAsAdmin.d.ts.map +1 -1
  88. package/dist/commonjs/react-query/clientSearchRecommendations.d.ts +1 -1
  89. package/dist/commonjs/react-query/clientSearchRecommendations.d.ts.map +1 -1
  90. package/dist/commonjs/react-query/clientToolsList.d.ts +38 -0
  91. package/dist/commonjs/react-query/clientToolsList.d.ts.map +1 -0
  92. package/dist/commonjs/react-query/clientToolsList.js +82 -0
  93. package/dist/commonjs/react-query/clientToolsList.js.map +1 -0
  94. package/dist/commonjs/react-query/clientToolsRun.d.ts +23 -0
  95. package/dist/commonjs/react-query/clientToolsRun.d.ts.map +1 -0
  96. package/dist/commonjs/react-query/clientToolsRun.js +47 -0
  97. package/dist/commonjs/react-query/clientToolsRun.js.map +1 -0
  98. package/dist/commonjs/react-query/index.d.ts +2 -0
  99. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  100. package/dist/commonjs/react-query/index.js +2 -0
  101. package/dist/commonjs/react-query/index.js.map +1 -1
  102. package/dist/commonjs/sdk/client.d.ts +3 -0
  103. package/dist/commonjs/sdk/client.d.ts.map +1 -1
  104. package/dist/commonjs/sdk/client.js +4 -0
  105. package/dist/commonjs/sdk/client.js.map +1 -1
  106. package/dist/commonjs/sdk/search.d.ts +3 -3
  107. package/dist/commonjs/sdk/search.d.ts.map +1 -1
  108. package/dist/commonjs/sdk/search.js.map +1 -1
  109. package/dist/commonjs/sdk/tools.d.ts +19 -0
  110. package/dist/commonjs/sdk/tools.d.ts.map +1 -0
  111. package/dist/commonjs/sdk/tools.js +32 -0
  112. package/dist/commonjs/sdk/tools.js.map +1 -0
  113. package/dist/esm/__tests__/indexing.test-d.d.ts +2 -0
  114. package/dist/esm/__tests__/indexing.test-d.d.ts.map +1 -0
  115. package/dist/esm/__tests__/indexing.test-d.js +37 -0
  116. package/dist/esm/__tests__/indexing.test-d.js.map +1 -0
  117. package/dist/esm/__tests__/policies.test.js +8 -5
  118. package/dist/esm/__tests__/policies.test.js.map +1 -1
  119. package/dist/esm/__tests__/tools.test.d.ts +2 -0
  120. package/dist/esm/__tests__/tools.test.d.ts.map +1 -0
  121. package/dist/esm/__tests__/tools.test.js +35 -0
  122. package/dist/esm/__tests__/tools.test.js.map +1 -0
  123. package/dist/esm/funcs/clientGovernanceDataPoliciesList.js +2 -2
  124. package/dist/esm/funcs/clientGovernanceDataPoliciesList.js.map +1 -1
  125. package/dist/esm/funcs/clientSearchQuery.d.ts +1 -1
  126. package/dist/esm/funcs/clientSearchQuery.d.ts.map +1 -1
  127. package/dist/esm/funcs/clientSearchQuery.js +2 -4
  128. package/dist/esm/funcs/clientSearchQuery.js.map +1 -1
  129. package/dist/esm/funcs/clientSearchQueryAsAdmin.d.ts +1 -1
  130. package/dist/esm/funcs/clientSearchQueryAsAdmin.d.ts.map +1 -1
  131. package/dist/esm/funcs/clientSearchQueryAsAdmin.js +2 -4
  132. package/dist/esm/funcs/clientSearchQueryAsAdmin.js.map +1 -1
  133. package/dist/esm/funcs/clientSearchRecommendations.d.ts +1 -1
  134. package/dist/esm/funcs/clientSearchRecommendations.d.ts.map +1 -1
  135. package/dist/esm/funcs/clientSearchRecommendations.js +2 -4
  136. package/dist/esm/funcs/clientSearchRecommendations.js.map +1 -1
  137. package/dist/esm/funcs/clientToolsList.d.ts +16 -0
  138. package/dist/esm/funcs/clientToolsList.d.ts.map +1 -0
  139. package/dist/esm/funcs/clientToolsList.js +83 -0
  140. package/dist/esm/funcs/clientToolsList.js.map +1 -0
  141. package/dist/esm/funcs/clientToolsRun.d.ts +16 -0
  142. package/dist/esm/funcs/clientToolsRun.d.ts.map +1 -0
  143. package/dist/esm/funcs/clientToolsRun.js +76 -0
  144. package/dist/esm/funcs/clientToolsRun.js.map +1 -0
  145. package/dist/esm/lib/config.d.ts +3 -3
  146. package/dist/esm/lib/config.js +3 -3
  147. package/dist/esm/models/components/agentrun.d.ts +6 -26
  148. package/dist/esm/models/components/agentrun.d.ts.map +1 -1
  149. package/dist/esm/models/components/agentrun.js +2 -23
  150. package/dist/esm/models/components/agentrun.js.map +1 -1
  151. package/dist/esm/models/components/agentruncreate.d.ts +6 -26
  152. package/dist/esm/models/components/agentruncreate.d.ts.map +1 -1
  153. package/dist/esm/models/components/agentruncreate.js +2 -23
  154. package/dist/esm/models/components/agentruncreate.js.map +1 -1
  155. package/dist/esm/models/components/index.d.ts +6 -0
  156. package/dist/esm/models/components/index.d.ts.map +1 -1
  157. package/dist/esm/models/components/index.js +6 -0
  158. package/dist/esm/models/components/index.js.map +1 -1
  159. package/dist/esm/models/components/tool.d.ts +89 -0
  160. package/dist/esm/models/components/tool.d.ts.map +1 -0
  161. package/dist/esm/models/components/tool.js +64 -0
  162. package/dist/esm/models/components/tool.js.map +1 -0
  163. package/dist/esm/models/components/toolparameter.d.ts +104 -0
  164. package/dist/esm/models/components/toolparameter.d.ts.map +1 -0
  165. package/dist/esm/models/components/toolparameter.js +68 -0
  166. package/dist/esm/models/components/toolparameter.js.map +1 -0
  167. package/dist/esm/models/components/toolscallparameter.d.ts +51 -0
  168. package/dist/esm/models/components/toolscallparameter.d.ts.map +1 -0
  169. package/dist/esm/models/components/toolscallparameter.js +39 -0
  170. package/dist/esm/models/components/toolscallparameter.js.map +1 -0
  171. package/dist/esm/models/components/toolscallrequest.d.ts +42 -0
  172. package/dist/esm/models/components/toolscallrequest.d.ts.map +1 -0
  173. package/dist/esm/models/components/toolscallrequest.js +34 -0
  174. package/dist/esm/models/components/toolscallrequest.js.map +1 -0
  175. package/dist/esm/models/components/toolscallresponse.d.ts +41 -0
  176. package/dist/esm/models/components/toolscallresponse.d.ts.map +1 -0
  177. package/dist/esm/models/components/toolscallresponse.js +33 -0
  178. package/dist/esm/models/components/toolscallresponse.js.map +1 -0
  179. package/dist/esm/models/components/toolslistresponse.d.ts +30 -0
  180. package/dist/esm/models/components/toolslistresponse.d.ts.map +1 -0
  181. package/dist/esm/models/components/toolslistresponse.js +32 -0
  182. package/dist/esm/models/components/toolslistresponse.js.map +1 -0
  183. package/dist/esm/models/operations/getrestapiv1toolslist.d.ts +32 -0
  184. package/dist/esm/models/operations/getrestapiv1toolslist.d.ts.map +1 -0
  185. package/dist/esm/models/operations/getrestapiv1toolslist.js +31 -0
  186. package/dist/esm/models/operations/getrestapiv1toolslist.js.map +1 -0
  187. package/dist/esm/models/operations/index.d.ts +2 -1
  188. package/dist/esm/models/operations/index.d.ts.map +1 -1
  189. package/dist/esm/models/operations/index.js +2 -1
  190. package/dist/esm/models/operations/index.js.map +1 -1
  191. package/dist/esm/models/operations/listpolicies.d.ts +37 -0
  192. package/dist/esm/models/operations/listpolicies.d.ts.map +1 -0
  193. package/dist/esm/models/operations/listpolicies.js +33 -0
  194. package/dist/esm/models/operations/listpolicies.js.map +1 -0
  195. package/dist/esm/react-query/clientSearchQuery.d.ts +1 -1
  196. package/dist/esm/react-query/clientSearchQuery.d.ts.map +1 -1
  197. package/dist/esm/react-query/clientSearchQueryAsAdmin.d.ts +1 -1
  198. package/dist/esm/react-query/clientSearchQueryAsAdmin.d.ts.map +1 -1
  199. package/dist/esm/react-query/clientSearchRecommendations.d.ts +1 -1
  200. package/dist/esm/react-query/clientSearchRecommendations.d.ts.map +1 -1
  201. package/dist/esm/react-query/clientToolsList.d.ts +38 -0
  202. package/dist/esm/react-query/clientToolsList.d.ts.map +1 -0
  203. package/dist/esm/react-query/clientToolsList.js +72 -0
  204. package/dist/esm/react-query/clientToolsList.js.map +1 -0
  205. package/dist/esm/react-query/clientToolsRun.d.ts +23 -0
  206. package/dist/esm/react-query/clientToolsRun.d.ts.map +1 -0
  207. package/dist/esm/react-query/clientToolsRun.js +42 -0
  208. package/dist/esm/react-query/clientToolsRun.js.map +1 -0
  209. package/dist/esm/react-query/index.d.ts +2 -0
  210. package/dist/esm/react-query/index.d.ts.map +1 -1
  211. package/dist/esm/react-query/index.js +2 -0
  212. package/dist/esm/react-query/index.js.map +1 -1
  213. package/dist/esm/sdk/client.d.ts +3 -0
  214. package/dist/esm/sdk/client.d.ts.map +1 -1
  215. package/dist/esm/sdk/client.js +4 -0
  216. package/dist/esm/sdk/client.js.map +1 -1
  217. package/dist/esm/sdk/search.d.ts +3 -3
  218. package/dist/esm/sdk/search.d.ts.map +1 -1
  219. package/dist/esm/sdk/search.js.map +1 -1
  220. package/dist/esm/sdk/tools.d.ts +19 -0
  221. package/dist/esm/sdk/tools.d.ts.map +1 -0
  222. package/dist/esm/sdk/tools.js +28 -0
  223. package/dist/esm/sdk/tools.js.map +1 -0
  224. package/docs/sdks/search/README.md +310 -22882
  225. package/docs/sdks/tools/README.md +214 -0
  226. package/jsr.json +1 -1
  227. package/package.json +2 -2
  228. package/src/__tests__/indexing.test-d.ts +40 -0
  229. package/src/__tests__/policies.test.ts +14 -8
  230. package/src/__tests__/tools.test.ts +41 -0
  231. package/src/funcs/clientGovernanceDataPoliciesList.ts +3 -3
  232. package/src/funcs/clientSearchQuery.ts +4 -6
  233. package/src/funcs/clientSearchQueryAsAdmin.ts +4 -6
  234. package/src/funcs/clientSearchRecommendations.ts +4 -7
  235. package/src/funcs/clientToolsList.ts +164 -0
  236. package/src/funcs/clientToolsRun.ts +154 -0
  237. package/src/lib/config.ts +3 -3
  238. package/src/models/components/agentrun.ts +4 -53
  239. package/src/models/components/agentruncreate.ts +4 -57
  240. package/src/models/components/index.ts +6 -0
  241. package/src/models/components/tool.ts +125 -0
  242. package/src/models/components/toolparameter.ts +141 -0
  243. package/src/models/components/toolscallparameter.ts +92 -0
  244. package/src/models/components/toolscallrequest.ts +82 -0
  245. package/src/models/components/toolscallresponse.ts +76 -0
  246. package/src/models/components/toolslistresponse.ts +72 -0
  247. package/src/models/operations/getrestapiv1toolslist.ts +71 -0
  248. package/src/models/operations/index.ts +2 -1
  249. package/src/models/operations/{getpolicies.ts → listpolicies.ts} +21 -21
  250. package/src/react-query/clientSearchQuery.ts +1 -1
  251. package/src/react-query/clientSearchQueryAsAdmin.ts +1 -1
  252. package/src/react-query/clientSearchRecommendations.ts +1 -1
  253. package/src/react-query/clientToolsList.ts +150 -0
  254. package/src/react-query/clientToolsRun.ts +88 -0
  255. package/src/react-query/index.ts +2 -0
  256. package/src/sdk/client.ts +6 -0
  257. package/src/sdk/search.ts +3 -3
  258. package/src/sdk/tools.ts +45 -0
  259. package/dist/commonjs/models/operations/getpolicies.d.ts +0 -37
  260. package/dist/commonjs/models/operations/getpolicies.d.ts.map +0 -1
  261. package/dist/commonjs/models/operations/getpolicies.js.map +0 -1
  262. package/dist/esm/models/operations/getpolicies.d.ts +0 -37
  263. package/dist/esm/models/operations/getpolicies.d.ts.map +0 -1
  264. package/dist/esm/models/operations/getpolicies.js +0 -33
  265. package/dist/esm/models/operations/getpolicies.js.map +0 -1
@@ -0,0 +1,92 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ToolsCallParameter = {
11
+ /**
12
+ * The name of the parameter
13
+ */
14
+ name: string;
15
+ /**
16
+ * The value of the parameter (for primitive types)
17
+ */
18
+ value: string;
19
+ /**
20
+ * The value of the parameter (for array types)
21
+ */
22
+ items?: Array<ToolsCallParameter> | undefined;
23
+ /**
24
+ * The value of the parameter (for object types)
25
+ */
26
+ properties?: { [k: string]: ToolsCallParameter } | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const ToolsCallParameter$inboundSchema: z.ZodType<
31
+ ToolsCallParameter,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ name: z.string(),
36
+ value: z.string(),
37
+ items: z.array(z.lazy(() => ToolsCallParameter$inboundSchema)).optional(),
38
+ properties: z.record(z.lazy(() => ToolsCallParameter$inboundSchema))
39
+ .optional(),
40
+ });
41
+
42
+ /** @internal */
43
+ export type ToolsCallParameter$Outbound = {
44
+ name: string;
45
+ value: string;
46
+ items?: Array<ToolsCallParameter$Outbound> | undefined;
47
+ properties?: { [k: string]: ToolsCallParameter$Outbound } | undefined;
48
+ };
49
+
50
+ /** @internal */
51
+ export const ToolsCallParameter$outboundSchema: z.ZodType<
52
+ ToolsCallParameter$Outbound,
53
+ z.ZodTypeDef,
54
+ ToolsCallParameter
55
+ > = z.object({
56
+ name: z.string(),
57
+ value: z.string(),
58
+ items: z.array(z.lazy(() => ToolsCallParameter$outboundSchema)).optional(),
59
+ properties: z.record(z.lazy(() => ToolsCallParameter$outboundSchema))
60
+ .optional(),
61
+ });
62
+
63
+ /**
64
+ * @internal
65
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
66
+ */
67
+ export namespace ToolsCallParameter$ {
68
+ /** @deprecated use `ToolsCallParameter$inboundSchema` instead. */
69
+ export const inboundSchema = ToolsCallParameter$inboundSchema;
70
+ /** @deprecated use `ToolsCallParameter$outboundSchema` instead. */
71
+ export const outboundSchema = ToolsCallParameter$outboundSchema;
72
+ /** @deprecated use `ToolsCallParameter$Outbound` instead. */
73
+ export type Outbound = ToolsCallParameter$Outbound;
74
+ }
75
+
76
+ export function toolsCallParameterToJSON(
77
+ toolsCallParameter: ToolsCallParameter,
78
+ ): string {
79
+ return JSON.stringify(
80
+ ToolsCallParameter$outboundSchema.parse(toolsCallParameter),
81
+ );
82
+ }
83
+
84
+ export function toolsCallParameterFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<ToolsCallParameter, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => ToolsCallParameter$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'ToolsCallParameter' from JSON`,
91
+ );
92
+ }
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ ToolsCallParameter,
11
+ ToolsCallParameter$inboundSchema,
12
+ ToolsCallParameter$Outbound,
13
+ ToolsCallParameter$outboundSchema,
14
+ } from "./toolscallparameter.js";
15
+
16
+ export type ToolsCallRequest = {
17
+ /**
18
+ * Required name of the tool to execute
19
+ */
20
+ name: string;
21
+ /**
22
+ * The parameters for the tool. Each key is the name of the parameter and the value is the parameter object.
23
+ */
24
+ parameters: { [k: string]: ToolsCallParameter };
25
+ };
26
+
27
+ /** @internal */
28
+ export const ToolsCallRequest$inboundSchema: z.ZodType<
29
+ ToolsCallRequest,
30
+ z.ZodTypeDef,
31
+ unknown
32
+ > = z.object({
33
+ name: z.string(),
34
+ parameters: z.record(ToolsCallParameter$inboundSchema),
35
+ });
36
+
37
+ /** @internal */
38
+ export type ToolsCallRequest$Outbound = {
39
+ name: string;
40
+ parameters: { [k: string]: ToolsCallParameter$Outbound };
41
+ };
42
+
43
+ /** @internal */
44
+ export const ToolsCallRequest$outboundSchema: z.ZodType<
45
+ ToolsCallRequest$Outbound,
46
+ z.ZodTypeDef,
47
+ ToolsCallRequest
48
+ > = z.object({
49
+ name: z.string(),
50
+ parameters: z.record(ToolsCallParameter$outboundSchema),
51
+ });
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace ToolsCallRequest$ {
58
+ /** @deprecated use `ToolsCallRequest$inboundSchema` instead. */
59
+ export const inboundSchema = ToolsCallRequest$inboundSchema;
60
+ /** @deprecated use `ToolsCallRequest$outboundSchema` instead. */
61
+ export const outboundSchema = ToolsCallRequest$outboundSchema;
62
+ /** @deprecated use `ToolsCallRequest$Outbound` instead. */
63
+ export type Outbound = ToolsCallRequest$Outbound;
64
+ }
65
+
66
+ export function toolsCallRequestToJSON(
67
+ toolsCallRequest: ToolsCallRequest,
68
+ ): string {
69
+ return JSON.stringify(
70
+ ToolsCallRequest$outboundSchema.parse(toolsCallRequest),
71
+ );
72
+ }
73
+
74
+ export function toolsCallRequestFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<ToolsCallRequest, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => ToolsCallRequest$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'ToolsCallRequest' from JSON`,
81
+ );
82
+ }
@@ -0,0 +1,76 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type ToolsCallResponse = {
11
+ /**
12
+ * The raw response from the tool
13
+ */
14
+ rawResponse?: { [k: string]: any } | undefined;
15
+ /**
16
+ * The error message if applicable
17
+ */
18
+ error?: string | undefined;
19
+ };
20
+
21
+ /** @internal */
22
+ export const ToolsCallResponse$inboundSchema: z.ZodType<
23
+ ToolsCallResponse,
24
+ z.ZodTypeDef,
25
+ unknown
26
+ > = z.object({
27
+ rawResponse: z.record(z.any()).optional(),
28
+ error: z.string().optional(),
29
+ });
30
+
31
+ /** @internal */
32
+ export type ToolsCallResponse$Outbound = {
33
+ rawResponse?: { [k: string]: any } | undefined;
34
+ error?: string | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const ToolsCallResponse$outboundSchema: z.ZodType<
39
+ ToolsCallResponse$Outbound,
40
+ z.ZodTypeDef,
41
+ ToolsCallResponse
42
+ > = z.object({
43
+ rawResponse: z.record(z.any()).optional(),
44
+ error: z.string().optional(),
45
+ });
46
+
47
+ /**
48
+ * @internal
49
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
+ */
51
+ export namespace ToolsCallResponse$ {
52
+ /** @deprecated use `ToolsCallResponse$inboundSchema` instead. */
53
+ export const inboundSchema = ToolsCallResponse$inboundSchema;
54
+ /** @deprecated use `ToolsCallResponse$outboundSchema` instead. */
55
+ export const outboundSchema = ToolsCallResponse$outboundSchema;
56
+ /** @deprecated use `ToolsCallResponse$Outbound` instead. */
57
+ export type Outbound = ToolsCallResponse$Outbound;
58
+ }
59
+
60
+ export function toolsCallResponseToJSON(
61
+ toolsCallResponse: ToolsCallResponse,
62
+ ): string {
63
+ return JSON.stringify(
64
+ ToolsCallResponse$outboundSchema.parse(toolsCallResponse),
65
+ );
66
+ }
67
+
68
+ export function toolsCallResponseFromJSON(
69
+ jsonString: string,
70
+ ): SafeParseResult<ToolsCallResponse, SDKValidationError> {
71
+ return safeParse(
72
+ jsonString,
73
+ (x) => ToolsCallResponse$inboundSchema.parse(JSON.parse(x)),
74
+ `Failed to parse 'ToolsCallResponse' from JSON`,
75
+ );
76
+ }
@@ -0,0 +1,72 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ Tool,
11
+ Tool$inboundSchema,
12
+ Tool$Outbound,
13
+ Tool$outboundSchema,
14
+ } from "./tool.js";
15
+
16
+ export type ToolsListResponse = {
17
+ tools?: Array<Tool> | undefined;
18
+ };
19
+
20
+ /** @internal */
21
+ export const ToolsListResponse$inboundSchema: z.ZodType<
22
+ ToolsListResponse,
23
+ z.ZodTypeDef,
24
+ unknown
25
+ > = z.object({
26
+ tools: z.array(Tool$inboundSchema).optional(),
27
+ });
28
+
29
+ /** @internal */
30
+ export type ToolsListResponse$Outbound = {
31
+ tools?: Array<Tool$Outbound> | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const ToolsListResponse$outboundSchema: z.ZodType<
36
+ ToolsListResponse$Outbound,
37
+ z.ZodTypeDef,
38
+ ToolsListResponse
39
+ > = z.object({
40
+ tools: z.array(Tool$outboundSchema).optional(),
41
+ });
42
+
43
+ /**
44
+ * @internal
45
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
46
+ */
47
+ export namespace ToolsListResponse$ {
48
+ /** @deprecated use `ToolsListResponse$inboundSchema` instead. */
49
+ export const inboundSchema = ToolsListResponse$inboundSchema;
50
+ /** @deprecated use `ToolsListResponse$outboundSchema` instead. */
51
+ export const outboundSchema = ToolsListResponse$outboundSchema;
52
+ /** @deprecated use `ToolsListResponse$Outbound` instead. */
53
+ export type Outbound = ToolsListResponse$Outbound;
54
+ }
55
+
56
+ export function toolsListResponseToJSON(
57
+ toolsListResponse: ToolsListResponse,
58
+ ): string {
59
+ return JSON.stringify(
60
+ ToolsListResponse$outboundSchema.parse(toolsListResponse),
61
+ );
62
+ }
63
+
64
+ export function toolsListResponseFromJSON(
65
+ jsonString: string,
66
+ ): SafeParseResult<ToolsListResponse, SDKValidationError> {
67
+ return safeParse(
68
+ jsonString,
69
+ (x) => ToolsListResponse$inboundSchema.parse(JSON.parse(x)),
70
+ `Failed to parse 'ToolsListResponse' from JSON`,
71
+ );
72
+ }
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+
10
+ export type GetRestApiV1ToolsListRequest = {
11
+ /**
12
+ * Optional array of tool names to filter by
13
+ */
14
+ toolNames?: Array<string> | undefined;
15
+ };
16
+
17
+ /** @internal */
18
+ export const GetRestApiV1ToolsListRequest$inboundSchema: z.ZodType<
19
+ GetRestApiV1ToolsListRequest,
20
+ z.ZodTypeDef,
21
+ unknown
22
+ > = z.object({
23
+ toolNames: z.array(z.string()).optional(),
24
+ });
25
+
26
+ /** @internal */
27
+ export type GetRestApiV1ToolsListRequest$Outbound = {
28
+ toolNames?: Array<string> | undefined;
29
+ };
30
+
31
+ /** @internal */
32
+ export const GetRestApiV1ToolsListRequest$outboundSchema: z.ZodType<
33
+ GetRestApiV1ToolsListRequest$Outbound,
34
+ z.ZodTypeDef,
35
+ GetRestApiV1ToolsListRequest
36
+ > = z.object({
37
+ toolNames: z.array(z.string()).optional(),
38
+ });
39
+
40
+ /**
41
+ * @internal
42
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
43
+ */
44
+ export namespace GetRestApiV1ToolsListRequest$ {
45
+ /** @deprecated use `GetRestApiV1ToolsListRequest$inboundSchema` instead. */
46
+ export const inboundSchema = GetRestApiV1ToolsListRequest$inboundSchema;
47
+ /** @deprecated use `GetRestApiV1ToolsListRequest$outboundSchema` instead. */
48
+ export const outboundSchema = GetRestApiV1ToolsListRequest$outboundSchema;
49
+ /** @deprecated use `GetRestApiV1ToolsListRequest$Outbound` instead. */
50
+ export type Outbound = GetRestApiV1ToolsListRequest$Outbound;
51
+ }
52
+
53
+ export function getRestApiV1ToolsListRequestToJSON(
54
+ getRestApiV1ToolsListRequest: GetRestApiV1ToolsListRequest,
55
+ ): string {
56
+ return JSON.stringify(
57
+ GetRestApiV1ToolsListRequest$outboundSchema.parse(
58
+ getRestApiV1ToolsListRequest,
59
+ ),
60
+ );
61
+ }
62
+
63
+ export function getRestApiV1ToolsListRequestFromJSON(
64
+ jsonString: string,
65
+ ): SafeParseResult<GetRestApiV1ToolsListRequest, SDKValidationError> {
66
+ return safeParse(
67
+ jsonString,
68
+ (x) => GetRestApiV1ToolsListRequest$inboundSchema.parse(JSON.parse(x)),
69
+ `Failed to parse 'GetRestApiV1ToolsListRequest' from JSON`,
70
+ );
71
+ }
@@ -16,11 +16,12 @@ export * from "./getchat.js";
16
16
  export * from "./getchatapplication.js";
17
17
  export * from "./getchatfiles.js";
18
18
  export * from "./getdocvisibility.js";
19
- export * from "./getpolicies.js";
20
19
  export * from "./getpolicy.js";
21
20
  export * from "./getreportstatus.js";
21
+ export * from "./getrestapiv1toolslist.js";
22
22
  export * from "./listchats.js";
23
23
  export * from "./listpins.js";
24
+ export * from "./listpolicies.js";
24
25
  export * from "./listverifications.js";
25
26
  export * from "./postapiindexv1debugdatasourcedocument.js";
26
27
  export * from "./postapiindexv1debugdatasourcedocuments.js";
@@ -7,7 +7,7 @@ import { safeParse } from "../../lib/schemas.js";
7
7
  import { Result as SafeParseResult } from "../../types/fp.js";
8
8
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
9
 
10
- export type GetpoliciesRequest = {
10
+ export type ListpoliciesRequest = {
11
11
  /**
12
12
  * Filter to return reports with a given value of auto-hide.
13
13
  */
@@ -19,8 +19,8 @@ export type GetpoliciesRequest = {
19
19
  };
20
20
 
21
21
  /** @internal */
22
- export const GetpoliciesRequest$inboundSchema: z.ZodType<
23
- GetpoliciesRequest,
22
+ export const ListpoliciesRequest$inboundSchema: z.ZodType<
23
+ ListpoliciesRequest,
24
24
  z.ZodTypeDef,
25
25
  unknown
26
26
  > = z.object({
@@ -29,16 +29,16 @@ export const GetpoliciesRequest$inboundSchema: z.ZodType<
29
29
  });
30
30
 
31
31
  /** @internal */
32
- export type GetpoliciesRequest$Outbound = {
32
+ export type ListpoliciesRequest$Outbound = {
33
33
  autoHide?: boolean | undefined;
34
34
  frequency?: string | undefined;
35
35
  };
36
36
 
37
37
  /** @internal */
38
- export const GetpoliciesRequest$outboundSchema: z.ZodType<
39
- GetpoliciesRequest$Outbound,
38
+ export const ListpoliciesRequest$outboundSchema: z.ZodType<
39
+ ListpoliciesRequest$Outbound,
40
40
  z.ZodTypeDef,
41
- GetpoliciesRequest
41
+ ListpoliciesRequest
42
42
  > = z.object({
43
43
  autoHide: z.boolean().optional(),
44
44
  frequency: z.string().optional(),
@@ -48,29 +48,29 @@ export const GetpoliciesRequest$outboundSchema: z.ZodType<
48
48
  * @internal
49
49
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
50
50
  */
51
- export namespace GetpoliciesRequest$ {
52
- /** @deprecated use `GetpoliciesRequest$inboundSchema` instead. */
53
- export const inboundSchema = GetpoliciesRequest$inboundSchema;
54
- /** @deprecated use `GetpoliciesRequest$outboundSchema` instead. */
55
- export const outboundSchema = GetpoliciesRequest$outboundSchema;
56
- /** @deprecated use `GetpoliciesRequest$Outbound` instead. */
57
- export type Outbound = GetpoliciesRequest$Outbound;
51
+ export namespace ListpoliciesRequest$ {
52
+ /** @deprecated use `ListpoliciesRequest$inboundSchema` instead. */
53
+ export const inboundSchema = ListpoliciesRequest$inboundSchema;
54
+ /** @deprecated use `ListpoliciesRequest$outboundSchema` instead. */
55
+ export const outboundSchema = ListpoliciesRequest$outboundSchema;
56
+ /** @deprecated use `ListpoliciesRequest$Outbound` instead. */
57
+ export type Outbound = ListpoliciesRequest$Outbound;
58
58
  }
59
59
 
60
- export function getpoliciesRequestToJSON(
61
- getpoliciesRequest: GetpoliciesRequest,
60
+ export function listpoliciesRequestToJSON(
61
+ listpoliciesRequest: ListpoliciesRequest,
62
62
  ): string {
63
63
  return JSON.stringify(
64
- GetpoliciesRequest$outboundSchema.parse(getpoliciesRequest),
64
+ ListpoliciesRequest$outboundSchema.parse(listpoliciesRequest),
65
65
  );
66
66
  }
67
67
 
68
- export function getpoliciesRequestFromJSON(
68
+ export function listpoliciesRequestFromJSON(
69
69
  jsonString: string,
70
- ): SafeParseResult<GetpoliciesRequest, SDKValidationError> {
70
+ ): SafeParseResult<ListpoliciesRequest, SDKValidationError> {
71
71
  return safeParse(
72
72
  jsonString,
73
- (x) => GetpoliciesRequest$inboundSchema.parse(JSON.parse(x)),
74
- `Failed to parse 'GetpoliciesRequest' from JSON`,
73
+ (x) => ListpoliciesRequest$inboundSchema.parse(JSON.parse(x)),
74
+ `Failed to parse 'ListpoliciesRequest' from JSON`,
75
75
  );
76
76
  }
@@ -17,7 +17,7 @@ import { useGleanContext } from "./_context.js";
17
17
  import { MutationHookOptions } from "./_types.js";
18
18
 
19
19
  export type ClientSearchQueryMutationVariables = {
20
- request?: components.SearchRequest | undefined;
20
+ request: components.SearchRequest;
21
21
  options?: RequestOptions;
22
22
  };
23
23
 
@@ -17,7 +17,7 @@ import { useGleanContext } from "./_context.js";
17
17
  import { MutationHookOptions } from "./_types.js";
18
18
 
19
19
  export type ClientSearchQueryAsAdminMutationVariables = {
20
- request?: components.SearchRequest | undefined;
20
+ request: components.SearchRequest;
21
21
  options?: RequestOptions;
22
22
  };
23
23
 
@@ -17,7 +17,7 @@ import { useGleanContext } from "./_context.js";
17
17
  import { MutationHookOptions } from "./_types.js";
18
18
 
19
19
  export type ClientSearchRecommendationsMutationVariables = {
20
- request?: components.RecommendationsRequest | undefined;
20
+ request: components.RecommendationsRequest;
21
21
  options?: RequestOptions;
22
22
  };
23
23
 
@@ -0,0 +1,150 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InvalidateQueryFilters,
7
+ QueryClient,
8
+ QueryFunctionContext,
9
+ QueryKey,
10
+ useQuery,
11
+ UseQueryResult,
12
+ useSuspenseQuery,
13
+ UseSuspenseQueryResult,
14
+ } from "@tanstack/react-query";
15
+ import { GleanCore } from "../core.js";
16
+ import { clientToolsList } from "../funcs/clientToolsList.js";
17
+ import { combineSignals } from "../lib/primitives.js";
18
+ import { RequestOptions } from "../lib/sdks.js";
19
+ import * as components from "../models/components/index.js";
20
+ import { unwrapAsync } from "../types/fp.js";
21
+ import { useGleanContext } from "./_context.js";
22
+ import {
23
+ QueryHookOptions,
24
+ SuspenseQueryHookOptions,
25
+ TupleToPrefixes,
26
+ } from "./_types.js";
27
+
28
+ export type ClientToolsListQueryData = components.ToolsListResponse;
29
+
30
+ /**
31
+ * List available tools
32
+ *
33
+ * @remarks
34
+ * Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned.
35
+ */
36
+ export function useClientToolsList(
37
+ toolNames?: Array<string> | undefined,
38
+ options?: QueryHookOptions<ClientToolsListQueryData>,
39
+ ): UseQueryResult<ClientToolsListQueryData, Error> {
40
+ const client = useGleanContext();
41
+ return useQuery({
42
+ ...buildClientToolsListQuery(
43
+ client,
44
+ toolNames,
45
+ options,
46
+ ),
47
+ ...options,
48
+ });
49
+ }
50
+
51
+ /**
52
+ * List available tools
53
+ *
54
+ * @remarks
55
+ * Returns a filtered set of available tools based on optional tool name parameters. If no filters are provided, all available tools are returned.
56
+ */
57
+ export function useClientToolsListSuspense(
58
+ toolNames?: Array<string> | undefined,
59
+ options?: SuspenseQueryHookOptions<ClientToolsListQueryData>,
60
+ ): UseSuspenseQueryResult<ClientToolsListQueryData, Error> {
61
+ const client = useGleanContext();
62
+ return useSuspenseQuery({
63
+ ...buildClientToolsListQuery(
64
+ client,
65
+ toolNames,
66
+ options,
67
+ ),
68
+ ...options,
69
+ });
70
+ }
71
+
72
+ export function prefetchClientToolsList(
73
+ queryClient: QueryClient,
74
+ client$: GleanCore,
75
+ toolNames?: Array<string> | undefined,
76
+ ): Promise<void> {
77
+ return queryClient.prefetchQuery({
78
+ ...buildClientToolsListQuery(
79
+ client$,
80
+ toolNames,
81
+ ),
82
+ });
83
+ }
84
+
85
+ export function setClientToolsListData(
86
+ client: QueryClient,
87
+ queryKeyBase: [parameters: { toolNames?: Array<string> | undefined }],
88
+ data: ClientToolsListQueryData,
89
+ ): ClientToolsListQueryData | undefined {
90
+ const key = queryKeyClientToolsList(...queryKeyBase);
91
+
92
+ return client.setQueryData<ClientToolsListQueryData>(key, data);
93
+ }
94
+
95
+ export function invalidateClientToolsList(
96
+ client: QueryClient,
97
+ queryKeyBase: TupleToPrefixes<
98
+ [parameters: { toolNames?: Array<string> | undefined }]
99
+ >,
100
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
101
+ ): Promise<void> {
102
+ return client.invalidateQueries({
103
+ ...filters,
104
+ queryKey: ["@gleanwork/api-client", "tools", "list", ...queryKeyBase],
105
+ });
106
+ }
107
+
108
+ export function invalidateAllClientToolsList(
109
+ client: QueryClient,
110
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
111
+ ): Promise<void> {
112
+ return client.invalidateQueries({
113
+ ...filters,
114
+ queryKey: ["@gleanwork/api-client", "tools", "list"],
115
+ });
116
+ }
117
+
118
+ export function buildClientToolsListQuery(
119
+ client$: GleanCore,
120
+ toolNames?: Array<string> | undefined,
121
+ options?: RequestOptions,
122
+ ): {
123
+ queryKey: QueryKey;
124
+ queryFn: (context: QueryFunctionContext) => Promise<ClientToolsListQueryData>;
125
+ } {
126
+ return {
127
+ queryKey: queryKeyClientToolsList({ toolNames }),
128
+ queryFn: async function clientToolsListQueryFn(
129
+ ctx,
130
+ ): Promise<ClientToolsListQueryData> {
131
+ const sig = combineSignals(ctx.signal, options?.fetchOptions?.signal);
132
+ const mergedOptions = {
133
+ ...options,
134
+ fetchOptions: { ...options?.fetchOptions, signal: sig },
135
+ };
136
+
137
+ return unwrapAsync(clientToolsList(
138
+ client$,
139
+ toolNames,
140
+ mergedOptions,
141
+ ));
142
+ },
143
+ };
144
+ }
145
+
146
+ export function queryKeyClientToolsList(
147
+ parameters: { toolNames?: Array<string> | undefined },
148
+ ): QueryKey {
149
+ return ["@gleanwork/api-client", "tools", "list", parameters];
150
+ }