syllable-sdk 0.1.0-alpha.222 → 0.1.0-alpha.224
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 +4 -0
- package/docs/sdks/batches/README.md +4 -4
- package/docs/sdks/channels/README.md +198 -0
- package/docs/sdks/workflows/README.md +8 -8
- package/funcs/channelsCreate.d.ts +13 -0
- package/funcs/channelsCreate.d.ts.map +1 -0
- package/funcs/channelsCreate.js +99 -0
- package/funcs/channelsCreate.js.map +1 -0
- package/funcs/channelsUpdate.d.ts +13 -0
- package/funcs/channelsUpdate.d.ts.map +1 -0
- package/funcs/channelsUpdate.js +99 -0
- package/funcs/channelsUpdate.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/channel.d.ts +6 -0
- package/models/components/channel.d.ts.map +1 -1
- package/models/components/channel.js +3 -0
- package/models/components/channel.js.map +1 -1
- package/models/components/channelconfigview.d.ts +33 -0
- package/models/components/channelconfigview.d.ts.map +1 -0
- package/models/components/channelconfigview.js +60 -0
- package/models/components/channelconfigview.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/organizationchannelconfig.d.ts +46 -0
- package/models/components/organizationchannelconfig.d.ts.map +1 -0
- package/models/components/organizationchannelconfig.js +75 -0
- package/models/components/organizationchannelconfig.js.map +1 -0
- package/models/components/organizationchannelcreaterequest.d.ts +57 -0
- package/models/components/organizationchannelcreaterequest.d.ts.map +1 -0
- package/models/components/organizationchannelcreaterequest.js +82 -0
- package/models/components/organizationchannelcreaterequest.js.map +1 -0
- package/models/components/organizationchannelupdaterequest.d.ts +62 -0
- package/models/components/organizationchannelupdaterequest.d.ts.map +1 -0
- package/models/components/organizationchannelupdaterequest.js +84 -0
- package/models/components/organizationchannelupdaterequest.js.map +1 -0
- package/models/components/telephonyconfigurations.d.ts +52 -0
- package/models/components/telephonyconfigurations.d.ts.map +1 -0
- package/models/components/telephonyconfigurations.js +84 -0
- package/models/components/telephonyconfigurations.js.map +1 -0
- package/openapi.json +431 -37
- package/package.json +1 -1
- package/sdk/channels.d.ts +8 -0
- package/sdk/channels.d.ts.map +1 -1
- package/sdk/channels.js +14 -0
- package/sdk/channels.js.map +1 -1
- package/src/funcs/channelsCreate.ts +133 -0
- package/src/funcs/channelsUpdate.ts +133 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/channel.ts +13 -0
- package/src/models/components/channelconfigview.ts +75 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/organizationchannelconfig.ts +103 -0
- package/src/models/components/organizationchannelcreaterequest.ts +126 -0
- package/src/models/components/organizationchannelupdaterequest.ts +133 -0
- package/src/models/components/telephonyconfigurations.ts +114 -0
- package/src/sdk/channels.ts +30 -0
package/package.json
CHANGED
package/sdk/channels.d.ts
CHANGED
|
@@ -12,6 +12,14 @@ export declare class Channels extends ClientSDK {
|
|
|
12
12
|
* Get Channels
|
|
13
13
|
*/
|
|
14
14
|
list(request: operations.ChannelsListRequest, options?: RequestOptions): Promise<components.ListResponseChannel>;
|
|
15
|
+
/**
|
|
16
|
+
* Create Channel
|
|
17
|
+
*/
|
|
18
|
+
create(request: components.OrganizationChannelCreateRequest, options?: RequestOptions): Promise<components.Channel>;
|
|
19
|
+
/**
|
|
20
|
+
* Update Channel
|
|
21
|
+
*/
|
|
22
|
+
update(request: components.OrganizationChannelUpdateRequest, options?: RequestOptions): Promise<components.Channel>;
|
|
15
23
|
/**
|
|
16
24
|
* Delete Channel Target
|
|
17
25
|
*
|
package/sdk/channels.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/sdk/channels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../src/sdk/channels.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAE5D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,qBAAa,QAAS,SAAQ,SAAS;IACrC,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,OAAO,CAAC,QAAQ,CAAC,CAAU;IAC3B,IAAI,OAAO,IAAI,OAAO,CAErB;IAED;;OAEG;IACG,IAAI,CACR,OAAO,EAAE,UAAU,CAAC,mBAAmB,EACvC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC;IAQ1C;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,gCAAgC,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAQ9B;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,gCAAgC,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC;IAQ9B;;;;;OAKG;IACG,MAAM,CACV,OAAO,EAAE,UAAU,CAAC,2BAA2B,EAC/C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,GAAG,CAAC;CAOhB"}
|
package/sdk/channels.js
CHANGED
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Channels = void 0;
|
|
7
|
+
const channelsCreate_js_1 = require("../funcs/channelsCreate.js");
|
|
7
8
|
const channelsDelete_js_1 = require("../funcs/channelsDelete.js");
|
|
8
9
|
const channelsList_js_1 = require("../funcs/channelsList.js");
|
|
10
|
+
const channelsUpdate_js_1 = require("../funcs/channelsUpdate.js");
|
|
9
11
|
const sdks_js_1 = require("../lib/sdks.js");
|
|
10
12
|
const fp_js_1 = require("../types/fp.js");
|
|
11
13
|
const targets_js_1 = require("./targets.js");
|
|
@@ -23,6 +25,18 @@ class Channels extends sdks_js_1.ClientSDK {
|
|
|
23
25
|
async list(request, options) {
|
|
24
26
|
return (0, fp_js_1.unwrapAsync)((0, channelsList_js_1.channelsList)(this, request, options));
|
|
25
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Create Channel
|
|
30
|
+
*/
|
|
31
|
+
async create(request, options) {
|
|
32
|
+
return (0, fp_js_1.unwrapAsync)((0, channelsCreate_js_1.channelsCreate)(this, request, options));
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Update Channel
|
|
36
|
+
*/
|
|
37
|
+
async update(request, options) {
|
|
38
|
+
return (0, fp_js_1.unwrapAsync)((0, channelsUpdate_js_1.channelsUpdate)(this, request, options));
|
|
39
|
+
}
|
|
26
40
|
/**
|
|
27
41
|
* Delete Channel Target
|
|
28
42
|
*
|
package/sdk/channels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/sdk/channels.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,kEAA4D;AAC5D,8DAAwD;AACxD,4CAA2D;AAG3D,0CAA6C;AAC7C,6CAAuC;AACvC,2CAAqC;AAErC,MAAa,QAAS,SAAQ,mBAAS;IAErC,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,kBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8BAAY,EAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../src/sdk/channels.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,kEAA4D;AAC5D,kEAA4D;AAC5D,8DAAwD;AACxD,kEAA4D;AAC5D,4CAA2D;AAG3D,0CAA6C;AAC7C,6CAAuC;AACvC,2CAAqC;AAErC,MAAa,QAAS,SAAQ,mBAAS;IAErC,IAAI,MAAM;QACR,OAAO,CAAC,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,IAAI,kBAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACtD,CAAC;IAGD,IAAI,OAAO;QACT,OAAO,CAAC,IAAI,CAAC,QAAQ,KAAb,IAAI,CAAC,QAAQ,GAAK,IAAI,oBAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,IAAI,CACR,OAAuC,EACvC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,8BAAY,EAC7B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAAoD,EACpD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CACV,OAAoD,EACpD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,MAAM,CACV,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,kCAAc,EAC/B,IAAI,EACJ,OAAO,EACP,OAAO,CACR,CAAC,CAAC;IACL,CAAC;CACF;AArED,4BAqEC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
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 Channel
|
|
28
|
+
*/
|
|
29
|
+
export async function channelsCreate(
|
|
30
|
+
client: SyllableSDKCore,
|
|
31
|
+
request: components.OrganizationChannelCreateRequest,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
components.Channel,
|
|
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) =>
|
|
49
|
+
components.OrganizationChannelCreateRequest$outboundSchema.parse(value),
|
|
50
|
+
"Input validation failed",
|
|
51
|
+
);
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
const payload = parsed.value;
|
|
56
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
57
|
+
|
|
58
|
+
const path = pathToFunc("/api/v1/channels/")();
|
|
59
|
+
|
|
60
|
+
const headers = new Headers(compactMap({
|
|
61
|
+
"Content-Type": "application/json",
|
|
62
|
+
Accept: "application/json",
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
66
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
67
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
68
|
+
|
|
69
|
+
const context = {
|
|
70
|
+
baseURL: options?.serverURL ?? "",
|
|
71
|
+
operationID: "channels_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.Channel,
|
|
114
|
+
| errors.HTTPValidationError
|
|
115
|
+
| SDKError
|
|
116
|
+
| SDKValidationError
|
|
117
|
+
| UnexpectedClientError
|
|
118
|
+
| InvalidRequestError
|
|
119
|
+
| RequestAbortedError
|
|
120
|
+
| RequestTimeoutError
|
|
121
|
+
| ConnectionError
|
|
122
|
+
>(
|
|
123
|
+
M.json(200, components.Channel$inboundSchema),
|
|
124
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
125
|
+
M.fail("4XX"),
|
|
126
|
+
M.fail("5XX"),
|
|
127
|
+
)(response, { extraFields: responseFields });
|
|
128
|
+
if (!result.ok) {
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result;
|
|
133
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
* Update Channel
|
|
28
|
+
*/
|
|
29
|
+
export async function channelsUpdate(
|
|
30
|
+
client: SyllableSDKCore,
|
|
31
|
+
request: components.OrganizationChannelUpdateRequest,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): Promise<
|
|
34
|
+
Result<
|
|
35
|
+
components.Channel,
|
|
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) =>
|
|
49
|
+
components.OrganizationChannelUpdateRequest$outboundSchema.parse(value),
|
|
50
|
+
"Input validation failed",
|
|
51
|
+
);
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
const payload = parsed.value;
|
|
56
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
57
|
+
|
|
58
|
+
const path = pathToFunc("/api/v1/channels/")();
|
|
59
|
+
|
|
60
|
+
const headers = new Headers(compactMap({
|
|
61
|
+
"Content-Type": "application/json",
|
|
62
|
+
Accept: "application/json",
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
const secConfig = await extractSecurity(client._options.apiKeyHeader);
|
|
66
|
+
const securityInput = secConfig == null ? {} : { apiKeyHeader: secConfig };
|
|
67
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
68
|
+
|
|
69
|
+
const context = {
|
|
70
|
+
baseURL: options?.serverURL ?? "",
|
|
71
|
+
operationID: "channels_update",
|
|
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: "PUT",
|
|
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.Channel,
|
|
114
|
+
| errors.HTTPValidationError
|
|
115
|
+
| SDKError
|
|
116
|
+
| SDKValidationError
|
|
117
|
+
| UnexpectedClientError
|
|
118
|
+
| InvalidRequestError
|
|
119
|
+
| RequestAbortedError
|
|
120
|
+
| RequestTimeoutError
|
|
121
|
+
| ConnectionError
|
|
122
|
+
>(
|
|
123
|
+
M.json(200, components.Channel$inboundSchema),
|
|
124
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
125
|
+
M.fail("4XX"),
|
|
126
|
+
M.fail("5XX"),
|
|
127
|
+
)(response, { extraFields: responseFields });
|
|
128
|
+
if (!result.ok) {
|
|
129
|
+
return result;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result;
|
|
133
|
+
}
|
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.224",
|
|
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.224 2.512.4 0.0.2 syllable-sdk",
|
|
64
64
|
} as const;
|
|
@@ -7,6 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
ChannelConfigView,
|
|
12
|
+
ChannelConfigView$inboundSchema,
|
|
13
|
+
ChannelConfigView$Outbound,
|
|
14
|
+
ChannelConfigView$outboundSchema,
|
|
15
|
+
} from "./channelconfigview.js";
|
|
10
16
|
import {
|
|
11
17
|
ChannelServices,
|
|
12
18
|
ChannelServices$inboundSchema,
|
|
@@ -34,6 +40,10 @@ export type Channel = {
|
|
|
34
40
|
* The channel ID
|
|
35
41
|
*/
|
|
36
42
|
id: number;
|
|
43
|
+
/**
|
|
44
|
+
* Configuration for the channel
|
|
45
|
+
*/
|
|
46
|
+
config?: ChannelConfigView | null | undefined;
|
|
37
47
|
};
|
|
38
48
|
|
|
39
49
|
/** @internal */
|
|
@@ -44,6 +54,7 @@ export const Channel$inboundSchema: z.ZodType<Channel, z.ZodTypeDef, unknown> =
|
|
|
44
54
|
supported_modes: z.nullable(z.string()).optional(),
|
|
45
55
|
is_system_channel: z.boolean().default(true),
|
|
46
56
|
id: z.number().int(),
|
|
57
|
+
config: z.nullable(ChannelConfigView$inboundSchema).optional(),
|
|
47
58
|
}).transform((v) => {
|
|
48
59
|
return remap$(v, {
|
|
49
60
|
"channel_service": "channelService",
|
|
@@ -59,6 +70,7 @@ export type Channel$Outbound = {
|
|
|
59
70
|
supported_modes?: string | null | undefined;
|
|
60
71
|
is_system_channel: boolean;
|
|
61
72
|
id: number;
|
|
73
|
+
config?: ChannelConfigView$Outbound | null | undefined;
|
|
62
74
|
};
|
|
63
75
|
|
|
64
76
|
/** @internal */
|
|
@@ -72,6 +84,7 @@ export const Channel$outboundSchema: z.ZodType<
|
|
|
72
84
|
supportedModes: z.nullable(z.string()).optional(),
|
|
73
85
|
isSystemChannel: z.boolean().default(true),
|
|
74
86
|
id: z.number().int(),
|
|
87
|
+
config: z.nullable(ChannelConfigView$outboundSchema).optional(),
|
|
75
88
|
}).transform((v) => {
|
|
76
89
|
return remap$(v, {
|
|
77
90
|
channelService: "channel_service",
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
TelephonyConfigurations,
|
|
11
|
+
TelephonyConfigurations$inboundSchema,
|
|
12
|
+
TelephonyConfigurations$Outbound,
|
|
13
|
+
TelephonyConfigurations$outboundSchema,
|
|
14
|
+
} from "./telephonyconfigurations.js";
|
|
15
|
+
|
|
16
|
+
export type ChannelConfigView = {
|
|
17
|
+
/**
|
|
18
|
+
* Telephony configurations to be applied to targets belonging to the channel. Only applies to voice supported channels.
|
|
19
|
+
*/
|
|
20
|
+
telephony?: TelephonyConfigurations | null | undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ChannelConfigView$inboundSchema: z.ZodType<
|
|
25
|
+
ChannelConfigView,
|
|
26
|
+
z.ZodTypeDef,
|
|
27
|
+
unknown
|
|
28
|
+
> = z.object({
|
|
29
|
+
telephony: z.nullable(TelephonyConfigurations$inboundSchema).optional(),
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @internal */
|
|
33
|
+
export type ChannelConfigView$Outbound = {
|
|
34
|
+
telephony?: TelephonyConfigurations$Outbound | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const ChannelConfigView$outboundSchema: z.ZodType<
|
|
39
|
+
ChannelConfigView$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
ChannelConfigView
|
|
42
|
+
> = z.object({
|
|
43
|
+
telephony: z.nullable(TelephonyConfigurations$outboundSchema).optional(),
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @internal
|
|
48
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
49
|
+
*/
|
|
50
|
+
export namespace ChannelConfigView$ {
|
|
51
|
+
/** @deprecated use `ChannelConfigView$inboundSchema` instead. */
|
|
52
|
+
export const inboundSchema = ChannelConfigView$inboundSchema;
|
|
53
|
+
/** @deprecated use `ChannelConfigView$outboundSchema` instead. */
|
|
54
|
+
export const outboundSchema = ChannelConfigView$outboundSchema;
|
|
55
|
+
/** @deprecated use `ChannelConfigView$Outbound` instead. */
|
|
56
|
+
export type Outbound = ChannelConfigView$Outbound;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function channelConfigViewToJSON(
|
|
60
|
+
channelConfigView: ChannelConfigView,
|
|
61
|
+
): string {
|
|
62
|
+
return JSON.stringify(
|
|
63
|
+
ChannelConfigView$outboundSchema.parse(channelConfigView),
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function channelConfigViewFromJSON(
|
|
68
|
+
jsonString: string,
|
|
69
|
+
): SafeParseResult<ChannelConfigView, SDKValidationError> {
|
|
70
|
+
return safeParse(
|
|
71
|
+
jsonString,
|
|
72
|
+
(x) => ChannelConfigView$inboundSchema.parse(JSON.parse(x)),
|
|
73
|
+
`Failed to parse 'ChannelConfigView' from JSON`,
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -29,6 +29,7 @@ export * from "./bodyoutboundbatchdelete.js";
|
|
|
29
29
|
export * from "./bodyoutboundbatchupload.js";
|
|
30
30
|
export * from "./campaignproperties.js";
|
|
31
31
|
export * from "./channel.js";
|
|
32
|
+
export * from "./channelconfigview.js";
|
|
32
33
|
export * from "./channelproperties.js";
|
|
33
34
|
export * from "./channelservices.js";
|
|
34
35
|
export * from "./channeltargetcreaterequest.js";
|
|
@@ -129,6 +130,9 @@ export * from "./listresponsetoolresponse.js";
|
|
|
129
130
|
export * from "./listresponseuserresponse.js";
|
|
130
131
|
export * from "./logintype.js";
|
|
131
132
|
export * from "./orderbydirection.js";
|
|
133
|
+
export * from "./organizationchannelconfig.js";
|
|
134
|
+
export * from "./organizationchannelcreaterequest.js";
|
|
135
|
+
export * from "./organizationchannelupdaterequest.js";
|
|
132
136
|
export * from "./organizationresponse.js";
|
|
133
137
|
export * from "./outboundcampaign.js";
|
|
134
138
|
export * from "./outboundcampaigninput.js";
|
|
@@ -170,6 +174,7 @@ export * from "./supportedllm.js";
|
|
|
170
174
|
export * from "./takeoutrequeststatus.js";
|
|
171
175
|
export * from "./takeoutstatusresponse.js";
|
|
172
176
|
export * from "./targetmodes.js";
|
|
177
|
+
export * from "./telephonyconfigurations.js";
|
|
173
178
|
export * from "./testmessage.js";
|
|
174
179
|
export * from "./testmessageresponse.js";
|
|
175
180
|
export * from "./toolagentinfo.js";
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
TelephonyConfigurations,
|
|
12
|
+
TelephonyConfigurations$inboundSchema,
|
|
13
|
+
TelephonyConfigurations$Outbound,
|
|
14
|
+
TelephonyConfigurations$outboundSchema,
|
|
15
|
+
} from "./telephonyconfigurations.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Channel config information for creates / updates through the organizations API
|
|
19
|
+
*/
|
|
20
|
+
export type OrganizationChannelConfig = {
|
|
21
|
+
/**
|
|
22
|
+
* SID of the Twilio account
|
|
23
|
+
*/
|
|
24
|
+
accountSid?: string | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The Twilio auth token
|
|
27
|
+
*/
|
|
28
|
+
authToken?: string | null | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Telephony configurations to be applied to the targets under the channel
|
|
31
|
+
*/
|
|
32
|
+
telephony?: TelephonyConfigurations | null | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const OrganizationChannelConfig$inboundSchema: z.ZodType<
|
|
37
|
+
OrganizationChannelConfig,
|
|
38
|
+
z.ZodTypeDef,
|
|
39
|
+
unknown
|
|
40
|
+
> = z.object({
|
|
41
|
+
account_sid: z.nullable(z.string()).optional(),
|
|
42
|
+
auth_token: z.nullable(z.string()).optional(),
|
|
43
|
+
telephony: z.nullable(TelephonyConfigurations$inboundSchema).optional(),
|
|
44
|
+
}).transform((v) => {
|
|
45
|
+
return remap$(v, {
|
|
46
|
+
"account_sid": "accountSid",
|
|
47
|
+
"auth_token": "authToken",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type OrganizationChannelConfig$Outbound = {
|
|
53
|
+
account_sid?: string | null | undefined;
|
|
54
|
+
auth_token?: string | null | undefined;
|
|
55
|
+
telephony?: TelephonyConfigurations$Outbound | null | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const OrganizationChannelConfig$outboundSchema: z.ZodType<
|
|
60
|
+
OrganizationChannelConfig$Outbound,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
OrganizationChannelConfig
|
|
63
|
+
> = z.object({
|
|
64
|
+
accountSid: z.nullable(z.string()).optional(),
|
|
65
|
+
authToken: z.nullable(z.string()).optional(),
|
|
66
|
+
telephony: z.nullable(TelephonyConfigurations$outboundSchema).optional(),
|
|
67
|
+
}).transform((v) => {
|
|
68
|
+
return remap$(v, {
|
|
69
|
+
accountSid: "account_sid",
|
|
70
|
+
authToken: "auth_token",
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
77
|
+
*/
|
|
78
|
+
export namespace OrganizationChannelConfig$ {
|
|
79
|
+
/** @deprecated use `OrganizationChannelConfig$inboundSchema` instead. */
|
|
80
|
+
export const inboundSchema = OrganizationChannelConfig$inboundSchema;
|
|
81
|
+
/** @deprecated use `OrganizationChannelConfig$outboundSchema` instead. */
|
|
82
|
+
export const outboundSchema = OrganizationChannelConfig$outboundSchema;
|
|
83
|
+
/** @deprecated use `OrganizationChannelConfig$Outbound` instead. */
|
|
84
|
+
export type Outbound = OrganizationChannelConfig$Outbound;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function organizationChannelConfigToJSON(
|
|
88
|
+
organizationChannelConfig: OrganizationChannelConfig,
|
|
89
|
+
): string {
|
|
90
|
+
return JSON.stringify(
|
|
91
|
+
OrganizationChannelConfig$outboundSchema.parse(organizationChannelConfig),
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function organizationChannelConfigFromJSON(
|
|
96
|
+
jsonString: string,
|
|
97
|
+
): SafeParseResult<OrganizationChannelConfig, SDKValidationError> {
|
|
98
|
+
return safeParse(
|
|
99
|
+
jsonString,
|
|
100
|
+
(x) => OrganizationChannelConfig$inboundSchema.parse(JSON.parse(x)),
|
|
101
|
+
`Failed to parse 'OrganizationChannelConfig' from JSON`,
|
|
102
|
+
);
|
|
103
|
+
}
|