syllable-sdk 0.1.0-alpha.26 → 0.1.0-alpha.28

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 (134) hide show
  1. package/README.md +6 -25
  2. package/docs/sdks/tools/README.md +36 -0
  3. package/lib/config.d.ts +3 -3
  4. package/lib/config.d.ts.map +1 -1
  5. package/lib/config.js +6 -6
  6. package/lib/config.js.map +1 -1
  7. package/models/components/channeltarget.d.ts +16 -16
  8. package/models/components/channeltarget.d.ts.map +1 -1
  9. package/models/components/channeltarget.js +16 -16
  10. package/models/components/channeltarget.js.map +1 -1
  11. package/models/components/channeltargetcreaterequest.d.ts +12 -12
  12. package/models/components/channeltargetcreaterequest.d.ts.map +1 -1
  13. package/models/components/channeltargetcreaterequest.js +12 -12
  14. package/models/components/channeltargetcreaterequest.js.map +1 -1
  15. package/models/components/channeltargetupdaterequest.d.ts +12 -12
  16. package/models/components/channeltargetupdaterequest.d.ts.map +1 -1
  17. package/models/components/channeltargetupdaterequest.js +12 -12
  18. package/models/components/channeltargetupdaterequest.js.map +1 -1
  19. package/models/components/function.d.ts +74 -0
  20. package/models/components/function.d.ts.map +1 -0
  21. package/models/components/function.js +86 -0
  22. package/models/components/function.js.map +1 -0
  23. package/models/components/httpendpoint.d.ts +114 -0
  24. package/models/components/httpendpoint.d.ts.map +1 -0
  25. package/models/components/httpendpoint.js +119 -0
  26. package/models/components/httpendpoint.js.map +1 -0
  27. package/models/components/index.d.ts +7 -0
  28. package/models/components/index.d.ts.map +1 -1
  29. package/models/components/index.js +7 -0
  30. package/models/components/index.js.map +1 -1
  31. package/models/components/sdkinternaltool.d.ts +46 -0
  32. package/models/components/sdkinternaltool.d.ts.map +1 -0
  33. package/models/components/sdkinternaltool.js +62 -0
  34. package/models/components/sdkinternaltool.js.map +1 -0
  35. package/models/components/sdktooldefinition.d.ts +161 -0
  36. package/models/components/sdktooldefinition.d.ts.map +1 -0
  37. package/models/components/sdktooldefinition.js +175 -0
  38. package/models/components/sdktooldefinition.js.map +1 -0
  39. package/models/components/testmessage.d.ts +2 -0
  40. package/models/components/testmessage.d.ts.map +1 -1
  41. package/models/components/testmessage.js +4 -0
  42. package/models/components/testmessage.js.map +1 -1
  43. package/models/components/tool.d.ts +3 -29
  44. package/models/components/tool.d.ts.map +1 -1
  45. package/models/components/tool.js +4 -26
  46. package/models/components/tool.js.map +1 -1
  47. package/models/components/toolcreate.d.ts +3 -29
  48. package/models/components/toolcreate.d.ts.map +1 -1
  49. package/models/components/toolcreate.js +4 -26
  50. package/models/components/toolcreate.js.map +1 -1
  51. package/models/components/toolparameterdefault.d.ts +36 -0
  52. package/models/components/toolparameterdefault.d.ts.map +1 -0
  53. package/models/components/toolparameterdefault.js +60 -0
  54. package/models/components/toolparameterdefault.js.map +1 -0
  55. package/models/components/toolparametertransform.d.ts +81 -0
  56. package/models/components/toolparametertransform.d.ts.map +1 -0
  57. package/models/components/toolparametertransform.js +88 -0
  58. package/models/components/toolparametertransform.js.map +1 -0
  59. package/models/components/toolparametertransformcondition.d.ts +45 -0
  60. package/models/components/toolparametertransformcondition.d.ts.map +1 -0
  61. package/models/components/toolparametertransformcondition.js +63 -0
  62. package/models/components/toolparametertransformcondition.js.map +1 -0
  63. package/models/components/toolupdate.d.ts +3 -29
  64. package/models/components/toolupdate.d.ts.map +1 -1
  65. package/models/components/toolupdate.js +4 -26
  66. package/models/components/toolupdate.js.map +1 -1
  67. package/package.json +1 -1
  68. package/sdk/sdk.d.ts +0 -3
  69. package/sdk/sdk.d.ts.map +1 -1
  70. package/sdk/sdk.js +0 -5
  71. package/sdk/sdk.js.map +1 -1
  72. package/src/lib/config.ts +6 -6
  73. package/src/models/components/channeltarget.ts +32 -32
  74. package/src/models/components/channeltargetcreaterequest.ts +24 -24
  75. package/src/models/components/channeltargetupdaterequest.ts +24 -24
  76. package/src/models/components/function.ts +136 -0
  77. package/src/models/components/httpendpoint.ts +158 -0
  78. package/src/models/components/index.ts +7 -0
  79. package/src/models/components/sdkinternaltool.ts +88 -0
  80. package/src/models/components/sdktooldefinition.ts +298 -0
  81. package/src/models/components/testmessage.ts +6 -0
  82. package/src/models/components/tool.ts +10 -56
  83. package/src/models/components/toolcreate.ts +10 -60
  84. package/src/models/components/toolparameterdefault.ts +78 -0
  85. package/src/models/components/toolparametertransform.ts +125 -0
  86. package/src/models/components/toolparametertransformcondition.ts +88 -0
  87. package/src/models/components/toolupdate.ts +10 -60
  88. package/src/sdk/sdk.ts +0 -6
  89. package/docs/sdks/v1/README.md +0 -629
  90. package/funcs/v1AgentGetAvailableVoices.d.ts +0 -15
  91. package/funcs/v1AgentGetAvailableVoices.d.ts.map +0 -1
  92. package/funcs/v1AgentGetAvailableVoices.js +0 -87
  93. package/funcs/v1AgentGetAvailableVoices.js.map +0 -1
  94. package/funcs/v1Create.d.ts +0 -16
  95. package/funcs/v1Create.d.ts.map +0 -1
  96. package/funcs/v1Create.js +0 -100
  97. package/funcs/v1Create.js.map +0 -1
  98. package/funcs/v1Delete.d.ts +0 -16
  99. package/funcs/v1Delete.d.ts.map +0 -1
  100. package/funcs/v1Delete.js +0 -106
  101. package/funcs/v1Delete.js.map +0 -1
  102. package/funcs/v1DirectoryMemberBulkLoad.d.ts +0 -16
  103. package/funcs/v1DirectoryMemberBulkLoad.d.ts.map +0 -1
  104. package/funcs/v1DirectoryMemberBulkLoad.js +0 -113
  105. package/funcs/v1DirectoryMemberBulkLoad.js.map +0 -1
  106. package/funcs/v1DirectoryMemberDownload.d.ts +0 -14
  107. package/funcs/v1DirectoryMemberDownload.d.ts.map +0 -1
  108. package/funcs/v1DirectoryMemberDownload.js +0 -86
  109. package/funcs/v1DirectoryMemberDownload.js.map +0 -1
  110. package/funcs/v1GetById.d.ts +0 -17
  111. package/funcs/v1GetById.d.ts.map +0 -1
  112. package/funcs/v1GetById.js +0 -106
  113. package/funcs/v1GetById.js.map +0 -1
  114. package/funcs/v1List.d.ts +0 -17
  115. package/funcs/v1List.d.ts.map +0 -1
  116. package/funcs/v1List.js +0 -112
  117. package/funcs/v1List.js.map +0 -1
  118. package/funcs/v1Update.d.ts +0 -17
  119. package/funcs/v1Update.d.ts.map +0 -1
  120. package/funcs/v1Update.js +0 -107
  121. package/funcs/v1Update.js.map +0 -1
  122. package/sdk/v1.d.ts +0 -62
  123. package/sdk/v1.d.ts.map +0 -1
  124. package/sdk/v1.js +0 -92
  125. package/sdk/v1.js.map +0 -1
  126. package/src/funcs/v1AgentGetAvailableVoices.ts +0 -109
  127. package/src/funcs/v1Create.ts +0 -132
  128. package/src/funcs/v1Delete.ts +0 -140
  129. package/src/funcs/v1DirectoryMemberBulkLoad.ts +0 -149
  130. package/src/funcs/v1DirectoryMemberDownload.ts +0 -108
  131. package/src/funcs/v1GetById.ts +0 -140
  132. package/src/funcs/v1List.ts +0 -146
  133. package/src/funcs/v1Update.ts +0 -141
  134. package/src/sdk/v1.ts +0 -150
