syllable-sdk 0.1.0-alpha.4 → 0.1.0-alpha.6

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 (159) hide show
  1. package/README.md +23 -7
  2. package/docs/sdks/prompts/README.md +78 -0
  3. package/docs/sdks/services/README.md +245 -0
  4. package/docs/sdks/sessions/README.md +1 -1
  5. package/docs/sdks/syllablesdk/README.md +3 -2
  6. package/docs/sdks/tools/README.md +163 -1
  7. package/docs/sdks/transcript/README.md +2 -0
  8. package/funcs/promptsPromptsHistory.d.ts +17 -0
  9. package/funcs/promptsPromptsHistory.d.ts.map +1 -0
  10. package/funcs/promptsPromptsHistory.js +106 -0
  11. package/funcs/promptsPromptsHistory.js.map +1 -0
  12. package/funcs/servicesCreate.d.ts +13 -0
  13. package/funcs/servicesCreate.d.ts.map +1 -0
  14. package/funcs/servicesCreate.js +96 -0
  15. package/funcs/servicesCreate.js.map +1 -0
  16. package/funcs/servicesList.d.ts +17 -0
  17. package/funcs/servicesList.d.ts.map +1 -0
  18. package/funcs/servicesList.js +111 -0
  19. package/funcs/servicesList.js.map +1 -0
  20. package/funcs/servicesUpdate.d.ts +13 -0
  21. package/funcs/servicesUpdate.d.ts.map +1 -0
  22. package/funcs/servicesUpdate.js +96 -0
  23. package/funcs/servicesUpdate.js.map +1 -0
  24. package/funcs/sessionsSessionRecordingStream.d.ts +1 -1
  25. package/funcs/sessionsSessionRecordingStream.d.ts.map +1 -1
  26. package/funcs/sessionsSessionRecordingStream.js +2 -2
  27. package/funcs/sessionsSessionRecordingStream.js.map +1 -1
  28. package/funcs/toolsCreate.d.ts +16 -0
  29. package/funcs/toolsCreate.d.ts.map +1 -0
  30. package/funcs/toolsCreate.js +99 -0
  31. package/funcs/toolsCreate.js.map +1 -0
  32. package/funcs/toolsList.d.ts +1 -1
  33. package/funcs/toolsList.js +1 -1
  34. package/funcs/toolsUpdate.d.ts +16 -0
  35. package/funcs/toolsUpdate.d.ts.map +1 -0
  36. package/funcs/toolsUpdate.js +99 -0
  37. package/funcs/toolsUpdate.js.map +1 -0
  38. package/lib/config.d.ts +4 -4
  39. package/lib/config.d.ts.map +1 -1
  40. package/lib/config.js +4 -4
  41. package/lib/config.js.map +1 -1
  42. package/models/components/index.d.ts +8 -0
  43. package/models/components/index.d.ts.map +1 -1
  44. package/models/components/index.js +8 -0
  45. package/models/components/index.js.map +1 -1
  46. package/models/components/listresponseservice.d.ts +38 -0
  47. package/models/components/listresponseservice.d.ts.map +1 -0
  48. package/models/components/listresponseservice.js +81 -0
  49. package/models/components/listresponseservice.js.map +1 -0
  50. package/models/components/prompt.d.ts +10 -0
  51. package/models/components/prompt.d.ts.map +1 -1
  52. package/models/components/prompt.js +8 -0
  53. package/models/components/prompt.js.map +1 -1
  54. package/models/components/prompthistory.d.ts +41 -0
  55. package/models/components/prompthistory.d.ts.map +1 -0
  56. package/models/components/prompthistory.js +88 -0
  57. package/models/components/prompthistory.js.map +1 -0
  58. package/models/components/promptproperties.d.ts +3 -0
  59. package/models/components/promptproperties.d.ts.map +1 -1
  60. package/models/components/promptproperties.js +1 -0
  61. package/models/components/promptproperties.js.map +1 -1
  62. package/models/components/service.d.ts +47 -0
  63. package/models/components/service.d.ts.map +1 -0
  64. package/models/components/service.js +65 -0
  65. package/models/components/service.js.map +1 -0
  66. package/models/components/servicecreate.d.ts +37 -0
  67. package/models/components/servicecreate.d.ts.map +1 -0
  68. package/models/components/servicecreate.js +61 -0
  69. package/models/components/servicecreate.js.map +1 -0
  70. package/models/components/serviceproperties.d.ts +28 -0
  71. package/models/components/serviceproperties.d.ts.map +1 -0
  72. package/models/components/serviceproperties.js +50 -0
  73. package/models/components/serviceproperties.js.map +1 -0
  74. package/models/components/serviceupdate.d.ts +42 -0
  75. package/models/components/serviceupdate.d.ts.map +1 -0
  76. package/models/components/serviceupdate.js +63 -0
  77. package/models/components/serviceupdate.js.map +1 -0
  78. package/models/components/sessionproperties.d.ts +3 -0
  79. package/models/components/sessionproperties.d.ts.map +1 -1
  80. package/models/components/sessionproperties.js +1 -0
  81. package/models/components/sessionproperties.js.map +1 -1
  82. package/models/components/toolcreate.d.ts +66 -0
  83. package/models/components/toolcreate.d.ts.map +1 -0
  84. package/models/components/toolcreate.js +95 -0
  85. package/models/components/toolcreate.js.map +1 -0
  86. package/models/components/toolupdate.d.ts +71 -0
  87. package/models/components/toolupdate.d.ts.map +1 -0
  88. package/models/components/toolupdate.js +97 -0
  89. package/models/components/toolupdate.js.map +1 -0
  90. package/models/operations/index.d.ts +2 -0
  91. package/models/operations/index.d.ts.map +1 -1
  92. package/models/operations/index.js +2 -0
  93. package/models/operations/index.js.map +1 -1
  94. package/models/operations/promptshistory.d.ts +29 -0
  95. package/models/operations/promptshistory.d.ts.map +1 -0
  96. package/models/operations/promptshistory.js +68 -0
  97. package/models/operations/promptshistory.js.map +1 -0
  98. package/models/operations/promptslist.d.ts +3 -0
  99. package/models/operations/promptslist.d.ts.map +1 -1
  100. package/models/operations/promptslist.js +1 -0
  101. package/models/operations/promptslist.js.map +1 -1
  102. package/models/operations/servicelist.d.ts +97 -0
  103. package/models/operations/servicelist.d.ts.map +1 -0
  104. package/models/operations/servicelist.js +137 -0
  105. package/models/operations/servicelist.js.map +1 -0
  106. package/models/operations/sessionslist.d.ts +3 -0
  107. package/models/operations/sessionslist.d.ts.map +1 -1
  108. package/models/operations/sessionslist.js +1 -0
  109. package/models/operations/sessionslist.js.map +1 -1
  110. package/package.json +1 -1
  111. package/sdk/prompts.d.ts +7 -0
  112. package/sdk/prompts.d.ts.map +1 -1
  113. package/sdk/prompts.js +10 -0
  114. package/sdk/prompts.js.map +1 -1
  115. package/sdk/sdk.d.ts +3 -0
  116. package/sdk/sdk.d.ts.map +1 -1
  117. package/sdk/sdk.js +5 -0
  118. package/sdk/sdk.js.map +1 -1
  119. package/sdk/services.d.ts +21 -0
  120. package/sdk/services.d.ts.map +1 -0
  121. package/sdk/services.js +36 -0
  122. package/sdk/services.js.map +1 -0
  123. package/sdk/sessions.d.ts +1 -1
  124. package/sdk/sessions.d.ts.map +1 -1
  125. package/sdk/tools.d.ts +15 -1
  126. package/sdk/tools.d.ts.map +1 -1
  127. package/sdk/tools.js +21 -1
  128. package/sdk/tools.js.map +1 -1
  129. package/src/funcs/promptsPromptsHistory.ts +139 -0
  130. package/src/funcs/servicesCreate.ts +128 -0
  131. package/src/funcs/servicesList.ts +144 -0
  132. package/src/funcs/servicesUpdate.ts +128 -0
  133. package/src/funcs/sessionsSessionRecordingStream.ts +4 -4
  134. package/src/funcs/toolsCreate.ts +131 -0
  135. package/src/funcs/toolsList.ts +1 -1
  136. package/src/funcs/toolsUpdate.ts +131 -0
  137. package/src/lib/config.ts +4 -4
  138. package/src/models/components/index.ts +8 -0
  139. package/src/models/components/listresponseservice.ts +101 -0
  140. package/src/models/components/prompt.ts +18 -0
  141. package/src/models/components/prompthistory.ts +103 -0
  142. package/src/models/components/promptproperties.ts +1 -0
  143. package/src/models/components/service.ts +83 -0
  144. package/src/models/components/servicecreate.ts +72 -0
  145. package/src/models/components/serviceproperties.ts +33 -0
  146. package/src/models/components/serviceupdate.ts +79 -0
  147. package/src/models/components/sessionproperties.ts +1 -0
  148. package/src/models/components/toolcreate.ts +141 -0
  149. package/src/models/components/toolupdate.ts +148 -0
  150. package/src/models/operations/index.ts +2 -0
  151. package/src/models/operations/promptshistory.ts +75 -0
  152. package/src/models/operations/promptslist.ts +1 -0
  153. package/src/models/operations/servicelist.ts +184 -0
  154. package/src/models/operations/sessionslist.ts +1 -0
  155. package/src/sdk/prompts.ts +18 -0
  156. package/src/sdk/sdk.ts +6 -0
  157. package/src/sdk/services.ts +58 -0
  158. package/src/sdk/sessions.ts +1 -1
  159. package/src/sdk/tools.ts +37 -1
