syllable-sdk 0.1.0-alpha.26 → 0.1.0-alpha.27
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 +6 -25
- package/lib/config.d.ts +3 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +6 -6
- package/lib/config.js.map +1 -1
- package/models/components/channel.d.ts +3 -0
- package/models/components/channel.d.ts.map +1 -1
- package/models/components/channel.js.map +1 -1
- package/models/components/index.d.ts +0 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -1
- package/models/components/index.js.map +1 -1
- package/models/components/llmconfig.d.ts +34 -3
- package/models/components/llmconfig.d.ts.map +1 -1
- package/models/components/llmconfig.js +26 -4
- package/models/components/llmconfig.js.map +1 -1
- package/models/components/prompt.d.ts +3 -0
- package/models/components/prompt.d.ts.map +1 -1
- package/models/components/prompt.js.map +1 -1
- package/models/components/promptcreate.d.ts +3 -0
- package/models/components/promptcreate.d.ts.map +1 -1
- package/models/components/promptcreate.js.map +1 -1
- package/models/components/promptupdate.d.ts +3 -0
- package/models/components/promptupdate.d.ts.map +1 -1
- package/models/components/promptupdate.js.map +1 -1
- package/models/components/target.d.ts +3 -0
- package/models/components/target.d.ts.map +1 -1
- package/models/components/target.js.map +1 -1
- package/models/components/testmessage.d.ts +2 -0
- package/models/components/testmessage.d.ts.map +1 -1
- package/models/components/testmessage.js +4 -0
- package/models/components/testmessage.js.map +1 -1
- package/package.json +1 -1
- package/sdk/sdk.d.ts +0 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +0 -5
- package/sdk/sdk.js.map +1 -1
- package/src/lib/config.ts +6 -6
- package/src/models/components/channel.ts +3 -0
- package/src/models/components/index.ts +0 -1
- package/src/models/components/llmconfig.ts +36 -9
- package/src/models/components/prompt.ts +3 -0
- package/src/models/components/promptcreate.ts +3 -0
- package/src/models/components/promptupdate.ts +3 -0
- package/src/models/components/target.ts +3 -0
- package/src/models/components/testmessage.ts +6 -0
- package/src/sdk/sdk.ts +0 -6
- package/docs/sdks/v1/README.md +0 -629
- package/funcs/v1AgentGetAvailableVoices.d.ts +0 -15
- package/funcs/v1AgentGetAvailableVoices.d.ts.map +0 -1
- package/funcs/v1AgentGetAvailableVoices.js +0 -87
- package/funcs/v1AgentGetAvailableVoices.js.map +0 -1
- package/funcs/v1Create.d.ts +0 -16
- package/funcs/v1Create.d.ts.map +0 -1
- package/funcs/v1Create.js +0 -100
- package/funcs/v1Create.js.map +0 -1
- package/funcs/v1Delete.d.ts +0 -16
- package/funcs/v1Delete.d.ts.map +0 -1
- package/funcs/v1Delete.js +0 -106
- package/funcs/v1Delete.js.map +0 -1
- package/funcs/v1DirectoryMemberBulkLoad.d.ts +0 -16
- package/funcs/v1DirectoryMemberBulkLoad.d.ts.map +0 -1
- package/funcs/v1DirectoryMemberBulkLoad.js +0 -113
- package/funcs/v1DirectoryMemberBulkLoad.js.map +0 -1
- package/funcs/v1DirectoryMemberDownload.d.ts +0 -14
- package/funcs/v1DirectoryMemberDownload.d.ts.map +0 -1
- package/funcs/v1DirectoryMemberDownload.js +0 -86
- package/funcs/v1DirectoryMemberDownload.js.map +0 -1
- package/funcs/v1GetById.d.ts +0 -17
- package/funcs/v1GetById.d.ts.map +0 -1
- package/funcs/v1GetById.js +0 -106
- package/funcs/v1GetById.js.map +0 -1
- package/funcs/v1List.d.ts +0 -17
- package/funcs/v1List.d.ts.map +0 -1
- package/funcs/v1List.js +0 -112
- package/funcs/v1List.js.map +0 -1
- package/funcs/v1Update.d.ts +0 -17
- package/funcs/v1Update.d.ts.map +0 -1
- package/funcs/v1Update.js +0 -107
- package/funcs/v1Update.js.map +0 -1
- package/models/components/provider.d.ts +0 -34
- package/models/components/provider.d.ts.map +0 -1
- package/models/components/provider.js +0 -54
- package/models/components/provider.js.map +0 -1
- package/sdk/v1.d.ts +0 -62
- package/sdk/v1.d.ts.map +0 -1
- package/sdk/v1.js +0 -92
- package/sdk/v1.js.map +0 -1
- package/src/funcs/v1AgentGetAvailableVoices.ts +0 -109
- package/src/funcs/v1Create.ts +0 -132
- package/src/funcs/v1Delete.ts +0 -140
- package/src/funcs/v1DirectoryMemberBulkLoad.ts +0 -149
- package/src/funcs/v1DirectoryMemberDownload.ts +0 -108
- package/src/funcs/v1GetById.ts +0 -140
- package/src/funcs/v1List.ts +0 -146
- package/src/funcs/v1Update.ts +0 -141
- package/src/models/components/provider.ts +0 -37
- package/src/sdk/v1.ts +0 -150
package/sdk/v1.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.V1 = void 0;
|
|
7
|
-
const v1AgentGetAvailableVoices_js_1 = require("../funcs/v1AgentGetAvailableVoices.js");
|
|
8
|
-
const v1Create_js_1 = require("../funcs/v1Create.js");
|
|
9
|
-
const v1Delete_js_1 = require("../funcs/v1Delete.js");
|
|
10
|
-
const v1DirectoryMemberBulkLoad_js_1 = require("../funcs/v1DirectoryMemberBulkLoad.js");
|
|
11
|
-
const v1DirectoryMemberDownload_js_1 = require("../funcs/v1DirectoryMemberDownload.js");
|
|
12
|
-
const v1GetById_js_1 = require("../funcs/v1GetById.js");
|
|
13
|
-
const v1List_js_1 = require("../funcs/v1List.js");
|
|
14
|
-
const v1Update_js_1 = require("../funcs/v1Update.js");
|
|
15
|
-
const sdks_js_1 = require("../lib/sdks.js");
|
|
16
|
-
const fp_js_1 = require("../types/fp.js");
|
|
17
|
-
class V1 extends sdks_js_1.ClientSDK {
|
|
18
|
-
/**
|
|
19
|
-
* Get Available Agent Voices
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Get available agent voices.
|
|
23
|
-
*/
|
|
24
|
-
async agentGetAvailableVoices(options) {
|
|
25
|
-
return (0, fp_js_1.unwrapAsync)((0, v1AgentGetAvailableVoices_js_1.v1AgentGetAvailableVoices)(this, options));
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Directory Member List
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* List the existing directory_members
|
|
32
|
-
*/
|
|
33
|
-
async list(request, options) {
|
|
34
|
-
return (0, fp_js_1.unwrapAsync)((0, v1List_js_1.v1List)(this, request, options));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Create Directory Member
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Create a new member in the directory
|
|
41
|
-
*/
|
|
42
|
-
async create(request, options) {
|
|
43
|
-
return (0, fp_js_1.unwrapAsync)((0, v1Create_js_1.v1Create)(this, request, options));
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get Directory Member By Id
|
|
47
|
-
*
|
|
48
|
-
* @remarks
|
|
49
|
-
* Get a DirectoryMember by ID.
|
|
50
|
-
*/
|
|
51
|
-
async getById(request, options) {
|
|
52
|
-
return (0, fp_js_1.unwrapAsync)((0, v1GetById_js_1.v1GetById)(this, request, options));
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Update Directory Member
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* Update a DirectoryMember.
|
|
59
|
-
*/
|
|
60
|
-
async update(request, options) {
|
|
61
|
-
return (0, fp_js_1.unwrapAsync)((0, v1Update_js_1.v1Update)(this, request, options));
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Delete Directory Member
|
|
65
|
-
*
|
|
66
|
-
* @remarks
|
|
67
|
-
* Delete a DirectoryMember.
|
|
68
|
-
*/
|
|
69
|
-
async delete(request, options) {
|
|
70
|
-
return (0, fp_js_1.unwrapAsync)((0, v1Delete_js_1.v1Delete)(this, request, options));
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* Bulk Load Directory Members
|
|
74
|
-
*
|
|
75
|
-
* @remarks
|
|
76
|
-
* Update Directory Members in chunks of 100.
|
|
77
|
-
*/
|
|
78
|
-
async directoryMemberBulkLoad(request, options) {
|
|
79
|
-
return (0, fp_js_1.unwrapAsync)((0, v1DirectoryMemberBulkLoad_js_1.v1DirectoryMemberBulkLoad)(this, request, options));
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Download Directory Members
|
|
83
|
-
*
|
|
84
|
-
* @remarks
|
|
85
|
-
* Download the entire directory as a JSON file.
|
|
86
|
-
*/
|
|
87
|
-
async directoryMemberDownload(options) {
|
|
88
|
-
return (0, fp_js_1.unwrapAsync)((0, v1DirectoryMemberDownload_js_1.v1DirectoryMemberDownload)(this, options));
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.V1 = V1;
|
|
92
|
-
//# sourceMappingURL=v1.js.map
|
package/sdk/v1.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"v1.js","sourceRoot":"","sources":["../src/sdk/v1.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,wFAAkF;AAClF,sDAAgD;AAChD,sDAAgD;AAChD,wFAAkF;AAClF,wFAAkF;AAClF,wDAAkD;AAClD,kDAA4C;AAC5C,sDAAgD;AAChD,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,EAAG,SAAQ,mBAAS;IAC/B;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,IAAI,CACR,OAA8C,EAC9C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kBAAM,EACvB,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sBAAQ,EACzB,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,OAAO,CACX,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wBAAS,EAC1B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAAgD,EAChD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sBAAQ,EACzB,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAAgD,EAChD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,sBAAQ,EACzB,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,uBAAuB,CAC3B,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAC1C,IAAI,EACJ,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AApID,gBAoIC"}
|
|
@@ -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
|
-
}
|
package/src/funcs/v1Create.ts
DELETED
|
@@ -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
|
-
}
|
package/src/funcs/v1Delete.ts
DELETED
|
@@ -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
|
-
}
|