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.
Files changed (60) hide show
  1. package/README.md +4 -0
  2. package/docs/sdks/batches/README.md +4 -4
  3. package/docs/sdks/channels/README.md +198 -0
  4. package/docs/sdks/workflows/README.md +8 -8
  5. package/funcs/channelsCreate.d.ts +13 -0
  6. package/funcs/channelsCreate.d.ts.map +1 -0
  7. package/funcs/channelsCreate.js +99 -0
  8. package/funcs/channelsCreate.js.map +1 -0
  9. package/funcs/channelsUpdate.d.ts +13 -0
  10. package/funcs/channelsUpdate.d.ts.map +1 -0
  11. package/funcs/channelsUpdate.js +99 -0
  12. package/funcs/channelsUpdate.js.map +1 -0
  13. package/jsr.json +1 -1
  14. package/lib/config.d.ts +2 -2
  15. package/lib/config.js +2 -2
  16. package/models/components/channel.d.ts +6 -0
  17. package/models/components/channel.d.ts.map +1 -1
  18. package/models/components/channel.js +3 -0
  19. package/models/components/channel.js.map +1 -1
  20. package/models/components/channelconfigview.d.ts +33 -0
  21. package/models/components/channelconfigview.d.ts.map +1 -0
  22. package/models/components/channelconfigview.js +60 -0
  23. package/models/components/channelconfigview.js.map +1 -0
  24. package/models/components/index.d.ts +5 -0
  25. package/models/components/index.d.ts.map +1 -1
  26. package/models/components/index.js +5 -0
  27. package/models/components/index.js.map +1 -1
  28. package/models/components/organizationchannelconfig.d.ts +46 -0
  29. package/models/components/organizationchannelconfig.d.ts.map +1 -0
  30. package/models/components/organizationchannelconfig.js +75 -0
  31. package/models/components/organizationchannelconfig.js.map +1 -0
  32. package/models/components/organizationchannelcreaterequest.d.ts +57 -0
  33. package/models/components/organizationchannelcreaterequest.d.ts.map +1 -0
  34. package/models/components/organizationchannelcreaterequest.js +82 -0
  35. package/models/components/organizationchannelcreaterequest.js.map +1 -0
  36. package/models/components/organizationchannelupdaterequest.d.ts +62 -0
  37. package/models/components/organizationchannelupdaterequest.d.ts.map +1 -0
  38. package/models/components/organizationchannelupdaterequest.js +84 -0
  39. package/models/components/organizationchannelupdaterequest.js.map +1 -0
  40. package/models/components/telephonyconfigurations.d.ts +52 -0
  41. package/models/components/telephonyconfigurations.d.ts.map +1 -0
  42. package/models/components/telephonyconfigurations.js +84 -0
  43. package/models/components/telephonyconfigurations.js.map +1 -0
  44. package/openapi.json +431 -37
  45. package/package.json +1 -1
  46. package/sdk/channels.d.ts +8 -0
  47. package/sdk/channels.d.ts.map +1 -1
  48. package/sdk/channels.js +14 -0
  49. package/sdk/channels.js.map +1 -1
  50. package/src/funcs/channelsCreate.ts +133 -0
  51. package/src/funcs/channelsUpdate.ts +133 -0
  52. package/src/lib/config.ts +2 -2
  53. package/src/models/components/channel.ts +13 -0
  54. package/src/models/components/channelconfigview.ts +75 -0
  55. package/src/models/components/index.ts +5 -0
  56. package/src/models/components/organizationchannelconfig.ts +103 -0
  57. package/src/models/components/organizationchannelcreaterequest.ts +126 -0
  58. package/src/models/components/organizationchannelupdaterequest.ts +133 -0
  59. package/src/models/components/telephonyconfigurations.ts +114 -0
  60. package/src/sdk/channels.ts +30 -0