@@ -0,0 +1,139 @@
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 { encodeSimple } from "../lib/encodings.js";
8
+ import * as M from "../lib/matchers.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 Prompt History
29
+ *
30
+ * @remarks
31
+ * Get a prompt by ID
32
+ */
33
+ export async function promptsPromptsHistory(
34
+ client: SyllableSDKCore,
35
+ request: operations.PromptsHistoryRequest,
36
+ options?: RequestOptions,
37
+ ): Promise<
38
+ Result<
39
+ Array<components.PromptHistory>,
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.PromptsHistoryRequest$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
+ prompt_id: encodeSimple("prompt_id", payload.prompt_id, {
63
+ explode: false,
64
+ charEncoding: "percent",
65
+ }),
66
+ };
67
+
68
+ const path = pathToFunc("/api/v1/prompts/{prompt_id}/history")(pathParams);
69
+
70
+ const headers = new Headers({
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
+ operationID: "prompts_history",
80
+ oAuth2Scopes: [],
81
+
82
+ resolvedSecurity: requestSecurity,
83
+
84
+ securitySource: client._options.apiKeyHeader,
85
+ retryConfig: options?.retries
86
+ || client._options.retryConfig
87
+ || { strategy: "none" },
88
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
89
+ };
90
+
91
+ const requestRes = client._createRequest(context, {
92
+ security: requestSecurity,
93
+ method: "GET",
94
+ path: path,
95
+ headers: headers,
96
+ body: body,
97
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
98
+ }, options);
99
+ if (!requestRes.ok) {
100
+ return requestRes;
101
+ }
102
+ const req = requestRes.value;
103
+
104
+ const doResult = await client._do(req, {
105
+ context,
106
+ errorCodes: ["422", "4XX", "5XX"],
107
+ retryConfig: context.retryConfig,
108
+ retryCodes: context.retryCodes,
109
+ });
110
+ if (!doResult.ok) {
111
+ return doResult;
112
+ }
113
+ const response = doResult.value;
114
+
115
+ const responseFields = {
116
+ HttpMeta: { Response: response, Request: req },
117
+ };
118
+
119
+ const [result] = await M.match<
120
+ Array<components.PromptHistory>,
121
+ | errors.HTTPValidationError
122
+ | SDKError
123
+ | SDKValidationError
124
+ | UnexpectedClientError
125
+ | InvalidRequestError
126
+ | RequestAbortedError
127
+ | RequestTimeoutError
128
+ | ConnectionError
129
+ >(
130
+ M.json(200, z.array(components.PromptHistory$inboundSchema)),
131
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
132
+ M.fail(["4XX", "5XX"]),
133
+ )(response, { extraFields: responseFields });
134
+ if (!result.ok) {
135
+ return result;
136
+ }
137
+
138
+ return result;
139
+ }
@@ -0,0 +1,128 @@
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 { safeParse } from "../lib/schemas.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 * as errors from "../models/errors/index.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import { Result } from "../types/fp.js";
24
+
25
+ /**
26
+ * Create Service
27
+ */
28
+ export async function servicesCreate(
29
+ client: SyllableSDKCore,
30
+ request: components.ServiceCreate,
31
+ options?: RequestOptions,
32
+ ): Promise<
33
+ Result<
34
+ components.Service,
35
+ | errors.HTTPValidationError
36
+ | SDKError
37
+ | SDKValidationError
38
+ | UnexpectedClientError
39
+ | InvalidRequestError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | ConnectionError
43
+ >
44
+ > {
45
+ const parsed = safeParse(
46
+ request,
47
+ (value) => components.ServiceCreate$outboundSchema.parse(value),
48
+ "Input validation failed",
49
+ );
50
+ if (!parsed.ok) {
51
+ return parsed;
52
+ }
53
+ const payload = parsed.value;
54
+ const body = encodeJSON("body", payload, { explode: true });
55
+
56
+ const path = pathToFunc("/api/v1/services/")();
57
+
58
+ const headers = new Headers({
59
+ "Content-Type": "application/json",
60
+ Accept: "application/json",
61
+ });
62
+
63
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
64
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
65
+ const requestSecurity = resolveGlobalSecurity(securityInput);
66
+
67
+ const context = {
68
+ operationID: "service_create",
69
+ oAuth2Scopes: [],
70
+
71
+ resolvedSecurity: requestSecurity,
72
+
73
+ securitySource: client._options.apiKeyHeader,
74
+ retryConfig: options?.retries
75
+ || client._options.retryConfig
76
+ || { strategy: "none" },
77
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
78
+ };
79
+
80
+ const requestRes = client._createRequest(context, {
81
+ security: requestSecurity,
82
+ method: "POST",
83
+ path: path,
84
+ headers: headers,
85
+ body: body,
86
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
87
+ }, options);
88
+ if (!requestRes.ok) {
89
+ return requestRes;
90
+ }
91
+ const req = requestRes.value;
92
+
93
+ const doResult = await client._do(req, {
94
+ context,
95
+ errorCodes: ["422", "4XX", "5XX"],
96
+ retryConfig: context.retryConfig,
97
+ retryCodes: context.retryCodes,
98
+ });
99
+ if (!doResult.ok) {
100
+ return doResult;
101
+ }
102
+ const response = doResult.value;
103
+
104
+ const responseFields = {
105
+ HttpMeta: { Response: response, Request: req },
106
+ };
107
+
108
+ const [result] = await M.match<
109
+ components.Service,
110
+ | errors.HTTPValidationError
111
+ | SDKError
112
+ | SDKValidationError
113
+ | UnexpectedClientError
114
+ | InvalidRequestError
115
+ | RequestAbortedError
116
+ | RequestTimeoutError
117
+ | ConnectionError
118
+ >(
119
+ M.json(200, components.Service$inboundSchema),
120
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
121
+ M.fail(["4XX", "5XX"]),
122
+ )(response, { extraFields: responseFields });
123
+ if (!result.ok) {
124
+ return result;
125
+ }
126
+
127
+ return result;
128
+ }
@@ -0,0 +1,144 @@
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 { safeParse } from "../lib/schemas.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 * as errors from "../models/errors/index.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { Result } from "../types/fp.js";
25
+
26
+ /**
27
+ * Service List
28
+ *
29
+ * @remarks
30
+ * List the existing agents
31
+ */
32
+ export async function servicesList(
33
+ client: SyllableSDKCore,
34
+ request: operations.ServiceListRequest,
35
+ options?: RequestOptions,
36
+ ): Promise<
37
+ Result<
38
+ components.ListResponseService,
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) => operations.ServiceListRequest$outboundSchema.parse(value),
52
+ "Input validation failed",
53
+ );
54
+ if (!parsed.ok) {
55
+ return parsed;
56
+ }
57
+ const payload = parsed.value;
58
+ const body = null;
59
+
60
+ const path = pathToFunc("/api/v1/services/")();
61
+
62
+ const query = encodeFormQuery({
63
+ "end_datetime": payload.end_datetime,
64
+ "fields": payload.fields,
65
+ "limit": payload.limit,
66
+ "order_by": payload.order_by,
67
+ "order_by_direction": payload.order_by_direction,
68
+ "page": payload.page,
69
+ "search_field_values": payload.search_field_values,
70
+ "search_fields": payload.search_fields,
71
+ "start_datetime": payload.start_datetime,
72
+ });
73
+
74
+ const headers = new Headers({
75
+ Accept: "application/json",
76
+ });
77
+
78
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
79
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
80
+ const requestSecurity = resolveGlobalSecurity(securityInput);
81
+
82
+ const context = {
83
+ operationID: "service_list",
84
+ oAuth2Scopes: [],
85
+
86
+ resolvedSecurity: requestSecurity,
87
+
88
+ securitySource: client._options.apiKeyHeader,
89
+ retryConfig: options?.retries
90
+ || client._options.retryConfig
91
+ || { strategy: "none" },
92
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
93
+ };
94
+
95
+ const requestRes = client._createRequest(context, {
96
+ security: requestSecurity,
97
+ method: "GET",
98
+ path: path,
99
+ headers: headers,
100
+ query: query,
101
+ body: body,
102
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
103
+ }, options);
104
+ if (!requestRes.ok) {
105
+ return requestRes;
106
+ }
107
+ const req = requestRes.value;
108
+
109
+ const doResult = await client._do(req, {
110
+ context,
111
+ errorCodes: ["422", "4XX", "5XX"],
112
+ retryConfig: context.retryConfig,
113
+ retryCodes: context.retryCodes,
114
+ });
115
+ if (!doResult.ok) {
116
+ return doResult;
117
+ }
118
+ const response = doResult.value;
119
+
120
+ const responseFields = {
121
+ HttpMeta: { Response: response, Request: req },
122
+ };
123
+
124
+ const [result] = await M.match<
125
+ components.ListResponseService,
126
+ | errors.HTTPValidationError
127
+ | SDKError
128
+ | SDKValidationError
129
+ | UnexpectedClientError
130
+ | InvalidRequestError
131
+ | RequestAbortedError
132
+ | RequestTimeoutError
133
+ | ConnectionError
134
+ >(
135
+ M.json(200, components.ListResponseService$inboundSchema),
136
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
137
+ M.fail(["4XX", "5XX"]),
138
+ )(response, { extraFields: responseFields });
139
+ if (!result.ok) {
140
+ return result;
141
+ }
142
+
143
+ return result;
144
+ }
@@ -0,0 +1,128 @@
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 { safeParse } from "../lib/schemas.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 * as errors from "../models/errors/index.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import { Result } from "../types/fp.js";
24
+
25
+ /**
26
+ * Update Service
27
+ */
28
+ export async function servicesUpdate(
29
+ client: SyllableSDKCore,
30
+ request: components.ServiceUpdate,
31
+ options?: RequestOptions,
32
+ ): Promise<
33
+ Result<
34
+ components.Service,
35
+ | errors.HTTPValidationError
36
+ | SDKError
37
+ | SDKValidationError
38
+ | UnexpectedClientError
39
+ | InvalidRequestError
40
+ | RequestAbortedError
41
+ | RequestTimeoutError
42
+ | ConnectionError
43
+ >
44
+ > {
45
+ const parsed = safeParse(
46
+ request,
47
+ (value) => components.ServiceUpdate$outboundSchema.parse(value),
48
+ "Input validation failed",
49
+ );
50
+ if (!parsed.ok) {
51
+ return parsed;
52
+ }
53
+ const payload = parsed.value;
54
+ const body = encodeJSON("body", payload, { explode: true });
55
+
56
+ const path = pathToFunc("/api/v1/services/")();
57
+
58
+ const headers = new Headers({
59
+ "Content-Type": "application/json",
60
+ Accept: "application/json",
61
+ });
62
+
63
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
64
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
65
+ const requestSecurity = resolveGlobalSecurity(securityInput);
66
+
67
+ const context = {
68
+ operationID: "service_update",
69
+ oAuth2Scopes: [],
70
+
71
+ resolvedSecurity: requestSecurity,
72
+
73
+ securitySource: client._options.apiKeyHeader,
74
+ retryConfig: options?.retries
75
+ || client._options.retryConfig
76
+ || { strategy: "none" },
77
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
78
+ };
79
+
80
+ const requestRes = client._createRequest(context, {
81
+ security: requestSecurity,
82
+ method: "PUT",
83
+ path: path,
84
+ headers: headers,
85
+ body: body,
86
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
87
+ }, options);
88
+ if (!requestRes.ok) {
89
+ return requestRes;
90
+ }
91
+ const req = requestRes.value;
92
+
93
+ const doResult = await client._do(req, {
94
+ context,
95
+ errorCodes: ["422", "4XX", "5XX"],
96
+ retryConfig: context.retryConfig,
97
+ retryCodes: context.retryCodes,
98
+ });
99
+ if (!doResult.ok) {
100
+ return doResult;
101
+ }
102
+ const response = doResult.value;
103
+
104
+ const responseFields = {
105
+ HttpMeta: { Response: response, Request: req },
106
+ };
107
+
108
+ const [result] = await M.match<
109
+ components.Service,
110
+ | errors.HTTPValidationError
111
+ | SDKError
112
+ | SDKValidationError
113
+ | UnexpectedClientError
114
+ | InvalidRequestError
115
+ | RequestAbortedError
116
+ | RequestTimeoutError
117
+ | ConnectionError
118
+ >(
119
+ M.json(200, components.Service$inboundSchema),
120
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
121
+ M.fail(["4XX", "5XX"]),
122
+ )(response, { extraFields: responseFields });
123
+ if (!result.ok) {
124
+ return result;
125
+ }
126
+
127
+ return result;
128
+ }
@@ -32,7 +32,7 @@ export async function sessionsSessionRecordingStream(
32
32
  options?: RequestOptions,
33
33
  ): Promise<
