syllable-sdk 0.1.0-alpha.45 → 0.1.0-alpha.47

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 (215) hide show
  1. package/README.md +34 -0
  2. package/docs/sdks/insights/README.md +6 -0
  3. package/docs/sdks/summary/README.md +85 -0
  4. package/docs/sdks/syllablesdktools/README.md +411 -0
  5. package/docs/sdks/workflows/README.md +429 -0
  6. package/funcs/insightsToolsCreate.d.ts +16 -0
  7. package/funcs/insightsToolsCreate.d.ts.map +1 -0
  8. package/funcs/insightsToolsCreate.js +102 -0
  9. package/funcs/insightsToolsCreate.js.map +1 -0
  10. package/funcs/insightsToolsGetById.d.ts +17 -0
  11. package/funcs/insightsToolsGetById.d.ts.map +1 -0
  12. package/funcs/insightsToolsGetById.js +108 -0
  13. package/funcs/insightsToolsGetById.js.map +1 -0
  14. package/funcs/insightsToolsInsightToolGetDefinitions.d.ts +15 -0
  15. package/funcs/insightsToolsInsightToolGetDefinitions.d.ts.map +1 -0
  16. package/funcs/insightsToolsInsightToolGetDefinitions.js +89 -0
  17. package/funcs/insightsToolsInsightToolGetDefinitions.js.map +1 -0
  18. package/funcs/insightsToolsList.d.ts +17 -0
  19. package/funcs/insightsToolsList.d.ts.map +1 -0
  20. package/funcs/insightsToolsList.js +114 -0
  21. package/funcs/insightsToolsList.js.map +1 -0
  22. package/funcs/insightsToolsUpdate.d.ts +17 -0
  23. package/funcs/insightsToolsUpdate.d.ts.map +1 -0
  24. package/funcs/insightsToolsUpdate.js +109 -0
  25. package/funcs/insightsToolsUpdate.js.map +1 -0
  26. package/funcs/insightsWorkflowsCreate.d.ts +16 -0
  27. package/funcs/insightsWorkflowsCreate.d.ts.map +1 -0
  28. package/funcs/insightsWorkflowsCreate.js +102 -0
  29. package/funcs/insightsWorkflowsCreate.js.map +1 -0
  30. package/funcs/insightsWorkflowsDelete.d.ts +16 -0
  31. package/funcs/insightsWorkflowsDelete.d.ts.map +1 -0
  32. package/funcs/insightsWorkflowsDelete.js +108 -0
  33. package/funcs/insightsWorkflowsDelete.js.map +1 -0
  34. package/funcs/insightsWorkflowsGetById.d.ts +17 -0
  35. package/funcs/insightsWorkflowsGetById.d.ts.map +1 -0
  36. package/funcs/insightsWorkflowsGetById.js +108 -0
  37. package/funcs/insightsWorkflowsGetById.js.map +1 -0
  38. package/funcs/insightsWorkflowsList.d.ts +17 -0
  39. package/funcs/insightsWorkflowsList.d.ts.map +1 -0
  40. package/funcs/insightsWorkflowsList.js +114 -0
  41. package/funcs/insightsWorkflowsList.js.map +1 -0
  42. package/funcs/insightsWorkflowsUpdate.d.ts +17 -0
  43. package/funcs/insightsWorkflowsUpdate.d.ts.map +1 -0
  44. package/funcs/insightsWorkflowsUpdate.js +111 -0
  45. package/funcs/insightsWorkflowsUpdate.js.map +1 -0
  46. package/funcs/sessionsSummaryGetById.d.ts +13 -0
  47. package/funcs/sessionsSummaryGetById.d.ts.map +1 -0
  48. package/funcs/sessionsSummaryGetById.js +105 -0
  49. package/funcs/sessionsSummaryGetById.js.map +1 -0
  50. package/jsr.json +1 -1
  51. package/lib/config.d.ts +2 -2
  52. package/lib/config.js +2 -2
  53. package/mintlify/mint.json +5 -2
  54. package/models/components/datasourcecreaterequest.d.ts +1 -1
  55. package/models/components/datasourcedetailresponse.d.ts +1 -1
  56. package/models/components/datasourcemetadataresponse.d.ts +1 -1
  57. package/models/components/datasourceupdaterequest.d.ts +1 -1
  58. package/models/components/index.d.ts +10 -0
  59. package/models/components/index.d.ts.map +1 -1
  60. package/models/components/index.js +10 -0
  61. package/models/components/index.js.map +1 -1
  62. package/models/components/insighttooldefinition.d.ts +105 -0
  63. package/models/components/insighttooldefinition.d.ts.map +1 -0
  64. package/models/components/insighttooldefinition.js +126 -0
  65. package/models/components/insighttooldefinition.js.map +1 -0
  66. package/models/components/insighttoolinput.d.ts +76 -0
  67. package/models/components/insighttoolinput.d.ts.map +1 -0
  68. package/models/components/insighttoolinput.js +101 -0
  69. package/models/components/insighttoolinput.js.map +1 -0
  70. package/models/components/insighttooloutput.d.ts +102 -0
  71. package/models/components/insighttooloutput.d.ts.map +1 -0
  72. package/models/components/insighttooloutput.js +124 -0
  73. package/models/components/insighttooloutput.js.map +1 -0
  74. package/models/components/insighttoolproperties.d.ts +40 -0
  75. package/models/components/insighttoolproperties.d.ts.map +1 -0
  76. package/models/components/insighttoolproperties.js +54 -0
  77. package/models/components/insighttoolproperties.js.map +1 -0
  78. package/models/components/insightworkflowinput.d.ts +76 -0
  79. package/models/components/insightworkflowinput.d.ts.map +1 -0
  80. package/models/components/insightworkflowinput.js +99 -0
  81. package/models/components/insightworkflowinput.js.map +1 -0
  82. package/models/components/insightworkflowoutput.d.ts +102 -0
  83. package/models/components/insightworkflowoutput.d.ts.map +1 -0
  84. package/models/components/insightworkflowoutput.js +120 -0
  85. package/models/components/insightworkflowoutput.js.map +1 -0
  86. package/models/components/insightworkflowproperties.d.ts +43 -0
  87. package/models/components/insightworkflowproperties.d.ts.map +1 -0
  88. package/models/components/insightworkflowproperties.js +55 -0
  89. package/models/components/insightworkflowproperties.js.map +1 -0
  90. package/models/components/listresponseinsighttooloutput.d.ts +38 -0
  91. package/models/components/listresponseinsighttooloutput.d.ts.map +1 -0
  92. package/models/components/listresponseinsighttooloutput.js +81 -0
  93. package/models/components/listresponseinsighttooloutput.js.map +1 -0
  94. package/models/components/listresponseinsightworkflowoutput.d.ts +38 -0
  95. package/models/components/listresponseinsightworkflowoutput.d.ts.map +1 -0
  96. package/models/components/listresponseinsightworkflowoutput.js +81 -0
  97. package/models/components/listresponseinsightworkflowoutput.js.map +1 -0
  98. package/models/components/toolagentinfo.d.ts +40 -0
  99. package/models/components/toolagentinfo.d.ts.map +1 -0
  100. package/models/components/toolagentinfo.js +61 -0
  101. package/models/components/toolagentinfo.js.map +1 -0
  102. package/models/components/tooldetailresponse.d.ts +6 -0
  103. package/models/components/tooldetailresponse.d.ts.map +1 -1
  104. package/models/components/tooldetailresponse.js +5 -0
  105. package/models/components/tooldetailresponse.js.map +1 -1
  106. package/models/components/toolresponse.d.ts +6 -0
  107. package/models/components/toolresponse.d.ts.map +1 -1
  108. package/models/components/toolresponse.js +5 -0
  109. package/models/components/toolresponse.js.map +1 -1
  110. package/models/operations/directoryworkflowdelete.d.ts +29 -0
  111. package/models/operations/directoryworkflowdelete.d.ts.map +1 -0
  112. package/models/operations/directoryworkflowdelete.js +68 -0
  113. package/models/operations/directoryworkflowdelete.js.map +1 -0
  114. package/models/operations/index.d.ts +8 -0
  115. package/models/operations/index.d.ts.map +1 -1
  116. package/models/operations/index.js +8 -0
  117. package/models/operations/index.js.map +1 -1
  118. package/models/operations/insightstoolupdate.d.ts +32 -0
  119. package/models/operations/insightstoolupdate.d.ts.map +1 -0
  120. package/models/operations/insightstoolupdate.js +73 -0
  121. package/models/operations/insightstoolupdate.js.map +1 -0
  122. package/models/operations/insightsworkflowgetbyid.d.ts +29 -0
  123. package/models/operations/insightsworkflowgetbyid.d.ts.map +1 -0
  124. package/models/operations/insightsworkflowgetbyid.js +68 -0
  125. package/models/operations/insightsworkflowgetbyid.js.map +1 -0
  126. package/models/operations/insightsworkflowlist.d.ts +46 -0
  127. package/models/operations/insightsworkflowlist.d.ts.map +1 -0
  128. package/models/operations/insightsworkflowlist.js +101 -0
  129. package/models/operations/insightsworkflowlist.js.map +1 -0
  130. package/models/operations/insightsworkflowupdate.d.ts +32 -0
  131. package/models/operations/insightsworkflowupdate.d.ts.map +1 -0
  132. package/models/operations/insightsworkflowupdate.js +73 -0
  133. package/models/operations/insightsworkflowupdate.js.map +1 -0
  134. package/models/operations/insighttoolgetbyid.d.ts +29 -0
  135. package/models/operations/insighttoolgetbyid.d.ts.map +1 -0
  136. package/models/operations/insighttoolgetbyid.js +68 -0
  137. package/models/operations/insighttoolgetbyid.js.map +1 -0
  138. package/models/operations/insighttoollist.d.ts +46 -0
  139. package/models/operations/insighttoollist.d.ts.map +1 -0
  140. package/models/operations/insighttoollist.js +103 -0
  141. package/models/operations/insighttoollist.js.map +1 -0
  142. package/models/operations/sessionsummarygetbyid.d.ts +29 -0
  143. package/models/operations/sessionsummarygetbyid.d.ts.map +1 -0
  144. package/models/operations/sessionsummarygetbyid.js +68 -0
  145. package/models/operations/sessionsummarygetbyid.js.map +1 -0
  146. package/openapi.json +1315 -35
  147. package/package.json +1 -1
  148. package/sdk/insights.d.ts +10 -0
  149. package/sdk/insights.d.ts.map +1 -0
  150. package/sdk/insights.js +19 -0
  151. package/sdk/insights.js.map +1 -0
  152. package/sdk/sdk.d.ts +3 -0
  153. package/sdk/sdk.d.ts.map +1 -1
  154. package/sdk/sdk.js +4 -0
  155. package/sdk/sdk.js.map +1 -1
  156. package/sdk/sessions.d.ts +3 -0
  157. package/sdk/sessions.d.ts.map +1 -1
  158. package/sdk/sessions.js +4 -0
  159. package/sdk/sessions.js.map +1 -1
  160. package/sdk/summary.d.ts +9 -0
  161. package/sdk/summary.d.ts.map +1 -0
  162. package/sdk/summary.js +19 -0
  163. package/sdk/summary.js.map +1 -0
  164. package/sdk/syllablesdktools.d.ts +41 -0
  165. package/sdk/syllablesdktools.d.ts.map +1 -0
  166. package/sdk/syllablesdktools.js +62 -0
  167. package/sdk/syllablesdktools.js.map +1 -0
  168. package/sdk/workflows.d.ts +41 -0
  169. package/sdk/workflows.d.ts.map +1 -0
  170. package/sdk/workflows.js +62 -0
  171. package/sdk/workflows.js.map +1 -0
  172. package/src/funcs/insightsToolsCreate.ts +135 -0
  173. package/src/funcs/insightsToolsGetById.ts +142 -0
  174. package/src/funcs/insightsToolsInsightToolGetDefinitions.ts +112 -0
  175. package/src/funcs/insightsToolsList.ts +148 -0
  176. package/src/funcs/insightsToolsUpdate.ts +143 -0
  177. package/src/funcs/insightsWorkflowsCreate.ts +135 -0
  178. package/src/funcs/insightsWorkflowsDelete.ts +145 -0
  179. package/src/funcs/insightsWorkflowsGetById.ts +145 -0
  180. package/src/funcs/insightsWorkflowsList.ts +149 -0
  181. package/src/funcs/insightsWorkflowsUpdate.ts +148 -0
  182. package/src/funcs/sessionsSummaryGetById.ts +140 -0
  183. package/src/lib/config.ts +2 -2
  184. package/src/models/components/datasourcecreaterequest.ts +1 -1
  185. package/src/models/components/datasourcedetailresponse.ts +1 -1
  186. package/src/models/components/datasourcemetadataresponse.ts +1 -1
  187. package/src/models/components/datasourceupdaterequest.ts +1 -1
  188. package/src/models/components/index.ts +10 -0
  189. package/src/models/components/insighttooldefinition.ts +213 -0
  190. package/src/models/components/insighttoolinput.ts +163 -0
  191. package/src/models/components/insighttooloutput.ts +210 -0
  192. package/src/models/components/insighttoolproperties.ts +37 -0
  193. package/src/models/components/insightworkflowinput.ts +161 -0
  194. package/src/models/components/insightworkflowoutput.ts +206 -0
  195. package/src/models/components/insightworkflowproperties.ts +40 -0
  196. package/src/models/components/listresponseinsighttooloutput.ts +103 -0
  197. package/src/models/components/listresponseinsightworkflowoutput.ts +104 -0
  198. package/src/models/components/toolagentinfo.ts +75 -0
  199. package/src/models/components/tooldetailresponse.ts +15 -0
  200. package/src/models/components/toolresponse.ts +15 -0
  201. package/src/models/operations/directoryworkflowdelete.ts +77 -0
  202. package/src/models/operations/index.ts +8 -0
  203. package/src/models/operations/insightstoolupdate.ts +82 -0
  204. package/src/models/operations/insightsworkflowgetbyid.ts +77 -0
  205. package/src/models/operations/insightsworkflowlist.ts +130 -0
  206. package/src/models/operations/insightsworkflowupdate.ts +84 -0
  207. package/src/models/operations/insighttoolgetbyid.ts +75 -0
  208. package/src/models/operations/insighttoollist.ts +126 -0
  209. package/src/models/operations/sessionsummarygetbyid.ts +77 -0
  210. package/src/sdk/insights.ts +19 -0
  211. package/src/sdk/sdk.ts +6 -0
  212. package/src/sdk/sessions.ts +6 -0
  213. package/src/sdk/summary.ts +24 -0
  214. package/src/sdk/syllablesdktools.ts +98 -0
  215. package/src/sdk/workflows.ts +100 -0
