syllable-sdk 0.1.0-alpha.70 → 0.1.0-alpha.71
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 +17 -0
- package/docs/sdks/insights/README.md +97 -0
- package/docs/sdks/prompts/README.md +81 -5
- package/docs/sdks/takeouts/README.md +163 -0
- package/docs/sdks/v1/README.md +251 -1
- package/funcs/insightsList.d.ts +17 -0
- package/funcs/insightsList.d.ts.map +1 -0
- package/funcs/insightsList.js +114 -0
- package/funcs/insightsList.js.map +1 -0
- package/funcs/promptsPromptGetSupportedLlms.d.ts +15 -0
- package/funcs/promptsPromptGetSupportedLlms.d.ts.map +1 -0
- package/funcs/promptsPromptGetSupportedLlms.js +89 -0
- package/funcs/promptsPromptGetSupportedLlms.js.map +1 -0
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts +13 -0
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts.map +1 -0
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js +99 -0
- package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js.map +1 -0
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts +14 -0
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts.map +1 -0
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js +105 -0
- package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js.map +1 -0
- package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.d.ts +13 -0
- package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.d.ts.map +1 -0
- package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.js +99 -0
- package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.js.map +1 -0
- package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.d.ts +14 -0
- package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.d.ts.map +1 -0
- package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.js +105 -0
- package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.js.map +1 -0
- package/funcs/v1List.d.ts +17 -0
- package/funcs/v1List.d.ts.map +1 -0
- package/funcs/v1List.js +114 -0
- package/funcs/v1List.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/createtakeoutresponse.d.ts +31 -0
- package/models/components/createtakeoutresponse.d.ts.map +1 -0
- package/models/components/createtakeoutresponse.js +72 -0
- package/models/components/createtakeoutresponse.js.map +1 -0
- package/models/components/daotakeoutcreate.d.ts +31 -0
- package/models/components/daotakeoutcreate.d.ts.map +1 -0
- package/models/components/daotakeoutcreate.js +72 -0
- package/models/components/daotakeoutcreate.js.map +1 -0
- 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/insightsoutput.d.ts +104 -0
- package/models/components/insightsoutput.d.ts.map +1 -0
- package/models/components/insightsoutput.js +127 -0
- package/models/components/insightsoutput.js.map +1 -0
- package/models/components/insightsproperties.d.ts +34 -0
- package/models/components/insightsproperties.d.ts.map +1 -0
- package/models/components/insightsproperties.js +52 -0
- package/models/components/insightsproperties.js.map +1 -0
- package/models/components/listresponseinsightsoutput.d.ts +53 -0
- package/models/components/listresponseinsightsoutput.d.ts.map +1 -0
- package/models/components/listresponseinsightsoutput.js +81 -0
- package/models/components/listresponseinsightsoutput.js.map +1 -0
- package/models/components/promptllmconfig.d.ts +1 -1
- package/models/components/supportedllm.d.ts +61 -0
- package/models/components/supportedllm.d.ts.map +1 -0
- package/models/components/supportedllm.js +81 -0
- package/models/components/supportedllm.js.map +1 -0
- package/models/components/takeoutrequeststatus.d.ts +43 -0
- package/models/components/takeoutrequeststatus.d.ts.map +1 -0
- package/models/components/takeoutrequeststatus.js +56 -0
- package/models/components/takeoutrequeststatus.js.map +1 -0
- package/models/components/takeoutstatusresponse.d.ts +39 -0
- package/models/components/takeoutstatusresponse.d.ts.map +1 -0
- package/models/components/takeoutstatusresponse.js +79 -0
- package/models/components/takeoutstatusresponse.js.map +1 -0
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts +29 -0
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts.map +1 -0
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.js +68 -0
- package/models/operations/gettakeoutapiv1takeoutsgetjobidget.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/insightslist.d.ts +73 -0
- package/models/operations/insightslist.d.ts.map +1 -0
- package/models/operations/insightslist.js +101 -0
- package/models/operations/insightslist.js.map +1 -0
- package/openapi.json +1080 -233
- package/package.json +1 -1
- package/sdk/insights.d.ts +10 -1
- package/sdk/insights.d.ts.map +1 -1
- package/sdk/insights.js +11 -0
- package/sdk/insights.js.map +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 +5 -2
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +7 -3
- package/sdk/sdk.js.map +1 -1
- package/sdk/takeouts.d.ts +14 -0
- package/sdk/takeouts.d.ts.map +1 -0
- package/sdk/takeouts.js +26 -0
- package/sdk/takeouts.js.map +1 -0
- package/sdk/v1.d.ts +15 -0
- package/sdk/v1.d.ts.map +1 -1
- package/sdk/v1.js +24 -0
- package/sdk/v1.js.map +1 -1
- package/src/funcs/insightsList.ts +148 -0
- package/src/funcs/promptsPromptGetSupportedLlms.ts +112 -0
- package/src/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.ts +132 -0
- package/src/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.ts +142 -0
- package/src/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.ts +132 -0
- package/src/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.ts +142 -0
- package/src/funcs/v1List.ts +148 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/createtakeoutresponse.ts +81 -0
- package/src/models/components/daotakeoutcreate.ts +81 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/insightsoutput.ts +207 -0
- package/src/models/components/insightsproperties.ts +35 -0
- package/src/models/components/listresponseinsightsoutput.ts +116 -0
- package/src/models/components/promptllmconfig.ts +1 -1
- package/src/models/components/supportedllm.ts +119 -0
- package/src/models/components/takeoutrequeststatus.ts +42 -0
- package/src/models/components/takeoutstatusresponse.ts +99 -0
- package/src/models/operations/gettakeoutapiv1takeoutsgetjobidget.ts +87 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/insightslist.ts +151 -0
- package/src/sdk/insights.ts +22 -1
- package/src/sdk/prompts.ts +16 -0
- package/src/sdk/sdk.ts +11 -5
- package/src/sdk/takeouts.ts +40 -0
- package/src/sdk/v1.ts +48 -0
|
@@ -0,0 +1,132 @@
|
|
|
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 Takeout
|
|
28
|
+
*/
|
|
29
|
+
export async function takeoutsCreateTakeoutApiV1TakeoutsCreatePost(
|
|
30
|
+
client: SyllableSDKCore,
|
|
31
|
+
request: components.DaoTakeoutCreate,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
components.CreateTakeoutResponse,
|
|
36
|
+
| errors.HTTPValidationError
|
|
37
|
+
| SDKError
|
|
38
|
+
| SDKValidationError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
>
|
|
45
|
+
> {
|
|
46
|
+
const parsed = safeParse(
|
|
47
|
+
request,
|
|
48
|
+
(value) => components.DaoTakeoutCreate$outboundSchema.parse(value),
|
|
49
|
+
"Input validation failed",
|
|
50
|
+
);
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
56
|
+
|
|
57
|
+
const path = pathToFunc("/api/v1/takeouts/create")();
|
|
58
|
+
|
|
59
|
+
const headers = new Headers(compactMap({
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
Accept: "application/json",
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
65
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
66
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
67
|
+
|
|
68
|
+
const context = {
|
|
69
|
+
baseURL: options?.serverURL ?? "",
|
|
70
|
+
operationID: "create_takeout_api_v1_takeouts_create_post",
|
|
71
|
+
oAuth2Scopes: [],
|
|
72
|
+
|
|
73
|
+
resolvedSecurity: requestSecurity,
|
|
74
|
+
|
|
75
|
+
securitySource: client._options.apiKeyHeader,
|
|
76
|
+
retryConfig: options?.retries
|
|
77
|
+
|| client._options.retryConfig
|
|
78
|
+
|| { strategy: "none" },
|
|
79
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const requestRes = client._createRequest(context, {
|
|
83
|
+
security: requestSecurity,
|
|
84
|
+
method: "POST",
|
|
85
|
+
baseURL: options?.serverURL,
|
|
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.CreateTakeoutResponse,
|
|
113
|
+
| errors.HTTPValidationError
|
|
114
|
+
| SDKError
|
|
115
|
+
| SDKValidationError
|
|
116
|
+
| UnexpectedClientError
|
|
117
|
+
| InvalidRequestError
|
|
118
|
+
| RequestAbortedError
|
|
119
|
+
| RequestTimeoutError
|
|
120
|
+
| ConnectionError
|
|
121
|
+
>(
|
|
122
|
+
M.json(200, components.CreateTakeoutResponse$inboundSchema),
|
|
123
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
124
|
+
M.fail("4XX"),
|
|
125
|
+
M.fail("5XX"),
|
|
126
|
+
)(response, { extraFields: responseFields });
|
|
127
|
+
if (!result.ok) {
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
@@ -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 Takeout
|
|
29
|
+
*/
|
|
30
|
+
export async function takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet(
|
|
31
|
+
client: SyllableSDKCore,
|
|
32
|
+
request: operations.GetTakeoutApiV1TakeoutsGetJobIdGetRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): Promise<
|
|
35
|
+
Result<
|
|
36
|
+
components.TakeoutStatusResponse,
|
|
37
|
+
| errors.HTTPValidationError
|
|
38
|
+
| SDKError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.GetTakeoutApiV1TakeoutsGetJobIdGetRequest$outboundSchema.parse(
|
|
51
|
+
value,
|
|
52
|
+
),
|
|
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
|
+
job_id: encodeSimple("job_id", payload.job_id, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc("/api/v1/takeouts/get/{job_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: "get_takeout_api_v1_takeouts_get__job_id__get",
|
|
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.TakeoutStatusResponse,
|
|
123
|
+
| errors.HTTPValidationError
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.json(200, components.TakeoutStatusResponse$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,132 @@
|
|
|
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 Takeout
|
|
28
|
+
*/
|
|
29
|
+
export async function v1CreateTakeoutApiV1TakeoutsCreatePost(
|
|
30
|
+
client: SyllableSDKCore,
|
|
31
|
+
request: components.DaoTakeoutCreate,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
components.CreateTakeoutResponse,
|
|
36
|
+
| errors.HTTPValidationError
|
|
37
|
+
| SDKError
|
|
38
|
+
| SDKValidationError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
>
|
|
45
|
+
> {
|
|
46
|
+
const parsed = safeParse(
|
|
47
|
+
request,
|
|
48
|
+
(value) => components.DaoTakeoutCreate$outboundSchema.parse(value),
|
|
49
|
+
"Input validation failed",
|
|
50
|
+
);
|
|
51
|
+
if (!parsed.ok) {
|
|
52
|
+
return parsed;
|
|
53
|
+
}
|
|
54
|
+
const payload = parsed.value;
|
|
55
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
56
|
+
|
|
57
|
+
const path = pathToFunc("/api/v1/takeouts/create")();
|
|
58
|
+
|
|
59
|
+
const headers = new Headers(compactMap({
|
|
60
|
+
"Content-Type": "application/json",
|
|
61
|
+
Accept: "application/json",
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
65
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
66
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
67
|
+
|
|
68
|
+
const context = {
|
|
69
|
+
baseURL: options?.serverURL ?? "",
|
|
70
|
+
operationID: "create_takeout_api_v1_takeouts_create_post",
|
|
71
|
+
oAuth2Scopes: [],
|
|
72
|
+
|
|
73
|
+
resolvedSecurity: requestSecurity,
|
|
74
|
+
|
|
75
|
+
securitySource: client._options.apiKeyHeader,
|
|
76
|
+
retryConfig: options?.retries
|
|
77
|
+
|| client._options.retryConfig
|
|
78
|
+
|| { strategy: "none" },
|
|
79
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const requestRes = client._createRequest(context, {
|
|
83
|
+
security: requestSecurity,
|
|
84
|
+
method: "POST",
|
|
85
|
+
baseURL: options?.serverURL,
|
|
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.CreateTakeoutResponse,
|
|
113
|
+
| errors.HTTPValidationError
|
|
114
|
+
| SDKError
|
|
115
|
+
| SDKValidationError
|
|
116
|
+
| UnexpectedClientError
|
|
117
|
+
| InvalidRequestError
|
|
118
|
+
| RequestAbortedError
|
|
119
|
+
| RequestTimeoutError
|
|
120
|
+
| ConnectionError
|
|
121
|
+
>(
|
|
122
|
+
M.json(200, components.CreateTakeoutResponse$inboundSchema),
|
|
123
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
124
|
+
M.fail("4XX"),
|
|
125
|
+
M.fail("5XX"),
|
|
126
|
+
)(response, { extraFields: responseFields });
|
|
127
|
+
if (!result.ok) {
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
@@ -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 Takeout
|
|
29
|
+
*/
|
|
30
|
+
export async function v1GetTakeoutApiV1TakeoutsGetJobIdGet(
|
|
31
|
+
client: SyllableSDKCore,
|
|
32
|
+
request: operations.GetTakeoutApiV1TakeoutsGetJobIdGetRequest,
|
|
33
|
+
options?: RequestOptions,
|
|
34
|
+
): Promise<
|
|
35
|
+
Result<
|
|
36
|
+
components.TakeoutStatusResponse,
|
|
37
|
+
| errors.HTTPValidationError
|
|
38
|
+
| SDKError
|
|
39
|
+
| SDKValidationError
|
|
40
|
+
| UnexpectedClientError
|
|
41
|
+
| InvalidRequestError
|
|
42
|
+
| RequestAbortedError
|
|
43
|
+
| RequestTimeoutError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
>
|
|
46
|
+
> {
|
|
47
|
+
const parsed = safeParse(
|
|
48
|
+
request,
|
|
49
|
+
(value) =>
|
|
50
|
+
operations.GetTakeoutApiV1TakeoutsGetJobIdGetRequest$outboundSchema.parse(
|
|
51
|
+
value,
|
|
52
|
+
),
|
|
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
|
+
job_id: encodeSimple("job_id", payload.job_id, {
|
|
63
|
+
explode: false,
|
|
64
|
+
charEncoding: "percent",
|
|
65
|
+
}),
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const path = pathToFunc("/api/v1/takeouts/get/{job_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: "get_takeout_api_v1_takeouts_get__job_id__get",
|
|
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.TakeoutStatusResponse,
|
|
123
|
+
| errors.HTTPValidationError
|
|
124
|
+
| SDKError
|
|
125
|
+
| SDKValidationError
|
|
126
|
+
| UnexpectedClientError
|
|
127
|
+
| InvalidRequestError
|
|
128
|
+
| RequestAbortedError
|
|
129
|
+
| RequestTimeoutError
|
|
130
|
+
| ConnectionError
|
|
131
|
+
>(
|
|
132
|
+
M.json(200, components.TakeoutStatusResponse$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,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
|
+
* Insights List
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* List the existing insight_tools
|
|
32
|
+
*/
|
|
33
|
+
export async function v1List(
|
|
34
|
+
client: SyllableSDKCore,
|
|
35
|
+
request: operations.InsightsListRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<
|
|
38
|
+
Result<
|
|
39
|
+
components.ListResponseInsightsOutput,
|
|
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.InsightsListRequest$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/")();
|
|
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: "insights_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.ListResponseInsightsOutput,
|
|
129
|
+
| errors.HTTPValidationError
|
|
130
|
+
| SDKError
|
|
131
|
+
| SDKValidationError
|
|
132
|
+
| UnexpectedClientError
|
|
133
|
+
| InvalidRequestError
|
|
134
|
+
| RequestAbortedError
|
|
135
|
+
| RequestTimeoutError
|
|
136
|
+
| ConnectionError
|
|
137
|
+
>(
|
|
138
|
+
M.json(200, components.ListResponseInsightsOutput$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
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -57,8 +57,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
57
57
|
export const SDK_METADATA = {
|
|
58
58
|
language: "typescript",
|
|
59
59
|
openapiDocVersion: "0.0.2",
|
|
60
|
-
sdkVersion: "0.1.0-alpha.
|
|
60
|
+
sdkVersion: "0.1.0-alpha.71",
|
|
61
61
|
genVersion: "2.512.4",
|
|
62
62
|
userAgent:
|
|
63
|
-
"speakeasy-sdk/typescript 0.1.0-alpha.
|
|
63
|
+
"speakeasy-sdk/typescript 0.1.0-alpha.71 2.512.4 0.0.2 syllable-sdk",
|
|
64
64
|
} as const;
|