@unified-api/typescript-sdk 2.86.1 → 2.86.2

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 (165) hide show
  1. package/FUNCTIONS.md +2 -2
  2. package/README.md +18 -12
  3. package/dist/commonjs/funcs/ucCreateUcCall.d.ts +18 -0
  4. package/dist/commonjs/funcs/ucCreateUcCall.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/ucCreateUcCall.js +126 -0
  6. package/dist/commonjs/funcs/ucCreateUcCall.js.map +1 -0
  7. package/dist/commonjs/funcs/ucPatchUcCall.d.ts +18 -0
  8. package/dist/commonjs/funcs/ucPatchUcCall.d.ts.map +1 -0
  9. package/dist/commonjs/funcs/ucPatchUcCall.js +130 -0
  10. package/dist/commonjs/funcs/ucPatchUcCall.js.map +1 -0
  11. package/dist/commonjs/funcs/ucUpdateUcCall.d.ts +18 -0
  12. package/dist/commonjs/funcs/ucUpdateUcCall.d.ts.map +1 -0
  13. package/dist/commonjs/funcs/ucUpdateUcCall.js +130 -0
  14. package/dist/commonjs/funcs/ucUpdateUcCall.js.map +1 -0
  15. package/dist/commonjs/lib/config.d.ts +3 -3
  16. package/dist/commonjs/lib/config.js +3 -3
  17. package/dist/commonjs/lib/config.js.map +1 -1
  18. package/dist/commonjs/sdk/call.d.ts +21 -0
  19. package/dist/commonjs/sdk/call.d.ts.map +1 -1
  20. package/dist/commonjs/sdk/call.js +30 -0
  21. package/dist/commonjs/sdk/call.js.map +1 -1
  22. package/dist/commonjs/sdk/models/operations/createuccall.d.ts +57 -0
  23. package/dist/commonjs/sdk/models/operations/createuccall.d.ts.map +1 -0
  24. package/dist/commonjs/sdk/models/operations/createuccall.js +86 -0
  25. package/dist/commonjs/sdk/models/operations/createuccall.js.map +1 -0
  26. package/dist/commonjs/sdk/models/operations/getuccall.d.ts +7 -0
  27. package/dist/commonjs/sdk/models/operations/getuccall.d.ts.map +1 -1
  28. package/dist/commonjs/sdk/models/operations/getuccall.js +7 -0
  29. package/dist/commonjs/sdk/models/operations/getuccall.js.map +1 -1
  30. package/dist/commonjs/sdk/models/operations/index.d.ts +3 -0
  31. package/dist/commonjs/sdk/models/operations/index.d.ts.map +1 -1
  32. package/dist/commonjs/sdk/models/operations/index.js +3 -0
  33. package/dist/commonjs/sdk/models/operations/index.js.map +1 -1
  34. package/dist/commonjs/sdk/models/operations/listuccalls.d.ts +7 -0
  35. package/dist/commonjs/sdk/models/operations/listuccalls.d.ts.map +1 -1
  36. package/dist/commonjs/sdk/models/operations/listuccalls.js +7 -0
  37. package/dist/commonjs/sdk/models/operations/listuccalls.js.map +1 -1
  38. package/dist/commonjs/sdk/models/operations/patchuccall.d.ts +62 -0
  39. package/dist/commonjs/sdk/models/operations/patchuccall.d.ts.map +1 -0
  40. package/dist/commonjs/sdk/models/operations/patchuccall.js +87 -0
  41. package/dist/commonjs/sdk/models/operations/patchuccall.js.map +1 -0
  42. package/dist/commonjs/sdk/models/operations/updateuccall.d.ts +62 -0
  43. package/dist/commonjs/sdk/models/operations/updateuccall.d.ts.map +1 -0
  44. package/dist/commonjs/sdk/models/operations/updateuccall.js +87 -0
  45. package/dist/commonjs/sdk/models/operations/updateuccall.js.map +1 -0
  46. package/dist/commonjs/sdk/models/shared/index.d.ts +2 -0
  47. package/dist/commonjs/sdk/models/shared/index.d.ts.map +1 -1
  48. package/dist/commonjs/sdk/models/shared/index.js +2 -0
  49. package/dist/commonjs/sdk/models/shared/index.js.map +1 -1
  50. package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.d.ts +1 -0
  51. package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  52. package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.js +1 -0
  53. package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  54. package/dist/commonjs/sdk/models/shared/propertyuccallinstructiontelephone.d.ts +35 -0
  55. package/dist/commonjs/sdk/models/shared/propertyuccallinstructiontelephone.d.ts.map +1 -0
  56. package/dist/commonjs/sdk/models/shared/propertyuccallinstructiontelephone.js +72 -0
  57. package/dist/commonjs/sdk/models/shared/propertyuccallinstructiontelephone.js.map +1 -0
  58. package/dist/commonjs/sdk/models/shared/propertyuccalltelephone.d.ts +10 -0
  59. package/dist/commonjs/sdk/models/shared/propertyuccalltelephone.d.ts.map +1 -1
  60. package/dist/commonjs/sdk/models/shared/propertyuccalltelephone.js +12 -1
  61. package/dist/commonjs/sdk/models/shared/propertyuccalltelephone.js.map +1 -1
  62. package/dist/commonjs/sdk/models/shared/uccall.d.ts +87 -3
  63. package/dist/commonjs/sdk/models/shared/uccall.d.ts.map +1 -1
  64. package/dist/commonjs/sdk/models/shared/uccall.js +81 -1
  65. package/dist/commonjs/sdk/models/shared/uccall.js.map +1 -1
  66. package/dist/commonjs/sdk/models/shared/uccallinstruction.d.ts +71 -0
  67. package/dist/commonjs/sdk/models/shared/uccallinstruction.d.ts.map +1 -0
  68. package/dist/commonjs/sdk/models/shared/uccallinstruction.js +102 -0
  69. package/dist/commonjs/sdk/models/shared/uccallinstruction.js.map +1 -0
  70. package/dist/commonjs/sdk/uc.d.ts +21 -0
  71. package/dist/commonjs/sdk/uc.d.ts.map +1 -1
  72. package/dist/commonjs/sdk/uc.js +30 -0
  73. package/dist/commonjs/sdk/uc.js.map +1 -1
  74. package/dist/esm/funcs/ucCreateUcCall.d.ts +18 -0
  75. package/dist/esm/funcs/ucCreateUcCall.d.ts.map +1 -0
  76. package/dist/esm/funcs/ucCreateUcCall.js +90 -0
  77. package/dist/esm/funcs/ucCreateUcCall.js.map +1 -0
  78. package/dist/esm/funcs/ucPatchUcCall.d.ts +18 -0
  79. package/dist/esm/funcs/ucPatchUcCall.d.ts.map +1 -0
  80. package/dist/esm/funcs/ucPatchUcCall.js +94 -0
  81. package/dist/esm/funcs/ucPatchUcCall.js.map +1 -0
  82. package/dist/esm/funcs/ucUpdateUcCall.d.ts +18 -0
  83. package/dist/esm/funcs/ucUpdateUcCall.d.ts.map +1 -0
  84. package/dist/esm/funcs/ucUpdateUcCall.js +94 -0
  85. package/dist/esm/funcs/ucUpdateUcCall.js.map +1 -0
  86. package/dist/esm/lib/config.d.ts +3 -3
  87. package/dist/esm/lib/config.js +3 -3
  88. package/dist/esm/lib/config.js.map +1 -1
  89. package/dist/esm/sdk/call.d.ts +21 -0
  90. package/dist/esm/sdk/call.d.ts.map +1 -1
  91. package/dist/esm/sdk/call.js +30 -0
  92. package/dist/esm/sdk/call.js.map +1 -1
  93. package/dist/esm/sdk/models/operations/createuccall.d.ts +57 -0
  94. package/dist/esm/sdk/models/operations/createuccall.d.ts.map +1 -0
  95. package/dist/esm/sdk/models/operations/createuccall.js +49 -0
  96. package/dist/esm/sdk/models/operations/createuccall.js.map +1 -0
  97. package/dist/esm/sdk/models/operations/getuccall.d.ts +7 -0
  98. package/dist/esm/sdk/models/operations/getuccall.d.ts.map +1 -1
  99. package/dist/esm/sdk/models/operations/getuccall.js +7 -0
  100. package/dist/esm/sdk/models/operations/getuccall.js.map +1 -1
  101. package/dist/esm/sdk/models/operations/index.d.ts +3 -0
  102. package/dist/esm/sdk/models/operations/index.d.ts.map +1 -1
  103. package/dist/esm/sdk/models/operations/index.js +3 -0
  104. package/dist/esm/sdk/models/operations/index.js.map +1 -1
  105. package/dist/esm/sdk/models/operations/listuccalls.d.ts +7 -0
  106. package/dist/esm/sdk/models/operations/listuccalls.d.ts.map +1 -1
  107. package/dist/esm/sdk/models/operations/listuccalls.js +7 -0
  108. package/dist/esm/sdk/models/operations/listuccalls.js.map +1 -1
  109. package/dist/esm/sdk/models/operations/patchuccall.d.ts +62 -0
  110. package/dist/esm/sdk/models/operations/patchuccall.d.ts.map +1 -0
  111. package/dist/esm/sdk/models/operations/patchuccall.js +50 -0
  112. package/dist/esm/sdk/models/operations/patchuccall.js.map +1 -0
  113. package/dist/esm/sdk/models/operations/updateuccall.d.ts +62 -0
  114. package/dist/esm/sdk/models/operations/updateuccall.d.ts.map +1 -0
  115. package/dist/esm/sdk/models/operations/updateuccall.js +50 -0
  116. package/dist/esm/sdk/models/operations/updateuccall.js.map +1 -0
  117. package/dist/esm/sdk/models/shared/index.d.ts +2 -0
  118. package/dist/esm/sdk/models/shared/index.d.ts.map +1 -1
  119. package/dist/esm/sdk/models/shared/index.js +2 -0
  120. package/dist/esm/sdk/models/shared/index.js.map +1 -1
  121. package/dist/esm/sdk/models/shared/propertyconnectionpermissions.d.ts +1 -0
  122. package/dist/esm/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
  123. package/dist/esm/sdk/models/shared/propertyconnectionpermissions.js +1 -0
  124. package/dist/esm/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
  125. package/dist/esm/sdk/models/shared/propertyuccallinstructiontelephone.d.ts +35 -0
  126. package/dist/esm/sdk/models/shared/propertyuccallinstructiontelephone.d.ts.map +1 -0
  127. package/dist/esm/sdk/models/shared/propertyuccallinstructiontelephone.js +34 -0
  128. package/dist/esm/sdk/models/shared/propertyuccallinstructiontelephone.js.map +1 -0
  129. package/dist/esm/sdk/models/shared/propertyuccalltelephone.d.ts +10 -0
  130. package/dist/esm/sdk/models/shared/propertyuccalltelephone.d.ts.map +1 -1
  131. package/dist/esm/sdk/models/shared/propertyuccalltelephone.js +10 -0
  132. package/dist/esm/sdk/models/shared/propertyuccalltelephone.js.map +1 -1
  133. package/dist/esm/sdk/models/shared/uccall.d.ts +87 -3
  134. package/dist/esm/sdk/models/shared/uccall.d.ts.map +1 -1
  135. package/dist/esm/sdk/models/shared/uccall.js +82 -3
  136. package/dist/esm/sdk/models/shared/uccall.js.map +1 -1
  137. package/dist/esm/sdk/models/shared/uccallinstruction.d.ts +71 -0
  138. package/dist/esm/sdk/models/shared/uccallinstruction.d.ts.map +1 -0
  139. package/dist/esm/sdk/models/shared/uccallinstruction.js +64 -0
  140. package/dist/esm/sdk/models/shared/uccallinstruction.js.map +1 -0
  141. package/dist/esm/sdk/uc.d.ts +21 -0
  142. package/dist/esm/sdk/uc.d.ts.map +1 -1
  143. package/dist/esm/sdk/uc.js +30 -0
  144. package/dist/esm/sdk/uc.js.map +1 -1
  145. package/examples/accountingCreateAccountingAccount.example.ts +2 -2
  146. package/jsr.json +1 -1
  147. package/package.json +1 -1
  148. package/src/funcs/ucCreateUcCall.ts +174 -0
  149. package/src/funcs/ucPatchUcCall.ts +178 -0
  150. package/src/funcs/ucUpdateUcCall.ts +178 -0
  151. package/src/lib/config.ts +3 -3
  152. package/src/sdk/call.ts +54 -0
  153. package/src/sdk/models/operations/createuccall.ts +91 -0
  154. package/src/sdk/models/operations/getuccall.ts +7 -0
  155. package/src/sdk/models/operations/index.ts +3 -0
  156. package/src/sdk/models/operations/listuccalls.ts +7 -0
  157. package/src/sdk/models/operations/patchuccall.ts +97 -0
  158. package/src/sdk/models/operations/updateuccall.ts +97 -0
  159. package/src/sdk/models/shared/index.ts +2 -0
  160. package/src/sdk/models/shared/propertyconnectionpermissions.ts +1 -0
  161. package/src/sdk/models/shared/propertyuccallinstructiontelephone.ts +87 -0
  162. package/src/sdk/models/shared/propertyuccalltelephone.ts +28 -0
  163. package/src/sdk/models/shared/uccall.ts +175 -2
  164. package/src/sdk/models/shared/uccallinstruction.ts +152 -0
  165. package/src/sdk/uc.ts +54 -0