@@ -0,0 +1,126 @@
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
+ ChannelServices,
12
+ ChannelServices$inboundSchema,
13
+ ChannelServices$outboundSchema,
14
+ } from "./channelservices.js";
15
+ import {
16
+ OrganizationChannelConfig,
17
+ OrganizationChannelConfig$inboundSchema,
18
+ OrganizationChannelConfig$Outbound,
19
+ OrganizationChannelConfig$outboundSchema,
20
+ } from "./organizationchannelconfig.js";
21
+
22
+ /**
23
+ * Request model to create a channel through the organizations API
24
+ */
25
+ export type OrganizationChannelCreateRequest = {
26
+ /**
27
+ * The channel name
28
+ */
29
+ name: string;
30
+ /**
31
+ * The communication service for a channel.
32
+ */
33
+ channelService: ChannelServices;
34
+ /**
35
+ * The comma-delimited list of supported modes for the channel, which defines the possible communication methods for channel targets linked to it.
36
+ */
37
+ supportedModes?: string | null | undefined;
38
+ /**
39
+ * Whether the channel is a built-in system channel (i.e., is not customizable)
40
+ */
41
+ isSystemChannel?: boolean | undefined;
42
+ /**
43
+ * Channel config information for creates / updates through the organizations API
44
+ */
45
+ config: OrganizationChannelConfig;
46
+ };
47
+
48
+ /** @internal */
49
+ export const OrganizationChannelCreateRequest$inboundSchema: z.ZodType<
50
+ OrganizationChannelCreateRequest,
51
+ z.ZodTypeDef,
52
+ unknown
53
+ > = z.object({
54
+ name: z.string(),
55
+ channel_service: ChannelServices$inboundSchema,
56
+ supported_modes: z.nullable(z.string()).optional(),
57
+ is_system_channel: z.boolean().default(true),
58
+ config: OrganizationChannelConfig$inboundSchema,
59
+ }).transform((v) => {
60
+ return remap$(v, {
61
+ "channel_service": "channelService",
62
+ "supported_modes": "supportedModes",
63
+ "is_system_channel": "isSystemChannel",
64
+ });
65
+ });
66
+
67
+ /** @internal */
68
+ export type OrganizationChannelCreateRequest$Outbound = {
69
+ name: string;
70
+ channel_service: string;
71
+ supported_modes?: string | null | undefined;
72
+ is_system_channel: boolean;
73
+ config: OrganizationChannelConfig$Outbound;
74
+ };
75
+
76
+ /** @internal */
77
+ export const OrganizationChannelCreateRequest$outboundSchema: z.ZodType<
78
+ OrganizationChannelCreateRequest$Outbound,
79
+ z.ZodTypeDef,
80
+ OrganizationChannelCreateRequest
81
+ > = z.object({
82
+ name: z.string(),
83
+ channelService: ChannelServices$outboundSchema,
84
+ supportedModes: z.nullable(z.string()).optional(),
85
+ isSystemChannel: z.boolean().default(true),
86
+ config: OrganizationChannelConfig$outboundSchema,
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ channelService: "channel_service",
90
+ supportedModes: "supported_modes",
91
+ isSystemChannel: "is_system_channel",
92
+ });
93
+ });
94
+
95
+ /**
96
+ * @internal
97
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
98
+ */
99
+ export namespace OrganizationChannelCreateRequest$ {
100
+ /** @deprecated use `OrganizationChannelCreateRequest$inboundSchema` instead. */
101
+ export const inboundSchema = OrganizationChannelCreateRequest$inboundSchema;
102
+ /** @deprecated use `OrganizationChannelCreateRequest$outboundSchema` instead. */
103
+ export const outboundSchema = OrganizationChannelCreateRequest$outboundSchema;
104
+ /** @deprecated use `OrganizationChannelCreateRequest$Outbound` instead. */
105
+ export type Outbound = OrganizationChannelCreateRequest$Outbound;
106
+ }
107
+
108
+ export function organizationChannelCreateRequestToJSON(
109
+ organizationChannelCreateRequest: OrganizationChannelCreateRequest,
110
+ ): string {
111
+ return JSON.stringify(
112
+ OrganizationChannelCreateRequest$outboundSchema.parse(
113
+ organizationChannelCreateRequest,
114
+ ),
115
+ );
116
+ }
117
+
118
+ export function organizationChannelCreateRequestFromJSON(
119
+ jsonString: string,
120
+ ): SafeParseResult<OrganizationChannelCreateRequest, SDKValidationError> {
121
+ return safeParse(
122
+ jsonString,
123
+ (x) => OrganizationChannelCreateRequest$inboundSchema.parse(JSON.parse(x)),
124
+ `Failed to parse 'OrganizationChannelCreateRequest' from JSON`,
125
+ );
126
+ }
@@ -0,0 +1,133 @@
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
+ ChannelServices,
12
+ ChannelServices$inboundSchema,
13
+ ChannelServices$outboundSchema,
14
+ } from "./channelservices.js";
15
+ import {
16
+ OrganizationChannelConfig,
17
+ OrganizationChannelConfig$inboundSchema,
18
+ OrganizationChannelConfig$Outbound,
19
+ OrganizationChannelConfig$outboundSchema,
20
+ } from "./organizationchannelconfig.js";
21
+
22
+ /**
23
+ * Request model to update a channel through the organizations API
24
+ */
25
+ export type OrganizationChannelUpdateRequest = {
26
+ /**
27
+ * The channel name
28
+ */
29
+ name: string;
30
+ /**
31
+ * The communication service for a channel.
32
+ */
33
+ channelService: ChannelServices;
34
+ /**
35
+ * The comma-delimited list of supported modes for the channel, which defines the possible communication methods for channel targets linked to it.
36
+ */
37
+ supportedModes?: string | null | undefined;
38
+ /**
39
+ * Whether the channel is a built-in system channel (i.e., is not customizable)
40
+ */
41
+ isSystemChannel?: boolean | undefined;
42
+ /**
43
+ * Channel config information for creates / updates through the organizations API
44
+ */
45
+ config: OrganizationChannelConfig;
46
+ /**
47
+ * The internal ID of the channel
48
+ */
49
+ id: number;
50
+ };
51
+
52
+ /** @internal */
53
+ export const OrganizationChannelUpdateRequest$inboundSchema: z.ZodType<
54
+ OrganizationChannelUpdateRequest,
55
+ z.ZodTypeDef,
56
+ unknown
57
+ > = z.object({
58
+ name: z.string(),
59
+ channel_service: ChannelServices$inboundSchema,
60
+ supported_modes: z.nullable(z.string()).optional(),
61
+ is_system_channel: z.boolean().default(true),
62
+ config: OrganizationChannelConfig$inboundSchema,
63
+ id: z.number().int(),
64
+ }).transform((v) => {
65
+ return remap$(v, {
66
+ "channel_service": "channelService",
67
+ "supported_modes": "supportedModes",
68
+ "is_system_channel": "isSystemChannel",
69
+ });
70
+ });
71
+
72
+ /** @internal */
73
+ export type OrganizationChannelUpdateRequest$Outbound = {
74
+ name: string;
75
+ channel_service: string;
76
+ supported_modes?: string | null | undefined;
77
+ is_system_channel: boolean;
78
+ config: OrganizationChannelConfig$Outbound;
79
+ id: number;
80
+ };
81
+
82
+ /** @internal */
83
+ export const OrganizationChannelUpdateRequest$outboundSchema: z.ZodType<
84
+ OrganizationChannelUpdateRequest$Outbound,
85
+ z.ZodTypeDef,
86
+ OrganizationChannelUpdateRequest
87
+ > = z.object({
88
+ name: z.string(),
89
+ channelService: ChannelServices$outboundSchema,
90
+ supportedModes: z.nullable(z.string()).optional(),
91
+ isSystemChannel: z.boolean().default(true),
92
+ config: OrganizationChannelConfig$outboundSchema,
93
+ id: z.number().int(),
94
+ }).transform((v) => {
95
+ return remap$(v, {
96
+ channelService: "channel_service",
97
+ supportedModes: "supported_modes",
98
+ isSystemChannel: "is_system_channel",
99
+ });
100
+ });
101
+
102
+ /**
103
+ * @internal
104
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
105
+ */
106
+ export namespace OrganizationChannelUpdateRequest$ {
107
+ /** @deprecated use `OrganizationChannelUpdateRequest$inboundSchema` instead. */
108
+ export const inboundSchema = OrganizationChannelUpdateRequest$inboundSchema;
109
+ /** @deprecated use `OrganizationChannelUpdateRequest$outboundSchema` instead. */
110
+ export const outboundSchema = OrganizationChannelUpdateRequest$outboundSchema;
111
+ /** @deprecated use `OrganizationChannelUpdateRequest$Outbound` instead. */
112
+ export type Outbound = OrganizationChannelUpdateRequest$Outbound;
113
+ }
114
+
115
+ export function organizationChannelUpdateRequestToJSON(
116
+ organizationChannelUpdateRequest: OrganizationChannelUpdateRequest,
117
+ ): string {
118
+ return JSON.stringify(
119
+ OrganizationChannelUpdateRequest$outboundSchema.parse(
120
+ organizationChannelUpdateRequest,
121
+ ),
122
+ );
123
+ }
124
+
125
+ export function organizationChannelUpdateRequestFromJSON(
126
+ jsonString: string,
127
+ ): SafeParseResult<OrganizationChannelUpdateRequest, SDKValidationError> {
128
+ return safeParse(
129
+ jsonString,
130
+ (x) => OrganizationChannelUpdateRequest$inboundSchema.parse(JSON.parse(x)),
131
+ `Failed to parse 'OrganizationChannelUpdateRequest' from JSON`,
132
+ );
133
+ }
@@ -0,0 +1,114 @@
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
+
11
+ export type TelephonyConfigurations = {
12
+ /**
13
+ * Pre input silence threshold
14
+ */
15
+ preInputTimeout?: number | null | undefined;
16
+ /**
17
+ * Post speech silence timeout to determine input as ended.
18
+ */
19
+ postSpeechInputTimeout?: number | null | undefined;
20
+ /**
21
+ * Post dtmf silence timeout to determine input as ended.
22
+ */
23
+ postDtmfInputTimeout?: number | null | undefined;
24
+ /**
25
+ * Total input timeout
26
+ */
27
+ overallInputTimeout?: number | null | undefined;
28
+ /**
29
+ * Number of seconds to start listening to user input before assistant speech ends
30
+ */
31
+ outputPadding?: number | null | undefined;
32
+ };
33
+
34
+ /** @internal */
35
+ export const TelephonyConfigurations$inboundSchema: z.ZodType<
36
+ TelephonyConfigurations,
37
+ z.ZodTypeDef,
38
+ unknown
39
+ > = z.object({
40
+ pre_input_timeout: z.nullable(z.number()).optional(),
41
+ post_speech_input_timeout: z.nullable(z.number()).optional(),
42
+ post_dtmf_input_timeout: z.nullable(z.number()).optional(),
43
+ overall_input_timeout: z.nullable(z.number()).optional(),
44
+ output_padding: z.nullable(z.number()).optional(),
45
+ }).transform((v) => {
46
+ return remap$(v, {
47
+ "pre_input_timeout": "preInputTimeout",
48
+ "post_speech_input_timeout": "postSpeechInputTimeout",
49
+ "post_dtmf_input_timeout": "postDtmfInputTimeout",
50
+ "overall_input_timeout": "overallInputTimeout",
51
+ "output_padding": "outputPadding",
52
+ });
53
+ });
54
+
55
+ /** @internal */
56
+ export type TelephonyConfigurations$Outbound = {
57
+ pre_input_timeout?: number | null | undefined;
58
+ post_speech_input_timeout?: number | null | undefined;
59
+ post_dtmf_input_timeout?: number | null | undefined;
60
+ overall_input_timeout?: number | null | undefined;
61
+ output_padding?: number | null | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const TelephonyConfigurations$outboundSchema: z.ZodType<
66
+ TelephonyConfigurations$Outbound,
67
+ z.ZodTypeDef,
68
+ TelephonyConfigurations
69
+ > = z.object({
70
+ preInputTimeout: z.nullable(z.number()).optional(),
71
+ postSpeechInputTimeout: z.nullable(z.number()).optional(),
72
+ postDtmfInputTimeout: z.nullable(z.number()).optional(),
73
+ overallInputTimeout: z.nullable(z.number()).optional(),
74
+ outputPadding: z.nullable(z.number()).optional(),
75
+ }).transform((v) => {
76
+ return remap$(v, {
77
+ preInputTimeout: "pre_input_timeout",
78
+ postSpeechInputTimeout: "post_speech_input_timeout",
79
+ postDtmfInputTimeout: "post_dtmf_input_timeout",
80
+ overallInputTimeout: "overall_input_timeout",
81
+ outputPadding: "output_padding",
82
+ });
83
+ });
84
+
85
+ /**
86
+ * @internal
87
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
88
+ */
89
+ export namespace TelephonyConfigurations$ {
90
+ /** @deprecated use `TelephonyConfigurations$inboundSchema` instead. */
91
+ export const inboundSchema = TelephonyConfigurations$inboundSchema;
92
+ /** @deprecated use `TelephonyConfigurations$outboundSchema` instead. */
93
+ export const outboundSchema = TelephonyConfigurations$outboundSchema;
94
+ /** @deprecated use `TelephonyConfigurations$Outbound` instead. */
95
+ export type Outbound = TelephonyConfigurations$Outbound;
96
+ }
97
+
98
+ export function telephonyConfigurationsToJSON(
99
+ telephonyConfigurations: TelephonyConfigurations,
100
+ ): string {
101
+ return JSON.stringify(
102
+ TelephonyConfigurations$outboundSchema.parse(telephonyConfigurations),
103
+ );
104
+ }
105
+
106
+ export function telephonyConfigurationsFromJSON(
107
+ jsonString: string,
108
+ ): SafeParseResult<TelephonyConfigurations, SDKValidationError> {
109
+ return safeParse(
110
+ jsonString,
111
+ (x) => TelephonyConfigurations$inboundSchema.parse(JSON.parse(x)),
112
+ `Failed to parse 'TelephonyConfigurations' from JSON`,
113
+ );
114
+ }
@@ -2,8 +2,10 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import { channelsCreate } from "../funcs/channelsCreate.js";
5
6
  import { channelsDelete } from "../funcs/channelsDelete.js";
6
7
  import { channelsList } from "../funcs/channelsList.js";
8
+ import { channelsUpdate } from "../funcs/channelsUpdate.js";
7
9
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
8
10
  import * as components from "../models/components/index.js";
9
11
  import * as operations from "../models/operations/index.js";
@@ -36,6 +38,34 @@ export class Channels extends ClientSDK {
36
38
  ));
37
39
  }
38
40
 
41
+ /**
42
+ * Create Channel
43
+ */
44
+ async create(
45
+ request: components.OrganizationChannelCreateRequest,
46
+ options?: RequestOptions,
47
+ ): Promise<components.Channel> {
48
+ return unwrapAsync(channelsCreate(
49
+ this,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
55
+ /**
56
+ * Update Channel
57
+ */
58
+ async update(
59
+ request: components.OrganizationChannelUpdateRequest,
60
+ options?: RequestOptions,
61
+ ): Promise<components.Channel> {
62
+ return unwrapAsync(channelsUpdate(
63
+ this,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
39
69
  /**
40
70
  * Delete Channel Target
41
71
  *