@@ -0,0 +1,142 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SyllableSDKCore } from "../core.js";
6
+ import { encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { SDKError } from "../models/errors/sdkerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Get Insight Tool By Id
29
+ *
30
+ * @remarks
31
+ * Get a InsightTool by Name.
32
+ */
33
+ export async function insightsToolsGetById(
34
+ client: SyllableSDKCore,
35
+ request: operations.InsightToolGetByIdRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<
38
+ Result<
39
+ components.InsightToolOutput,
40
+ | errors.HTTPValidationError
41
+ | SDKError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ const parsed = safeParse(
51
+ request,
52
+ (value) => operations.InsightToolGetByIdRequest$outboundSchema.parse(value),
53
+ "Input validation failed",
54
+ );
55
+ if (!parsed.ok) {
56
+ return parsed;
57
+ }
58
+ const payload = parsed.value;
59
+ const body = null;
60
+
61
+ const pathParams = {
62
+ tool_id: encodeSimple("tool_id", payload.tool_id, {
63
+ explode: false,
64
+ charEncoding: "percent",
65
+ }),
66
+ };
67
+
68
+ const path = pathToFunc("/api/v1/insights/tools/{tool_id}")(pathParams);
69
+
70
+ const headers = new Headers(compactMap({
71
+ Accept: "application/json",
72
+ }));
73
+
74
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
75
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
76
+ const requestSecurity = resolveGlobalSecurity(securityInput);
77
+
78
+ const context = {
79
+ baseURL: options?.serverURL ?? "",
80
+ operationID: "insight_tool_get_by_id",
81
+ oAuth2Scopes: [],
82
+
83
+ resolvedSecurity: requestSecurity,
84
+
85
+ securitySource: client._options.apiKeyHeader,
86
+ retryConfig: options?.retries
87
+ || client._options.retryConfig
88
+ || { strategy: "none" },
89
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
90
+ };
91
+
92
+ const requestRes = client._createRequest(context, {
93
+ security: requestSecurity,
94
+ method: "GET",
95
+ baseURL: options?.serverURL,
96
+ path: path,
97
+ headers: headers,
98
+ body: body,
99
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
100
+ }, options);
101
+ if (!requestRes.ok) {
102
+ return requestRes;
103
+ }
104
+ const req = requestRes.value;
105
+
106
+ const doResult = await client._do(req, {
107
+ context,
108
+ errorCodes: ["422", "4XX", "5XX"],
109
+ retryConfig: context.retryConfig,
110
+ retryCodes: context.retryCodes,
111
+ });
112
+ if (!doResult.ok) {
113
+ return doResult;
114
+ }
115
+ const response = doResult.value;
116
+
117
+ const responseFields = {
118
+ HttpMeta: { Response: response, Request: req },
119
+ };
120
+
121
+ const [result] = await M.match<
122
+ components.InsightToolOutput,
123
+ | errors.HTTPValidationError
124
+ | SDKError
125
+ | SDKValidationError
126
+ | UnexpectedClientError
127
+ | InvalidRequestError
128
+ | RequestAbortedError
129
+ | RequestTimeoutError
130
+ | ConnectionError
131
+ >(
132
+ M.json(200, components.InsightToolOutput$inboundSchema),
133
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
134
+ M.fail("4XX"),
135
+ M.fail("5XX"),
136
+ )(response, { extraFields: responseFields });
137
+ if (!result.ok) {
138
+ return result;
139
+ }
140
+
141
+ return result;
142
+ }
@@ -0,0 +1,112 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { SyllableSDKCore } from "../core.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { RequestOptions } from "../lib/sdks.js";
10
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
+ import { pathToFunc } from "../lib/url.js";
12
+ import * as components from "../models/components/index.js";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { SDKError } from "../models/errors/sdkerror.js";
21
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
+ import { Result } from "../types/fp.js";
23
+
24
+ /**
25
+ * Get Insight Tool Definitions
26
+ *
27
+ * @remarks
28
+ * Get a InsightTool by Name.
29
+ */
30
+ export async function insightsToolsInsightToolGetDefinitions(
31
+ client: SyllableSDKCore,
32
+ options?: RequestOptions,
33
+ ): Promise<
34
+ Result<
35
+ Array<components.InsightToolDefinition>,
36
+ | SDKError
37
+ | SDKValidationError
38
+ | UnexpectedClientError
39
+ | InvalidRequestError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | ConnectionError
43
+ >
44
+ > {
45
+ const path = pathToFunc("/api/v1/insights/tool-definitions")();
46
+
47
+ const headers = new Headers(compactMap({
48
+ Accept: "application/json",
49
+ }));
50
+
51
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
52
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
53
+ const requestSecurity = resolveGlobalSecurity(securityInput);
54
+
55
+ const context = {
56
+ baseURL: options?.serverURL ?? "",
57
+ operationID: "insight_tool_get_definitions",
58
+ oAuth2Scopes: [],
59
+
60
+ resolvedSecurity: requestSecurity,
61
+
62
+ securitySource: client._options.apiKeyHeader,
63
+ retryConfig: options?.retries
64
+ || client._options.retryConfig
65
+ || { strategy: "none" },
66
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
67
+ };
68
+
69
+ const requestRes = client._createRequest(context, {
70
+ security: requestSecurity,
71
+ method: "GET",
72
+ baseURL: options?.serverURL,
73
+ path: path,
74
+ headers: headers,
75
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
76
+ }, options);
77
+ if (!requestRes.ok) {
78
+ return requestRes;
79
+ }
80
+ const req = requestRes.value;
81
+
82
+ const doResult = await client._do(req, {
83
+ context,
84
+ errorCodes: ["4XX", "5XX"],
85
+ retryConfig: context.retryConfig,
86
+ retryCodes: context.retryCodes,
87
+ });
88
+ if (!doResult.ok) {
89
+ return doResult;
90
+ }
91
+ const response = doResult.value;
92
+
93
+ const [result] = await M.match<
94
+ Array<components.InsightToolDefinition>,
95
+ | SDKError
96
+ | SDKValidationError
97
+ | UnexpectedClientError
98
+ | InvalidRequestError
99
+ | RequestAbortedError
100
+ | RequestTimeoutError
101
+ | ConnectionError
102
+ >(
103
+ M.json(200, z.array(components.InsightToolDefinition$inboundSchema)),
104
+ M.fail("4XX"),
105
+ M.fail("5XX"),
106
+ )(response);
107
+ if (!result.ok) {
108
+ return result;
109
+ }
110
+
111
+ return result;
112
+ }
@@ -0,0 +1,148 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SyllableSDKCore } from "../core.js";
6
+ import { encodeFormQuery } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { SDKError } from "../models/errors/sdkerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Insight Tool List
29
+ *
30
+ * @remarks
31
+ * List the existing insight_tools
32
+ */
33
+ export async function insightsToolsList(
34
+ client: SyllableSDKCore,
35
+ request: operations.InsightToolListRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<
38
+ Result<
39
+ components.ListResponseInsightToolOutput,
40
+ | errors.HTTPValidationError
41
+ | SDKError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ const parsed = safeParse(
51
+ request,
52
+ (value) => operations.InsightToolListRequest$outboundSchema.parse(value),
53
+ "Input validation failed",
54
+ );
55
+ if (!parsed.ok) {
56
+ return parsed;
57
+ }
58
+ const payload = parsed.value;
59
+ const body = null;
60
+
61
+ const path = pathToFunc("/api/v1/insights/tools")();
62
+
63
+ const query = encodeFormQuery({
64
+ "end_datetime": payload.end_datetime,
65
+ "fields": payload.fields,
66
+ "limit": payload.limit,
67
+ "order_by": payload.order_by,
68
+ "order_by_direction": payload.order_by_direction,
69
+ "page": payload.page,
70
+ "search_field_values": payload.search_field_values,
71
+ "search_fields": payload.search_fields,
72
+ "start_datetime": payload.start_datetime,
73
+ });
74
+
75
+ const headers = new Headers(compactMap({
76
+ Accept: "application/json",
77
+ }));
78
+
79
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
80
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
81
+ const requestSecurity = resolveGlobalSecurity(securityInput);
82
+
83
+ const context = {
84
+ baseURL: options?.serverURL ?? "",
85
+ operationID: "insight_tool_list",
86
+ oAuth2Scopes: [],
87
+
88
+ resolvedSecurity: requestSecurity,
89
+
90
+ securitySource: client._options.apiKeyHeader,
91
+ retryConfig: options?.retries
92
+ || client._options.retryConfig
93
+ || { strategy: "none" },
94
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
95
+ };
96
+
97
+ const requestRes = client._createRequest(context, {
98
+ security: requestSecurity,
99
+ method: "GET",
100
+ baseURL: options?.serverURL,
101
+ path: path,
102
+ headers: headers,
103
+ query: query,
104
+ body: body,
105
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
106
+ }, options);
107
+ if (!requestRes.ok) {
108
+ return requestRes;
109
+ }
110
+ const req = requestRes.value;
111
+
112
+ const doResult = await client._do(req, {
113
+ context,
114
+ errorCodes: ["422", "4XX", "5XX"],
115
+ retryConfig: context.retryConfig,
116
+ retryCodes: context.retryCodes,
117
+ });
118
+ if (!doResult.ok) {
119
+ return doResult;
120
+ }
121
+ const response = doResult.value;
122
+
123
+ const responseFields = {
124
+ HttpMeta: { Response: response, Request: req },
125
+ };
126
+
127
+ const [result] = await M.match<
128
+ components.ListResponseInsightToolOutput,
129
+ | errors.HTTPValidationError
130
+ | SDKError
131
+ | SDKValidationError
132
+ | UnexpectedClientError
133
+ | InvalidRequestError
134
+ | RequestAbortedError
135
+ | RequestTimeoutError
136
+ | ConnectionError
137
+ >(
138
+ M.json(200, components.ListResponseInsightToolOutput$inboundSchema),
139
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
140
+ M.fail("4XX"),
141
+ M.fail("5XX"),
142
+ )(response, { extraFields: responseFields });
143
+ if (!result.ok) {
144
+ return result;
145
+ }
146
+
147
+ return result;
148
+ }
@@ -0,0 +1,143 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SyllableSDKCore } from "../core.js";
6
+ import { encodeJSON, encodeSimple } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { SDKError } from "../models/errors/sdkerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import * as operations from "../models/operations/index.js";
25
+ import { Result } from "../types/fp.js";
26
+
27
+ /**
28
+ * Update Insights Tool
29
+ *
30
+ * @remarks
31
+ * Update a InsightTool.
32
+ */
33
+ export async function insightsToolsUpdate(
34
+ client: SyllableSDKCore,
35
+ request: operations.InsightsToolUpdateRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<
38
+ Result<
39
+ components.InsightToolOutput,
40
+ | errors.HTTPValidationError
41
+ | SDKError
42
+ | SDKValidationError
43
+ | UnexpectedClientError
44
+ | InvalidRequestError
45
+ | RequestAbortedError
46
+ | RequestTimeoutError
47
+ | ConnectionError
48
+ >
49
+ > {
50
+ const parsed = safeParse(
51
+ request,
52
+ (value) => operations.InsightsToolUpdateRequest$outboundSchema.parse(value),
53
+ "Input validation failed",
54
+ );
55
+ if (!parsed.ok) {
56
+ return parsed;
57
+ }
58
+ const payload = parsed.value;
59
+ const body = encodeJSON("body", payload.InsightToolInput, { explode: true });
60
+
61
+ const pathParams = {
62
+ tool_id: encodeSimple("tool_id", payload.tool_id, {
63
+ explode: false,
64
+ charEncoding: "percent",
65
+ }),
66
+ };
67
+
68
+ const path = pathToFunc("/api/v1/insights/tools/{tool_id}")(pathParams);
69
+
70
+ const headers = new Headers(compactMap({
71
+ "Content-Type": "application/json",
72
+ Accept: "application/json",
73
+ }));
74
+
75
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
76
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
77
+ const requestSecurity = resolveGlobalSecurity(securityInput);
78
+
79
+ const context = {
80
+ baseURL: options?.serverURL ?? "",
81
+ operationID: "insights_tool_update",
82
+ oAuth2Scopes: [],
83
+
84
+ resolvedSecurity: requestSecurity,
85
+
86
+ securitySource: client._options.apiKeyHeader,
87
+ retryConfig: options?.retries
88
+ || client._options.retryConfig
89
+ || { strategy: "none" },
90
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
91
+ };
92
+
93
+ const requestRes = client._createRequest(context, {
94
+ security: requestSecurity,
95
+ method: "PUT",
96
+ baseURL: options?.serverURL,
97
+ path: path,
98
+ headers: headers,
99
+ body: body,
100
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
101
+ }, options);
102
+ if (!requestRes.ok) {
103
+ return requestRes;
104
+ }
105
+ const req = requestRes.value;
106
+
107
+ const doResult = await client._do(req, {
108
+ context,
109
+ errorCodes: ["400", "404", "412", "422", "4XX", "500", "5XX"],
110
+ retryConfig: context.retryConfig,
111
+ retryCodes: context.retryCodes,
112
+ });
113
+ if (!doResult.ok) {
114
+ return doResult;
115
+ }
116
+ const response = doResult.value;
117
+
118
+ const responseFields = {
119
+ HttpMeta: { Response: response, Request: req },
120
+ };
121
+
122
+ const [result] = await M.match<
123
+ components.InsightToolOutput,
124
+ | errors.HTTPValidationError
125
+ | SDKError
126
+ | SDKValidationError
127
+ | UnexpectedClientError
128
+ | InvalidRequestError
129
+ | RequestAbortedError
130
+ | RequestTimeoutError
131
+ | ConnectionError
132
+ >(
133
+ M.json(200, components.InsightToolOutput$inboundSchema),
134
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
135
+ M.fail([400, 404, 412, "4XX"]),
136
+ M.fail([500, "5XX"]),
137
+ )(response, { extraFields: responseFields });
138
+ if (!result.ok) {
139
+ return result;
140
+ }
141
+
142
+ return result;
143
+ }
@@ -0,0 +1,135 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { SyllableSDKCore } from "../core.js";
6
+ import { encodeJSON } from "../lib/encodings.js";
7
+ import * as M from "../lib/matchers.js";
8
+ import { compactMap } from "../lib/primitives.js";
9
+ import { safeParse } from "../lib/schemas.js";
10
+ import { RequestOptions } from "../lib/sdks.js";
11
+ import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
+ import { pathToFunc } from "../lib/url.js";
13
+ import * as components from "../models/components/index.js";
14
+ import {
15
+ ConnectionError,
16
+ InvalidRequestError,
17
+ RequestAbortedError,
18
+ RequestTimeoutError,
19
+ UnexpectedClientError,
20
+ } from "../models/errors/httpclienterrors.js";
21
+ import * as errors from "../models/errors/index.js";
22
+ import { SDKError } from "../models/errors/sdkerror.js";
23
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * Create Insight Workflow
28
+ *
29
+ * @remarks
30
+ * Create a new tool in the insights
31
+ */
32
+ export async function insightsWorkflowsCreate(
33
+ client: SyllableSDKCore,
34
+ request: components.InsightWorkflowInput,
35
+ options?: RequestOptions,
36
+ ): Promise<
37
+ Result<
38
+ components.InsightWorkflowOutput,
39
+ | errors.HTTPValidationError
40
+ | SDKError
41
+ | SDKValidationError
42
+ | UnexpectedClientError
43
+ | InvalidRequestError
44
+ | RequestAbortedError
45
+ | RequestTimeoutError
46
+ | ConnectionError
47
+ >
48
+ > {
49
+ const parsed = safeParse(
50
+ request,
51
+ (value) => components.InsightWorkflowInput$outboundSchema.parse(value),
52
+ "Input validation failed",
53
+ );
54
+ if (!parsed.ok) {
55
+ return parsed;
56
+ }
57
+ const payload = parsed.value;
58
+ const body = encodeJSON("body", payload, { explode: true });
59
+
60
+ const path = pathToFunc("/api/v1/insights/workflows/")();
61
+
62
+ const headers = new Headers(compactMap({
63
+ "Content-Type": "application/json",
64
+ Accept: "application/json",
65
+ }));
66
+
67
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
68
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
69
+ const requestSecurity = resolveGlobalSecurity(securityInput);
70
+
71
+ const context = {
72
+ baseURL: options?.serverURL ?? "",
73
+ operationID: "insights_workflow_create",
74
+ oAuth2Scopes: [],
75
+
76
+ resolvedSecurity: requestSecurity,
77
+
78
+ securitySource: client._options.apiKeyHeader,
79
+ retryConfig: options?.retries
80
+ || client._options.retryConfig
81
+ || { strategy: "none" },
82
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
83
+ };
84
+
85
+ const requestRes = client._createRequest(context, {
86
+ security: requestSecurity,
87
+ method: "POST",
88
+ baseURL: options?.serverURL,
89
+ path: path,
90
+ headers: headers,
91
+ body: body,
92
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
93
+ }, options);
94
+ if (!requestRes.ok) {
95
+ return requestRes;
96
+ }
97
+ const req = requestRes.value;
98
+
99
+ const doResult = await client._do(req, {
100
+ context,
101
+ errorCodes: ["422", "4XX", "5XX"],
102
+ retryConfig: context.retryConfig,
103
+ retryCodes: context.retryCodes,
104
+ });
105
+ if (!doResult.ok) {
106
+ return doResult;
107
+ }
108
+ const response = doResult.value;
109
+
110
+ const responseFields = {
111
+ HttpMeta: { Response: response, Request: req },
112
+ };
113
+
114
+ const [result] = await M.match<
115
+ components.InsightWorkflowOutput,
116
+ | errors.HTTPValidationError
117
+ | SDKError
118
+ | SDKValidationError
119
+ | UnexpectedClientError
120
+ | InvalidRequestError
121
+ | RequestAbortedError
122
+ | RequestTimeoutError
123
+ | ConnectionError
124
+ >(
125
+ M.json(200, components.InsightWorkflowOutput$inboundSchema),
126
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
127
+ M.fail("4XX"),
128
+ M.fail("5XX"),
129
+ )(response, { extraFields: responseFields });
130
+ if (!result.ok) {
131
+ return result;
132
+ }
133
+
134
+ return result;
135
+ }