@@ -0,0 +1,152 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../../lib/primitives.js";
7
+ import { safeParse } from "../../../lib/schemas.js";
8
+ import * as openEnums from "../../types/enums.js";
9
+ import { OpenEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+ import {
13
+ PropertyUcCallInstructionTelephone,
14
+ PropertyUcCallInstructionTelephone$inboundSchema,
15
+ PropertyUcCallInstructionTelephone$Outbound,
16
+ PropertyUcCallInstructionTelephone$outboundSchema,
17
+ } from "./propertyuccallinstructiontelephone.js";
18
+
19
+ export const UcCallInstructionType = {
20
+ Say: "SAY",
21
+ Play: "PLAY",
22
+ Pause: "PAUSE",
23
+ Dial: "DIAL",
24
+ Hangup: "HANGUP",
25
+ } as const;
26
+ export type UcCallInstructionType = OpenEnum<typeof UcCallInstructionType>;
27
+
28
+ export type UcCallInstruction = {
29
+ /**
30
+ * PLAY: public MP3 or WAV URL
31
+ */
32
+ audioUrl?: string | undefined;
33
+ /**
34
+ * SAY: BCP 47 language code (e.g. en-US), passed to the integration as-is
35
+ */
36
+ language?: string | undefined;
37
+ /**
38
+ * PAUSE: length of silence
39
+ */
40
+ seconds?: number | undefined;
41
+ /**
42
+ * DIAL: SIP address to dial instead of telephone
43
+ */
44
+ sipUri?: string | undefined;
45
+ /**
46
+ * DIAL: number to dial and bridge
47
+ */
48
+ telephone?: PropertyUcCallInstructionTelephone | undefined;
49
+ /**
50
+ * SAY: text to speak
51
+ */
52
+ text?: string | undefined;
53
+ /**
54
+ * DIAL: how long to ring before giving up
55
+ */
56
+ timeoutSeconds?: number | undefined;
57
+ type: UcCallInstructionType;
58
+ /**
59
+ * DIAL: caller ID on the dialed leg (defaults to the call's user_phone)
60
+ */
61
+ userPhone?: string | undefined;
62
+ };
63
+
64
+ /** @internal */
65
+ export const UcCallInstructionType$inboundSchema: z.ZodType<
66
+ UcCallInstructionType,
67
+ z.ZodTypeDef,
68
+ unknown
69
+ > = openEnums.inboundSchema(UcCallInstructionType);
70
+ /** @internal */
71
+ export const UcCallInstructionType$outboundSchema: z.ZodType<
72
+ string,
73
+ z.ZodTypeDef,
74
+ UcCallInstructionType
75
+ > = openEnums.outboundSchema(UcCallInstructionType);
76
+
77
+ /** @internal */
78
+ export const UcCallInstruction$inboundSchema: z.ZodType<
79
+ UcCallInstruction,
80
+ z.ZodTypeDef,
81
+ unknown
82
+ > = z.object({
83
+ audio_url: z.string().optional(),
84
+ language: z.string().optional(),
85
+ seconds: z.number().optional(),
86
+ sip_uri: z.string().optional(),
87
+ telephone: PropertyUcCallInstructionTelephone$inboundSchema.optional(),
88
+ text: z.string().optional(),
89
+ timeout_seconds: z.number().optional(),
90
+ type: UcCallInstructionType$inboundSchema,
91
+ user_phone: z.string().optional(),
92
+ }).transform((v) => {
93
+ return remap$(v, {
94
+ "audio_url": "audioUrl",
95
+ "sip_uri": "sipUri",
96
+ "timeout_seconds": "timeoutSeconds",
97
+ "user_phone": "userPhone",
98
+ });
99
+ });
100
+ /** @internal */
101
+ export type UcCallInstruction$Outbound = {
102
+ audio_url?: string | undefined;
103
+ language?: string | undefined;
104
+ seconds?: number | undefined;
105
+ sip_uri?: string | undefined;
106
+ telephone?: PropertyUcCallInstructionTelephone$Outbound | undefined;
107
+ text?: string | undefined;
108
+ timeout_seconds?: number | undefined;
109
+ type: string;
110
+ user_phone?: string | undefined;
111
+ };
112
+
113
+ /** @internal */
114
+ export const UcCallInstruction$outboundSchema: z.ZodType<
115
+ UcCallInstruction$Outbound,
116
+ z.ZodTypeDef,
117
+ UcCallInstruction
118
+ > = z.object({
119
+ audioUrl: z.string().optional(),
120
+ language: z.string().optional(),
121
+ seconds: z.number().optional(),
122
+ sipUri: z.string().optional(),
123
+ telephone: PropertyUcCallInstructionTelephone$outboundSchema.optional(),
124
+ text: z.string().optional(),
125
+ timeoutSeconds: z.number().optional(),
126
+ type: UcCallInstructionType$outboundSchema,
127
+ userPhone: z.string().optional(),
128
+ }).transform((v) => {
129
+ return remap$(v, {
130
+ audioUrl: "audio_url",
131
+ sipUri: "sip_uri",
132
+ timeoutSeconds: "timeout_seconds",
133
+ userPhone: "user_phone",
134
+ });
135
+ });
136
+
137
+ export function ucCallInstructionToJSON(
138
+ ucCallInstruction: UcCallInstruction,
139
+ ): string {
140
+ return JSON.stringify(
141
+ UcCallInstruction$outboundSchema.parse(ucCallInstruction),
142
+ );
143
+ }
144
+ export function ucCallInstructionFromJSON(
145
+ jsonString: string,
146
+ ): SafeParseResult<UcCallInstruction, SDKValidationError> {
147
+ return safeParse(
148
+ jsonString,
149
+ (x) => UcCallInstruction$inboundSchema.parse(JSON.parse(x)),
150
+ `Failed to parse 'UcCallInstruction' from JSON`,
151
+ );
152
+ }
package/src/sdk/uc.ts CHANGED
@@ -22,16 +22,36 @@ import { recordingRemoveUcRecording } from "../funcs/recordingRemoveUcRecording.
22
22
  import { recordingUpdateUcRecording } from "../funcs/recordingUpdateUcRecording.js";
23
23
  import { scorecardGetUcScorecard } from "../funcs/scorecardGetUcScorecard.js";
24
24
  import { scorecardListUcScorecards } from "../funcs/scorecardListUcScorecards.js";
25
+ import { ucCreateUcCall } from "../funcs/ucCreateUcCall.js";
25
26
  import { ucGetUcCall } from "../funcs/ucGetUcCall.js";
26
27
  import { ucGetUcScorecardtemplate } from "../funcs/ucGetUcScorecardtemplate.js";
27
28
  import { ucListUcCalls } from "../funcs/ucListUcCalls.js";
28
29
  import { ucListUcScorecardtemplates } from "../funcs/ucListUcScorecardtemplates.js";
30
+ import { ucPatchUcCall } from "../funcs/ucPatchUcCall.js";
31
+ import { ucUpdateUcCall } from "../funcs/ucUpdateUcCall.js";
29
32
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
30
33
  import * as operations from "./models/operations/index.js";
31
34
  import * as shared from "./models/shared/index.js";
32
35
  import { unwrapAsync } from "./types/fp.js";
33
36
 
34
37
  export class Uc extends ClientSDK {
38
+ /**
39
+ * Create a call
40
+ *
41
+ * @remarks
42
+ * Creates a UcCall. Provide the unified UcCall fields in the request body; they are mapped to the provider's API. Returns the created UcCall.
43
+ */
44
+ async createUcCall(
45
+ request: operations.CreateUcCallRequest,
46
+ options?: RequestOptions,
47
+ ): Promise<shared.UcCall> {
48
+ return unwrapAsync(ucCreateUcCall(
49
+ this,
50
+ request,
51
+ options,
52
+ ));
53
+ }
54
+
35
55
  /**
36
56
  * Create a comment
37
57
  *
@@ -287,6 +307,23 @@ export class Uc extends ClientSDK {
287
307
  ));
288
308
  }
289
309
 
310
+ /**
311
+ * Update a call
312
+ *
313
+ * @remarks
314
+ * Updates the UcCall identified by `id`. Provide the unified UcCall fields to change in the request body.
315
+ */
316
+ async patchUcCall(
317
+ request: operations.PatchUcCallRequest,
318
+ options?: RequestOptions,
319
+ ): Promise<shared.UcCall> {
320
+ return unwrapAsync(ucPatchUcCall(
321
+ this,
322
+ request,
323
+ options,
324
+ ));
325
+ }
326
+
290
327
  /**
291
328
  * Update a comment
292
329
  *
@@ -389,6 +426,23 @@ export class Uc extends ClientSDK {
389
426
  ));
390
427
  }
391
428
 
429
+ /**
430
+ * Update a call
431
+ *
432
+ * @remarks
433
+ * Updates the UcCall identified by `id`. Provide the unified UcCall fields to change in the request body.
434
+ */
435
+ async updateUcCall(
436
+ request: operations.UpdateUcCallRequest,
437
+ options?: RequestOptions,
438
+ ): Promise<shared.UcCall> {
439
+ return unwrapAsync(ucUpdateUcCall(
440
+ this,
441
+ request,
442
+ options,
443
+ ));
444
+ }
445
+
392
446
  /**
393
447
  * Update a comment
394
448
  *