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.
- package/README.md +23 -7
- package/docs/sdks/prompts/README.md +78 -0
- package/docs/sdks/services/README.md +245 -0
- package/docs/sdks/sessions/README.md +1 -1
- package/docs/sdks/syllablesdk/README.md +3 -2
- package/docs/sdks/tools/README.md +163 -1
- package/docs/sdks/transcript/README.md +2 -0
- package/funcs/promptsPromptsHistory.d.ts +17 -0
- package/funcs/promptsPromptsHistory.d.ts.map +1 -0
- package/funcs/promptsPromptsHistory.js +106 -0
- package/funcs/promptsPromptsHistory.js.map +1 -0
- package/funcs/servicesCreate.d.ts +13 -0
- package/funcs/servicesCreate.d.ts.map +1 -0
- package/funcs/servicesCreate.js +96 -0
- package/funcs/servicesCreate.js.map +1 -0
- package/funcs/servicesList.d.ts +17 -0
- package/funcs/servicesList.d.ts.map +1 -0
- package/funcs/servicesList.js +111 -0
- package/funcs/servicesList.js.map +1 -0
- package/funcs/servicesUpdate.d.ts +13 -0
- package/funcs/servicesUpdate.d.ts.map +1 -0
- package/funcs/servicesUpdate.js +96 -0
- package/funcs/servicesUpdate.js.map +1 -0
- package/funcs/sessionsSessionRecordingStream.d.ts +1 -1
- package/funcs/sessionsSessionRecordingStream.d.ts.map +1 -1
- package/funcs/sessionsSessionRecordingStream.js +2 -2
- package/funcs/sessionsSessionRecordingStream.js.map +1 -1
- package/funcs/toolsCreate.d.ts +16 -0
- package/funcs/toolsCreate.d.ts.map +1 -0
- package/funcs/toolsCreate.js +99 -0
- package/funcs/toolsCreate.js.map +1 -0
- package/funcs/toolsList.d.ts +1 -1
- package/funcs/toolsList.js +1 -1
- package/funcs/toolsUpdate.d.ts +16 -0
- package/funcs/toolsUpdate.d.ts.map +1 -0
- package/funcs/toolsUpdate.js +99 -0
- package/funcs/toolsUpdate.js.map +1 -0
- package/lib/config.d.ts +4 -4
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +4 -4
- package/lib/config.js.map +1 -1
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -0
- package/models/components/index.js.map +1 -1
- package/models/components/listresponseservice.d.ts +38 -0
- package/models/components/listresponseservice.d.ts.map +1 -0
- package/models/components/listresponseservice.js +81 -0
- package/models/components/listresponseservice.js.map +1 -0
- package/models/components/prompt.d.ts +10 -0
- package/models/components/prompt.d.ts.map +1 -1
- package/models/components/prompt.js +8 -0
- package/models/components/prompt.js.map +1 -1
- package/models/components/prompthistory.d.ts +41 -0
- package/models/components/prompthistory.d.ts.map +1 -0
- package/models/components/prompthistory.js +88 -0
- package/models/components/prompthistory.js.map +1 -0
- package/models/components/promptproperties.d.ts +3 -0
- package/models/components/promptproperties.d.ts.map +1 -1
- package/models/components/promptproperties.js +1 -0
- package/models/components/promptproperties.js.map +1 -1
- package/models/components/service.d.ts +47 -0
- package/models/components/service.d.ts.map +1 -0
- package/models/components/service.js +65 -0
- package/models/components/service.js.map +1 -0
- package/models/components/servicecreate.d.ts +37 -0
- package/models/components/servicecreate.d.ts.map +1 -0
- package/models/components/servicecreate.js +61 -0
- package/models/components/servicecreate.js.map +1 -0
- package/models/components/serviceproperties.d.ts +28 -0
- package/models/components/serviceproperties.d.ts.map +1 -0
- package/models/components/serviceproperties.js +50 -0
- package/models/components/serviceproperties.js.map +1 -0
- package/models/components/serviceupdate.d.ts +42 -0
- package/models/components/serviceupdate.d.ts.map +1 -0
- package/models/components/serviceupdate.js +63 -0
- package/models/components/serviceupdate.js.map +1 -0
- package/models/components/sessionproperties.d.ts +3 -0
- package/models/components/sessionproperties.d.ts.map +1 -1
- package/models/components/sessionproperties.js +1 -0
- package/models/components/sessionproperties.js.map +1 -1
- package/models/components/toolcreate.d.ts +66 -0
- package/models/components/toolcreate.d.ts.map +1 -0
- package/models/components/toolcreate.js +95 -0
- package/models/components/toolcreate.js.map +1 -0
- package/models/components/toolupdate.d.ts +71 -0
- package/models/components/toolupdate.d.ts.map +1 -0
- package/models/components/toolupdate.js +97 -0
- package/models/components/toolupdate.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/promptshistory.d.ts +29 -0
- package/models/operations/promptshistory.d.ts.map +1 -0
- package/models/operations/promptshistory.js +68 -0
- package/models/operations/promptshistory.js.map +1 -0
- package/models/operations/promptslist.d.ts +3 -0
- package/models/operations/promptslist.d.ts.map +1 -1
- package/models/operations/promptslist.js +1 -0
- package/models/operations/promptslist.js.map +1 -1
- package/models/operations/servicelist.d.ts +97 -0
- package/models/operations/servicelist.d.ts.map +1 -0
- package/models/operations/servicelist.js +137 -0
- package/models/operations/servicelist.js.map +1 -0
- package/models/operations/sessionslist.d.ts +3 -0
- package/models/operations/sessionslist.d.ts.map +1 -1
- package/models/operations/sessionslist.js +1 -0
- package/models/operations/sessionslist.js.map +1 -1
- package/package.json +1 -1
- package/sdk/prompts.d.ts +7 -0
- package/sdk/prompts.d.ts.map +1 -1
- package/sdk/prompts.js +10 -0
- package/sdk/prompts.js.map +1 -1
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +5 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/services.d.ts +21 -0
- package/sdk/services.d.ts.map +1 -0
- package/sdk/services.js +36 -0
- package/sdk/services.js.map +1 -0
- package/sdk/sessions.d.ts +1 -1
- package/sdk/sessions.d.ts.map +1 -1
- package/sdk/tools.d.ts +15 -1
- package/sdk/tools.d.ts.map +1 -1
- package/sdk/tools.js +21 -1
- package/sdk/tools.js.map +1 -1
- package/src/funcs/promptsPromptsHistory.ts +139 -0
- package/src/funcs/servicesCreate.ts +128 -0
- package/src/funcs/servicesList.ts +144 -0
- package/src/funcs/servicesUpdate.ts +128 -0
- package/src/funcs/sessionsSessionRecordingStream.ts +4 -4
- package/src/funcs/toolsCreate.ts +131 -0
- package/src/funcs/toolsList.ts +1 -1
- package/src/funcs/toolsUpdate.ts +131 -0
- package/src/lib/config.ts +4 -4
- package/src/models/components/index.ts +8 -0
- package/src/models/components/listresponseservice.ts +101 -0
- package/src/models/components/prompt.ts +18 -0
- package/src/models/components/prompthistory.ts +103 -0
- package/src/models/components/promptproperties.ts +1 -0
- package/src/models/components/service.ts +83 -0
- package/src/models/components/servicecreate.ts +72 -0
- package/src/models/components/serviceproperties.ts +33 -0
- package/src/models/components/serviceupdate.ts +79 -0
- package/src/models/components/sessionproperties.ts +1 -0
- package/src/models/components/toolcreate.ts +141 -0
- package/src/models/components/toolupdate.ts +148 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/promptshistory.ts +75 -0
- package/src/models/operations/promptslist.ts +1 -0
- package/src/models/operations/servicelist.ts +184 -0
- package/src/models/operations/sessionslist.ts +1 -0
- package/src/sdk/prompts.ts +18 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/services.ts +58 -0
- package/src/sdk/sessions.ts +1 -1
- 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
|
-
|
|
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/
|
|
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
|
-
|
|
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.
|
|
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
|
+
}
|