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.
Files changed (133) hide show
  1. package/README.md +17 -0
  2. package/docs/sdks/insights/README.md +97 -0
  3. package/docs/sdks/prompts/README.md +81 -5
  4. package/docs/sdks/takeouts/README.md +163 -0
  5. package/docs/sdks/v1/README.md +251 -1
  6. package/funcs/insightsList.d.ts +17 -0
  7. package/funcs/insightsList.d.ts.map +1 -0
  8. package/funcs/insightsList.js +114 -0
  9. package/funcs/insightsList.js.map +1 -0
  10. package/funcs/promptsPromptGetSupportedLlms.d.ts +15 -0
  11. package/funcs/promptsPromptGetSupportedLlms.d.ts.map +1 -0
  12. package/funcs/promptsPromptGetSupportedLlms.js +89 -0
  13. package/funcs/promptsPromptGetSupportedLlms.js.map +1 -0
  14. package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts +13 -0
  15. package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.d.ts.map +1 -0
  16. package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js +99 -0
  17. package/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.js.map +1 -0
  18. package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts +14 -0
  19. package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.d.ts.map +1 -0
  20. package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js +105 -0
  21. package/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.js.map +1 -0
  22. package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.d.ts +13 -0
  23. package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.d.ts.map +1 -0
  24. package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.js +99 -0
  25. package/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.js.map +1 -0
  26. package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.d.ts +14 -0
  27. package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.d.ts.map +1 -0
  28. package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.js +105 -0
  29. package/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.js.map +1 -0
  30. package/funcs/v1List.d.ts +17 -0
  31. package/funcs/v1List.d.ts.map +1 -0
  32. package/funcs/v1List.js +114 -0
  33. package/funcs/v1List.js.map +1 -0
  34. package/jsr.json +1 -1
  35. package/lib/config.d.ts +2 -2
  36. package/lib/config.js +2 -2
  37. package/models/components/createtakeoutresponse.d.ts +31 -0
  38. package/models/components/createtakeoutresponse.d.ts.map +1 -0
  39. package/models/components/createtakeoutresponse.js +72 -0
  40. package/models/components/createtakeoutresponse.js.map +1 -0
  41. package/models/components/daotakeoutcreate.d.ts +31 -0
  42. package/models/components/daotakeoutcreate.d.ts.map +1 -0
  43. package/models/components/daotakeoutcreate.js +72 -0
  44. package/models/components/daotakeoutcreate.js.map +1 -0
  45. package/models/components/index.d.ts +8 -0
  46. package/models/components/index.d.ts.map +1 -1
  47. package/models/components/index.js +8 -0
  48. package/models/components/index.js.map +1 -1
  49. package/models/components/insightsoutput.d.ts +104 -0
  50. package/models/components/insightsoutput.d.ts.map +1 -0
  51. package/models/components/insightsoutput.js +127 -0
  52. package/models/components/insightsoutput.js.map +1 -0
  53. package/models/components/insightsproperties.d.ts +34 -0
  54. package/models/components/insightsproperties.d.ts.map +1 -0
  55. package/models/components/insightsproperties.js +52 -0
  56. package/models/components/insightsproperties.js.map +1 -0
  57. package/models/components/listresponseinsightsoutput.d.ts +53 -0
  58. package/models/components/listresponseinsightsoutput.d.ts.map +1 -0
  59. package/models/components/listresponseinsightsoutput.js +81 -0
  60. package/models/components/listresponseinsightsoutput.js.map +1 -0
  61. package/models/components/promptllmconfig.d.ts +1 -1
  62. package/models/components/supportedllm.d.ts +61 -0
  63. package/models/components/supportedllm.d.ts.map +1 -0
  64. package/models/components/supportedllm.js +81 -0
  65. package/models/components/supportedllm.js.map +1 -0
  66. package/models/components/takeoutrequeststatus.d.ts +43 -0
  67. package/models/components/takeoutrequeststatus.d.ts.map +1 -0
  68. package/models/components/takeoutrequeststatus.js +56 -0
  69. package/models/components/takeoutrequeststatus.js.map +1 -0
  70. package/models/components/takeoutstatusresponse.d.ts +39 -0
  71. package/models/components/takeoutstatusresponse.d.ts.map +1 -0
  72. package/models/components/takeoutstatusresponse.js +79 -0
  73. package/models/components/takeoutstatusresponse.js.map +1 -0
  74. package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts +29 -0
  75. package/models/operations/gettakeoutapiv1takeoutsgetjobidget.d.ts.map +1 -0
  76. package/models/operations/gettakeoutapiv1takeoutsgetjobidget.js +68 -0
  77. package/models/operations/gettakeoutapiv1takeoutsgetjobidget.js.map +1 -0
  78. package/models/operations/index.d.ts +2 -0
  79. package/models/operations/index.d.ts.map +1 -1
  80. package/models/operations/index.js +2 -0
  81. package/models/operations/index.js.map +1 -1
  82. package/models/operations/insightslist.d.ts +73 -0
  83. package/models/operations/insightslist.d.ts.map +1 -0
  84. package/models/operations/insightslist.js +101 -0
  85. package/models/operations/insightslist.js.map +1 -0
  86. package/openapi.json +1080 -233
  87. package/package.json +1 -1
  88. package/sdk/insights.d.ts +10 -1
  89. package/sdk/insights.d.ts.map +1 -1
  90. package/sdk/insights.js +11 -0
  91. package/sdk/insights.js.map +1 -1
  92. package/sdk/prompts.d.ts +7 -0
  93. package/sdk/prompts.d.ts.map +1 -1
  94. package/sdk/prompts.js +10 -0
  95. package/sdk/prompts.js.map +1 -1
  96. package/sdk/sdk.d.ts +5 -2
  97. package/sdk/sdk.d.ts.map +1 -1
  98. package/sdk/sdk.js +7 -3
  99. package/sdk/sdk.js.map +1 -1
  100. package/sdk/takeouts.d.ts +14 -0
  101. package/sdk/takeouts.d.ts.map +1 -0
  102. package/sdk/takeouts.js +26 -0
  103. package/sdk/takeouts.js.map +1 -0
  104. package/sdk/v1.d.ts +15 -0
  105. package/sdk/v1.d.ts.map +1 -1
  106. package/sdk/v1.js +24 -0
  107. package/sdk/v1.js.map +1 -1
  108. package/src/funcs/insightsList.ts +148 -0
  109. package/src/funcs/promptsPromptGetSupportedLlms.ts +112 -0
  110. package/src/funcs/takeoutsCreateTakeoutApiV1TakeoutsCreatePost.ts +132 -0
  111. package/src/funcs/takeoutsGetTakeoutApiV1TakeoutsGetJobIdGet.ts +142 -0
  112. package/src/funcs/v1CreateTakeoutApiV1TakeoutsCreatePost.ts +132 -0
  113. package/src/funcs/v1GetTakeoutApiV1TakeoutsGetJobIdGet.ts +142 -0
  114. package/src/funcs/v1List.ts +148 -0
  115. package/src/lib/config.ts +2 -2
  116. package/src/models/components/createtakeoutresponse.ts +81 -0
  117. package/src/models/components/daotakeoutcreate.ts +81 -0
  118. package/src/models/components/index.ts +8 -0
  119. package/src/models/components/insightsoutput.ts +207 -0
  120. package/src/models/components/insightsproperties.ts +35 -0
  121. package/src/models/components/listresponseinsightsoutput.ts +116 -0
  122. package/src/models/components/promptllmconfig.ts +1 -1
  123. package/src/models/components/supportedllm.ts +119 -0
  124. package/src/models/components/takeoutrequeststatus.ts +42 -0
  125. package/src/models/components/takeoutstatusresponse.ts +99 -0
  126. package/src/models/operations/gettakeoutapiv1takeoutsgetjobidget.ts +87 -0
  127. package/src/models/operations/index.ts +2 -0
  128. package/src/models/operations/insightslist.ts +151 -0
  129. package/src/sdk/insights.ts +22 -1
  130. package/src/sdk/prompts.ts +16 -0
  131. package/src/sdk/sdk.ts +11 -5
  132. package/src/sdk/takeouts.ts +40 -0
  133. 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.70",
60
+ sdkVersion: "0.1.0-alpha.71",
61
61
  genVersion: "2.512.4",
62
62
  userAgent:
63
- "speakeasy-sdk/typescript 0.1.0-alpha.70 2.512.4 0.0.2 syllable-sdk",
63
+ "speakeasy-sdk/typescript 0.1.0-alpha.71 2.512.4 0.0.2 syllable-sdk",
64
64
  } as const;