34
34
  Result<
35
- any,
35
+ ReadableStream<Uint8Array>,
36
36
  | errors.HTTPValidationError
37
37
  | SDKError
38
38
  | SDKValidationError
@@ -62,7 +62,7 @@ export async function sessionsSessionRecordingStream(
62
62
  });
63
63
 
64
64
  const headers = new Headers({
65
- Accept: "application/json",
65
+ Accept: "application/octet-stream",
66
66
  });
67
67
 
68
68
  const secConfig = await extractSecurity(client._options.apiKeyHeader);
@@ -112,7 +112,7 @@ export async function sessionsSessionRecordingStream(
112
112
  };
113
113
 
114
114
  const [result] = await M.match<
115
- any,
115
+ ReadableStream<Uint8Array>,
116
116
  | errors.HTTPValidationError
117
117
  | SDKError
118
118
  | SDKValidationError
@@ -122,7 +122,7 @@ export async function sessionsSessionRecordingStream(
122
122
  | RequestTimeoutError
123
123
  | ConnectionError
124
124
  >(
125
- M.json(200, z.any()),
125
+ M.stream(200, z.instanceof(ReadableStream<Uint8Array>)),
126
126
  M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
127
127
  M.fail(["4XX", "5XX"]),
128
128
  )(response, { extraFields: responseFields });
@@ -0,0 +1,131 @@
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 { safeParse } from "../lib/schemas.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 * as errors from "../models/errors/index.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import { Result } from "../types/fp.js";
24
+
25
+ /**
26
+ * Create Tool
27
+ *
28
+ * @remarks
29
+ * Create a new tool
30
+ */
31
+ export async function toolsCreate(
32
+ client: SyllableSDKCore,
33
+ request: components.ToolCreate,
34
+ options?: RequestOptions,
35
+ ): Promise<
36
+ Result<
37
+ components.Tool,
38
+ | errors.HTTPValidationError
39
+ | SDKError
40
+ | SDKValidationError
41
+ | UnexpectedClientError
42
+ | InvalidRequestError
43
+ | RequestAbortedError
44
+ | RequestTimeoutError
45
+ | ConnectionError
46
+ >
47
+ > {
48
+ const parsed = safeParse(
49
+ request,
50
+ (value) => components.ToolCreate$outboundSchema.parse(value),
51
+ "Input validation failed",
52
+ );
53
+ if (!parsed.ok) {
54
+ return parsed;
55
+ }
56
+ const payload = parsed.value;
57
+ const body = encodeJSON("body", payload, { explode: true });
58
+
59
+ const path = pathToFunc("/api/v1/tools/")();
60
+
61
+ const headers = new Headers({
62
+ "Content-Type": "application/json",
63
+ Accept: "application/json",
64
+ });
65
+
66
+ const secConfig = await extractSecurity(client._options.apiKeyHeader);
67
+ const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
68
+ const requestSecurity = resolveGlobalSecurity(securityInput);
69
+
70
+ const context = {
71
+ operationID: "tool_create",
72
+ oAuth2Scopes: [],
73
+
74
+ resolvedSecurity: requestSecurity,
75
+
76
+ securitySource: client._options.apiKeyHeader,
77
+ retryConfig: options?.retries
78
+ || client._options.retryConfig
79
+ || { strategy: "none" },
80
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
81
+ };
82
+
83
+ const requestRes = client._createRequest(context, {
84
+ security: requestSecurity,
85
+ method: "POST",
86
+ path: path,
87
+ headers: headers,
88
+ body: body,
89
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
90
+ }, options);
91
+ if (!requestRes.ok) {
92
+ return requestRes;
93
+ }
94
+ const req = requestRes.value;
95
+
96
+ const doResult = await client._do(req, {
97
+ context,
98
+ errorCodes: ["422", "4XX", "5XX"],
99
+ retryConfig: context.retryConfig,
100
+ retryCodes: context.retryCodes,
101
+ });
102
+ if (!doResult.ok) {
103
+ return doResult;
104
+ }
105
+ const response = doResult.value;
106
+
107
+ const responseFields = {
108
+ HttpMeta: { Response: response, Request: req },
109
+ };
110
+
111
+ const [result] = await M.match<
112
+ components.Tool,
113
+ | errors.HTTPValidationError
114
+ | SDKError
115
+ | SDKValidationError
116
+ | UnexpectedClientError
117
+ | InvalidRequestError
118
+ | RequestAbortedError
119
+ | RequestTimeoutError
120
+ | ConnectionError
121
+ >(
122
+ M.json(200, components.Tool$inboundSchema),
123
+ M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
124
+ M.fail(["4XX", "5XX"]),
125
+ )(response, { extraFields: responseFields });
126
+ if (!result.ok) {
127
+ return result;
128
+ }
129
+
130
+ return result;
131
+ }