@@ -1,109 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { SyllableSDKCore } from "../core.js";
7
- import * as M from "../lib/matchers.js";
8
- import { RequestOptions } from "../lib/sdks.js";
9
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
10
- import { pathToFunc } from "../lib/url.js";
11
- import * as components from "../models/components/index.js";
12
- import {
13
- ConnectionError,
14
- InvalidRequestError,
15
- RequestAbortedError,
16
- RequestTimeoutError,
17
- UnexpectedClientError,
18
- } from "../models/errors/httpclienterrors.js";
19
- import { SDKError } from "../models/errors/sdkerror.js";
20
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
21
- import { Result } from "../types/fp.js";
22
-
23
- /**
24
- * Get Available Agent Voices
25
- *
26
- * @remarks
27
- * Get available agent voices.
28
- */
29
- export async function v1AgentGetAvailableVoices(
30
- client: SyllableSDKCore,
31
- options?: RequestOptions,
32
- ): Promise<
33
- Result<
34
- Array<components.AgentVoice>,
35
- | SDKError
36
- | SDKValidationError
37
- | UnexpectedClientError
38
- | InvalidRequestError
39
- | RequestAbortedError
40
- | RequestTimeoutError
41
- | ConnectionError
42
- >
43
- > {
44
- const path = pathToFunc("/api/v1/agents/voices/available")();
45
-
46
- const headers = new Headers({
47
- Accept: "application/json",
48
- });
49
-
50
- const secConfig = await extractSecurity(client._options.apiKeyHeader);
51
- const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
52
- const requestSecurity = resolveGlobalSecurity(securityInput);
53
-
54
- const context = {
55
- operationID: "agent_get_available_voices",
56
- oAuth2Scopes: [],
57
-
58
- resolvedSecurity: requestSecurity,
59
-
60
- securitySource: client._options.apiKeyHeader,
61
- retryConfig: options?.retries
62
- || client._options.retryConfig
63
- || { strategy: "none" },
64
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
65
- };
66
-
67
- const requestRes = client._createRequest(context, {
68
- security: requestSecurity,
69
- method: "GET",
70
- baseURL: options?.serverURL,
71
- path: path,
72
- headers: headers,
73
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
74
- }, options);
75
- if (!requestRes.ok) {
76
- return requestRes;
77
- }
78
- const req = requestRes.value;
79
-
80
- const doResult = await client._do(req, {
81
- context,
82
- errorCodes: ["4XX", "5XX"],
83
- retryConfig: context.retryConfig,
84
- retryCodes: context.retryCodes,
85
- });
86
- if (!doResult.ok) {
87
- return doResult;
88
- }
89
- const response = doResult.value;
90
-
91
- const [result] = await M.match<
92
- Array<components.AgentVoice>,
93
- | SDKError
94
- | SDKValidationError
95
- | UnexpectedClientError
96
- | InvalidRequestError
97
- | RequestAbortedError
98
- | RequestTimeoutError
99
- | ConnectionError
100
- >(
101
- M.json(200, z.array(components.AgentVoice$inboundSchema)),
102
- M.fail(["4XX", "5XX"]),
103
- )(response);
104
- if (!result.ok) {
105
- return result;
106
- }
107
-
108
- return result;
109
- }
@@ -1,132 +0,0 @@
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 Directory Member
27
- *
28
- * @remarks
29
- * Create a new member in the directory
30
- */
31
- export async function v1Create(
32
- client: SyllableSDKCore,
33
- request: components.DirectoryMemberCreate,
34
- options?: RequestOptions,
35
- ): Promise<
36
- Result<
37
- components.DirectoryMember,
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.DirectoryMemberCreate$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/directory_members/")();
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: "directory_member_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
- baseURL: options?.serverURL,
87
- path: path,
88
- headers: headers,
89
- body: body,
90
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
91
- }, options);
92
- if (!requestRes.ok) {
93
- return requestRes;
94
- }
95
- const req = requestRes.value;
96
-
97
- const doResult = await client._do(req, {
98
- context,
99
- errorCodes: ["422", "4XX", "5XX"],
100
- retryConfig: context.retryConfig,
101
- retryCodes: context.retryCodes,
102
- });
103
- if (!doResult.ok) {
104
- return doResult;
105
- }
106
- const response = doResult.value;
107
-
108
- const responseFields = {
109
- HttpMeta: { Response: response, Request: req },
110
- };
111
-
112
- const [result] = await M.match<
113
- components.DirectoryMember,
114
- | errors.HTTPValidationError
115
- | SDKError
116
- | SDKValidationError
117
- | UnexpectedClientError
118
- | InvalidRequestError
119
- | RequestAbortedError
120
- | RequestTimeoutError
121
- | ConnectionError
122
- >(
123
- M.json(200, components.DirectoryMember$inboundSchema),
124
- M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
125
- M.fail(["4XX", "5XX"]),
126
- )(response, { extraFields: responseFields });
127
- if (!result.ok) {
128
- return result;
129
- }
130
-
131
- return result;
132
- }
@@ -1,140 +0,0 @@
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 {
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
- * Delete Directory Member
28
- *
29
- * @remarks
30
- * Delete a DirectoryMember.
31
- */
32
- export async function v1Delete(
33
- client: SyllableSDKCore,
34
- request: operations.DirectoryMemberDeleteRequest,
35
- options?: RequestOptions,
36
- ): Promise<
37
- Result<
38
- any,
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) =>
52
- operations.DirectoryMemberDeleteRequest$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
- member_id: encodeSimple("member_id", payload.member_id, {
63
- explode: false,
64
- charEncoding: "percent",
65
- }),
66
- };
67
-
68
- const path = pathToFunc("/api/v1/directory_members/{member_id}")(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: "directory_member_delete",
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: "DELETE",
94
- baseURL: options?.serverURL,
95
- path: path,
96
- headers: headers,
97
- body: body,
98
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
99
- }, options);
100
- if (!requestRes.ok) {
101
- return requestRes;
102
- }
103
- const req = requestRes.value;
104
-
105
- const doResult = await client._do(req, {
106
- context,
107
- errorCodes: ["400", "404", "422", "4XX", "500", "5XX"],
108
- retryConfig: context.retryConfig,
109
- retryCodes: context.retryCodes,
110
- });
111
- if (!doResult.ok) {
112
- return doResult;
113
- }
114
- const response = doResult.value;
115
-
116
- const responseFields = {
117
- HttpMeta: { Response: response, Request: req },
118
- };
119
-
120
- const [result] = await M.match<
121
- any,
122
- | errors.HTTPValidationError
123
- | SDKError
124
- | SDKValidationError
125
- | UnexpectedClientError
126
- | InvalidRequestError
127
- | RequestAbortedError
128
- | RequestTimeoutError
129
- | ConnectionError
130
- >(
131
- M.json(200, z.any()),
132
- M.fail([400, 404, "4XX", 500, "5XX"]),
133
- M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
134
- )(response, { extraFields: responseFields });
135
- if (!result.ok) {
136
- return result;
137
- }
138
-
139
- return result;
140
- }
@@ -1,149 +0,0 @@
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 { readableStreamToArrayBuffer } from "../lib/files.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 { isBlobLike } from "../types/blobs.js";
25
- import { Result } from "../types/fp.js";
26
- import { isReadableStream } from "../types/streams.js";
27
-
28
- /**
29
- * Bulk Load Directory Members
30
- *
31
- * @remarks
32
- * Update Directory Members in chunks of 100.
33
- */
34
- export async function v1DirectoryMemberBulkLoad(
35
- client: SyllableSDKCore,
36
- request: components.BodyDirectoryMemberBulkLoad,
37
- options?: RequestOptions,
38
- ): Promise<
39
- Result<
40
- any,
41
- | errors.HTTPValidationError
42
- | SDKError
43
- | SDKValidationError
44
- | UnexpectedClientError
45
- | InvalidRequestError
46
- | RequestAbortedError
47
- | RequestTimeoutError
48
- | ConnectionError
49
- >
50
- > {
51
- const parsed = safeParse(
52
- request,
53
- (value) =>
54
- components.BodyDirectoryMemberBulkLoad$outboundSchema.parse(value),
55
- "Input validation failed",
56
- );
57
- if (!parsed.ok) {
58
- return parsed;
59
- }
60
- const payload = parsed.value;
61
- const body = new FormData();
62
-
63
- if (isBlobLike(payload.file)) {
64
- body.append("file", payload.file);
65
- } else if (isReadableStream(payload.file.content)) {
66
- const buffer = await readableStreamToArrayBuffer(payload.file.content);
67
- const blob = new Blob([buffer], { type: "application/octet-stream" });
68
- body.append("file", blob);
69
- } else {
70
- body.append(
71
- "file",
72
- new Blob([payload.file.content], { type: "application/octet-stream" }),
73
- payload.file.fileName,
74
- );
75
- }
76
-
77
- const path = pathToFunc("/api/v1/directory_members/upload/")();
78
-
79
- const headers = new Headers({
80
- Accept: "application/json",
81
- });
82
-
83
- const secConfig = await extractSecurity(client._options.apiKeyHeader);
84
- const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
85
- const requestSecurity = resolveGlobalSecurity(securityInput);
86
-
87
- const context = {
88
- operationID: "directory_member_bulk_load",
89
- oAuth2Scopes: [],
90
-
91
- resolvedSecurity: requestSecurity,
92
-
93
- securitySource: client._options.apiKeyHeader,
94
- retryConfig: options?.retries
95
- || client._options.retryConfig
96
- || { strategy: "none" },
97
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
98
- };
99
-
100
- const requestRes = client._createRequest(context, {
101
- security: requestSecurity,
102
- method: "PUT",
103
- baseURL: options?.serverURL,
104
- path: path,
105
- headers: headers,
106
- body: body,
107
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
108
- }, options);
109
- if (!requestRes.ok) {
110
- return requestRes;
111
- }
112
- const req = requestRes.value;
113
-
114
- const doResult = await client._do(req, {
115
- context,
116
- errorCodes: ["400", "404", "412", "422", "4XX", "500", "5XX"],
117
- retryConfig: context.retryConfig,
118
- retryCodes: context.retryCodes,
119
- });
120
- if (!doResult.ok) {
121
- return doResult;
122
- }
123
- const response = doResult.value;
124
-
125
- const responseFields = {
126
- HttpMeta: { Response: response, Request: req },
127
- };
128
-
129
- const [result] = await M.match<
130
- any,
131
- | errors.HTTPValidationError
132
- | SDKError
133
- | SDKValidationError
134
- | UnexpectedClientError
135
- | InvalidRequestError
136
- | RequestAbortedError
137
- | RequestTimeoutError
138
- | ConnectionError
139
- >(
140
- M.json(200, z.any()),
141
- M.fail([400, 404, 412, "4XX", 500, "5XX"]),
142
- M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
143
- )(response, { extraFields: responseFields });
144
- if (!result.ok) {
145
- return result;
146
- }
147
-
148
- return result;
149
- }
@@ -1,108 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { SyllableSDKCore } from "../core.js";
7
- import * as M from "../lib/matchers.js";
8
- import { RequestOptions } from "../lib/sdks.js";
9
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
10
- import { pathToFunc } from "../lib/url.js";
11
- import {
12
- ConnectionError,
13
- InvalidRequestError,
14
- RequestAbortedError,
15
- RequestTimeoutError,
16
- UnexpectedClientError,
17
- } from "../models/errors/httpclienterrors.js";
18
- import { SDKError } from "../models/errors/sdkerror.js";
19
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
20
- import { Result } from "../types/fp.js";
21
-
22
- /**
23
- * Download Directory Members
24
- *
25
- * @remarks
26
- * Download the entire directory as a JSON file.
27
- */
28
- export async function v1DirectoryMemberDownload(
29
- client: SyllableSDKCore,
30
- options?: RequestOptions,
31
- ): Promise<
32
- Result<
33
- any,
34
- | SDKError
35
- | SDKValidationError
36
- | UnexpectedClientError
37
- | InvalidRequestError
38
- | RequestAbortedError
39
- | RequestTimeoutError
40
- | ConnectionError
41
- >
42
- > {
43
- const path = pathToFunc("/api/v1/directory_members/download/")();
44
-
45
- const headers = new Headers({
46
- Accept: "application/json",
47
- });
48
-
49
- const secConfig = await extractSecurity(client._options.apiKeyHeader);
50
- const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
51
- const requestSecurity = resolveGlobalSecurity(securityInput);
52
-
53
- const context = {
54
- operationID: "directory_member_download",
55
- oAuth2Scopes: [],
56
-
57
- resolvedSecurity: requestSecurity,
58
-
59
- securitySource: client._options.apiKeyHeader,
60
- retryConfig: options?.retries
61
- || client._options.retryConfig
62
- || { strategy: "none" },
63
- retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
64
- };
65
-
66
- const requestRes = client._createRequest(context, {
67
- security: requestSecurity,
68
- method: "GET",
69
- baseURL: options?.serverURL,
70
- path: path,
71
- headers: headers,
72
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
73
- }, options);
74
- if (!requestRes.ok) {
75
- return requestRes;
76
- }
77
- const req = requestRes.value;
78
-
79
- const doResult = await client._do(req, {
80
- context,
81
- errorCodes: ["4XX", "500", "5XX"],
82
- retryConfig: context.retryConfig,
83
- retryCodes: context.retryCodes,
84
- });
85
- if (!doResult.ok) {
86
- return doResult;
87
- }
88
- const response = doResult.value;
89
-
90
- const [result] = await M.match<
91
- any,
92
- | SDKError
93
- | SDKValidationError
94
- | UnexpectedClientError
95
- | InvalidRequestError
96
- | RequestAbortedError
97
- | RequestTimeoutError
98
- | ConnectionError
99
- >(
100
- M.json(200, z.any()),
101
- M.fail(["4XX", 500, "5XX"]),
102
- )(response);
103
- if (!result.ok) {
104
- return result;
105
- }
106
-
107
- return result;
108
- }