@talqing/sdk 0.1.0 → 0.2.0

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 (215) hide show
  1. package/README.md +2 -1
  2. package/dist/cjs/browser.d.ts.map +1 -0
  3. package/dist/cjs/browser.js +463 -0
  4. package/dist/cjs/browser.js.map +1 -0
  5. package/dist/{client.d.ts → cjs/client.d.ts} +3 -0
  6. package/dist/cjs/client.d.ts.map +1 -0
  7. package/dist/cjs/client.js +109 -0
  8. package/dist/cjs/client.js.map +1 -0
  9. package/dist/cjs/gen/apiVersion.d.ts.map +1 -0
  10. package/dist/cjs/gen/apiVersion.js +7 -0
  11. package/dist/cjs/gen/apiVersion.js.map +1 -0
  12. package/dist/cjs/gen/client/client.gen.d.ts.map +1 -0
  13. package/dist/cjs/gen/client/client.gen.js +221 -0
  14. package/dist/cjs/gen/client/client.gen.js.map +1 -0
  15. package/dist/cjs/gen/client/index.d.ts.map +1 -0
  16. package/dist/cjs/gen/client/index.js +18 -0
  17. package/dist/cjs/gen/client/index.js.map +1 -0
  18. package/dist/cjs/gen/client/types.gen.d.ts.map +1 -0
  19. package/dist/cjs/gen/client/types.gen.js +4 -0
  20. package/dist/cjs/gen/client/types.gen.js.map +1 -0
  21. package/dist/cjs/gen/client/utils.gen.d.ts.map +1 -0
  22. package/dist/cjs/gen/client/utils.gen.js +242 -0
  23. package/dist/cjs/gen/client/utils.gen.js.map +1 -0
  24. package/dist/cjs/gen/client.gen.d.ts.map +1 -0
  25. package/dist/cjs/gen/client.gen.js +7 -0
  26. package/dist/cjs/gen/client.gen.js.map +1 -0
  27. package/dist/cjs/gen/core/auth.gen.d.ts.map +1 -0
  28. package/dist/cjs/gen/core/auth.gen.js +19 -0
  29. package/dist/cjs/gen/core/auth.gen.js.map +1 -0
  30. package/dist/cjs/gen/core/bodySerializer.gen.d.ts.map +1 -0
  31. package/dist/cjs/gen/core/bodySerializer.gen.js +61 -0
  32. package/dist/cjs/gen/core/bodySerializer.gen.js.map +1 -0
  33. package/dist/cjs/gen/core/params.gen.d.ts.map +1 -0
  34. package/dist/cjs/gen/core/params.gen.js +113 -0
  35. package/dist/cjs/gen/core/params.gen.js.map +1 -0
  36. package/dist/cjs/gen/core/pathSerializer.gen.d.ts.map +1 -0
  37. package/dist/cjs/gen/core/pathSerializer.gen.js +116 -0
  38. package/dist/cjs/gen/core/pathSerializer.gen.js.map +1 -0
  39. package/dist/cjs/gen/core/queryKeySerializer.gen.d.ts.map +1 -0
  40. package/dist/cjs/gen/core/queryKeySerializer.gen.js +99 -0
  41. package/dist/cjs/gen/core/queryKeySerializer.gen.js.map +1 -0
  42. package/dist/cjs/gen/core/serverSentEvents.gen.d.ts.map +1 -0
  43. package/dist/cjs/gen/core/serverSentEvents.gen.js +136 -0
  44. package/dist/cjs/gen/core/serverSentEvents.gen.js.map +1 -0
  45. package/dist/cjs/gen/core/types.gen.d.ts.map +1 -0
  46. package/dist/cjs/gen/core/types.gen.js +4 -0
  47. package/dist/cjs/gen/core/types.gen.js.map +1 -0
  48. package/dist/cjs/gen/core/utils.gen.d.ts.map +1 -0
  49. package/dist/cjs/gen/core/utils.gen.js +94 -0
  50. package/dist/cjs/gen/core/utils.gen.js.map +1 -0
  51. package/dist/cjs/gen/index.d.ts.map +1 -0
  52. package/dist/cjs/gen/index.js +7 -0
  53. package/dist/cjs/gen/index.js.map +1 -0
  54. package/dist/cjs/gen/sdk.gen.d.ts.map +1 -0
  55. package/dist/cjs/gen/sdk.gen.js +4373 -0
  56. package/dist/cjs/gen/sdk.gen.js.map +1 -0
  57. package/dist/cjs/gen/types.gen.d.ts.map +1 -0
  58. package/dist/cjs/gen/types.gen.js +4 -0
  59. package/dist/cjs/gen/types.gen.js.map +1 -0
  60. package/dist/cjs/index.d.ts.map +1 -0
  61. package/dist/cjs/index.js +27 -0
  62. package/dist/cjs/index.js.map +1 -0
  63. package/dist/cjs/package.json +3 -0
  64. package/dist/cjs/vocabulary.d.ts.map +1 -0
  65. package/dist/cjs/vocabulary.js +13 -0
  66. package/dist/cjs/vocabulary.js.map +1 -0
  67. package/dist/esm/browser.d.ts +153 -0
  68. package/dist/esm/browser.d.ts.map +1 -0
  69. package/dist/esm/browser.js.map +1 -0
  70. package/dist/esm/client.d.ts +104 -0
  71. package/dist/esm/client.d.ts.map +1 -0
  72. package/dist/{client.js → esm/client.js} +16 -0
  73. package/dist/esm/client.js.map +1 -0
  74. package/dist/esm/gen/apiVersion.d.ts +3 -0
  75. package/dist/esm/gen/apiVersion.d.ts.map +1 -0
  76. package/dist/esm/gen/apiVersion.js.map +1 -0
  77. package/dist/esm/gen/client/client.gen.d.ts +3 -0
  78. package/dist/esm/gen/client/client.gen.d.ts.map +1 -0
  79. package/dist/esm/gen/client/client.gen.js.map +1 -0
  80. package/dist/esm/gen/client/index.d.ts +11 -0
  81. package/dist/esm/gen/client/index.d.ts.map +1 -0
  82. package/dist/esm/gen/client/index.js.map +1 -0
  83. package/dist/esm/gen/client/types.gen.d.ts +121 -0
  84. package/dist/esm/gen/client/types.gen.d.ts.map +1 -0
  85. package/dist/esm/gen/client/types.gen.js.map +1 -0
  86. package/dist/esm/gen/client/utils.gen.d.ts +38 -0
  87. package/dist/esm/gen/client/utils.gen.d.ts.map +1 -0
  88. package/dist/esm/gen/client/utils.gen.js.map +1 -0
  89. package/dist/esm/gen/client.gen.d.ts +13 -0
  90. package/dist/esm/gen/client.gen.d.ts.map +1 -0
  91. package/dist/esm/gen/client.gen.js.map +1 -0
  92. package/dist/esm/gen/core/auth.gen.d.ts +26 -0
  93. package/dist/esm/gen/core/auth.gen.d.ts.map +1 -0
  94. package/dist/esm/gen/core/auth.gen.js.map +1 -0
  95. package/dist/esm/gen/core/bodySerializer.gen.d.ts +26 -0
  96. package/dist/esm/gen/core/bodySerializer.gen.d.ts.map +1 -0
  97. package/dist/esm/gen/core/bodySerializer.gen.js.map +1 -0
  98. package/dist/esm/gen/core/params.gen.d.ts +44 -0
  99. package/dist/esm/gen/core/params.gen.d.ts.map +1 -0
  100. package/dist/esm/gen/core/params.gen.js.map +1 -0
  101. package/dist/esm/gen/core/pathSerializer.gen.d.ts +34 -0
  102. package/dist/esm/gen/core/pathSerializer.gen.d.ts.map +1 -0
  103. package/dist/esm/gen/core/pathSerializer.gen.js.map +1 -0
  104. package/dist/esm/gen/core/queryKeySerializer.gen.d.ts +19 -0
  105. package/dist/esm/gen/core/queryKeySerializer.gen.d.ts.map +1 -0
  106. package/dist/esm/gen/core/queryKeySerializer.gen.js.map +1 -0
  107. package/dist/esm/gen/core/serverSentEvents.gen.d.ts +72 -0
  108. package/dist/esm/gen/core/serverSentEvents.gen.d.ts.map +1 -0
  109. package/dist/esm/gen/core/serverSentEvents.gen.js.map +1 -0
  110. package/dist/esm/gen/core/types.gen.d.ts +84 -0
  111. package/dist/esm/gen/core/types.gen.d.ts.map +1 -0
  112. package/dist/esm/gen/core/types.gen.js.map +1 -0
  113. package/dist/esm/gen/core/utils.gen.d.ts +20 -0
  114. package/dist/esm/gen/core/utils.gen.d.ts.map +1 -0
  115. package/dist/esm/gen/core/utils.gen.js.map +1 -0
  116. package/dist/esm/gen/index.d.ts +3 -0
  117. package/dist/esm/gen/index.d.ts.map +1 -0
  118. package/dist/esm/gen/index.js.map +1 -0
  119. package/dist/esm/gen/sdk.gen.d.ts +2330 -0
  120. package/dist/esm/gen/sdk.gen.d.ts.map +1 -0
  121. package/dist/esm/gen/sdk.gen.js.map +1 -0
  122. package/dist/esm/gen/types.gen.d.ts +17288 -0
  123. package/dist/esm/gen/types.gen.d.ts.map +1 -0
  124. package/dist/esm/gen/types.gen.js.map +1 -0
  125. package/dist/esm/index.d.ts +6 -0
  126. package/dist/esm/index.d.ts.map +1 -0
  127. package/dist/esm/index.js.map +1 -0
  128. package/dist/esm/package.json +3 -0
  129. package/dist/esm/vocabulary.d.ts +67 -0
  130. package/dist/esm/vocabulary.d.ts.map +1 -0
  131. package/dist/esm/vocabulary.js.map +1 -0
  132. package/package.json +32 -11
  133. package/src/client.ts +17 -0
  134. package/dist/browser.d.ts.map +0 -1
  135. package/dist/browser.js.map +0 -1
  136. package/dist/client.d.ts.map +0 -1
  137. package/dist/client.js.map +0 -1
  138. package/dist/gen/apiVersion.d.ts.map +0 -1
  139. package/dist/gen/apiVersion.js.map +0 -1
  140. package/dist/gen/client/client.gen.d.ts.map +0 -1
  141. package/dist/gen/client/client.gen.js.map +0 -1
  142. package/dist/gen/client/index.d.ts.map +0 -1
  143. package/dist/gen/client/index.js.map +0 -1
  144. package/dist/gen/client/types.gen.d.ts.map +0 -1
  145. package/dist/gen/client/types.gen.js.map +0 -1
  146. package/dist/gen/client/utils.gen.d.ts.map +0 -1
  147. package/dist/gen/client/utils.gen.js.map +0 -1
  148. package/dist/gen/client.gen.d.ts.map +0 -1
  149. package/dist/gen/client.gen.js.map +0 -1
  150. package/dist/gen/core/auth.gen.d.ts.map +0 -1
  151. package/dist/gen/core/auth.gen.js.map +0 -1
  152. package/dist/gen/core/bodySerializer.gen.d.ts.map +0 -1
  153. package/dist/gen/core/bodySerializer.gen.js.map +0 -1
  154. package/dist/gen/core/params.gen.d.ts.map +0 -1
  155. package/dist/gen/core/params.gen.js.map +0 -1
  156. package/dist/gen/core/pathSerializer.gen.d.ts.map +0 -1
  157. package/dist/gen/core/pathSerializer.gen.js.map +0 -1
  158. package/dist/gen/core/queryKeySerializer.gen.d.ts.map +0 -1
  159. package/dist/gen/core/queryKeySerializer.gen.js.map +0 -1
  160. package/dist/gen/core/serverSentEvents.gen.d.ts.map +0 -1
  161. package/dist/gen/core/serverSentEvents.gen.js.map +0 -1
  162. package/dist/gen/core/types.gen.d.ts.map +0 -1
  163. package/dist/gen/core/types.gen.js.map +0 -1
  164. package/dist/gen/core/utils.gen.d.ts.map +0 -1
  165. package/dist/gen/core/utils.gen.js.map +0 -1
  166. package/dist/gen/index.d.ts.map +0 -1
  167. package/dist/gen/index.js.map +0 -1
  168. package/dist/gen/sdk.gen.d.ts.map +0 -1
  169. package/dist/gen/sdk.gen.js.map +0 -1
  170. package/dist/gen/types.gen.d.ts.map +0 -1
  171. package/dist/gen/types.gen.js.map +0 -1
  172. package/dist/index.d.ts.map +0 -1
  173. package/dist/index.js.map +0 -1
  174. package/dist/vocabulary.d.ts.map +0 -1
  175. package/dist/vocabulary.js.map +0 -1
  176. /package/dist/{browser.d.ts → cjs/browser.d.ts} +0 -0
  177. /package/dist/{gen → cjs/gen}/apiVersion.d.ts +0 -0
  178. /package/dist/{gen → cjs/gen}/client/client.gen.d.ts +0 -0
  179. /package/dist/{gen → cjs/gen}/client/index.d.ts +0 -0
  180. /package/dist/{gen → cjs/gen}/client/types.gen.d.ts +0 -0
  181. /package/dist/{gen → cjs/gen}/client/utils.gen.d.ts +0 -0
  182. /package/dist/{gen → cjs/gen}/client.gen.d.ts +0 -0
  183. /package/dist/{gen → cjs/gen}/core/auth.gen.d.ts +0 -0
  184. /package/dist/{gen → cjs/gen}/core/bodySerializer.gen.d.ts +0 -0
  185. /package/dist/{gen → cjs/gen}/core/params.gen.d.ts +0 -0
  186. /package/dist/{gen → cjs/gen}/core/pathSerializer.gen.d.ts +0 -0
  187. /package/dist/{gen → cjs/gen}/core/queryKeySerializer.gen.d.ts +0 -0
  188. /package/dist/{gen → cjs/gen}/core/serverSentEvents.gen.d.ts +0 -0
  189. /package/dist/{gen → cjs/gen}/core/types.gen.d.ts +0 -0
  190. /package/dist/{gen → cjs/gen}/core/utils.gen.d.ts +0 -0
  191. /package/dist/{gen → cjs/gen}/index.d.ts +0 -0
  192. /package/dist/{gen → cjs/gen}/sdk.gen.d.ts +0 -0
  193. /package/dist/{gen → cjs/gen}/types.gen.d.ts +0 -0
  194. /package/dist/{index.d.ts → cjs/index.d.ts} +0 -0
  195. /package/dist/{vocabulary.d.ts → cjs/vocabulary.d.ts} +0 -0
  196. /package/dist/{browser.js → esm/browser.js} +0 -0
  197. /package/dist/{gen → esm/gen}/apiVersion.js +0 -0
  198. /package/dist/{gen → esm/gen}/client/client.gen.js +0 -0
  199. /package/dist/{gen → esm/gen}/client/index.js +0 -0
  200. /package/dist/{gen → esm/gen}/client/types.gen.js +0 -0
  201. /package/dist/{gen → esm/gen}/client/utils.gen.js +0 -0
  202. /package/dist/{gen → esm/gen}/client.gen.js +0 -0
  203. /package/dist/{gen → esm/gen}/core/auth.gen.js +0 -0
  204. /package/dist/{gen → esm/gen}/core/bodySerializer.gen.js +0 -0
  205. /package/dist/{gen → esm/gen}/core/params.gen.js +0 -0
  206. /package/dist/{gen → esm/gen}/core/pathSerializer.gen.js +0 -0
  207. /package/dist/{gen → esm/gen}/core/queryKeySerializer.gen.js +0 -0
  208. /package/dist/{gen → esm/gen}/core/serverSentEvents.gen.js +0 -0
  209. /package/dist/{gen → esm/gen}/core/types.gen.js +0 -0
  210. /package/dist/{gen → esm/gen}/core/utils.gen.js +0 -0
  211. /package/dist/{gen → esm/gen}/index.js +0 -0
  212. /package/dist/{gen → esm/gen}/sdk.gen.js +0 -0
  213. /package/dist/{gen → esm/gen}/types.gen.js +0 -0
  214. /package/dist/{index.js → esm/index.js} +0 -0
  215. /package/dist/{vocabulary.js → esm/vocabulary.js} +0 -0
@@ -0,0 +1,4373 @@
1
+ "use strict";
2
+ // This file is auto-generated by @hey-api/openapi-ts
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TalqingApi = exports.Webhooks = exports.Tools2 = exports.Versions2 = exports.Telephony = exports.Providers = exports.PhoneNumbers = exports.Accounts = exports.Tasks2 = exports.Runs = exports.Secrets = exports.Schemas = exports.Orgs = exports.Members = exports.Invites = exports.Observability = exports.Tokens = exports.Knowledge2 = exports.Pages = exports.Nodes = exports.Integrations = exports.Triggers = exports.McpTools = exports.Email = exports.Senders = exports.Batches2 = exports.Recipients2 = exports.Copilot = exports.Tools = exports.Tasks = exports.Knowledge = exports.Agents2 = exports.Conversations = exports.Sessions = exports.Items = exports.Messages = exports.Catalog = exports.Voices = exports.Elevenlabs = exports.Avatars = exports.Calls = exports.ScreenRecording = exports.Recording = exports.Batches = exports.Recipients = exports.Analysis = exports.ProviderKeys = exports.Auth = exports.Agents = exports.Versions = void 0;
5
+ const client_gen_js_1 = require("./client.gen.js");
6
+ const index_js_1 = require("./client/index.js");
7
+ class HeyApiClient {
8
+ constructor(args) {
9
+ this.client = args?.client ?? client_gen_js_1.client;
10
+ }
11
+ }
12
+ class HeyApiRegistry {
13
+ constructor() {
14
+ this.defaultKey = 'default';
15
+ this.instances = new Map();
16
+ }
17
+ get(key) {
18
+ const instance = this.instances.get(key ?? this.defaultKey);
19
+ if (!instance) {
20
+ throw new Error(`No SDK client found. Create one with "new TalqingApi()" to fix this error.`);
21
+ }
22
+ return instance;
23
+ }
24
+ set(value, key) {
25
+ this.instances.set(key ?? this.defaultKey, value);
26
+ }
27
+ }
28
+ class Versions extends HeyApiClient {
29
+ /**
30
+ * Get Agent Version
31
+ *
32
+ * Fetch what one published version of an agent actually contains.
33
+ *
34
+ * `get_agent` lists the versions and when each was published; this returns the
35
+ * frozen definition itself — prompt, models, turn handling and the tool
36
+ * versions it pinned, exactly as they were at that publish. Use it to see what
37
+ * changed between two versions, or between a version and the current draft.
38
+ */
39
+ get(parameters, options) {
40
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }, { in: 'path', key: 'version' }] }]);
41
+ return (options?.client ?? this.client).get({
42
+ responseStyle: 'data',
43
+ security: [{ scheme: 'bearer', type: 'http' }, {
44
+ in: 'cookie',
45
+ name: 'talqing_session',
46
+ type: 'apiKey'
47
+ }],
48
+ url: '/v1/agents/{agent_id}/versions/{version}',
49
+ ...options,
50
+ ...params
51
+ });
52
+ }
53
+ /**
54
+ * Rollback Agent Version
55
+ *
56
+ * Put an earlier published version of an agent back into production.
57
+ *
58
+ * That version becomes live **immediately** and **replaces the current draft**,
59
+ * so any unpublished edits are lost. Calls already in progress finish on the
60
+ * version they started.
61
+ *
62
+ * No new version is created: `published_version` simply points at the older
63
+ * one. The restored draft tracks each tool's latest published version, not the
64
+ * ones this version pinned.
65
+ */
66
+ rollback(parameters, options) {
67
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }, { in: 'path', key: 'version' }] }]);
68
+ return (options?.client ?? this.client).post({
69
+ responseStyle: 'data',
70
+ security: [{ scheme: 'bearer', type: 'http' }, {
71
+ in: 'cookie',
72
+ name: 'talqing_session',
73
+ type: 'apiKey'
74
+ }],
75
+ url: '/v1/agents/{agent_id}/versions/{version}/rollback',
76
+ ...options,
77
+ ...params
78
+ });
79
+ }
80
+ }
81
+ exports.Versions = Versions;
82
+ class Agents extends HeyApiClient {
83
+ /**
84
+ * List Agents
85
+ *
86
+ * List the workspace's agents, newest edit first.
87
+ *
88
+ * Each item carries the full draft config and the published version number
89
+ * (null while the agent has never been published).
90
+ */
91
+ list(parameters, options) {
92
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
93
+ return (options?.client ?? this.client).get({
94
+ responseStyle: 'data',
95
+ security: [{ scheme: 'bearer', type: 'http' }, {
96
+ in: 'cookie',
97
+ name: 'talqing_session',
98
+ type: 'apiKey'
99
+ }],
100
+ url: '/v1/agents',
101
+ ...options,
102
+ ...params
103
+ });
104
+ }
105
+ /**
106
+ * Create Agent
107
+ *
108
+ * Create an agent from a complete config.
109
+ *
110
+ * The config is validated the same way an update is, so unknown models or
111
+ * unpublished tool references are rejected here. Names are unique per
112
+ * workspace. The agent starts unpublished.
113
+ */
114
+ create(parameters, options) {
115
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createAgentRequest', map: 'body' }] }]);
116
+ return (options?.client ?? this.client).post({
117
+ responseStyle: 'data',
118
+ security: [{ scheme: 'bearer', type: 'http' }, {
119
+ in: 'cookie',
120
+ name: 'talqing_session',
121
+ type: 'apiKey'
122
+ }],
123
+ url: '/v1/agents',
124
+ ...options,
125
+ ...params,
126
+ headers: {
127
+ 'Content-Type': 'application/json',
128
+ ...options?.headers,
129
+ ...params.headers
130
+ }
131
+ });
132
+ }
133
+ /**
134
+ * Delete Agent
135
+ *
136
+ * Delete an agent and its published versions permanently.
137
+ */
138
+ delete(parameters, options) {
139
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
140
+ return (options?.client ?? this.client).delete({
141
+ responseStyle: 'data',
142
+ security: [{ scheme: 'bearer', type: 'http' }, {
143
+ in: 'cookie',
144
+ name: 'talqing_session',
145
+ type: 'apiKey'
146
+ }],
147
+ url: '/v1/agents/{agent_id}',
148
+ ...options,
149
+ ...params
150
+ });
151
+ }
152
+ /**
153
+ * Get Agent
154
+ *
155
+ * Fetch one agent's draft config, published version and publish history.
156
+ */
157
+ get(parameters, options) {
158
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
159
+ return (options?.client ?? this.client).get({
160
+ responseStyle: 'data',
161
+ security: [{ scheme: 'bearer', type: 'http' }, {
162
+ in: 'cookie',
163
+ name: 'talqing_session',
164
+ type: 'apiKey'
165
+ }],
166
+ url: '/v1/agents/{agent_id}',
167
+ ...options,
168
+ ...params
169
+ });
170
+ }
171
+ /**
172
+ * Update Agent
173
+ *
174
+ * Replace the agent's draft config with the one supplied.
175
+ *
176
+ * `config` is the complete definition, not a partial patch: whatever it omits
177
+ * reverts to that field's default. Writes land on the draft only — live
178
+ * traffic keeps running the published version until you publish again.
179
+ *
180
+ * Switching `channel` normalizes the media stack: text agents drop stt, tts,
181
+ * realtime, greeting, turn handling and avatar.
182
+ *
183
+ * Setting `realtime` to a speech-to-speech model makes it the whole pipeline —
184
+ * `stt`, `llm` and `tts` are cleared and it handles turn detection itself.
185
+ * Realtime agents have no fallback model, cannot use the 'after each user
186
+ * turn' hook, and only approximate a fixed greeting.
187
+ */
188
+ update(parameters, options) {
189
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }, { key: 'updateAgentRequest', map: 'body' }] }]);
190
+ return (options?.client ?? this.client).patch({
191
+ responseStyle: 'data',
192
+ security: [{ scheme: 'bearer', type: 'http' }, {
193
+ in: 'cookie',
194
+ name: 'talqing_session',
195
+ type: 'apiKey'
196
+ }],
197
+ url: '/v1/agents/{agent_id}',
198
+ ...options,
199
+ ...params,
200
+ headers: {
201
+ 'Content-Type': 'application/json',
202
+ ...options?.headers,
203
+ ...params.headers
204
+ }
205
+ });
206
+ }
207
+ /**
208
+ * Publish Agent
209
+ *
210
+ * Freeze the current draft as a new immutable version and make it live.
211
+ *
212
+ * Validation must pass. Publishing pins every attached tool (and lifecycle
213
+ * hook) to the tool version that is live right now, so republishing a tool does
214
+ * not change this agent's behaviour until the agent is published again.
215
+ */
216
+ publish(parameters, options) {
217
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
218
+ return (options?.client ?? this.client).post({
219
+ responseStyle: 'data',
220
+ security: [{ scheme: 'bearer', type: 'http' }, {
221
+ in: 'cookie',
222
+ name: 'talqing_session',
223
+ type: 'apiKey'
224
+ }],
225
+ url: '/v1/agents/{agent_id}/publish',
226
+ ...options,
227
+ ...params
228
+ });
229
+ }
230
+ /**
231
+ * Validate Agent
232
+ *
233
+ * Run publish-grade validation on the draft without publishing it.
234
+ *
235
+ * Covers everything a draft write checks plus the deeper checks publishing
236
+ * adds: a workspace API key for every provider the agent needs, and the
237
+ * operation trees of attached and hook tools. Returns errors (blocking) and
238
+ * warnings (advisory).
239
+ */
240
+ validate(parameters, options) {
241
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
242
+ return (options?.client ?? this.client).post({
243
+ responseStyle: 'data',
244
+ security: [{ scheme: 'bearer', type: 'http' }, {
245
+ in: 'cookie',
246
+ name: 'talqing_session',
247
+ type: 'apiKey'
248
+ }],
249
+ url: '/v1/agents/{agent_id}/validate',
250
+ ...options,
251
+ ...params
252
+ });
253
+ }
254
+ get versions() {
255
+ return this._versions ?? (this._versions = new Versions({ client: this.client }));
256
+ }
257
+ }
258
+ exports.Agents = Agents;
259
+ class Auth extends HeyApiClient {
260
+ /**
261
+ * Logout
262
+ */
263
+ logout(options) {
264
+ return (options?.client ?? this.client).post({
265
+ responseStyle: 'data',
266
+ url: '/v1/auth/logout',
267
+ ...options
268
+ });
269
+ }
270
+ /**
271
+ * Me
272
+ *
273
+ * Who this credential is: the signed-in user, their role, and the organization.
274
+ *
275
+ * Everything else you can reach is scoped to that organization, and `role`
276
+ * (`ADMIN`, `EDITOR` or `VIEWER`) decides whether writes will be accepted. A
277
+ * user may belong to several organizations with a different role in each; this
278
+ * reports the one this credential is for.
279
+ */
280
+ me(options) {
281
+ return (options?.client ?? this.client).get({
282
+ responseStyle: 'data',
283
+ security: [{ scheme: 'bearer', type: 'http' }, {
284
+ in: 'cookie',
285
+ name: 'talqing_session',
286
+ type: 'apiKey'
287
+ }],
288
+ url: '/v1/auth/me',
289
+ ...options
290
+ });
291
+ }
292
+ }
293
+ exports.Auth = Auth;
294
+ class ProviderKeys extends HeyApiClient {
295
+ /**
296
+ * List Provider Keys
297
+ *
298
+ * List every AI provider and whether this workspace has an API key for it.
299
+ *
300
+ * Talqing is strict BYOK: agents run on the workspace's own provider keys.
301
+ * Publishing fails if the agent needs a provider with no key configured.
302
+ * Every key listed here was accepted by its provider when it was saved.
303
+ */
304
+ list(options) {
305
+ return (options?.client ?? this.client).get({
306
+ responseStyle: 'data',
307
+ security: [{ scheme: 'bearer', type: 'http' }, {
308
+ in: 'cookie',
309
+ name: 'talqing_session',
310
+ type: 'apiKey'
311
+ }],
312
+ url: '/v1/byok',
313
+ ...options
314
+ });
315
+ }
316
+ /**
317
+ * Delete Provider Key
318
+ *
319
+ * Remove this organization's API key for one provider. Agents that need it
320
+ * will stop working and can no longer be published. Organization admins only.
321
+ */
322
+ delete(parameters, options) {
323
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'provider' }] }]);
324
+ return (options?.client ?? this.client).delete({
325
+ responseStyle: 'data',
326
+ security: [{ scheme: 'bearer', type: 'http' }, {
327
+ in: 'cookie',
328
+ name: 'talqing_session',
329
+ type: 'apiKey'
330
+ }],
331
+ url: '/v1/byok/{provider}',
332
+ ...options,
333
+ ...params
334
+ });
335
+ }
336
+ /**
337
+ * Set Provider Key
338
+ *
339
+ * Store this workspace's API key for one provider, replacing any existing key.
340
+ *
341
+ * The key is called against the provider first and only stored if accepted: a
342
+ * rejected key is a 400 that leaves any existing key untouched, and a provider
343
+ * that cannot be reached is a 502. Encrypted at rest and never returned.
344
+ * Organization admins only.
345
+ */
346
+ set(parameters, options) {
347
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'provider' }, { key: 'setProviderKeyRequest', map: 'body' }] }]);
348
+ return (options?.client ?? this.client).put({
349
+ responseStyle: 'data',
350
+ security: [{ scheme: 'bearer', type: 'http' }, {
351
+ in: 'cookie',
352
+ name: 'talqing_session',
353
+ type: 'apiKey'
354
+ }],
355
+ url: '/v1/byok/{provider}',
356
+ ...options,
357
+ ...params,
358
+ headers: {
359
+ 'Content-Type': 'application/json',
360
+ ...options?.headers,
361
+ ...params.headers
362
+ }
363
+ });
364
+ }
365
+ }
366
+ exports.ProviderKeys = ProviderKeys;
367
+ class Analysis extends HeyApiClient {
368
+ /**
369
+ * Backfill Call Analysis
370
+ *
371
+ * Re-analyse past calls with each one's current agent definition.
372
+ *
373
+ * Use this after changing what an agent extracts, to fill in calls that ran
374
+ * under the old definition — and to retry calls whose analysis failed.
375
+ *
376
+ * Each call is analysed by a real model call and re-priced, so the tenant is
377
+ * charged again for every call in the list. Try the definition on one call
378
+ * with `preview_call_analysis` first.
379
+ */
380
+ backfill(parameters, options) {
381
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'backfillAnalysisRequest', map: 'body' }] }]);
382
+ return (options?.client ?? this.client).post({
383
+ responseStyle: 'data',
384
+ security: [{ scheme: 'bearer', type: 'http' }, {
385
+ in: 'cookie',
386
+ name: 'talqing_session',
387
+ type: 'apiKey'
388
+ }],
389
+ url: '/v1/calls/analysis/backfill',
390
+ ...options,
391
+ ...params,
392
+ headers: {
393
+ 'Content-Type': 'application/json',
394
+ ...options?.headers,
395
+ ...params.headers
396
+ }
397
+ });
398
+ }
399
+ /**
400
+ * Preview Call Analysis
401
+ *
402
+ * Try an analysis definition against one past call and see what it finds.
403
+ *
404
+ * Nothing is saved, which makes this the way to tune a summary prompt, a
405
+ * success definition or an extraction field before putting it on the agent.
406
+ * The call is analysed against the agent definition it actually ran. Costs one
407
+ * model call.
408
+ */
409
+ preview(parameters, options) {
410
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }, { key: 'previewAnalysisRequest', map: 'body' }] }]);
411
+ return (options?.client ?? this.client).post({
412
+ responseStyle: 'data',
413
+ security: [{ scheme: 'bearer', type: 'http' }, {
414
+ in: 'cookie',
415
+ name: 'talqing_session',
416
+ type: 'apiKey'
417
+ }],
418
+ url: '/v1/calls/{session_id}/analysis/preview',
419
+ ...options,
420
+ ...params,
421
+ headers: {
422
+ 'Content-Type': 'application/json',
423
+ ...options?.headers,
424
+ ...params.headers
425
+ }
426
+ });
427
+ }
428
+ }
429
+ exports.Analysis = Analysis;
430
+ class Recipients extends HeyApiClient {
431
+ /**
432
+ * List Call Batch Recipients
433
+ *
434
+ * One batch's recipients and how each call went, in the uploaded order.
435
+ *
436
+ * `session_id` is that person's most recent call — pass it to `get_call` for
437
+ * the transcript, recording and cost, and `last_close_reason` says exactly how
438
+ * the attempt ended. A recipient of a cancelled batch reads as `canceled` even
439
+ * though their row was never touched.
440
+ */
441
+ list(parameters, options) {
442
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
443
+ { in: 'path', key: 'batch_id' },
444
+ { in: 'query', key: 'limit' },
445
+ { in: 'query', key: 'offset' },
446
+ { in: 'query', key: 'status' }
447
+ ] }]);
448
+ return (options?.client ?? this.client).get({
449
+ responseStyle: 'data',
450
+ security: [{ scheme: 'bearer', type: 'http' }, {
451
+ in: 'cookie',
452
+ name: 'talqing_session',
453
+ type: 'apiKey'
454
+ }],
455
+ url: '/v1/calls/batches/{batch_id}/recipients',
456
+ ...options,
457
+ ...params
458
+ });
459
+ }
460
+ /**
461
+ * Add Call Batch Recipients
462
+ *
463
+ * Append people to a batch, including one that is already running.
464
+ *
465
+ * Numbers the batch already holds are **skipped and reported**, not rejected —
466
+ * re-uploading a list exported from a CRM is the normal case, and nobody
467
+ * already called is called again. The new rows are dialled after the existing
468
+ * ones.
469
+ */
470
+ add(parameters, options) {
471
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'addRecipientsRequest', map: 'body' }] }]);
472
+ return (options?.client ?? this.client).post({
473
+ responseStyle: 'data',
474
+ security: [{ scheme: 'bearer', type: 'http' }, {
475
+ in: 'cookie',
476
+ name: 'talqing_session',
477
+ type: 'apiKey'
478
+ }],
479
+ url: '/v1/calls/batches/{batch_id}/recipients',
480
+ ...options,
481
+ ...params,
482
+ headers: {
483
+ 'Content-Type': 'application/json',
484
+ ...options?.headers,
485
+ ...params.headers
486
+ }
487
+ });
488
+ }
489
+ }
490
+ exports.Recipients = Recipients;
491
+ class Batches extends HeyApiClient {
492
+ /**
493
+ * List Call Batches
494
+ *
495
+ * List outbound calling batches, newest first, with live progress.
496
+ *
497
+ * `counts` breaks the recipient list down by outcome and `next_dial_at` says
498
+ * when a batch that is not dialling will start again — the clock, not a fault.
499
+ * A `failed` batch carries `failure_reason`: the circuit breaker stopped it
500
+ * after ten consecutive setup failures.
501
+ */
502
+ list(parameters, options) {
503
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
504
+ { in: 'query', key: 'limit' },
505
+ { in: 'query', key: 'offset' },
506
+ { in: 'query', key: 'status' }
507
+ ] }]);
508
+ return (options?.client ?? this.client).get({
509
+ responseStyle: 'data',
510
+ security: [{ scheme: 'bearer', type: 'http' }, {
511
+ in: 'cookie',
512
+ name: 'talqing_session',
513
+ type: 'apiKey'
514
+ }],
515
+ url: '/v1/calls/batches',
516
+ ...options,
517
+ ...params
518
+ });
519
+ }
520
+ /**
521
+ * Create Call Batch
522
+ *
523
+ * Call a list of people with a published agent, now or on a schedule.
524
+ *
525
+ * **This places real, billable PSTN calls** — one per recipient, up to 10 000
526
+ * of them. Only call it when the user has asked for this specific list to be
527
+ * dialled.
528
+ *
529
+ * `recipients[]` carries `to` (any format, normalized to E.164) and
530
+ * `userdata`, the session state behind `{{userdata.field}}` in the prompt and
531
+ * greeting. A number that appears twice is refused with both row numbers.
532
+ *
533
+ * `start_at` and `calling_window` schedule it in the timezone you give;
534
+ * `max_concurrency` and `max_attempts` pace it. A number that was reached is
535
+ * never called twice.
536
+ *
537
+ * Two things you would otherwise learn from an invoice:
538
+ *
539
+ * - **Answering machines are not detected.** Voicemail is answered and billed.
540
+ * - **Calls run your agent's current published version.** Republishing changes
541
+ * every call placed after that moment.
542
+ */
543
+ create(parameters, options) {
544
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createCallBatchRequest', map: 'body' }] }]);
545
+ return (options?.client ?? this.client).post({
546
+ responseStyle: 'data',
547
+ security: [{ scheme: 'bearer', type: 'http' }, {
548
+ in: 'cookie',
549
+ name: 'talqing_session',
550
+ type: 'apiKey'
551
+ }],
552
+ url: '/v1/calls/batches',
553
+ ...options,
554
+ ...params,
555
+ headers: {
556
+ 'Content-Type': 'application/json',
557
+ ...options?.headers,
558
+ ...params.headers
559
+ }
560
+ });
561
+ }
562
+ /**
563
+ * Get Call Batch
564
+ *
565
+ * One batch: its policy, its progress, and why it is or is not dialling.
566
+ *
567
+ * `agent_name` and `from_e164` are read live, so a renamed agent shows its
568
+ * current name and a deleted one shows null.
569
+ */
570
+ get(parameters, options) {
571
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
572
+ return (options?.client ?? this.client).get({
573
+ responseStyle: 'data',
574
+ security: [{ scheme: 'bearer', type: 'http' }, {
575
+ in: 'cookie',
576
+ name: 'talqing_session',
577
+ type: 'apiKey'
578
+ }],
579
+ url: '/v1/calls/batches/{batch_id}',
580
+ ...options,
581
+ ...params
582
+ });
583
+ }
584
+ /**
585
+ * Patch Call Batch
586
+ *
587
+ * Change a batch's policy while it runs. The next pass picks it up.
588
+ *
589
+ * Everything here is policy, so nothing revisits a recipient already called,
590
+ * and calls in flight finish under the policy they were dispatched with. You
591
+ * do not need this to pick up a republished prompt — every call already runs
592
+ * the current published version. `start_at` moves only while the batch is
593
+ * still `scheduled`.
594
+ */
595
+ update(parameters, options) {
596
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'patchCallBatchRequest', map: 'body' }] }]);
597
+ return (options?.client ?? this.client).patch({
598
+ responseStyle: 'data',
599
+ security: [{ scheme: 'bearer', type: 'http' }, {
600
+ in: 'cookie',
601
+ name: 'talqing_session',
602
+ type: 'apiKey'
603
+ }],
604
+ url: '/v1/calls/batches/{batch_id}',
605
+ ...options,
606
+ ...params,
607
+ headers: {
608
+ 'Content-Type': 'application/json',
609
+ ...options?.headers,
610
+ ...params.headers
611
+ }
612
+ });
613
+ }
614
+ /**
615
+ * Cancel Call Batch
616
+ *
617
+ * Stop a batch for good. There is no undo, and a batch cannot be deleted.
618
+ *
619
+ * Everyone not yet called immediately reads as `canceled`. Calls already
620
+ * ringing or in progress are **not** dropped — they run to their natural end,
621
+ * and the batch is only finished once they have.
622
+ */
623
+ cancel(parameters, options) {
624
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
625
+ return (options?.client ?? this.client).post({
626
+ responseStyle: 'data',
627
+ security: [{ scheme: 'bearer', type: 'http' }, {
628
+ in: 'cookie',
629
+ name: 'talqing_session',
630
+ type: 'apiKey'
631
+ }],
632
+ url: '/v1/calls/batches/{batch_id}/cancel',
633
+ ...options,
634
+ ...params
635
+ });
636
+ }
637
+ /**
638
+ * Pause Call Batch
639
+ *
640
+ * Stop placing new calls. Calls already in progress run to their end.
641
+ */
642
+ pause(parameters, options) {
643
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
644
+ return (options?.client ?? this.client).post({
645
+ responseStyle: 'data',
646
+ security: [{ scheme: 'bearer', type: 'http' }, {
647
+ in: 'cookie',
648
+ name: 'talqing_session',
649
+ type: 'apiKey'
650
+ }],
651
+ url: '/v1/calls/batches/{batch_id}/pause',
652
+ ...options,
653
+ ...params
654
+ });
655
+ }
656
+ /**
657
+ * Resume Call Batch
658
+ *
659
+ * Undo a pause and carry on from where the batch stopped.
660
+ *
661
+ * A batch whose `start_at` is still in the future goes back to `scheduled`
662
+ * rather than starting early.
663
+ */
664
+ resume(parameters, options) {
665
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
666
+ return (options?.client ?? this.client).post({
667
+ responseStyle: 'data',
668
+ security: [{ scheme: 'bearer', type: 'http' }, {
669
+ in: 'cookie',
670
+ name: 'talqing_session',
671
+ type: 'apiKey'
672
+ }],
673
+ url: '/v1/calls/batches/{batch_id}/resume',
674
+ ...options,
675
+ ...params
676
+ });
677
+ }
678
+ get recipients() {
679
+ return this._recipients ?? (this._recipients = new Recipients({ client: this.client }));
680
+ }
681
+ }
682
+ exports.Batches = Batches;
683
+ class Recording extends HeyApiClient {
684
+ /**
685
+ * Delete Call Recording
686
+ *
687
+ * Delete the call's recorded media, keeping the call itself.
688
+ *
689
+ * Both the audio and, where the agent watched one, the screen video. The
690
+ * transcript, cost and everything else about the call stay exactly as they are.
691
+ * This is immediate and cannot be undone. Deleting a recording that is already
692
+ * gone succeeds quietly.
693
+ *
694
+ * Deliberately synchronous, unlike `delete_call`: this destroys one or two
695
+ * objects and returns, where deleting a call schedules a redaction across
696
+ * several tables.
697
+ */
698
+ delete(parameters, options) {
699
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }] }]);
700
+ return (options?.client ?? this.client).delete({
701
+ responseStyle: 'data',
702
+ security: [{ scheme: 'bearer', type: 'http' }, {
703
+ in: 'cookie',
704
+ name: 'talqing_session',
705
+ type: 'apiKey'
706
+ }],
707
+ url: '/v1/calls/{session_id}/recording',
708
+ ...options,
709
+ ...params
710
+ });
711
+ }
712
+ /**
713
+ * Get Call Recording
714
+ *
715
+ * Redirect to the call's audio: one stereo Ogg/Opus file.
716
+ *
717
+ * The redirect goes to object storage and expires within the hour, so follow
718
+ * it straight away rather than storing it. It supports `Range`, which is what
719
+ * lets a player seek without downloading the whole call first. Pass
720
+ * `download=true` for a link that saves as `call-{id}.ogg`.
721
+ *
722
+ * The caller is the left channel and the agent is the right, so you can listen
723
+ * to either side alone by splitting the channels — one `ffmpeg -map_channel`
724
+ * away, and what makes the file useful both for hearing the call and for
725
+ * building training data. It is what the agent heard after noise cancellation,
726
+ * not a capture of the phone line, and it does not include background audio,
727
+ * which the agent publishes as its own track.
728
+ *
729
+ * A `404` here means there is nothing to play, and its message says why — the
730
+ * agent had recording off, the call is still running, the recording was
731
+ * deleted by a person or by your retention policy, the caller asked not to be
732
+ * recorded, or it failed to save. Check `recording.state` on the call first to
733
+ * know which without a round trip; `get_call` also returns ready-made
734
+ * `recording.url` and `recording.download_url` links.
735
+ */
736
+ get(parameters, options) {
737
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }, { in: 'query', key: 'download' }] }]);
738
+ return (options?.client ?? this.client).get({
739
+ responseStyle: 'data',
740
+ security: [{ scheme: 'bearer', type: 'http' }, {
741
+ in: 'cookie',
742
+ name: 'talqing_session',
743
+ type: 'apiKey'
744
+ }],
745
+ url: '/v1/calls/{session_id}/recording',
746
+ ...options,
747
+ ...params
748
+ });
749
+ }
750
+ }
751
+ exports.Recording = Recording;
752
+ class ScreenRecording extends HeyApiClient {
753
+ /**
754
+ * Get Call Screen Recording
755
+ *
756
+ * Redirect to the screen the person shared: one 1 fps H.264 file.
757
+ *
758
+ * Only agents with `vision_input.screenshare.record` produce one. It covers the
759
+ * whole call rather than only the shared stretches — the parts where nobody was
760
+ * sharing are black — so its timeline lines up with the audio and the
761
+ * transcript second for second, and a turn's offset into it is the same
762
+ * arithmetic as into the recording.
763
+ *
764
+ * Like the audio, the redirect goes to object storage, expires within the hour
765
+ * and supports `Range`. A `404` says why there is nothing to play, and
766
+ * `screen_recording.state` on the call answers the same question without a
767
+ * round trip — including `not_shared`, which means screen recording was on and
768
+ * nobody ever shared, as opposed to `none`, which means it was off.
769
+ */
770
+ get(parameters, options) {
771
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }, { in: 'query', key: 'download' }] }]);
772
+ return (options?.client ?? this.client).get({
773
+ responseStyle: 'data',
774
+ security: [{ scheme: 'bearer', type: 'http' }, {
775
+ in: 'cookie',
776
+ name: 'talqing_session',
777
+ type: 'apiKey'
778
+ }],
779
+ url: '/v1/calls/{session_id}/screen-recording',
780
+ ...options,
781
+ ...params
782
+ });
783
+ }
784
+ }
785
+ exports.ScreenRecording = ScreenRecording;
786
+ class Calls extends HeyApiClient {
787
+ /**
788
+ * List Calls
789
+ *
790
+ * List voice and video calls, newest first, with status, duration and cost.
791
+ *
792
+ * The window defaults to the last 30 days. Filter by `agent_id`, by `type` to
793
+ * separate web calls from phone calls, by `contact_key` for one customer's
794
+ * whole history, or by `batch_id` for every call one outbound batch placed.
795
+ * Text conversations are not calls — those live under `list_conversations`.
796
+ */
797
+ list(parameters, options) {
798
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
799
+ { in: 'query', key: 'limit' },
800
+ { in: 'query', key: 'offset' },
801
+ { in: 'query', key: 'start' },
802
+ { in: 'query', key: 'end' },
803
+ { in: 'query', key: 'agent_id' },
804
+ { in: 'query', key: 'type' },
805
+ { in: 'query', key: 'status' },
806
+ { in: 'query', key: 'outcome' },
807
+ { in: 'query', key: 'contact_key' },
808
+ { in: 'query', key: 'close_reason' },
809
+ { in: 'query', key: 'batch_id' }
810
+ ] }]);
811
+ return (options?.client ?? this.client).get({
812
+ responseStyle: 'data',
813
+ security: [{ scheme: 'bearer', type: 'http' }, {
814
+ in: 'cookie',
815
+ name: 'talqing_session',
816
+ type: 'apiKey'
817
+ }],
818
+ url: '/v1/calls',
819
+ ...options,
820
+ ...params
821
+ });
822
+ }
823
+ /**
824
+ * Create Outbound Call
825
+ *
826
+ * Dial a real phone number and have a published agent take the call.
827
+ *
828
+ * **This places a live, billable PSTN call** — only call it when the user has
829
+ * asked for this specific call to be made. The agent must be published and on
830
+ * the `voice` channel, and `from_phone_number_id` an active outbound-capable
831
+ * number on a ready carrier account.
832
+ *
833
+ * `userdata` seeds the session state read as `{{userdata.field}}`; keys
834
+ * beginning with `_talqing` are reserved. Prefer `agent_id`; reach for
835
+ * `agent_override`, `agent` or `agent_team` only when the definition is
836
+ * generated per request and would never be reused.
837
+ *
838
+ * It returns when the call is placed, not when it is answered.
839
+ */
840
+ outbound(parameters, options) {
841
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'outboundCallRequest', map: 'body' }] }]);
842
+ return (options?.client ?? this.client).post({
843
+ responseStyle: 'data',
844
+ security: [{ scheme: 'bearer', type: 'http' }, {
845
+ in: 'cookie',
846
+ name: 'talqing_session',
847
+ type: 'apiKey'
848
+ }],
849
+ url: '/v1/calls/outbound',
850
+ ...options,
851
+ ...params,
852
+ headers: {
853
+ 'Content-Type': 'application/json',
854
+ ...options?.headers,
855
+ ...params.headers
856
+ }
857
+ });
858
+ }
859
+ /**
860
+ * Call Stats
861
+ *
862
+ * Totals for a window: call count, minutes, spend and average cost.
863
+ *
864
+ * Spend and `avg_cost_per_call` count only priced calls (`priced_calls`), so
865
+ * a call still being priced does not drag the average down. The window
866
+ * defaults to the last 30 days.
867
+ */
868
+ stats(parameters, options) {
869
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
870
+ { in: 'query', key: 'start' },
871
+ { in: 'query', key: 'end' },
872
+ { in: 'query', key: 'agent_id' }
873
+ ] }]);
874
+ return (options?.client ?? this.client).get({
875
+ responseStyle: 'data',
876
+ security: [{ scheme: 'bearer', type: 'http' }, {
877
+ in: 'cookie',
878
+ name: 'talqing_session',
879
+ type: 'apiKey'
880
+ }],
881
+ url: '/v1/calls/stats',
882
+ ...options,
883
+ ...params
884
+ });
885
+ }
886
+ /**
887
+ * Calls Token
888
+ *
889
+ * Mint a LiveKit token for a browser to open a web call with an agent.
890
+ *
891
+ * `userdata` seeds the session state read as `{{userdata.field}}`; keys
892
+ * beginning with `_talqing` are reserved. Prefer `agent_id`; reach for
893
+ * `agent_override`, `agent` or `agent_team` only when the definition is
894
+ * generated per request and would never be reused.
895
+ *
896
+ * Needs the editor role — these fields run an arbitrary prompt on an arbitrary
897
+ * model, paid for with the workspace's own provider keys.
898
+ *
899
+ * The token only lets a browser connect. To dial a phone, use
900
+ * `create_outbound_call`.
901
+ */
902
+ token(parameters, options) {
903
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'tokenRequest', map: 'body' }] }]);
904
+ return (options?.client ?? this.client).post({
905
+ responseStyle: 'data',
906
+ security: [{ scheme: 'bearer', type: 'http' }, {
907
+ in: 'cookie',
908
+ name: 'talqing_session',
909
+ type: 'apiKey'
910
+ }],
911
+ url: '/v1/calls/token',
912
+ ...options,
913
+ ...params,
914
+ headers: {
915
+ 'Content-Type': 'application/json',
916
+ ...options?.headers,
917
+ ...params.headers
918
+ }
919
+ });
920
+ }
921
+ /**
922
+ * Delete Call
923
+ *
924
+ * Erase this call's content. The call itself stays, with its cost.
925
+ *
926
+ * What goes: the recording, the transcript, every tool call and its output,
927
+ * the session's userdata, the summary, the extracted fields, and the phone
928
+ * numbers on the call. What stays: the call, its duration, status, outcome,
929
+ * per-turn timings and everything it was billed — so past invoices still
930
+ * resolve.
931
+ *
932
+ * Erasing a person's last remaining call also erases what your agents
933
+ * remember about them, so the next call from that number meets an agent that
934
+ * has never heard of them.
935
+ *
936
+ * Returns `202`: the work is scheduled rather than done, which is what stops a
937
+ * request to erase two hundred thousand calls arriving as two hundred thousand
938
+ * synchronous deletes. It normally completes within seconds. This cannot be
939
+ * undone.
940
+ *
941
+ * A call that is still in progress is refused with a `409` — it is still
942
+ * writing, and finalize would put the content back on a row already marked
943
+ * erased. Ask again once it has ended.
944
+ *
945
+ * To delete only the audio and keep the transcript, use
946
+ * `delete_call_recording` instead — that one is immediate.
947
+ */
948
+ delete(parameters, options) {
949
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }] }]);
950
+ return (options?.client ?? this.client).delete({
951
+ responseStyle: 'data',
952
+ security: [{ scheme: 'bearer', type: 'http' }, {
953
+ in: 'cookie',
954
+ name: 'talqing_session',
955
+ type: 'apiKey'
956
+ }],
957
+ url: '/v1/calls/{session_id}',
958
+ ...options,
959
+ ...params
960
+ });
961
+ }
962
+ /**
963
+ * Get Call
964
+ *
965
+ * Everything about one call: health, transcript, tool calls, usage, cost.
966
+ *
967
+ * Start with `snapshot`: it answers "did this call go well?" on its own —
968
+ * `snapshot.issues` names every problem found and `snapshot.ok` is true when
969
+ * there were none.
970
+ *
971
+ * `transcript` carries what was said with every function call and its output,
972
+ * and `session.userdata` is the state the call ended with. `tools`,
973
+ * `starting_prompt` and `greeting` are the frozen version this call actually
974
+ * ran, not the agent's current draft.
975
+ */
976
+ get(parameters, options) {
977
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'session_id' }] }]);
978
+ return (options?.client ?? this.client).get({
979
+ responseStyle: 'data',
980
+ security: [{ scheme: 'bearer', type: 'http' }, {
981
+ in: 'cookie',
982
+ name: 'talqing_session',
983
+ type: 'apiKey'
984
+ }],
985
+ url: '/v1/calls/{session_id}',
986
+ ...options,
987
+ ...params
988
+ });
989
+ }
990
+ get analysis() {
991
+ return this._analysis ?? (this._analysis = new Analysis({ client: this.client }));
992
+ }
993
+ get batches() {
994
+ return this._batches ?? (this._batches = new Batches({ client: this.client }));
995
+ }
996
+ get recording() {
997
+ return this._recording ?? (this._recording = new Recording({ client: this.client }));
998
+ }
999
+ get screenRecording() {
1000
+ return this._screenRecording ?? (this._screenRecording = new ScreenRecording({ client: this.client }));
1001
+ }
1002
+ }
1003
+ exports.Calls = Calls;
1004
+ class Avatars extends HeyApiClient {
1005
+ /**
1006
+ * Catalog Avatars
1007
+ *
1008
+ * The Anam avatar gallery — the faces a video agent can wear.
1009
+ *
1010
+ * An avatar's `id` is what a video agent's `avatar.avatar_id` refers to.
1011
+ * `active_version` and `render_style` are gallery facets, not billing models —
1012
+ * an agent's `avatar.model` always comes from the provider catalog.
1013
+ *
1014
+ * Shows your own Anam account when you have a key for it and Talqing's
1015
+ * otherwise; `workspace_key` says which.
1016
+ */
1017
+ list(parameters, options) {
1018
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1019
+ { in: 'query', key: 'active_version' },
1020
+ { in: 'query', key: 'render_style' },
1021
+ { in: 'query', key: 'offset' },
1022
+ { in: 'query', key: 'limit' }
1023
+ ] }]);
1024
+ return (options?.client ?? this.client).get({
1025
+ responseStyle: 'data',
1026
+ security: [{ scheme: 'bearer', type: 'http' }, {
1027
+ in: 'cookie',
1028
+ name: 'talqing_session',
1029
+ type: 'apiKey'
1030
+ }],
1031
+ url: '/v1/catalog/avatars',
1032
+ ...options,
1033
+ ...params
1034
+ });
1035
+ }
1036
+ }
1037
+ exports.Avatars = Avatars;
1038
+ class Elevenlabs extends HeyApiClient {
1039
+ /**
1040
+ * Add Elevenlabs Voice
1041
+ *
1042
+ * Save a shared ElevenLabs library voice so agents can use it.
1043
+ *
1044
+ * Takes the `voice_id` and `owner_id` of a shared voice and returns the id to
1045
+ * set as an agent's `tts.voice`. Saved into your workspace's own ElevenLabs
1046
+ * account when you have a key for it. Voices already in that account come back
1047
+ * from `catalog_voices` with no `owner_id` and need no save at all.
1048
+ */
1049
+ add(parameters, options) {
1050
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'addVoiceRequest', map: 'body' }] }]);
1051
+ return (options?.client ?? this.client).post({
1052
+ responseStyle: 'data',
1053
+ security: [{ scheme: 'bearer', type: 'http' }, {
1054
+ in: 'cookie',
1055
+ name: 'talqing_session',
1056
+ type: 'apiKey'
1057
+ }],
1058
+ url: '/v1/catalog/voices/elevenlabs/add',
1059
+ ...options,
1060
+ ...params,
1061
+ headers: {
1062
+ 'Content-Type': 'application/json',
1063
+ ...options?.headers,
1064
+ ...params.headers
1065
+ }
1066
+ });
1067
+ }
1068
+ /**
1069
+ * Elevenlabs Voice Settings
1070
+ *
1071
+ * The `stability` and `similarity_boost` an ElevenLabs voice was tuned with.
1072
+ *
1073
+ * Copy these onto an agent's `tts` when you set its `voice`: ElevenLabs
1074
+ * applies a voice's own settings only when a request carries no overrides at
1075
+ * all, and Talqing always sends a speed — so an agent without these numbers
1076
+ * speaks in the generic default rather than the voice its author shipped.
1077
+ *
1078
+ * A shared-library voice must be saved by `add_elevenlabs_voice` first; call
1079
+ * this with the id THAT returned.
1080
+ */
1081
+ settings(parameters, options) {
1082
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'voice_id' }] }]);
1083
+ return (options?.client ?? this.client).get({
1084
+ responseStyle: 'data',
1085
+ security: [{ scheme: 'bearer', type: 'http' }, {
1086
+ in: 'cookie',
1087
+ name: 'talqing_session',
1088
+ type: 'apiKey'
1089
+ }],
1090
+ url: '/v1/catalog/voices/elevenlabs/{voice_id}/settings',
1091
+ ...options,
1092
+ ...params
1093
+ });
1094
+ }
1095
+ }
1096
+ exports.Elevenlabs = Elevenlabs;
1097
+ class Voices extends HeyApiClient {
1098
+ /**
1099
+ * Catalog Voices
1100
+ *
1101
+ * Browse and filter the voices available for one provider.
1102
+ *
1103
+ * A voice's `id` is what an agent's `tts.voice` refers to, or `realtime.voice`
1104
+ * when `kind` is `realtime` — speech-to-speech models pick from their own
1105
+ * roster. Use this before choosing a voice by style, accent or gender rather
1106
+ * than assuming an id exists.
1107
+ *
1108
+ * With a workspace key saved for the provider the listing runs on that key and
1109
+ * leads with your own account's voices; `workspace_key` says whether it did.
1110
+ */
1111
+ list(parameters, options) {
1112
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1113
+ { in: 'query', key: 'provider' },
1114
+ { in: 'query', key: 'model' },
1115
+ { in: 'query', key: 'kind' },
1116
+ { in: 'query', key: 'search' },
1117
+ { in: 'query', key: 'language' },
1118
+ { in: 'query', key: 'accent' },
1119
+ { in: 'query', key: 'gender' },
1120
+ { in: 'query', key: 'page' }
1121
+ ] }]);
1122
+ return (options?.client ?? this.client).get({
1123
+ responseStyle: 'data',
1124
+ security: [{ scheme: 'bearer', type: 'http' }, {
1125
+ in: 'cookie',
1126
+ name: 'talqing_session',
1127
+ type: 'apiKey'
1128
+ }],
1129
+ url: '/v1/catalog/voices',
1130
+ ...options,
1131
+ ...params
1132
+ });
1133
+ }
1134
+ get elevenlabs() {
1135
+ return this._elevenlabs ?? (this._elevenlabs = new Elevenlabs({ client: this.client }));
1136
+ }
1137
+ }
1138
+ exports.Voices = Voices;
1139
+ class Catalog extends HeyApiClient {
1140
+ /**
1141
+ * Get Catalog
1142
+ *
1143
+ * The provider catalog: every LLM, STT, TTS, realtime and avatar model that
1144
+ * agents may use.
1145
+ *
1146
+ * The authoritative source for `provider`/`model` pairs and for what each
1147
+ * entry supports — channels, language codes, speed range, default voice. A
1148
+ * config naming anything not listed here is rejected.
1149
+ *
1150
+ * `realtime` lists the speech-to-speech models. One of those replaces `stt`,
1151
+ * `llm` and `tts` together, so an agent sets either `realtime` or the three
1152
+ * cascade slots, never both.
1153
+ */
1154
+ get(options) {
1155
+ return (options?.client ?? this.client).get({
1156
+ responseStyle: 'data',
1157
+ security: [{ scheme: 'bearer', type: 'http' }, {
1158
+ in: 'cookie',
1159
+ name: 'talqing_session',
1160
+ type: 'apiKey'
1161
+ }],
1162
+ url: '/v1/catalog',
1163
+ ...options
1164
+ });
1165
+ }
1166
+ get avatars() {
1167
+ return this._avatars ?? (this._avatars = new Avatars({ client: this.client }));
1168
+ }
1169
+ get voices() {
1170
+ return this._voices ?? (this._voices = new Voices({ client: this.client }));
1171
+ }
1172
+ }
1173
+ exports.Catalog = Catalog;
1174
+ class Messages extends HeyApiClient {
1175
+ /**
1176
+ * Create Text Message
1177
+ *
1178
+ * Send a message to a text agent — the way to actually talk to one.
1179
+ *
1180
+ * Addressed by `contact_key`, not by id, so the same key always reaches the
1181
+ * same thread. `client_message_id` is a UUID you generate; re-sending with the
1182
+ * same one is ignored rather than duplicated.
1183
+ *
1184
+ * Returns as soon as the message is accepted, carrying only the user's own
1185
+ * item — poll `list_conversation_items` for the agent's reply.
1186
+ */
1187
+ create(parameters, options) {
1188
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'textMessageRequest', map: 'body' }] }]);
1189
+ return (options?.client ?? this.client).post({
1190
+ responseStyle: 'data',
1191
+ security: [{ scheme: 'bearer', type: 'http' }, {
1192
+ in: 'cookie',
1193
+ name: 'talqing_session',
1194
+ type: 'apiKey'
1195
+ }],
1196
+ url: '/v1/conversations/messages',
1197
+ ...options,
1198
+ ...params,
1199
+ headers: {
1200
+ 'Content-Type': 'application/json',
1201
+ ...options?.headers,
1202
+ ...params.headers
1203
+ }
1204
+ });
1205
+ }
1206
+ }
1207
+ exports.Messages = Messages;
1208
+ class Items extends HeyApiClient {
1209
+ /**
1210
+ * List Conversation Items
1211
+ *
1212
+ * The messages in a conversation — the transcript of what was said.
1213
+ *
1214
+ * `order=asc` reads from the beginning; `order=desc` returns the newest
1215
+ * window, still chronological within the page, which is what you want to see
1216
+ * an agent's latest reply. `direction` distinguishes inbound from outbound
1217
+ * and `delivery_status` says whether an outbound message actually landed.
1218
+ */
1219
+ list(parameters, options) {
1220
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1221
+ { in: 'path', key: 'conversation_id' },
1222
+ { in: 'query', key: 'limit' },
1223
+ { in: 'query', key: 'offset' },
1224
+ { in: 'query', key: 'order' }
1225
+ ] }]);
1226
+ return (options?.client ?? this.client).get({
1227
+ responseStyle: 'data',
1228
+ security: [{ scheme: 'bearer', type: 'http' }, {
1229
+ in: 'cookie',
1230
+ name: 'talqing_session',
1231
+ type: 'apiKey'
1232
+ }],
1233
+ url: '/v1/conversations/{conversation_id}/items',
1234
+ ...options,
1235
+ ...params
1236
+ });
1237
+ }
1238
+ }
1239
+ exports.Items = Items;
1240
+ class Sessions extends HeyApiClient {
1241
+ /**
1242
+ * List Conversation Sessions
1243
+ *
1244
+ * The agent sessions behind a conversation, newest first.
1245
+ *
1246
+ * A thread can be handled many times — each phone call, each text window,
1247
+ * each trigger firing is one session, recording which agent version ran and
1248
+ * how it finished. Use it to find out *which* version answered, and to reach
1249
+ * the matching `session_id` for `get_call`.
1250
+ */
1251
+ list(parameters, options) {
1252
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1253
+ { in: 'path', key: 'conversation_id' },
1254
+ { in: 'query', key: 'limit' },
1255
+ { in: 'query', key: 'offset' }
1256
+ ] }]);
1257
+ return (options?.client ?? this.client).get({
1258
+ responseStyle: 'data',
1259
+ security: [{ scheme: 'bearer', type: 'http' }, {
1260
+ in: 'cookie',
1261
+ name: 'talqing_session',
1262
+ type: 'apiKey'
1263
+ }],
1264
+ url: '/v1/conversations/{conversation_id}/sessions',
1265
+ ...options,
1266
+ ...params
1267
+ });
1268
+ }
1269
+ }
1270
+ exports.Sessions = Sessions;
1271
+ class Conversations extends HeyApiClient {
1272
+ /**
1273
+ * List Conversations
1274
+ *
1275
+ * List conversations across every channel, most recently active first.
1276
+ *
1277
+ * One conversation is one bounded stretch of talking — a web chat, a Telegram
1278
+ * thread, or a single phone call — with `surface` saying which. Several of them
1279
+ * can belong to the same person: pass `contact_key` to list only theirs.
1280
+ */
1281
+ list(parameters, options) {
1282
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1283
+ { in: 'query', key: 'limit' },
1284
+ { in: 'query', key: 'offset' },
1285
+ { in: 'query', key: 'agent_id' },
1286
+ { in: 'query', key: 'contact_key' }
1287
+ ] }]);
1288
+ return (options?.client ?? this.client).get({
1289
+ responseStyle: 'data',
1290
+ security: [{ scheme: 'bearer', type: 'http' }, {
1291
+ in: 'cookie',
1292
+ name: 'talqing_session',
1293
+ type: 'apiKey'
1294
+ }],
1295
+ url: '/v1/conversations',
1296
+ ...options,
1297
+ ...params
1298
+ });
1299
+ }
1300
+ /**
1301
+ * Create Text Conversation
1302
+ *
1303
+ * Open a text conversation with a published text agent.
1304
+ *
1305
+ * `contact_key` is your own stable id for the person you are talking to —
1306
+ * unique in the workspace, and how you reach them again. `userdata` seeds what
1307
+ * the agent knows about them, readable as `{{userdata.field}}` from the
1308
+ * agent's tools.
1309
+ *
1310
+ * Creating the conversation does not send anything; call `create_text_message`
1311
+ * to say something.
1312
+ */
1313
+ create(parameters, options) {
1314
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createTextConversationRequest', map: 'body' }] }]);
1315
+ return (options?.client ?? this.client).post({
1316
+ responseStyle: 'data',
1317
+ security: [{ scheme: 'bearer', type: 'http' }, {
1318
+ in: 'cookie',
1319
+ name: 'talqing_session',
1320
+ type: 'apiKey'
1321
+ }],
1322
+ url: '/v1/conversations',
1323
+ ...options,
1324
+ ...params,
1325
+ headers: {
1326
+ 'Content-Type': 'application/json',
1327
+ ...options?.headers,
1328
+ ...params.headers
1329
+ }
1330
+ });
1331
+ }
1332
+ /**
1333
+ * Get Conversation
1334
+ *
1335
+ * Read one conversation's header: agent, surface, summary and userdata.
1336
+ *
1337
+ * `userdata` is what the agent knows about the *contact* — what its tools
1338
+ * published to the `userdata` store, across every conversation with them. For
1339
+ * what one call ended up knowing, read a session's own `userdata` from
1340
+ * `list_conversation_sessions`. The messages are in `list_conversation_items`.
1341
+ */
1342
+ get(parameters, options) {
1343
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'conversation_id' }] }]);
1344
+ return (options?.client ?? this.client).get({
1345
+ responseStyle: 'data',
1346
+ security: [{ scheme: 'bearer', type: 'http' }, {
1347
+ in: 'cookie',
1348
+ name: 'talqing_session',
1349
+ type: 'apiKey'
1350
+ }],
1351
+ url: '/v1/conversations/{conversation_id}',
1352
+ ...options,
1353
+ ...params
1354
+ });
1355
+ }
1356
+ /**
1357
+ * Patch Conversation
1358
+ *
1359
+ * Edit a conversation's summary, userdata or metadata.
1360
+ *
1361
+ * Writing `userdata` changes what the agent sees as `{{userdata.field}}` on the
1362
+ * next turn — the way to correct or preload what it knows from outside a call.
1363
+ * It belongs to the *contact*, so it reaches every conversation with them, not
1364
+ * just this one. Each field you send replaces that whole object; omitted fields
1365
+ * are left alone.
1366
+ */
1367
+ update(parameters, options) {
1368
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'conversation_id' }, { key: 'patchConversationRequest', map: 'body' }] }]);
1369
+ return (options?.client ?? this.client).patch({
1370
+ responseStyle: 'data',
1371
+ security: [{ scheme: 'bearer', type: 'http' }, {
1372
+ in: 'cookie',
1373
+ name: 'talqing_session',
1374
+ type: 'apiKey'
1375
+ }],
1376
+ url: '/v1/conversations/{conversation_id}',
1377
+ ...options,
1378
+ ...params,
1379
+ headers: {
1380
+ 'Content-Type': 'application/json',
1381
+ ...options?.headers,
1382
+ ...params.headers
1383
+ }
1384
+ });
1385
+ }
1386
+ /**
1387
+ * Conversation Event Stream
1388
+ *
1389
+ * Watch one conversation happen: a snapshot, then every item and turn live.
1390
+ *
1391
+ * Frames: `conversation.snapshot` (the conversation and its items, sent first
1392
+ * and on every reconnect), `item.created`, `item.delivery_updated`, `turn` and
1393
+ * `turn.failed` (turn lifecycle), and `assistant.started` / `assistant.delta`
1394
+ * / `assistant.completed` for the reply as it is generated.
1395
+ *
1396
+ * Nothing here is canonical — a dropped frame is recovered by reconnecting
1397
+ * (the snapshot re-syncs) or by `list_conversation_items`.
1398
+ */
1399
+ events(parameters, options) {
1400
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'conversation_id' }] }]);
1401
+ return (options?.client ?? this.client).sse.get({
1402
+ responseStyle: 'data',
1403
+ security: [{ scheme: 'bearer', type: 'http' }, {
1404
+ in: 'cookie',
1405
+ name: 'talqing_session',
1406
+ type: 'apiKey'
1407
+ }],
1408
+ url: '/v1/conversations/{conversation_id}/events',
1409
+ ...options,
1410
+ ...params
1411
+ });
1412
+ }
1413
+ /**
1414
+ * Get Conversation Snapshot
1415
+ *
1416
+ * Did this conversation go well? One verdict over the whole thread.
1417
+ *
1418
+ * `issues` names every problem found across every session in the thread —
1419
+ * errors, failed tools, slow responses, a bad connection — and `ok` is true
1420
+ * when there were none. Cost and duration sum across sessions; latency and
1421
+ * tooling come from the merged timeline.
1422
+ */
1423
+ snapshot(parameters, options) {
1424
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'conversation_id' }] }]);
1425
+ return (options?.client ?? this.client).get({
1426
+ responseStyle: 'data',
1427
+ security: [{ scheme: 'bearer', type: 'http' }, {
1428
+ in: 'cookie',
1429
+ name: 'talqing_session',
1430
+ type: 'apiKey'
1431
+ }],
1432
+ url: '/v1/conversations/{conversation_id}/snapshot',
1433
+ ...options,
1434
+ ...params
1435
+ });
1436
+ }
1437
+ get messages() {
1438
+ return this._messages ?? (this._messages = new Messages({ client: this.client }));
1439
+ }
1440
+ get items() {
1441
+ return this._items ?? (this._items = new Items({ client: this.client }));
1442
+ }
1443
+ get sessions() {
1444
+ return this._sessions ?? (this._sessions = new Sessions({ client: this.client }));
1445
+ }
1446
+ }
1447
+ exports.Conversations = Conversations;
1448
+ class Agents2 extends HeyApiClient {
1449
+ /**
1450
+ * Agent Copilot Send Message
1451
+ *
1452
+ * Say something to AgentCoPilot. The reply arrives on the stream, not here.
1453
+ *
1454
+ * Returns as soon as the turn is queued; watch `turn` and `message` frames
1455
+ * on the matching `/stream` for what it does.
1456
+ */
1457
+ send(parameters, options) {
1458
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }, { key: 'sendMessageRequest', map: 'body' }] }]);
1459
+ return (options?.client ?? this.client).post({
1460
+ responseStyle: 'data',
1461
+ security: [{ scheme: 'bearer', type: 'http' }, {
1462
+ in: 'cookie',
1463
+ name: 'talqing_session',
1464
+ type: 'apiKey'
1465
+ }],
1466
+ url: '/v1/copilot/agents/{agent_id}/messages',
1467
+ ...options,
1468
+ ...params,
1469
+ headers: {
1470
+ 'Content-Type': 'application/json',
1471
+ ...options?.headers,
1472
+ ...params.headers
1473
+ }
1474
+ });
1475
+ }
1476
+ /**
1477
+ * Agent Copilot Stream
1478
+ *
1479
+ * AgentCoPilot's conversation for one agent, as its editor rail shows it.
1480
+ *
1481
+ * Frames: `snapshot` (the whole conversation, sent first and on every
1482
+ * reconnect), `message` (one new message), `turn` (that turn's lifecycle —
1483
+ * `running`, `done`, `error`, `canceled`).
1484
+ */
1485
+ stream(parameters, options) {
1486
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'agent_id' }] }]);
1487
+ return (options?.client ?? this.client).sse.get({
1488
+ responseStyle: 'data',
1489
+ security: [{ scheme: 'bearer', type: 'http' }, {
1490
+ in: 'cookie',
1491
+ name: 'talqing_session',
1492
+ type: 'apiKey'
1493
+ }],
1494
+ url: '/v1/copilot/agents/{agent_id}/stream',
1495
+ ...options,
1496
+ ...params
1497
+ });
1498
+ }
1499
+ }
1500
+ exports.Agents2 = Agents2;
1501
+ class Knowledge extends HeyApiClient {
1502
+ /**
1503
+ * Knowledge Copilot Send Message
1504
+ *
1505
+ * Say something to KnowledgeCoPilot. The reply arrives on the stream, not here.
1506
+ *
1507
+ * Returns as soon as the turn is queued; watch `turn` and `message` frames
1508
+ * on the matching `/stream` for what it does.
1509
+ */
1510
+ send(parameters, options) {
1511
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { key: 'sendMessageRequest', map: 'body' }] }]);
1512
+ return (options?.client ?? this.client).post({
1513
+ responseStyle: 'data',
1514
+ security: [{ scheme: 'bearer', type: 'http' }, {
1515
+ in: 'cookie',
1516
+ name: 'talqing_session',
1517
+ type: 'apiKey'
1518
+ }],
1519
+ url: '/v1/copilot/knowledge/{kb_id}/messages',
1520
+ ...options,
1521
+ ...params,
1522
+ headers: {
1523
+ 'Content-Type': 'application/json',
1524
+ ...options?.headers,
1525
+ ...params.headers
1526
+ }
1527
+ });
1528
+ }
1529
+ /**
1530
+ * Knowledge Copilot Stream
1531
+ *
1532
+ * KnowledgeCoPilot's curation chat for one knowledge base.
1533
+ *
1534
+ * Frames: `snapshot` (the whole conversation, sent first and on every
1535
+ * reconnect), `message` (one new message), `turn` (that turn's lifecycle —
1536
+ * `running`, `done`, `error`, `canceled`).
1537
+ */
1538
+ stream(parameters, options) {
1539
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
1540
+ return (options?.client ?? this.client).sse.get({
1541
+ responseStyle: 'data',
1542
+ security: [{ scheme: 'bearer', type: 'http' }, {
1543
+ in: 'cookie',
1544
+ name: 'talqing_session',
1545
+ type: 'apiKey'
1546
+ }],
1547
+ url: '/v1/copilot/knowledge/{kb_id}/stream',
1548
+ ...options,
1549
+ ...params
1550
+ });
1551
+ }
1552
+ }
1553
+ exports.Knowledge = Knowledge;
1554
+ class Tasks extends HeyApiClient {
1555
+ /**
1556
+ * Task Copilot Send Message
1557
+ *
1558
+ * Say something to TaskCoPilot. The reply arrives on the stream, not here.
1559
+ *
1560
+ * Returns as soon as the turn is queued; watch `turn` and `message` frames
1561
+ * on the matching `/stream` for what it does.
1562
+ */
1563
+ send(parameters, options) {
1564
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'sendMessageRequest', map: 'body' }] }]);
1565
+ return (options?.client ?? this.client).post({
1566
+ responseStyle: 'data',
1567
+ security: [{ scheme: 'bearer', type: 'http' }, {
1568
+ in: 'cookie',
1569
+ name: 'talqing_session',
1570
+ type: 'apiKey'
1571
+ }],
1572
+ url: '/v1/copilot/tasks/{task_id}/messages',
1573
+ ...options,
1574
+ ...params,
1575
+ headers: {
1576
+ 'Content-Type': 'application/json',
1577
+ ...options?.headers,
1578
+ ...params.headers
1579
+ }
1580
+ });
1581
+ }
1582
+ /**
1583
+ * Task Copilot Stream
1584
+ *
1585
+ * TaskCoPilot's conversation for one agent task, as its editor rail shows it.
1586
+ *
1587
+ * Frames: `snapshot` (the whole conversation, sent first and on every
1588
+ * reconnect), `message` (one new message), `turn` (that turn's lifecycle —
1589
+ * `running`, `done`, `error`, `canceled`).
1590
+ */
1591
+ stream(parameters, options) {
1592
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
1593
+ return (options?.client ?? this.client).sse.get({
1594
+ responseStyle: 'data',
1595
+ security: [{ scheme: 'bearer', type: 'http' }, {
1596
+ in: 'cookie',
1597
+ name: 'talqing_session',
1598
+ type: 'apiKey'
1599
+ }],
1600
+ url: '/v1/copilot/tasks/{task_id}/stream',
1601
+ ...options,
1602
+ ...params
1603
+ });
1604
+ }
1605
+ }
1606
+ exports.Tasks = Tasks;
1607
+ class Tools extends HeyApiClient {
1608
+ /**
1609
+ * Tool Copilot Send Message
1610
+ *
1611
+ * Say something to ToolCoPilot. The reply arrives on the stream, not here.
1612
+ *
1613
+ * Returns as soon as the turn is queued; watch `turn` and `message` frames
1614
+ * on the matching `/stream` for what it does.
1615
+ */
1616
+ send(parameters, options) {
1617
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { key: 'sendMessageRequest', map: 'body' }] }]);
1618
+ return (options?.client ?? this.client).post({
1619
+ responseStyle: 'data',
1620
+ security: [{ scheme: 'bearer', type: 'http' }, {
1621
+ in: 'cookie',
1622
+ name: 'talqing_session',
1623
+ type: 'apiKey'
1624
+ }],
1625
+ url: '/v1/copilot/tools/{tool_id}/messages',
1626
+ ...options,
1627
+ ...params,
1628
+ headers: {
1629
+ 'Content-Type': 'application/json',
1630
+ ...options?.headers,
1631
+ ...params.headers
1632
+ }
1633
+ });
1634
+ }
1635
+ /**
1636
+ * Tool Copilot Stream
1637
+ *
1638
+ * ToolCoPilot's conversation for one tool, as its editor rail shows it.
1639
+ *
1640
+ * Frames: `snapshot` (the whole conversation, sent first and on every
1641
+ * reconnect), `message` (one new message), `turn` (that turn's lifecycle —
1642
+ * `running`, `done`, `error`, `canceled`).
1643
+ */
1644
+ stream(parameters, options) {
1645
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }] }]);
1646
+ return (options?.client ?? this.client).sse.get({
1647
+ responseStyle: 'data',
1648
+ security: [{ scheme: 'bearer', type: 'http' }, {
1649
+ in: 'cookie',
1650
+ name: 'talqing_session',
1651
+ type: 'apiKey'
1652
+ }],
1653
+ url: '/v1/copilot/tools/{tool_id}/stream',
1654
+ ...options,
1655
+ ...params
1656
+ });
1657
+ }
1658
+ }
1659
+ exports.Tools = Tools;
1660
+ class Copilot extends HeyApiClient {
1661
+ get agents() {
1662
+ return this._agents ?? (this._agents = new Agents2({ client: this.client }));
1663
+ }
1664
+ get knowledge() {
1665
+ return this._knowledge ?? (this._knowledge = new Knowledge({ client: this.client }));
1666
+ }
1667
+ get tasks() {
1668
+ return this._tasks ?? (this._tasks = new Tasks({ client: this.client }));
1669
+ }
1670
+ get tools() {
1671
+ return this._tools ?? (this._tools = new Tools({ client: this.client }));
1672
+ }
1673
+ }
1674
+ exports.Copilot = Copilot;
1675
+ class Recipients2 extends HeyApiClient {
1676
+ /**
1677
+ * List Email Batch Recipients
1678
+ *
1679
+ * One batch's rows, in the order they were uploaded.
1680
+ *
1681
+ * Each row carries `columns` — the merged space of what you uploaded, what the
1682
+ * task produced and what a person edited, in that precedence — plus the three
1683
+ * halves separately, so an edited cell can be told from the model's own value.
1684
+ * `not_ready_reason` is why this row cannot be sent yet, and is null when it
1685
+ * can be.
1686
+ */
1687
+ list(parameters, options) {
1688
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1689
+ { in: 'path', key: 'batch_id' },
1690
+ { in: 'query', key: 'limit' },
1691
+ { in: 'query', key: 'offset' },
1692
+ { in: 'query', key: 'status' }
1693
+ ] }]);
1694
+ return (options?.client ?? this.client).get({
1695
+ responseStyle: 'data',
1696
+ security: [{ scheme: 'bearer', type: 'http' }, {
1697
+ in: 'cookie',
1698
+ name: 'talqing_session',
1699
+ type: 'apiKey'
1700
+ }],
1701
+ url: '/v1/email/batches/{batch_id}/recipients',
1702
+ ...options,
1703
+ ...params
1704
+ });
1705
+ }
1706
+ /**
1707
+ * Patch Email Batch Recipient
1708
+ *
1709
+ * Edit cells on one row before it is sent.
1710
+ *
1711
+ * `overrides` is merged over the uploaded and generated values at send time and
1712
+ * stored apart from both, so what the model wrote stays readable underneath.
1713
+ * Sending an empty value clears that edit rather than sending an empty field —
1714
+ * the way to send nothing is to skip the row. A row that has already been
1715
+ * queued or sent can no longer be edited.
1716
+ */
1717
+ update(parameters, options) {
1718
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1719
+ { in: 'path', key: 'batch_id' },
1720
+ { in: 'path', key: 'recipient_id' },
1721
+ { key: 'patchEmailRecipientRequest', map: 'body' }
1722
+ ] }]);
1723
+ return (options?.client ?? this.client).patch({
1724
+ responseStyle: 'data',
1725
+ security: [{ scheme: 'bearer', type: 'http' }, {
1726
+ in: 'cookie',
1727
+ name: 'talqing_session',
1728
+ type: 'apiKey'
1729
+ }],
1730
+ url: '/v1/email/batches/{batch_id}/recipients/{recipient_id}',
1731
+ ...options,
1732
+ ...params,
1733
+ headers: {
1734
+ 'Content-Type': 'application/json',
1735
+ ...options?.headers,
1736
+ ...params.headers
1737
+ }
1738
+ });
1739
+ }
1740
+ /**
1741
+ * Restore Email Batch Recipients
1742
+ *
1743
+ * Put skipped rows back. `selection: "all_eligible"` means every skipped row.
1744
+ */
1745
+ restore(parameters, options) {
1746
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
1747
+ return (options?.client ?? this.client).post({
1748
+ responseStyle: 'data',
1749
+ security: [{ scheme: 'bearer', type: 'http' }, {
1750
+ in: 'cookie',
1751
+ name: 'talqing_session',
1752
+ type: 'apiKey'
1753
+ }],
1754
+ url: '/v1/email/batches/{batch_id}/restore',
1755
+ ...options,
1756
+ ...params,
1757
+ headers: {
1758
+ 'Content-Type': 'application/json',
1759
+ ...options?.headers,
1760
+ ...params.headers
1761
+ }
1762
+ });
1763
+ }
1764
+ /**
1765
+ * Retry Email Batch Recipients
1766
+ *
1767
+ * Draft rows whose first attempt failed, again.
1768
+ *
1769
+ * `selection: "all_eligible"` means every row whose drafting failed. This is
1770
+ * the one action that revives a batch that has already finished drafting: it
1771
+ * goes back to `drafting` and picks up exactly the rows you retried — the
1772
+ * alternative would be telling you that twelve failed rows are unrecoverable
1773
+ * because the other 4 988 finished first.
1774
+ */
1775
+ retry(parameters, options) {
1776
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
1777
+ return (options?.client ?? this.client).post({
1778
+ responseStyle: 'data',
1779
+ security: [{ scheme: 'bearer', type: 'http' }, {
1780
+ in: 'cookie',
1781
+ name: 'talqing_session',
1782
+ type: 'apiKey'
1783
+ }],
1784
+ url: '/v1/email/batches/{batch_id}/retry',
1785
+ ...options,
1786
+ ...params,
1787
+ headers: {
1788
+ 'Content-Type': 'application/json',
1789
+ ...options?.headers,
1790
+ ...params.headers
1791
+ }
1792
+ });
1793
+ }
1794
+ /**
1795
+ * Send Email Batch Recipients
1796
+ *
1797
+ * Send the rows you name. **This mails real people and cannot be undone.**
1798
+ *
1799
+ * At most 50 rows per call, named one by one — there is no "select all" and no
1800
+ * bulk form of this. A row whose `to`, `subject` or `body` does not resolve
1801
+ * comes back in `rejected` and stays a draft; fix it with
1802
+ * `patch_email_batch_recipient` and try again.
1803
+ *
1804
+ * `from_email`, `from_name` and `reply_to` override the sender for this call
1805
+ * only, and must be on a domain verified on the same Resend account.
1806
+ */
1807
+ send(parameters, options) {
1808
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'sendEmailBatchRequest', map: 'body' }] }]);
1809
+ return (options?.client ?? this.client).post({
1810
+ responseStyle: 'data',
1811
+ security: [{ scheme: 'bearer', type: 'http' }, {
1812
+ in: 'cookie',
1813
+ name: 'talqing_session',
1814
+ type: 'apiKey'
1815
+ }],
1816
+ url: '/v1/email/batches/{batch_id}/send',
1817
+ ...options,
1818
+ ...params,
1819
+ headers: {
1820
+ 'Content-Type': 'application/json',
1821
+ ...options?.headers,
1822
+ ...params.headers
1823
+ }
1824
+ });
1825
+ }
1826
+ /**
1827
+ * Skip Email Batch Recipients
1828
+ *
1829
+ * Take drafted rows out of consideration. Reversible with `restore`.
1830
+ *
1831
+ * Takes either `recipient_ids` or `selection: "all_eligible"`, which here means
1832
+ * every row that has a draft. The reversible verbs keep that shorthand while
1833
+ * `send` does not, because the rule is about irreversibility rather than bulk.
1834
+ */
1835
+ skip(parameters, options) {
1836
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'selectRecipientsRequest', map: 'body' }] }]);
1837
+ return (options?.client ?? this.client).post({
1838
+ responseStyle: 'data',
1839
+ security: [{ scheme: 'bearer', type: 'http' }, {
1840
+ in: 'cookie',
1841
+ name: 'talqing_session',
1842
+ type: 'apiKey'
1843
+ }],
1844
+ url: '/v1/email/batches/{batch_id}/skip',
1845
+ ...options,
1846
+ ...params,
1847
+ headers: {
1848
+ 'Content-Type': 'application/json',
1849
+ ...options?.headers,
1850
+ ...params.headers
1851
+ }
1852
+ });
1853
+ }
1854
+ }
1855
+ exports.Recipients2 = Recipients2;
1856
+ class Batches2 extends HeyApiClient {
1857
+ /**
1858
+ * List Email Batches
1859
+ *
1860
+ * List email batches, newest first.
1861
+ *
1862
+ * `status` is about **drafting** and nothing else: `scheduled`, `drafting`,
1863
+ * `paused`, `drafted`, `canceled`, `failed`. A `drafted` batch is one whose
1864
+ * drafts are ready to review — it says nothing about how many have been sent,
1865
+ * which is what `counts` is for.
1866
+ */
1867
+ list(parameters, options) {
1868
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
1869
+ { in: 'query', key: 'limit' },
1870
+ { in: 'query', key: 'offset' },
1871
+ { in: 'query', key: 'status' }
1872
+ ] }]);
1873
+ return (options?.client ?? this.client).get({
1874
+ responseStyle: 'data',
1875
+ security: [{ scheme: 'bearer', type: 'http' }, {
1876
+ in: 'cookie',
1877
+ name: 'talqing_session',
1878
+ type: 'apiKey'
1879
+ }],
1880
+ url: '/v1/email/batches',
1881
+ ...options,
1882
+ ...params
1883
+ });
1884
+ }
1885
+ /**
1886
+ * Create Email Batch
1887
+ *
1888
+ * Create an email batch: a list, an agent task that drafts each row, and a
1889
+ * connected Resend account to send from.
1890
+ *
1891
+ * **Read your provider's terms first.** Resend's Acceptable Use Policy
1892
+ * prohibits unsolicited mail of any kind — cold outreach, purchased lists,
1893
+ * scraped contacts — and this runs on your account under your agreement.
1894
+ *
1895
+ * **Nothing is sent that a person has not selected.** Creating a batch only
1896
+ * starts drafting; sending is a separate call over at most 50 named rows.
1897
+ *
1898
+ * **Every row runs your task as it stands right now** — a task has no
1899
+ * versions, so editing it mid-batch changes every row drafted after that.
1900
+ *
1901
+ * `field_map` points `to`, `subject` and `body` at a column of your list or at
1902
+ * a field the task produces. An invalid batch is a 400 listing every problem.
1903
+ *
1904
+ * There is no spend cap: every row runs the task and is billed, so a 5 000-row
1905
+ * batch doing research costs 5 000 task runs whether or not anything is sent.
1906
+ */
1907
+ create(parameters, options) {
1908
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createEmailBatchRequest', map: 'body' }] }]);
1909
+ return (options?.client ?? this.client).post({
1910
+ responseStyle: 'data',
1911
+ security: [{ scheme: 'bearer', type: 'http' }, {
1912
+ in: 'cookie',
1913
+ name: 'talqing_session',
1914
+ type: 'apiKey'
1915
+ }],
1916
+ url: '/v1/email/batches',
1917
+ ...options,
1918
+ ...params,
1919
+ headers: {
1920
+ 'Content-Type': 'application/json',
1921
+ ...options?.headers,
1922
+ ...params.headers
1923
+ }
1924
+ });
1925
+ }
1926
+ /**
1927
+ * Get Email Batch
1928
+ *
1929
+ * One batch: its policy, its per-status counts, what drafting has cost so
1930
+ * far, and — while it is waiting on a start time or a closed window —
1931
+ * `next_draft_at`.
1932
+ */
1933
+ get(parameters, options) {
1934
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
1935
+ return (options?.client ?? this.client).get({
1936
+ responseStyle: 'data',
1937
+ security: [{ scheme: 'bearer', type: 'http' }, {
1938
+ in: 'cookie',
1939
+ name: 'talqing_session',
1940
+ type: 'apiKey'
1941
+ }],
1942
+ url: '/v1/email/batches/{batch_id}',
1943
+ ...options,
1944
+ ...params
1945
+ });
1946
+ }
1947
+ /**
1948
+ * Patch Email Batch
1949
+ *
1950
+ * Edit a batch's policy. The next drafting pass reads the new row.
1951
+ *
1952
+ * Pacing and the calling window are editable at any time. The sender, the body
1953
+ * format and the field map freeze once the batch has sent anything — changing
1954
+ * them then would make the rows already delivered no longer describe what they
1955
+ * were sent as. `start_at` moves only while the batch is still scheduled.
1956
+ */
1957
+ update(parameters, options) {
1958
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }, { key: 'patchEmailBatchRequest', map: 'body' }] }]);
1959
+ return (options?.client ?? this.client).patch({
1960
+ responseStyle: 'data',
1961
+ security: [{ scheme: 'bearer', type: 'http' }, {
1962
+ in: 'cookie',
1963
+ name: 'talqing_session',
1964
+ type: 'apiKey'
1965
+ }],
1966
+ url: '/v1/email/batches/{batch_id}',
1967
+ ...options,
1968
+ ...params,
1969
+ headers: {
1970
+ 'Content-Type': 'application/json',
1971
+ ...options?.headers,
1972
+ ...params.headers
1973
+ }
1974
+ });
1975
+ }
1976
+ /**
1977
+ * Cancel Email Batch
1978
+ *
1979
+ * Stop drafting for good. This is the only terminal action — a batch cannot
1980
+ * be deleted, because it is the record of what was sent to whom.
1981
+ *
1982
+ * Rows already drafted are **not** touched: cancelling stops drafting, and
1983
+ * drafts already produced are still worth reviewing and sending. Rows never
1984
+ * reached report as `canceled`.
1985
+ */
1986
+ cancel(parameters, options) {
1987
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
1988
+ return (options?.client ?? this.client).post({
1989
+ responseStyle: 'data',
1990
+ security: [{ scheme: 'bearer', type: 'http' }, {
1991
+ in: 'cookie',
1992
+ name: 'talqing_session',
1993
+ type: 'apiKey'
1994
+ }],
1995
+ url: '/v1/email/batches/{batch_id}/cancel',
1996
+ ...options,
1997
+ ...params
1998
+ });
1999
+ }
2000
+ /**
2001
+ * Pause Email Batch
2002
+ *
2003
+ * Stop drafting new rows. Runs already in flight finish.
2004
+ *
2005
+ * A paused batch has nothing scheduled at all until you resume it. Drafts
2006
+ * already produced stay reviewable and sendable.
2007
+ */
2008
+ pause(parameters, options) {
2009
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
2010
+ return (options?.client ?? this.client).post({
2011
+ responseStyle: 'data',
2012
+ security: [{ scheme: 'bearer', type: 'http' }, {
2013
+ in: 'cookie',
2014
+ name: 'talqing_session',
2015
+ type: 'apiKey'
2016
+ }],
2017
+ url: '/v1/email/batches/{batch_id}/pause',
2018
+ ...options,
2019
+ ...params
2020
+ });
2021
+ }
2022
+ /**
2023
+ * Resume Email Batch
2024
+ *
2025
+ * Undo a pause and start drafting again from where it stopped.
2026
+ */
2027
+ resume(parameters, options) {
2028
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'batch_id' }] }]);
2029
+ return (options?.client ?? this.client).post({
2030
+ responseStyle: 'data',
2031
+ security: [{ scheme: 'bearer', type: 'http' }, {
2032
+ in: 'cookie',
2033
+ name: 'talqing_session',
2034
+ type: 'apiKey'
2035
+ }],
2036
+ url: '/v1/email/batches/{batch_id}/resume',
2037
+ ...options,
2038
+ ...params
2039
+ });
2040
+ }
2041
+ get recipients() {
2042
+ return this._recipients ?? (this._recipients = new Recipients2({ client: this.client }));
2043
+ }
2044
+ }
2045
+ exports.Batches2 = Batches2;
2046
+ class Senders extends HeyApiClient {
2047
+ /**
2048
+ * List Email Senders
2049
+ *
2050
+ * The domains a connected email account may send from, right now.
2051
+ *
2052
+ * Domains rather than addresses, because that is what Resend verifies: any
2053
+ * local part on a verified domain sends. Read live off the account, and this
2054
+ * is what a `from_email` is checked against — both the batch's default and a
2055
+ * per-send override.
2056
+ */
2057
+ list(parameters, options) {
2058
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'integration_id' }] }]);
2059
+ return (options?.client ?? this.client).get({
2060
+ responseStyle: 'data',
2061
+ security: [{ scheme: 'bearer', type: 'http' }, {
2062
+ in: 'cookie',
2063
+ name: 'talqing_session',
2064
+ type: 'apiKey'
2065
+ }],
2066
+ url: '/v1/email/senders',
2067
+ ...options,
2068
+ ...params
2069
+ });
2070
+ }
2071
+ }
2072
+ exports.Senders = Senders;
2073
+ class Email extends HeyApiClient {
2074
+ get batches() {
2075
+ return this._batches ?? (this._batches = new Batches2({ client: this.client }));
2076
+ }
2077
+ get senders() {
2078
+ return this._senders ?? (this._senders = new Senders({ client: this.client }));
2079
+ }
2080
+ }
2081
+ exports.Email = Email;
2082
+ class McpTools extends HeyApiClient {
2083
+ /**
2084
+ * List Integration Mcp Tools
2085
+ *
2086
+ * Connect to the integration's MCP server and list every tool it offers.
2087
+ *
2088
+ * A live call to the provider, so it also proves the connection works. The
2089
+ * list is unfiltered — it is what tool approval is chosen from. Which of these
2090
+ * an attached agent can actually call is the integration's `allowed_tools`
2091
+ * (null there means all of them). Fails if the integration is not active or
2092
+ * the server is unreachable.
2093
+ */
2094
+ list(parameters, options) {
2095
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2096
+ return (options?.client ?? this.client).get({
2097
+ responseStyle: 'data',
2098
+ security: [{ scheme: 'bearer', type: 'http' }, {
2099
+ in: 'cookie',
2100
+ name: 'talqing_session',
2101
+ type: 'apiKey'
2102
+ }],
2103
+ url: '/v1/integrations/{integration_id}/mcp-tools',
2104
+ ...options,
2105
+ ...params
2106
+ });
2107
+ }
2108
+ }
2109
+ exports.McpTools = McpTools;
2110
+ class Triggers extends HeyApiClient {
2111
+ /**
2112
+ * List Integration Triggers
2113
+ *
2114
+ * List the trigger deployments under an integration.
2115
+ *
2116
+ * A trigger binds an inbound provider event — a Telegram message — to a
2117
+ * published agent version.
2118
+ */
2119
+ list(parameters, options) {
2120
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
2121
+ { in: 'path', key: 'integration_id' },
2122
+ { in: 'query', key: 'limit' },
2123
+ { in: 'query', key: 'offset' }
2124
+ ] }]);
2125
+ return (options?.client ?? this.client).get({
2126
+ responseStyle: 'data',
2127
+ security: [{ scheme: 'bearer', type: 'http' }, {
2128
+ in: 'cookie',
2129
+ name: 'talqing_session',
2130
+ type: 'apiKey'
2131
+ }],
2132
+ url: '/v1/integrations/{integration_id}/triggers',
2133
+ ...options,
2134
+ ...params
2135
+ });
2136
+ }
2137
+ /**
2138
+ * Create Integration Trigger
2139
+ *
2140
+ * Deploy an agent to an inbound provider event.
2141
+ *
2142
+ * `reply_mode` decides what happens with the agent's answer: `public_reply`
2143
+ * sends it to the customer, `internal_note` posts it privately where the
2144
+ * provider supports that, `none` generates without sending.
2145
+ *
2146
+ * Enabling validates that the integration is active and the assigned agent is
2147
+ * a published text agent, so create disabled while still wiring things up.
2148
+ */
2149
+ create(parameters, options) {
2150
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'createIntegrationTriggerRequest', map: 'body' }] }]);
2151
+ return (options?.client ?? this.client).post({
2152
+ responseStyle: 'data',
2153
+ security: [{ scheme: 'bearer', type: 'http' }, {
2154
+ in: 'cookie',
2155
+ name: 'talqing_session',
2156
+ type: 'apiKey'
2157
+ }],
2158
+ url: '/v1/integrations/{integration_id}/triggers',
2159
+ ...options,
2160
+ ...params,
2161
+ headers: {
2162
+ 'Content-Type': 'application/json',
2163
+ ...options?.headers,
2164
+ ...params.headers
2165
+ }
2166
+ });
2167
+ }
2168
+ /**
2169
+ * Delete Integration Trigger
2170
+ *
2171
+ * Delete a trigger permanently. The agent stops receiving that event.
2172
+ */
2173
+ delete(parameters, options) {
2174
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { in: 'path', key: 'trigger_id' }] }]);
2175
+ return (options?.client ?? this.client).delete({
2176
+ responseStyle: 'data',
2177
+ security: [{ scheme: 'bearer', type: 'http' }, {
2178
+ in: 'cookie',
2179
+ name: 'talqing_session',
2180
+ type: 'apiKey'
2181
+ }],
2182
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2183
+ ...options,
2184
+ ...params
2185
+ });
2186
+ }
2187
+ /**
2188
+ * Patch Integration Trigger
2189
+ *
2190
+ * Update a trigger: reassign the agent, change reply mode, enable or
2191
+ * disable it. Omitted fields are left unchanged. The same checks as creation
2192
+ * run when enabling.
2193
+ */
2194
+ update(parameters, options) {
2195
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
2196
+ { in: 'path', key: 'integration_id' },
2197
+ { in: 'path', key: 'trigger_id' },
2198
+ { key: 'patchIntegrationTriggerRequest', map: 'body' }
2199
+ ] }]);
2200
+ return (options?.client ?? this.client).patch({
2201
+ responseStyle: 'data',
2202
+ security: [{ scheme: 'bearer', type: 'http' }, {
2203
+ in: 'cookie',
2204
+ name: 'talqing_session',
2205
+ type: 'apiKey'
2206
+ }],
2207
+ url: '/v1/integrations/{integration_id}/triggers/{trigger_id}',
2208
+ ...options,
2209
+ ...params,
2210
+ headers: {
2211
+ 'Content-Type': 'application/json',
2212
+ ...options?.headers,
2213
+ ...params.headers
2214
+ }
2215
+ });
2216
+ }
2217
+ }
2218
+ exports.Triggers = Triggers;
2219
+ class Integrations extends HeyApiClient {
2220
+ /**
2221
+ * List Integrations
2222
+ *
2223
+ * List the workspace's integrations with their provider, status and config.
2224
+ *
2225
+ * Secret values are never returned — credential fields come back as
2226
+ * `{{secrets.NAME}}` references.
2227
+ */
2228
+ list(parameters, options) {
2229
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2230
+ return (options?.client ?? this.client).get({
2231
+ responseStyle: 'data',
2232
+ security: [{ scheme: 'bearer', type: 'http' }, {
2233
+ in: 'cookie',
2234
+ name: 'talqing_session',
2235
+ type: 'apiKey'
2236
+ }],
2237
+ url: '/v1/integrations',
2238
+ ...options,
2239
+ ...params
2240
+ });
2241
+ }
2242
+ /**
2243
+ * Create Integration
2244
+ *
2245
+ * Create a manual integration, fully configured.
2246
+ *
2247
+ * Which of `credentials_ref`, `provider_account_info`, `mcp_config` and
2248
+ * `webhook_config` a provider needs is described by its `setup_fields` in the
2249
+ * integration catalog. Secret-bearing fields take a plaintext value — stored
2250
+ * as a workspace secret — or an existing `{{secrets.NAME}}` reference.
2251
+ *
2252
+ * Leave `allowed_tools` unset to expose every tool the server lists. OAuth
2253
+ * providers are connected from the dashboard instead.
2254
+ */
2255
+ create(parameters, options) {
2256
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createIntegrationRequest', map: 'body' }] }]);
2257
+ return (options?.client ?? this.client).post({
2258
+ responseStyle: 'data',
2259
+ security: [{ scheme: 'bearer', type: 'http' }, {
2260
+ in: 'cookie',
2261
+ name: 'talqing_session',
2262
+ type: 'apiKey'
2263
+ }],
2264
+ url: '/v1/integrations',
2265
+ ...options,
2266
+ ...params,
2267
+ headers: {
2268
+ 'Content-Type': 'application/json',
2269
+ ...options?.headers,
2270
+ ...params.headers
2271
+ }
2272
+ });
2273
+ }
2274
+ /**
2275
+ * Integration Catalog
2276
+ *
2277
+ * List the providers that can be integrated, and how to connect each one.
2278
+ *
2279
+ * `auth_type` says which path a provider takes: `manual` through this API,
2280
+ * `oauth` from the dashboard. `setup_fields` is the authoritative list of what
2281
+ * each manual provider requires — read it rather than guessing. `capabilities`
2282
+ * says whether it serves tools (MCP) or a messaging channel (triggers).
2283
+ */
2284
+ catalog(parameters, options) {
2285
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2286
+ return (options?.client ?? this.client).get({
2287
+ responseStyle: 'data',
2288
+ security: [{ scheme: 'bearer', type: 'http' }, {
2289
+ in: 'cookie',
2290
+ name: 'talqing_session',
2291
+ type: 'apiKey'
2292
+ }],
2293
+ url: '/v1/integrations/catalog',
2294
+ ...options,
2295
+ ...params
2296
+ });
2297
+ }
2298
+ /**
2299
+ * Delete Integration
2300
+ *
2301
+ * Delete an integration and its triggers permanently.
2302
+ */
2303
+ delete(parameters, options) {
2304
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2305
+ return (options?.client ?? this.client).delete({
2306
+ responseStyle: 'data',
2307
+ security: [{ scheme: 'bearer', type: 'http' }, {
2308
+ in: 'cookie',
2309
+ name: 'talqing_session',
2310
+ type: 'apiKey'
2311
+ }],
2312
+ url: '/v1/integrations/{integration_id}',
2313
+ ...options,
2314
+ ...params
2315
+ });
2316
+ }
2317
+ /**
2318
+ * Get Integration
2319
+ *
2320
+ * Fetch one integration: provider, status, structured config, trigger
2321
+ * capabilities and inbound webhook setup state.
2322
+ */
2323
+ get(parameters, options) {
2324
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }] }]);
2325
+ return (options?.client ?? this.client).get({
2326
+ responseStyle: 'data',
2327
+ security: [{ scheme: 'bearer', type: 'http' }, {
2328
+ in: 'cookie',
2329
+ name: 'talqing_session',
2330
+ type: 'apiKey'
2331
+ }],
2332
+ url: '/v1/integrations/{integration_id}',
2333
+ ...options,
2334
+ ...params
2335
+ });
2336
+ }
2337
+ /**
2338
+ * Patch Integration
2339
+ *
2340
+ * Update an integration. Omitted fields are left unchanged.
2341
+ *
2342
+ * Sending `credentials_ref` rotates the credential. Only `active` integrations
2343
+ * can be attached to agents or serve triggers.
2344
+ *
2345
+ * `allowed_tools` replaces the approved list wholesale: exactly those tools
2346
+ * become callable by every agent this integration is attached to. It cannot be
2347
+ * emptied — an agent that should call nothing is an integration that should be
2348
+ * disabled.
2349
+ */
2350
+ update(parameters, options) {
2351
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'integration_id' }, { key: 'patchIntegrationRequest', map: 'body' }] }]);
2352
+ return (options?.client ?? this.client).patch({
2353
+ responseStyle: 'data',
2354
+ security: [{ scheme: 'bearer', type: 'http' }, {
2355
+ in: 'cookie',
2356
+ name: 'talqing_session',
2357
+ type: 'apiKey'
2358
+ }],
2359
+ url: '/v1/integrations/{integration_id}',
2360
+ ...options,
2361
+ ...params,
2362
+ headers: {
2363
+ 'Content-Type': 'application/json',
2364
+ ...options?.headers,
2365
+ ...params.headers
2366
+ }
2367
+ });
2368
+ }
2369
+ get mcpTools() {
2370
+ return this._mcpTools ?? (this._mcpTools = new McpTools({ client: this.client }));
2371
+ }
2372
+ get triggers() {
2373
+ return this._triggers ?? (this._triggers = new Triggers({ client: this.client }));
2374
+ }
2375
+ }
2376
+ exports.Integrations = Integrations;
2377
+ class Nodes extends HeyApiClient {
2378
+ /**
2379
+ * Delete Node
2380
+ *
2381
+ * Drop one entry from the table of contents, permanently.
2382
+ *
2383
+ * Its children go with it, and agents can no longer retrieve any of it.
2384
+ */
2385
+ delete(parameters, options) {
2386
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { in: 'path', key: 'node_id' }] }]);
2387
+ return (options?.client ?? this.client).delete({
2388
+ responseStyle: 'data',
2389
+ security: [{ scheme: 'bearer', type: 'http' }, {
2390
+ in: 'cookie',
2391
+ name: 'talqing_session',
2392
+ type: 'apiKey'
2393
+ }],
2394
+ url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2395
+ ...options,
2396
+ ...params
2397
+ });
2398
+ }
2399
+ /**
2400
+ * Get Node
2401
+ *
2402
+ * Read one entry of the table of contents, with its full content.
2403
+ *
2404
+ * This is the text an agent retrieves when it fetches this node. `version` is
2405
+ * what `patch_node` needs for a safe edit.
2406
+ */
2407
+ get(parameters, options) {
2408
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { in: 'path', key: 'node_id' }] }]);
2409
+ return (options?.client ?? this.client).get({
2410
+ responseStyle: 'data',
2411
+ security: [{ scheme: 'bearer', type: 'http' }, {
2412
+ in: 'cookie',
2413
+ name: 'talqing_session',
2414
+ type: 'apiKey'
2415
+ }],
2416
+ url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2417
+ ...options,
2418
+ ...params
2419
+ });
2420
+ }
2421
+ /**
2422
+ * Patch Node
2423
+ *
2424
+ * Correct one entry's title, summary or content by hand — the way to fix a
2425
+ * fact the crawl got wrong without rebuilding.
2426
+ *
2427
+ * `title` and `summary` are what the agent sees in the table of contents and
2428
+ * decide whether it ever fetches this node, so keep them accurate.
2429
+ *
2430
+ * Send the `version` you read from `get_node`; a mismatch is rejected rather
2431
+ * than overwriting someone else's edit.
2432
+ */
2433
+ update(parameters, options) {
2434
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
2435
+ { in: 'path', key: 'kb_id' },
2436
+ { in: 'path', key: 'node_id' },
2437
+ { key: 'patchNodeRequest', map: 'body' }
2438
+ ] }]);
2439
+ return (options?.client ?? this.client).patch({
2440
+ responseStyle: 'data',
2441
+ security: [{ scheme: 'bearer', type: 'http' }, {
2442
+ in: 'cookie',
2443
+ name: 'talqing_session',
2444
+ type: 'apiKey'
2445
+ }],
2446
+ url: '/v1/knowledge/{kb_id}/nodes/{node_id}',
2447
+ ...options,
2448
+ ...params,
2449
+ headers: {
2450
+ 'Content-Type': 'application/json',
2451
+ ...options?.headers,
2452
+ ...params.headers
2453
+ }
2454
+ });
2455
+ }
2456
+ }
2457
+ exports.Nodes = Nodes;
2458
+ class Pages extends HeyApiClient {
2459
+ /**
2460
+ * List Pages
2461
+ *
2462
+ * List the crawled pages and how each one transcribed.
2463
+ *
2464
+ * Where you look when a knowledge base is missing something: a page with a
2465
+ * non-`done` status and an `error` never made it in, and `content_len` of 0
2466
+ * means the URL yielded nothing worth indexing.
2467
+ */
2468
+ list(parameters, options) {
2469
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
2470
+ { in: 'path', key: 'kb_id' },
2471
+ { in: 'query', key: 'limit' },
2472
+ { in: 'query', key: 'offset' }
2473
+ ] }]);
2474
+ return (options?.client ?? this.client).get({
2475
+ responseStyle: 'data',
2476
+ security: [{ scheme: 'bearer', type: 'http' }, {
2477
+ in: 'cookie',
2478
+ name: 'talqing_session',
2479
+ type: 'apiKey'
2480
+ }],
2481
+ url: '/v1/knowledge/{kb_id}/pages',
2482
+ ...options,
2483
+ ...params
2484
+ });
2485
+ }
2486
+ }
2487
+ exports.Pages = Pages;
2488
+ class Knowledge2 extends HeyApiClient {
2489
+ /**
2490
+ * List Kbs
2491
+ *
2492
+ * List the workspace's knowledge bases with their build status.
2493
+ *
2494
+ * A knowledge base gives an agent grounded answers over crawled content. Only
2495
+ * one with status `ready` can be attached to an agent, through the agent
2496
+ * config's `kb_ids`.
2497
+ */
2498
+ list(parameters, options) {
2499
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2500
+ return (options?.client ?? this.client).get({
2501
+ responseStyle: 'data',
2502
+ security: [{ scheme: 'bearer', type: 'http' }, {
2503
+ in: 'cookie',
2504
+ name: 'talqing_session',
2505
+ type: 'apiKey'
2506
+ }],
2507
+ url: '/v1/knowledge',
2508
+ ...options,
2509
+ ...params
2510
+ });
2511
+ }
2512
+ /**
2513
+ * Create Kb
2514
+ *
2515
+ * Start a knowledge base by crawling one or more websites.
2516
+ *
2517
+ * Returns immediately with `status: discovering` — crawling takes minutes.
2518
+ * Poll `get_kb` until `review`, then pass the URLs worth indexing to
2519
+ * `build_kb`. `max_pages` caps how many discovery may find (default 1000) and
2520
+ * `notes` guides how the content is transcribed and organized.
2521
+ */
2522
+ create(parameters, options) {
2523
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createKbRequest', map: 'body' }] }]);
2524
+ return (options?.client ?? this.client).post({
2525
+ responseStyle: 'data',
2526
+ security: [{ scheme: 'bearer', type: 'http' }, {
2527
+ in: 'cookie',
2528
+ name: 'talqing_session',
2529
+ type: 'apiKey'
2530
+ }],
2531
+ url: '/v1/knowledge',
2532
+ ...options,
2533
+ ...params,
2534
+ headers: {
2535
+ 'Content-Type': 'application/json',
2536
+ ...options?.headers,
2537
+ ...params.headers
2538
+ }
2539
+ });
2540
+ }
2541
+ /**
2542
+ * Delete Kb
2543
+ *
2544
+ * Delete a knowledge base and everything crawled into it, permanently.
2545
+ *
2546
+ * Rebuilding means crawling the site again. Agents that list it in `kb_ids`
2547
+ * lose those grounded answers, so detach it there first.
2548
+ */
2549
+ delete(parameters, options) {
2550
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2551
+ return (options?.client ?? this.client).delete({
2552
+ responseStyle: 'data',
2553
+ security: [{ scheme: 'bearer', type: 'http' }, {
2554
+ in: 'cookie',
2555
+ name: 'talqing_session',
2556
+ type: 'apiKey'
2557
+ }],
2558
+ url: '/v1/knowledge/{kb_id}',
2559
+ ...options,
2560
+ ...params
2561
+ });
2562
+ }
2563
+ /**
2564
+ * Get Kb
2565
+ *
2566
+ * Read one knowledge base: build status, progress and content tree.
2567
+ *
2568
+ * `status` walks `discovering` -> `review` -> `transcribing` -> `generating`
2569
+ * -> `ready`, with `error` set if it stopped. At `review`, `discovered` holds
2570
+ * the crawled URLs awaiting your selection; once ready, `tree` is the table of
2571
+ * contents. This is the endpoint to poll while a build runs.
2572
+ */
2573
+ get(parameters, options) {
2574
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2575
+ return (options?.client ?? this.client).get({
2576
+ responseStyle: 'data',
2577
+ security: [{ scheme: 'bearer', type: 'http' }, {
2578
+ in: 'cookie',
2579
+ name: 'talqing_session',
2580
+ type: 'apiKey'
2581
+ }],
2582
+ url: '/v1/knowledge/{kb_id}',
2583
+ ...options,
2584
+ ...params
2585
+ });
2586
+ }
2587
+ /**
2588
+ * Build Kb
2589
+ *
2590
+ * Index the chosen pages, then write the table of contents.
2591
+ *
2592
+ * Call this once the knowledge base reaches `review`, passing the subset of
2593
+ * `discovered` URLs worth indexing — the KB is only as good as that choice.
2594
+ * Returns as soon as the work is queued; poll `get_kb` until `ready`, which is
2595
+ * when it can be attached to an agent.
2596
+ */
2597
+ build(parameters, options) {
2598
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }, { key: 'buildKbRequest', map: 'body' }] }]);
2599
+ return (options?.client ?? this.client).post({
2600
+ responseStyle: 'data',
2601
+ security: [{ scheme: 'bearer', type: 'http' }, {
2602
+ in: 'cookie',
2603
+ name: 'talqing_session',
2604
+ type: 'apiKey'
2605
+ }],
2606
+ url: '/v1/knowledge/{kb_id}/build',
2607
+ ...options,
2608
+ ...params,
2609
+ headers: {
2610
+ 'Content-Type': 'application/json',
2611
+ ...options?.headers,
2612
+ ...params.headers
2613
+ }
2614
+ });
2615
+ }
2616
+ /**
2617
+ * Events
2618
+ *
2619
+ * Watch one knowledge base build: `snapshot` first, then `progress` and `status`.
2620
+ *
2621
+ * `progress` carries the per-stage counts, `status` the terminal verdict
2622
+ * (`ready`, or an `error`). The same state is readable at any time with
2623
+ * `get_kb`; this is the live view of it.
2624
+ */
2625
+ events(parameters, options) {
2626
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2627
+ return (options?.client ?? this.client).sse.get({
2628
+ responseStyle: 'data',
2629
+ security: [{ scheme: 'bearer', type: 'http' }, {
2630
+ in: 'cookie',
2631
+ name: 'talqing_session',
2632
+ type: 'apiKey'
2633
+ }],
2634
+ url: '/v1/knowledge/{kb_id}/events',
2635
+ ...options,
2636
+ ...params
2637
+ });
2638
+ }
2639
+ /**
2640
+ * Get Kb Prompt
2641
+ *
2642
+ * The table of contents exactly as an agent using this KB is given it.
2643
+ *
2644
+ * Read it to judge what the agent can actually find — if a topic reads
2645
+ * vaguely here, the agent will not know to fetch it. `chars` is how much of
2646
+ * the agent's context this KB occupies.
2647
+ */
2648
+ prompt(parameters, options) {
2649
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2650
+ return (options?.client ?? this.client).get({
2651
+ responseStyle: 'data',
2652
+ security: [{ scheme: 'bearer', type: 'http' }, {
2653
+ in: 'cookie',
2654
+ name: 'talqing_session',
2655
+ type: 'apiKey'
2656
+ }],
2657
+ url: '/v1/knowledge/{kb_id}/prompt',
2658
+ ...options,
2659
+ ...params
2660
+ });
2661
+ }
2662
+ /**
2663
+ * Regenerate Toc
2664
+ *
2665
+ * Rewrite the table of contents from the pages already indexed.
2666
+ *
2667
+ * The repair for a knowledge base whose structure came out wrong, or whose
2668
+ * build failed at the last stage: it re-runs only that stage, so the site is
2669
+ * not crawled or transcribed again.
2670
+ */
2671
+ regenerateToc(parameters, options) {
2672
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'kb_id' }] }]);
2673
+ return (options?.client ?? this.client).post({
2674
+ responseStyle: 'data',
2675
+ security: [{ scheme: 'bearer', type: 'http' }, {
2676
+ in: 'cookie',
2677
+ name: 'talqing_session',
2678
+ type: 'apiKey'
2679
+ }],
2680
+ url: '/v1/knowledge/{kb_id}/toc',
2681
+ ...options,
2682
+ ...params
2683
+ });
2684
+ }
2685
+ get nodes() {
2686
+ return this._nodes ?? (this._nodes = new Nodes({ client: this.client }));
2687
+ }
2688
+ get pages() {
2689
+ return this._pages ?? (this._pages = new Pages({ client: this.client }));
2690
+ }
2691
+ }
2692
+ exports.Knowledge2 = Knowledge2;
2693
+ class Tokens extends HeyApiClient {
2694
+ /**
2695
+ * Mcp Token
2696
+ *
2697
+ * This user's MCP token, in plaintext, with the API URL to pair it with.
2698
+ *
2699
+ * Unlike a token created by hand, this one can be read whenever it is needed:
2700
+ * the dashboard renders it into ready-to-paste MCP configuration for Claude
2701
+ * Code, Codex and Grok. The value is re-derived from the token's row, not
2702
+ * stored, and is the same string every time — so a configuration a user
2703
+ * already saved keeps working.
2704
+ *
2705
+ * It is always the caller's own token, never anyone else's, and is created on
2706
+ * the spot for a user who somehow has none. Delete it from the tokens list to
2707
+ * revoke it; the next call issues a new one, which rotates the credential.
2708
+ */
2709
+ mcp(options) {
2710
+ return (options?.client ?? this.client).get({
2711
+ responseStyle: 'data',
2712
+ security: [{ scheme: 'bearer', type: 'http' }, {
2713
+ in: 'cookie',
2714
+ name: 'talqing_session',
2715
+ type: 'apiKey'
2716
+ }],
2717
+ url: '/v1/mcp-token',
2718
+ ...options
2719
+ });
2720
+ }
2721
+ /**
2722
+ * List Tokens
2723
+ *
2724
+ * List personal access tokens: your own, or every one in the organization
2725
+ * if you are an admin.
2726
+ *
2727
+ * Who holds which credential is organization-admin information, so an EDITOR
2728
+ * or VIEWER sees only what they created. Plaintext token values are never
2729
+ * returned. A token with `kind: mcp` was issued automatically for the
2730
+ * dashboard's MCP setup; the rest were created by hand.
2731
+ */
2732
+ list(parameters, options) {
2733
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2734
+ return (options?.client ?? this.client).get({
2735
+ responseStyle: 'data',
2736
+ security: [{ scheme: 'bearer', type: 'http' }, {
2737
+ in: 'cookie',
2738
+ name: 'talqing_session',
2739
+ type: 'apiKey'
2740
+ }],
2741
+ url: '/v1/tokens',
2742
+ ...options,
2743
+ ...params
2744
+ });
2745
+ }
2746
+ /**
2747
+ * Create Token
2748
+ *
2749
+ * Create a personal access token for driving this API without the dashboard.
2750
+ *
2751
+ * The token authenticates as its creator and acts with that user's live role,
2752
+ * so it can never do more than they can. It does not expire; deleting it is
2753
+ * the revocation. The plaintext value is returned once here and never again —
2754
+ * treat it like a password and do not echo it back into a conversation.
2755
+ */
2756
+ create(parameters, options) {
2757
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createTokenRequest', map: 'body' }] }]);
2758
+ return (options?.client ?? this.client).post({
2759
+ responseStyle: 'data',
2760
+ security: [{ scheme: 'bearer', type: 'http' }, {
2761
+ in: 'cookie',
2762
+ name: 'talqing_session',
2763
+ type: 'apiKey'
2764
+ }],
2765
+ url: '/v1/tokens',
2766
+ ...options,
2767
+ ...params,
2768
+ headers: {
2769
+ 'Content-Type': 'application/json',
2770
+ ...options?.headers,
2771
+ ...params.headers
2772
+ }
2773
+ });
2774
+ }
2775
+ /**
2776
+ * Delete Token
2777
+ *
2778
+ * Revoke a token immediately and permanently.
2779
+ *
2780
+ * Owners can delete their own; organization admins can delete any in the
2781
+ * organization. Deleting an `mcp` token rotates it: the owner's next dashboard
2782
+ * visit issues a replacement, and anything still configured with the old one
2783
+ * stops working.
2784
+ */
2785
+ delete(parameters, options) {
2786
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'token_id' }] }]);
2787
+ return (options?.client ?? this.client).delete({
2788
+ responseStyle: 'data',
2789
+ security: [{ scheme: 'bearer', type: 'http' }, {
2790
+ in: 'cookie',
2791
+ name: 'talqing_session',
2792
+ type: 'apiKey'
2793
+ }],
2794
+ url: '/v1/tokens/{token_id}',
2795
+ ...options,
2796
+ ...params
2797
+ });
2798
+ }
2799
+ }
2800
+ exports.Tokens = Tokens;
2801
+ class Observability extends HeyApiClient {
2802
+ /**
2803
+ * Get Observability
2804
+ *
2805
+ * Workspace analytics: volume, endings, recordings, response time and spend.
2806
+ * One snapshot of a date range, up to 7 days.
2807
+ *
2808
+ * `summary` is the range total, `daily` one row per day, and `volume` the same
2809
+ * days cut by dimension (agent, phone number, type, status, close reason,
2810
+ * recording, analysis, transfer) — each capped at eight series with the tail
2811
+ * rolled into `Other`. `latency` reports response time per model stage and
2812
+ * `cost` breaks the bill down by stage, provider and model.
2813
+ *
2814
+ * Narrow it with `agent_id` and `channel`; `timezone` decides day boundaries.
2815
+ *
2816
+ * Two traps. `latency.basis` is `per_turn` for voice and video and `per_call`
2817
+ * for text, so the two are never averaged into one number. And every rate is
2818
+ * over a subset — `success_rate` over `judged_sessions`, `cost` over
2819
+ * `priced_sessions`, latency over `measured_sessions`.
2820
+ */
2821
+ get(parameters, options) {
2822
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
2823
+ { in: 'query', key: 'start_date' },
2824
+ { in: 'query', key: 'end_date' },
2825
+ { in: 'query', key: 'timezone' },
2826
+ { in: 'query', key: 'agent_id' },
2827
+ { in: 'query', key: 'channel' }
2828
+ ] }]);
2829
+ return (options?.client ?? this.client).get({
2830
+ responseStyle: 'data',
2831
+ security: [{ scheme: 'bearer', type: 'http' }, {
2832
+ in: 'cookie',
2833
+ name: 'talqing_session',
2834
+ type: 'apiKey'
2835
+ }],
2836
+ url: '/v1/observability',
2837
+ ...options,
2838
+ ...params
2839
+ });
2840
+ }
2841
+ }
2842
+ exports.Observability = Observability;
2843
+ class Invites extends HeyApiClient {
2844
+ /**
2845
+ * List Invites
2846
+ *
2847
+ * Invites waiting on a first login. Accepted and revoked ones drop off the
2848
+ * list — an accepted invite is a member, and belongs on the roster instead.
2849
+ */
2850
+ list(parameters, options) {
2851
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2852
+ return (options?.client ?? this.client).get({
2853
+ responseStyle: 'data',
2854
+ security: [{ scheme: 'bearer', type: 'http' }, {
2855
+ in: 'cookie',
2856
+ name: 'talqing_session',
2857
+ type: 'apiKey'
2858
+ }],
2859
+ url: '/v1/org/invites',
2860
+ ...options,
2861
+ ...params
2862
+ });
2863
+ }
2864
+ /**
2865
+ * Create Invite
2866
+ *
2867
+ * Invite an email address into this organization with a role.
2868
+ *
2869
+ * There is no invite link and no accept step: the invite is keyed to a Google
2870
+ * identity, so signing in with that address *is* the check. Someone who
2871
+ * already has an account joins immediately; anyone else joins the first time
2872
+ * they sign in.
2873
+ *
2874
+ * No email is sent at MVP, so an existing user finds out by seeing the
2875
+ * organization appear in their switcher — tell them yourself.
2876
+ */
2877
+ create(parameters, options) {
2878
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'inviteRequest', map: 'body' }] }]);
2879
+ return (options?.client ?? this.client).post({
2880
+ responseStyle: 'data',
2881
+ security: [{ scheme: 'bearer', type: 'http' }, {
2882
+ in: 'cookie',
2883
+ name: 'talqing_session',
2884
+ type: 'apiKey'
2885
+ }],
2886
+ url: '/v1/org/invites',
2887
+ ...options,
2888
+ ...params,
2889
+ headers: {
2890
+ 'Content-Type': 'application/json',
2891
+ ...options?.headers,
2892
+ ...params.headers
2893
+ }
2894
+ });
2895
+ }
2896
+ /**
2897
+ * Revoke Invite
2898
+ *
2899
+ * Withdraw a pending invite, so signing in with that address no longer
2900
+ * joins this organization.
2901
+ */
2902
+ revoke(parameters, options) {
2903
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'invite_id' }] }]);
2904
+ return (options?.client ?? this.client).delete({
2905
+ responseStyle: 'data',
2906
+ security: [{ scheme: 'bearer', type: 'http' }, {
2907
+ in: 'cookie',
2908
+ name: 'talqing_session',
2909
+ type: 'apiKey'
2910
+ }],
2911
+ url: '/v1/org/invites/{invite_id}',
2912
+ ...options,
2913
+ ...params
2914
+ });
2915
+ }
2916
+ }
2917
+ exports.Invites = Invites;
2918
+ class Members extends HeyApiClient {
2919
+ /**
2920
+ * List Members
2921
+ *
2922
+ * Every member sees the roster; only an ADMIN can change it.
2923
+ */
2924
+ list(parameters, options) {
2925
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
2926
+ return (options?.client ?? this.client).get({
2927
+ responseStyle: 'data',
2928
+ security: [{ scheme: 'bearer', type: 'http' }, {
2929
+ in: 'cookie',
2930
+ name: 'talqing_session',
2931
+ type: 'apiKey'
2932
+ }],
2933
+ url: '/v1/org/members',
2934
+ ...options,
2935
+ ...params
2936
+ });
2937
+ }
2938
+ /**
2939
+ * Remove Member
2940
+ *
2941
+ * Remove someone from this organization.
2942
+ *
2943
+ * They lose access on their next request, and their access tokens for this
2944
+ * organization stop working with them. Nothing they created is deleted.
2945
+ *
2946
+ * Allowed even when this is the only organization they belong to — whether
2947
+ * they have somewhere else to go is not this organization's problem, and their
2948
+ * next sign-in gives them one of their own.
2949
+ */
2950
+ remove(parameters, options) {
2951
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'user_id' }] }]);
2952
+ return (options?.client ?? this.client).delete({
2953
+ responseStyle: 'data',
2954
+ security: [{ scheme: 'bearer', type: 'http' }, {
2955
+ in: 'cookie',
2956
+ name: 'talqing_session',
2957
+ type: 'apiKey'
2958
+ }],
2959
+ url: '/v1/org/members/{user_id}',
2960
+ ...options,
2961
+ ...params
2962
+ });
2963
+ }
2964
+ /**
2965
+ * Set Member Role
2966
+ *
2967
+ * Change a member's role. Takes effect on their very next request.
2968
+ */
2969
+ setRole(parameters, options) {
2970
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'user_id' }, { key: 'roleRequest', map: 'body' }] }]);
2971
+ return (options?.client ?? this.client).patch({
2972
+ responseStyle: 'data',
2973
+ security: [{ scheme: 'bearer', type: 'http' }, {
2974
+ in: 'cookie',
2975
+ name: 'talqing_session',
2976
+ type: 'apiKey'
2977
+ }],
2978
+ url: '/v1/org/members/{user_id}',
2979
+ ...options,
2980
+ ...params,
2981
+ headers: {
2982
+ 'Content-Type': 'application/json',
2983
+ ...options?.headers,
2984
+ ...params.headers
2985
+ }
2986
+ });
2987
+ }
2988
+ }
2989
+ exports.Members = Members;
2990
+ class Orgs extends HeyApiClient {
2991
+ /**
2992
+ * Patch Org
2993
+ *
2994
+ * Change this organization's name or its data retention policy.
2995
+ *
2996
+ * The name is display only — nothing keys on it.
2997
+ *
2998
+ * `retention_days` is how long call and conversation *content* is kept:
2999
+ * recordings, transcripts, summaries, extracted fields and the phone numbers
3000
+ * on a call. When it passes, all of that is deleted and the call itself
3001
+ * remains, with its duration, outcome and cost, so past invoices still
3002
+ * resolve. `null` keeps everything forever, which is the default.
3003
+ *
3004
+ * It applies to calls from now on: a call already in the system keeps the
3005
+ * deadline it was given when it ended, so shortening the policy never
3006
+ * retroactively destroys anything. Erasing a contact's last call also resets
3007
+ * what your agents remember about that person.
3008
+ */
3009
+ update(parameters, options) {
3010
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'patchOrgRequest', map: 'body' }] }]);
3011
+ return (options?.client ?? this.client).patch({
3012
+ responseStyle: 'data',
3013
+ security: [{ scheme: 'bearer', type: 'http' }, {
3014
+ in: 'cookie',
3015
+ name: 'talqing_session',
3016
+ type: 'apiKey'
3017
+ }],
3018
+ url: '/v1/org',
3019
+ ...options,
3020
+ ...params,
3021
+ headers: {
3022
+ 'Content-Type': 'application/json',
3023
+ ...options?.headers,
3024
+ ...params.headers
3025
+ }
3026
+ });
3027
+ }
3028
+ /**
3029
+ * Leave Org
3030
+ *
3031
+ * Leave this organization. Any member may, including an admin who has
3032
+ * promoted a successor. Nothing they created is deleted.
3033
+ */
3034
+ leave(options) {
3035
+ return (options?.client ?? this.client).post({
3036
+ responseStyle: 'data',
3037
+ security: [{ scheme: 'bearer', type: 'http' }, {
3038
+ in: 'cookie',
3039
+ name: 'talqing_session',
3040
+ type: 'apiKey'
3041
+ }],
3042
+ url: '/v1/org/leave',
3043
+ ...options
3044
+ });
3045
+ }
3046
+ /**
3047
+ * List Orgs
3048
+ *
3049
+ * Every organization the signed-in user belongs to, with their role in each.
3050
+ *
3051
+ * Newest membership first, deliberately: an admin can add you to their
3052
+ * organization without you being asked or emailed, so the one you did not know
3053
+ * about is the one that needs to be visible.
3054
+ */
3055
+ list(parameters, options) {
3056
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3057
+ return (options?.client ?? this.client).get({
3058
+ responseStyle: 'data',
3059
+ security: [{ scheme: 'bearer', type: 'http' }, {
3060
+ in: 'cookie',
3061
+ name: 'talqing_session',
3062
+ type: 'apiKey'
3063
+ }],
3064
+ url: '/v1/orgs',
3065
+ ...options,
3066
+ ...params
3067
+ });
3068
+ }
3069
+ /**
3070
+ * Create Org
3071
+ *
3072
+ * Create a new, empty organization with the caller as its ADMIN.
3073
+ *
3074
+ * Any member can do this — it grants nothing in the organization they are
3075
+ * currently in. Switch into it to start working there.
3076
+ */
3077
+ create(parameters, options) {
3078
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'orgNameRequest', map: 'body' }] }]);
3079
+ return (options?.client ?? this.client).post({
3080
+ responseStyle: 'data',
3081
+ security: [{ scheme: 'bearer', type: 'http' }, {
3082
+ in: 'cookie',
3083
+ name: 'talqing_session',
3084
+ type: 'apiKey'
3085
+ }],
3086
+ url: '/v1/orgs',
3087
+ ...options,
3088
+ ...params,
3089
+ headers: {
3090
+ 'Content-Type': 'application/json',
3091
+ ...options?.headers,
3092
+ ...params.headers
3093
+ }
3094
+ });
3095
+ }
3096
+ /**
3097
+ * Switch Org
3098
+ *
3099
+ * Point the dashboard session at another of the caller's organizations.
3100
+ *
3101
+ * The session cookie carries the organization, so switching re-issues it — the
3102
+ * caller's role, resources and billing all move with it. Reload after this.
3103
+ */
3104
+ switch(parameters, options) {
3105
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'org_id' }] }]);
3106
+ return (options?.client ?? this.client).post({
3107
+ responseStyle: 'data',
3108
+ security: [{ scheme: 'bearer', type: 'http' }, {
3109
+ in: 'cookie',
3110
+ name: 'talqing_session',
3111
+ type: 'apiKey'
3112
+ }],
3113
+ url: '/v1/orgs/{org_id}/switch',
3114
+ ...options,
3115
+ ...params
3116
+ });
3117
+ }
3118
+ get invites() {
3119
+ return this._invites ?? (this._invites = new Invites({ client: this.client }));
3120
+ }
3121
+ get members() {
3122
+ return this._members ?? (this._members = new Members({ client: this.client }));
3123
+ }
3124
+ }
3125
+ exports.Orgs = Orgs;
3126
+ class Schemas extends HeyApiClient {
3127
+ /**
3128
+ * Describe Schema
3129
+ *
3130
+ * The full JSON Schema of one of the five large request types.
3131
+ *
3132
+ * An argument whose description ends in `describe_schema('X')` carries only a
3133
+ * placeholder for its shape — fetch the real one here before writing it.
3134
+ *
3135
+ * - `AgentConfig` — a whole agent definition; what `create_agent` takes.
3136
+ * - `AgentOverride` — the same tree, every field optional, for one call.
3137
+ * - `AgentTeam` — several agents on one call, handing off to each other.
3138
+ * - `TaskConfig` — an agent task: inputs, output shape, model stack.
3139
+ * - `ToolOperations` — the operation tree a custom tool runs.
3140
+ *
3141
+ * These compose, so a document you fetch may itself defer to another.
3142
+ */
3143
+ get(parameters, options) {
3144
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'name' }] }]);
3145
+ return (options?.client ?? this.client).get({
3146
+ responseStyle: 'data',
3147
+ security: [{ scheme: 'bearer', type: 'http' }, {
3148
+ in: 'cookie',
3149
+ name: 'talqing_session',
3150
+ type: 'apiKey'
3151
+ }],
3152
+ url: '/v1/schemas/{name}',
3153
+ ...options,
3154
+ ...params
3155
+ });
3156
+ }
3157
+ }
3158
+ exports.Schemas = Schemas;
3159
+ class Secrets extends HeyApiClient {
3160
+ /**
3161
+ * List Secrets
3162
+ *
3163
+ * List the workspace's secrets by name, with a masked hint of each value.
3164
+ *
3165
+ * Values are write-only: once stored, a secret can only be read by the runtime
3166
+ * through a `{{secrets.NAME}}` reference.
3167
+ */
3168
+ list(parameters, options) {
3169
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3170
+ return (options?.client ?? this.client).get({
3171
+ responseStyle: 'data',
3172
+ security: [{ scheme: 'bearer', type: 'http' }, {
3173
+ in: 'cookie',
3174
+ name: 'talqing_session',
3175
+ type: 'apiKey'
3176
+ }],
3177
+ url: '/v1/secrets',
3178
+ ...options,
3179
+ ...params
3180
+ });
3181
+ }
3182
+ /**
3183
+ * Create Secret
3184
+ *
3185
+ * Store a secret, replacing any existing one with the same name.
3186
+ *
3187
+ * `name` must be a valid identifier and is how tool operations and integration
3188
+ * config refer to the value, as `{{secrets.NAME}}`. Organization admins only.
3189
+ */
3190
+ create(parameters, options) {
3191
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createSecretRequest', map: 'body' }] }]);
3192
+ return (options?.client ?? this.client).post({
3193
+ responseStyle: 'data',
3194
+ security: [{ scheme: 'bearer', type: 'http' }, {
3195
+ in: 'cookie',
3196
+ name: 'talqing_session',
3197
+ type: 'apiKey'
3198
+ }],
3199
+ url: '/v1/secrets',
3200
+ ...options,
3201
+ ...params,
3202
+ headers: {
3203
+ 'Content-Type': 'application/json',
3204
+ ...options?.headers,
3205
+ ...params.headers
3206
+ }
3207
+ });
3208
+ }
3209
+ /**
3210
+ * Delete Secret
3211
+ *
3212
+ * Delete a secret permanently. Anything still referencing it will fail to
3213
+ * resolve at runtime. Organization admins only.
3214
+ */
3215
+ delete(parameters, options) {
3216
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'secret_id' }] }]);
3217
+ return (options?.client ?? this.client).delete({
3218
+ responseStyle: 'data',
3219
+ security: [{ scheme: 'bearer', type: 'http' }, {
3220
+ in: 'cookie',
3221
+ name: 'talqing_session',
3222
+ type: 'apiKey'
3223
+ }],
3224
+ url: '/v1/secrets/{secret_id}',
3225
+ ...options,
3226
+ ...params
3227
+ });
3228
+ }
3229
+ }
3230
+ exports.Secrets = Secrets;
3231
+ class Runs extends HeyApiClient {
3232
+ /**
3233
+ * List Task Runs
3234
+ *
3235
+ * This task's runs, newest first, each with its output, trace and cost.
3236
+ *
3237
+ * A run records the task's *name* and nothing else about the definition it ran
3238
+ * under, so two runs either side of an edit are indistinguishable here.
3239
+ */
3240
+ list(parameters, options) {
3241
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
3242
+ { in: 'path', key: 'task_id' },
3243
+ { in: 'query', key: 'limit' },
3244
+ { in: 'query', key: 'offset' }
3245
+ ] }]);
3246
+ return (options?.client ?? this.client).get({
3247
+ responseStyle: 'data',
3248
+ security: [{ scheme: 'bearer', type: 'http' }, {
3249
+ in: 'cookie',
3250
+ name: 'talqing_session',
3251
+ type: 'apiKey'
3252
+ }],
3253
+ url: '/v1/tasks/{task_id}/runs',
3254
+ ...options,
3255
+ ...params
3256
+ });
3257
+ }
3258
+ /**
3259
+ * Run Task
3260
+ *
3261
+ * Run the task once with the variables you supply, and wait for the result.
3262
+ *
3263
+ * **This executes for real**: the tools call your endpoints with your secrets,
3264
+ * the MCP servers spend your credits, and the model spends your tokens. A task
3265
+ * that books a slot, charges a card or sends a message will do so.
3266
+ *
3267
+ * `vars` must match what the task declares — an unknown name is refused rather
3268
+ * than dropped. The response is the whole run: the structured `output`, a
3269
+ * `trace` of every tool call, the steps used and what the tokens cost. On
3270
+ * failure `error.type` says whose problem it is. Secrets are redacted.
3271
+ */
3272
+ create(parameters, options) {
3273
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'runTaskRequest', map: 'body' }] }]);
3274
+ return (options?.client ?? this.client).post({
3275
+ responseStyle: 'data',
3276
+ security: [{ scheme: 'bearer', type: 'http' }, {
3277
+ in: 'cookie',
3278
+ name: 'talqing_session',
3279
+ type: 'apiKey'
3280
+ }],
3281
+ url: '/v1/tasks/{task_id}/runs',
3282
+ ...options,
3283
+ ...params,
3284
+ headers: {
3285
+ 'Content-Type': 'application/json',
3286
+ ...options?.headers,
3287
+ ...params.headers
3288
+ }
3289
+ });
3290
+ }
3291
+ /**
3292
+ * Get Task Run
3293
+ *
3294
+ * One run in full: what it produced, every tool it called on the way, and
3295
+ * what it cost.
3296
+ *
3297
+ * This is what answers "why did it write that" for a caller holding one run id
3298
+ * — an email batch's review table links each drafted row here. Secret values
3299
+ * are redacted from the trace, and a trace that was cut reports it.
3300
+ */
3301
+ get(parameters, options) {
3302
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { in: 'path', key: 'run_id' }] }]);
3303
+ return (options?.client ?? this.client).get({
3304
+ responseStyle: 'data',
3305
+ security: [{ scheme: 'bearer', type: 'http' }, {
3306
+ in: 'cookie',
3307
+ name: 'talqing_session',
3308
+ type: 'apiKey'
3309
+ }],
3310
+ url: '/v1/tasks/{task_id}/runs/{run_id}',
3311
+ ...options,
3312
+ ...params
3313
+ });
3314
+ }
3315
+ }
3316
+ exports.Runs = Runs;
3317
+ class Tasks2 extends HeyApiClient {
3318
+ /**
3319
+ * List Tasks
3320
+ *
3321
+ * List the workspace's agent tasks.
3322
+ *
3323
+ * A task is an agent nobody talks to: a prompt, one LLM, tools and MCP
3324
+ * servers, the variables it takes as input, and the typed result it must
3325
+ * produce. `last_run` says how the most recent run of each one went, so a
3326
+ * task whose prompt stopped calling `submit_result` is visible here rather
3327
+ * than only in its own history.
3328
+ */
3329
+ list(parameters, options) {
3330
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3331
+ return (options?.client ?? this.client).get({
3332
+ responseStyle: 'data',
3333
+ security: [{ scheme: 'bearer', type: 'http' }, {
3334
+ in: 'cookie',
3335
+ name: 'talqing_session',
3336
+ type: 'apiKey'
3337
+ }],
3338
+ url: '/v1/tasks',
3339
+ ...options,
3340
+ ...params
3341
+ });
3342
+ }
3343
+ /**
3344
+ * Create Task
3345
+ *
3346
+ * Create an agent task.
3347
+ *
3348
+ * A task has no draft and no publish step: it is valid the moment it saves and
3349
+ * callable immediately. An invalid config is a 400 listing every problem and
3350
+ * nothing is stored.
3351
+ *
3352
+ * `output` is what makes this a task rather than a chat agent — declare the
3353
+ * fields the model must produce and it is given a `submit_result` tool built
3354
+ * from them. `vars` are its inputs, read as `{{vars.name}}`.
3355
+ *
3356
+ * `warnings` reports the non-fatal problems. There is no publish screen to
3357
+ * show them on, so read them here.
3358
+ */
3359
+ create(parameters, options) {
3360
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createTaskRequest', map: 'body' }] }]);
3361
+ return (options?.client ?? this.client).post({
3362
+ responseStyle: 'data',
3363
+ security: [{ scheme: 'bearer', type: 'http' }, {
3364
+ in: 'cookie',
3365
+ name: 'talqing_session',
3366
+ type: 'apiKey'
3367
+ }],
3368
+ url: '/v1/tasks',
3369
+ ...options,
3370
+ ...params,
3371
+ headers: {
3372
+ 'Content-Type': 'application/json',
3373
+ ...options?.headers,
3374
+ ...params.headers
3375
+ }
3376
+ });
3377
+ }
3378
+ /**
3379
+ * Delete Task
3380
+ *
3381
+ * Delete a task. Its run history survives, still named after it.
3382
+ */
3383
+ delete(parameters, options) {
3384
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3385
+ return (options?.client ?? this.client).delete({
3386
+ responseStyle: 'data',
3387
+ security: [{ scheme: 'bearer', type: 'http' }, {
3388
+ in: 'cookie',
3389
+ name: 'talqing_session',
3390
+ type: 'apiKey'
3391
+ }],
3392
+ url: '/v1/tasks/{task_id}',
3393
+ ...options,
3394
+ ...params
3395
+ });
3396
+ }
3397
+ /**
3398
+ * Get Task
3399
+ *
3400
+ * Fetch one task's config and how its last run went.
3401
+ */
3402
+ get(parameters, options) {
3403
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }] }]);
3404
+ return (options?.client ?? this.client).get({
3405
+ responseStyle: 'data',
3406
+ security: [{ scheme: 'bearer', type: 'http' }, {
3407
+ in: 'cookie',
3408
+ name: 'talqing_session',
3409
+ type: 'apiKey'
3410
+ }],
3411
+ url: '/v1/tasks/{task_id}',
3412
+ ...options,
3413
+ ...params
3414
+ });
3415
+ }
3416
+ /**
3417
+ * Update Task
3418
+ *
3419
+ * Replace a task's config.
3420
+ *
3421
+ * The whole config is sent, so include every field you mean to keep, and it is
3422
+ * validated exactly as `create_task` is. The edit takes effect on the next run
3423
+ * — a task has no versions, so there is no old wording to go back to and no
3424
+ * record of which definition produced an earlier run.
3425
+ */
3426
+ update(parameters, options) {
3427
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'task_id' }, { key: 'patchTaskRequest', map: 'body' }] }]);
3428
+ return (options?.client ?? this.client).patch({
3429
+ responseStyle: 'data',
3430
+ security: [{ scheme: 'bearer', type: 'http' }, {
3431
+ in: 'cookie',
3432
+ name: 'talqing_session',
3433
+ type: 'apiKey'
3434
+ }],
3435
+ url: '/v1/tasks/{task_id}',
3436
+ ...options,
3437
+ ...params,
3438
+ headers: {
3439
+ 'Content-Type': 'application/json',
3440
+ ...options?.headers,
3441
+ ...params.headers
3442
+ }
3443
+ });
3444
+ }
3445
+ get runs() {
3446
+ return this._runs ?? (this._runs = new Runs({ client: this.client }));
3447
+ }
3448
+ }
3449
+ exports.Tasks2 = Tasks2;
3450
+ class Accounts extends HeyApiClient {
3451
+ /**
3452
+ * List Telephony Accounts
3453
+ *
3454
+ * List the workspace's connected carrier accounts.
3455
+ *
3456
+ * A carrier account is the credential Talqing uses to reach a phone network;
3457
+ * phone numbers hang off one. `setup_complete` and `setup_steps` say whether
3458
+ * it is finished — including the steps that can only be done in the carrier's
3459
+ * own console.
3460
+ */
3461
+ list(parameters, options) {
3462
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3463
+ return (options?.client ?? this.client).get({
3464
+ responseStyle: 'data',
3465
+ security: [{ scheme: 'bearer', type: 'http' }, {
3466
+ in: 'cookie',
3467
+ name: 'talqing_session',
3468
+ type: 'apiKey'
3469
+ }],
3470
+ url: '/v1/telephony/accounts',
3471
+ ...options,
3472
+ ...params
3473
+ });
3474
+ }
3475
+ /**
3476
+ * Create Telephony Account
3477
+ *
3478
+ * Connect a carrier account so the workspace can own phone numbers.
3479
+ *
3480
+ * `account_info` and `credentials` must carry exactly the keys that carrier's
3481
+ * `list_telephony_providers` entry declares. A credential may be plaintext —
3482
+ * stored as a workspace secret — or an existing reference.
3483
+ *
3484
+ * Creating only records the credential; call `provision_telephony_account`
3485
+ * next to build the SIP trunk.
3486
+ */
3487
+ create(parameters, options) {
3488
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createTelephonyAccountRequest', map: 'body' }] }]);
3489
+ return (options?.client ?? this.client).post({
3490
+ responseStyle: 'data',
3491
+ security: [{ scheme: 'bearer', type: 'http' }, {
3492
+ in: 'cookie',
3493
+ name: 'talqing_session',
3494
+ type: 'apiKey'
3495
+ }],
3496
+ url: '/v1/telephony/accounts',
3497
+ ...options,
3498
+ ...params,
3499
+ headers: {
3500
+ 'Content-Type': 'application/json',
3501
+ ...options?.headers,
3502
+ ...params.headers
3503
+ }
3504
+ });
3505
+ }
3506
+ /**
3507
+ * Delete Telephony Account
3508
+ *
3509
+ * Disconnect a carrier account permanently.
3510
+ *
3511
+ * Every phone number on it must be disabled first, so this can never silently
3512
+ * take live numbers off the air. Deleting also tears down the SIP trunk.
3513
+ */
3514
+ delete(parameters, options) {
3515
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'account_id' }] }]);
3516
+ return (options?.client ?? this.client).delete({
3517
+ responseStyle: 'data',
3518
+ security: [{ scheme: 'bearer', type: 'http' }, {
3519
+ in: 'cookie',
3520
+ name: 'talqing_session',
3521
+ type: 'apiKey'
3522
+ }],
3523
+ url: '/v1/telephony/accounts/{account_id}',
3524
+ ...options,
3525
+ ...params
3526
+ });
3527
+ }
3528
+ /**
3529
+ * Get Telephony Account
3530
+ *
3531
+ * Read one carrier account, including what its setup still needs.
3532
+ *
3533
+ * `setup_steps` is the authoritative checklist — read it rather than trying
3534
+ * to re-derive setup state from `provider_state`. A step marked
3535
+ * `user_confirmable` cannot be checked over any API; it is done in the
3536
+ * carrier's console and confirmed with `patch_telephony_account`.
3537
+ */
3538
+ get(parameters, options) {
3539
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'account_id' }] }]);
3540
+ return (options?.client ?? this.client).get({
3541
+ responseStyle: 'data',
3542
+ security: [{ scheme: 'bearer', type: 'http' }, {
3543
+ in: 'cookie',
3544
+ name: 'talqing_session',
3545
+ type: 'apiKey'
3546
+ }],
3547
+ url: '/v1/telephony/accounts/{account_id}',
3548
+ ...options,
3549
+ ...params
3550
+ });
3551
+ }
3552
+ /**
3553
+ * Patch Telephony Account
3554
+ *
3555
+ * Update a carrier account: rename it, replace credentials, or disable it.
3556
+ *
3557
+ * Only the fields you send change. `status` accepts `disabled` to stop the
3558
+ * account and `connected` to re-enable it. Set `console_setup_confirmed` when
3559
+ * the user says they have finished the carrier-console steps — no API can
3560
+ * verify that work, and inbound calling on this account's numbers stays
3561
+ * blocked until they confirm.
3562
+ */
3563
+ update(parameters, options) {
3564
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'account_id' }, { key: 'patchTelephonyAccountRequest', map: 'body' }] }]);
3565
+ return (options?.client ?? this.client).patch({
3566
+ responseStyle: 'data',
3567
+ security: [{ scheme: 'bearer', type: 'http' }, {
3568
+ in: 'cookie',
3569
+ name: 'talqing_session',
3570
+ type: 'apiKey'
3571
+ }],
3572
+ url: '/v1/telephony/accounts/{account_id}',
3573
+ ...options,
3574
+ ...params,
3575
+ headers: {
3576
+ 'Content-Type': 'application/json',
3577
+ ...options?.headers,
3578
+ ...params.headers
3579
+ }
3580
+ });
3581
+ }
3582
+ /**
3583
+ * Provision Telephony Account
3584
+ *
3585
+ * Build (or repair) the SIP trunk between Talqing and the carrier.
3586
+ *
3587
+ * Run this after connecting an account, and again after replacing its
3588
+ * credentials. It is safe to repeat: it converges the carrier side to what
3589
+ * the account should have rather than creating a second trunk. The response's
3590
+ * `status` and `setup_steps` say what is working and what is left.
3591
+ */
3592
+ provision(parameters, options) {
3593
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'account_id' }] }]);
3594
+ return (options?.client ?? this.client).post({
3595
+ responseStyle: 'data',
3596
+ security: [{ scheme: 'bearer', type: 'http' }, {
3597
+ in: 'cookie',
3598
+ name: 'talqing_session',
3599
+ type: 'apiKey'
3600
+ }],
3601
+ url: '/v1/telephony/accounts/{account_id}/provision',
3602
+ ...options,
3603
+ ...params
3604
+ });
3605
+ }
3606
+ /**
3607
+ * List Remote Numbers
3608
+ *
3609
+ * List the numbers this account owns at the carrier, ready to import.
3610
+ *
3611
+ * Read live from the carrier, so it also proves the credentials work.
3612
+ * `already_imported` marks the ones Talqing already has — pass the rest to
3613
+ * `import_phone_numbers`. Buying a number is done at the carrier, not here.
3614
+ */
3615
+ remoteNumbers(parameters, options) {
3616
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
3617
+ { in: 'path', key: 'account_id' },
3618
+ { in: 'query', key: 'limit' },
3619
+ { in: 'query', key: 'offset' }
3620
+ ] }]);
3621
+ return (options?.client ?? this.client).get({
3622
+ responseStyle: 'data',
3623
+ security: [{ scheme: 'bearer', type: 'http' }, {
3624
+ in: 'cookie',
3625
+ name: 'talqing_session',
3626
+ type: 'apiKey'
3627
+ }],
3628
+ url: '/v1/telephony/accounts/{account_id}/remote-numbers',
3629
+ ...options,
3630
+ ...params
3631
+ });
3632
+ }
3633
+ }
3634
+ exports.Accounts = Accounts;
3635
+ class PhoneNumbers extends HeyApiClient {
3636
+ /**
3637
+ * List Phone Numbers
3638
+ *
3639
+ * List the workspace's phone numbers, optionally for one carrier account.
3640
+ *
3641
+ * `readiness` is the field to report to a user — it collapses status,
3642
+ * capability and routing into the one answer they want: `live` (answering
3643
+ * inbound), `needs_agent`, `needs_carrier_setup`, `setting_up`, `error` or
3644
+ * `disabled`.
3645
+ */
3646
+ list(parameters, options) {
3647
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
3648
+ { in: 'query', key: 'account_id' },
3649
+ { in: 'query', key: 'limit' },
3650
+ { in: 'query', key: 'offset' }
3651
+ ] }]);
3652
+ return (options?.client ?? this.client).get({
3653
+ responseStyle: 'data',
3654
+ security: [{ scheme: 'bearer', type: 'http' }, {
3655
+ in: 'cookie',
3656
+ name: 'talqing_session',
3657
+ type: 'apiKey'
3658
+ }],
3659
+ url: '/v1/telephony/phone-numbers',
3660
+ ...options,
3661
+ ...params
3662
+ });
3663
+ }
3664
+ /**
3665
+ * Import Phone Numbers
3666
+ *
3667
+ * Bring carrier-owned numbers into the workspace, provisioning each one.
3668
+ *
3669
+ * Per number, not all-or-nothing: `items` carries one result per requested
3670
+ * E.164, so check every `ok` rather than assuming a 200 means all of them
3671
+ * landed. `provision` defaults to true, which is what makes a number usable.
3672
+ */
3673
+ import(parameters, options) {
3674
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'importPhoneNumbersRequest', map: 'body' }] }]);
3675
+ return (options?.client ?? this.client).post({
3676
+ responseStyle: 'data',
3677
+ security: [{ scheme: 'bearer', type: 'http' }, {
3678
+ in: 'cookie',
3679
+ name: 'talqing_session',
3680
+ type: 'apiKey'
3681
+ }],
3682
+ url: '/v1/telephony/phone-numbers/import',
3683
+ ...options,
3684
+ ...params,
3685
+ headers: {
3686
+ 'Content-Type': 'application/json',
3687
+ ...options?.headers,
3688
+ ...params.headers
3689
+ }
3690
+ });
3691
+ }
3692
+ /**
3693
+ * Get Phone Number
3694
+ *
3695
+ * Read one phone number: its carrier, capabilities, agent and readiness.
3696
+ */
3697
+ get(parameters, options) {
3698
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'number_id' }] }]);
3699
+ return (options?.client ?? this.client).get({
3700
+ responseStyle: 'data',
3701
+ security: [{ scheme: 'bearer', type: 'http' }, {
3702
+ in: 'cookie',
3703
+ name: 'talqing_session',
3704
+ type: 'apiKey'
3705
+ }],
3706
+ url: '/v1/telephony/phone-numbers/{number_id}',
3707
+ ...options,
3708
+ ...params
3709
+ });
3710
+ }
3711
+ /**
3712
+ * Patch Phone Number
3713
+ *
3714
+ * Relabel a number, change what it may do, or take it out of service.
3715
+ *
3716
+ * `can_inbound` and `can_outbound` gate the directions it will carry.
3717
+ * `status` accepts `disabled`, which tears down its LiveKit routing, and
3718
+ * `pending`, which re-opens a disabled number so it can be provisioned again.
3719
+ */
3720
+ update(parameters, options) {
3721
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'number_id' }, { key: 'patchPhoneNumberRequest', map: 'body' }] }]);
3722
+ return (options?.client ?? this.client).patch({
3723
+ responseStyle: 'data',
3724
+ security: [{ scheme: 'bearer', type: 'http' }, {
3725
+ in: 'cookie',
3726
+ name: 'talqing_session',
3727
+ type: 'apiKey'
3728
+ }],
3729
+ url: '/v1/telephony/phone-numbers/{number_id}',
3730
+ ...options,
3731
+ ...params,
3732
+ headers: {
3733
+ 'Content-Type': 'application/json',
3734
+ ...options?.headers,
3735
+ ...params.headers
3736
+ }
3737
+ });
3738
+ }
3739
+ /**
3740
+ * Assign Phone Number
3741
+ *
3742
+ * Put an agent on a number so it answers incoming calls.
3743
+ *
3744
+ * The agent must be **published** and on the `voice` or `video` channel, and
3745
+ * the number active, inbound-capable and on a ready carrier account — each is
3746
+ * refused with the reason. One agent per number; assigning again replaces the
3747
+ * previous one. Republishing the agent later needs no reassignment.
3748
+ */
3749
+ assign(parameters, options) {
3750
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'number_id' }, { key: 'assignPhoneNumberRequest', map: 'body' }] }]);
3751
+ return (options?.client ?? this.client).post({
3752
+ responseStyle: 'data',
3753
+ security: [{ scheme: 'bearer', type: 'http' }, {
3754
+ in: 'cookie',
3755
+ name: 'talqing_session',
3756
+ type: 'apiKey'
3757
+ }],
3758
+ url: '/v1/telephony/phone-numbers/{number_id}/assign',
3759
+ ...options,
3760
+ ...params,
3761
+ headers: {
3762
+ 'Content-Type': 'application/json',
3763
+ ...options?.headers,
3764
+ ...params.headers
3765
+ }
3766
+ });
3767
+ }
3768
+ /**
3769
+ * Provision Phone Number
3770
+ *
3771
+ * Wire a number up at the carrier and in LiveKit so it can carry calls.
3772
+ *
3773
+ * `import_phone_numbers` already does this unless it was called with
3774
+ * `provision: false`; use this to retry a number left in `error`, or to bring
3775
+ * one back after re-enabling it.
3776
+ */
3777
+ provision(parameters, options) {
3778
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'number_id' }] }]);
3779
+ return (options?.client ?? this.client).post({
3780
+ responseStyle: 'data',
3781
+ security: [{ scheme: 'bearer', type: 'http' }, {
3782
+ in: 'cookie',
3783
+ name: 'talqing_session',
3784
+ type: 'apiKey'
3785
+ }],
3786
+ url: '/v1/telephony/phone-numbers/{number_id}/provision',
3787
+ ...options,
3788
+ ...params
3789
+ });
3790
+ }
3791
+ /**
3792
+ * Unassign Phone Number
3793
+ *
3794
+ * Take the agent off a number, so incoming calls are no longer answered.
3795
+ *
3796
+ * The number stays provisioned and can still place outbound calls; its
3797
+ * readiness drops to `needs_agent`.
3798
+ */
3799
+ unassign(parameters, options) {
3800
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'number_id' }] }]);
3801
+ return (options?.client ?? this.client).post({
3802
+ responseStyle: 'data',
3803
+ security: [{ scheme: 'bearer', type: 'http' }, {
3804
+ in: 'cookie',
3805
+ name: 'talqing_session',
3806
+ type: 'apiKey'
3807
+ }],
3808
+ url: '/v1/telephony/phone-numbers/{number_id}/unassign',
3809
+ ...options,
3810
+ ...params
3811
+ });
3812
+ }
3813
+ }
3814
+ exports.PhoneNumbers = PhoneNumbers;
3815
+ class Providers extends HeyApiClient {
3816
+ /**
3817
+ * List Telephony Providers
3818
+ *
3819
+ * List the telephony carriers an account can be connected to.
3820
+ *
3821
+ * `account_info_keys`, `credential_keys` and `setup_fields` state exactly what
3822
+ * connecting each carrier needs — read this before `create_telephony_account`
3823
+ * rather than guessing field names. Entries with `implemented: false` have no
3824
+ * adapter yet and cannot be used.
3825
+ */
3826
+ list(parameters, options) {
3827
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3828
+ return (options?.client ?? this.client).get({
3829
+ responseStyle: 'data',
3830
+ security: [{ scheme: 'bearer', type: 'http' }, {
3831
+ in: 'cookie',
3832
+ name: 'talqing_session',
3833
+ type: 'apiKey'
3834
+ }],
3835
+ url: '/v1/telephony/providers',
3836
+ ...options,
3837
+ ...params
3838
+ });
3839
+ }
3840
+ }
3841
+ exports.Providers = Providers;
3842
+ class Telephony extends HeyApiClient {
3843
+ get accounts() {
3844
+ return this._accounts ?? (this._accounts = new Accounts({ client: this.client }));
3845
+ }
3846
+ get phoneNumbers() {
3847
+ return this._phoneNumbers ?? (this._phoneNumbers = new PhoneNumbers({ client: this.client }));
3848
+ }
3849
+ get providers() {
3850
+ return this._providers ?? (this._providers = new Providers({ client: this.client }));
3851
+ }
3852
+ }
3853
+ exports.Telephony = Telephony;
3854
+ class Versions2 extends HeyApiClient {
3855
+ /**
3856
+ * Get Tool Version
3857
+ *
3858
+ * Fetch what one published version of a tool actually contains.
3859
+ *
3860
+ * `get_tool` lists the versions and when each was published; this returns the
3861
+ * frozen definition itself — the arguments, behaviour flags and operation tree
3862
+ * exactly as they were at that publish. Use it to see what changed between two
3863
+ * versions, or between a version and the current draft.
3864
+ */
3865
+ get(parameters, options) {
3866
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { in: 'path', key: 'version' }] }]);
3867
+ return (options?.client ?? this.client).get({
3868
+ responseStyle: 'data',
3869
+ security: [{ scheme: 'bearer', type: 'http' }, {
3870
+ in: 'cookie',
3871
+ name: 'talqing_session',
3872
+ type: 'apiKey'
3873
+ }],
3874
+ url: '/v1/tools/{tool_id}/versions/{version}',
3875
+ ...options,
3876
+ ...params
3877
+ });
3878
+ }
3879
+ /**
3880
+ * Rollback Tool Version
3881
+ *
3882
+ * Put an earlier published version of a tool back into production.
3883
+ *
3884
+ * That version becomes live immediately and **replaces the current draft**, so
3885
+ * any unpublished edits are lost. No new version is created.
3886
+ *
3887
+ * Agents already published keep the tool definition they were published with,
3888
+ * so republish them for the rollback to reach live calls.
3889
+ */
3890
+ rollback(parameters, options) {
3891
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { in: 'path', key: 'version' }] }]);
3892
+ return (options?.client ?? this.client).post({
3893
+ responseStyle: 'data',
3894
+ security: [{ scheme: 'bearer', type: 'http' }, {
3895
+ in: 'cookie',
3896
+ name: 'talqing_session',
3897
+ type: 'apiKey'
3898
+ }],
3899
+ url: '/v1/tools/{tool_id}/versions/{version}/rollback',
3900
+ ...options,
3901
+ ...params
3902
+ });
3903
+ }
3904
+ }
3905
+ exports.Versions2 = Versions2;
3906
+ class Tools2 extends HeyApiClient {
3907
+ /**
3908
+ * List Tools
3909
+ *
3910
+ * List the workspace's tools with their draft operation trees.
3911
+ *
3912
+ * `published_version` is null for a tool that has never been published; only
3913
+ * published tools can be attached to an agent or used as a lifecycle hook.
3914
+ */
3915
+ list(parameters, options) {
3916
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
3917
+ return (options?.client ?? this.client).get({
3918
+ responseStyle: 'data',
3919
+ security: [{ scheme: 'bearer', type: 'http' }, {
3920
+ in: 'cookie',
3921
+ name: 'talqing_session',
3922
+ type: 'apiKey'
3923
+ }],
3924
+ url: '/v1/tools',
3925
+ ...options,
3926
+ ...params
3927
+ });
3928
+ }
3929
+ /**
3930
+ * Create Tool
3931
+ *
3932
+ * Create a draft tool.
3933
+ *
3934
+ * `name` is the function name the agent's LLM sees, so it must be a valid
3935
+ * identifier and describe the capability. `json_schema` declares the arguments
3936
+ * that LLM supplies. `operations` may be sent here or added later with a
3937
+ * patch. The tool is a draft until published.
3938
+ */
3939
+ create(parameters, options) {
3940
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createToolRequest', map: 'body' }] }]);
3941
+ return (options?.client ?? this.client).post({
3942
+ responseStyle: 'data',
3943
+ security: [{ scheme: 'bearer', type: 'http' }, {
3944
+ in: 'cookie',
3945
+ name: 'talqing_session',
3946
+ type: 'apiKey'
3947
+ }],
3948
+ url: '/v1/tools',
3949
+ ...options,
3950
+ ...params,
3951
+ headers: {
3952
+ 'Content-Type': 'application/json',
3953
+ ...options?.headers,
3954
+ ...params.headers
3955
+ }
3956
+ });
3957
+ }
3958
+ /**
3959
+ * Delete Tool
3960
+ *
3961
+ * Delete a tool and its published versions permanently.
3962
+ */
3963
+ delete(parameters, options) {
3964
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }] }]);
3965
+ return (options?.client ?? this.client).delete({
3966
+ responseStyle: 'data',
3967
+ security: [{ scheme: 'bearer', type: 'http' }, {
3968
+ in: 'cookie',
3969
+ name: 'talqing_session',
3970
+ type: 'apiKey'
3971
+ }],
3972
+ url: '/v1/tools/{tool_id}',
3973
+ ...options,
3974
+ ...params
3975
+ });
3976
+ }
3977
+ /**
3978
+ * Get Tool
3979
+ *
3980
+ * Fetch one tool: behaviour flags, argument schema, draft operation tree
3981
+ * and the list of published versions.
3982
+ */
3983
+ get(parameters, options) {
3984
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }] }]);
3985
+ return (options?.client ?? this.client).get({
3986
+ responseStyle: 'data',
3987
+ security: [{ scheme: 'bearer', type: 'http' }, {
3988
+ in: 'cookie',
3989
+ name: 'talqing_session',
3990
+ type: 'apiKey'
3991
+ }],
3992
+ url: '/v1/tools/{tool_id}',
3993
+ ...options,
3994
+ ...params
3995
+ });
3996
+ }
3997
+ /**
3998
+ * Patch Tool
3999
+ *
4000
+ * Update a draft tool. Omitted fields are left unchanged.
4001
+ *
4002
+ * `operations` is the one exception: sending it replaces the entire tree, so
4003
+ * include every node you want to keep. Changes land on the draft; publish to
4004
+ * make them live.
4005
+ */
4006
+ update(parameters, options) {
4007
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { key: 'patchToolRequest', map: 'body' }] }]);
4008
+ return (options?.client ?? this.client).patch({
4009
+ responseStyle: 'data',
4010
+ security: [{ scheme: 'bearer', type: 'http' }, {
4011
+ in: 'cookie',
4012
+ name: 'talqing_session',
4013
+ type: 'apiKey'
4014
+ }],
4015
+ url: '/v1/tools/{tool_id}',
4016
+ ...options,
4017
+ ...params,
4018
+ headers: {
4019
+ 'Content-Type': 'application/json',
4020
+ ...options?.headers,
4021
+ ...params.headers
4022
+ }
4023
+ });
4024
+ }
4025
+ /**
4026
+ * Publish Tool
4027
+ *
4028
+ * Validate the draft and freeze it as a new immutable tool version.
4029
+ *
4030
+ * Required before the tool can be attached to an agent or used as a lifecycle
4031
+ * hook. Agents already published keep the definition they were published with
4032
+ * until they are republished.
4033
+ */
4034
+ publish(parameters, options) {
4035
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { key: 'publishToolRequest', map: 'body' }] }]);
4036
+ return (options?.client ?? this.client).post({
4037
+ responseStyle: 'data',
4038
+ security: [{ scheme: 'bearer', type: 'http' }, {
4039
+ in: 'cookie',
4040
+ name: 'talqing_session',
4041
+ type: 'apiKey'
4042
+ }],
4043
+ url: '/v1/tools/{tool_id}/publish',
4044
+ ...options,
4045
+ ...params,
4046
+ headers: {
4047
+ 'Content-Type': 'application/json',
4048
+ ...options?.headers,
4049
+ ...params.headers
4050
+ }
4051
+ });
4052
+ }
4053
+ /**
4054
+ * Run Tool
4055
+ *
4056
+ * Run the draft tool once with arguments you supply and see every step.
4057
+ *
4058
+ * This executes for real: HTTP operations call your endpoints with your
4059
+ * secrets, so a tool that books a slot or charges a card will do so.
4060
+ * Conversational operations (`say`, `generate_reply`, `add_message`,
4061
+ * `handoff`, `end_call`, `frontend_rpc`) are recorded with their resolved text
4062
+ * rather than performed.
4063
+ *
4064
+ * Each step reports the resolved request and response, the branch an `if`
4065
+ * took, and everything published into `tooldata` or `userdata`. Secrets are
4066
+ * redacted. Nothing is saved, so there is no need to publish first.
4067
+ */
4068
+ run(parameters, options) {
4069
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }, { key: 'runToolRequest', map: 'body' }] }]);
4070
+ return (options?.client ?? this.client).post({
4071
+ responseStyle: 'data',
4072
+ security: [{ scheme: 'bearer', type: 'http' }, {
4073
+ in: 'cookie',
4074
+ name: 'talqing_session',
4075
+ type: 'apiKey'
4076
+ }],
4077
+ url: '/v1/tools/{tool_id}/run',
4078
+ ...options,
4079
+ ...params,
4080
+ headers: {
4081
+ 'Content-Type': 'application/json',
4082
+ ...options?.headers,
4083
+ ...params.headers
4084
+ }
4085
+ });
4086
+ }
4087
+ /**
4088
+ * Validate Tool
4089
+ *
4090
+ * Check the draft operation tree without publishing it.
4091
+ *
4092
+ * Reports unknown argument and secret references, unreachable published
4093
+ * fields, handoff targets that are not published, code that fails to
4094
+ * transpile, and userdata read before it is written.
4095
+ */
4096
+ validate(parameters, options) {
4097
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'tool_id' }] }]);
4098
+ return (options?.client ?? this.client).post({
4099
+ responseStyle: 'data',
4100
+ security: [{ scheme: 'bearer', type: 'http' }, {
4101
+ in: 'cookie',
4102
+ name: 'talqing_session',
4103
+ type: 'apiKey'
4104
+ }],
4105
+ url: '/v1/tools/{tool_id}/validate',
4106
+ ...options,
4107
+ ...params
4108
+ });
4109
+ }
4110
+ get versions() {
4111
+ return this._versions ?? (this._versions = new Versions2({ client: this.client }));
4112
+ }
4113
+ }
4114
+ exports.Tools2 = Tools2;
4115
+ class Webhooks extends HeyApiClient {
4116
+ /**
4117
+ * List Webhooks
4118
+ *
4119
+ * List the workspace's webhooks with their subscriptions and last delivery
4120
+ * result. Signing secrets are returned only as a masked hint.
4121
+ */
4122
+ list(parameters, options) {
4123
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'query', key: 'limit' }, { in: 'query', key: 'offset' }] }]);
4124
+ return (options?.client ?? this.client).get({
4125
+ responseStyle: 'data',
4126
+ security: [{ scheme: 'bearer', type: 'http' }, {
4127
+ in: 'cookie',
4128
+ name: 'talqing_session',
4129
+ type: 'apiKey'
4130
+ }],
4131
+ url: '/v1/webhooks',
4132
+ ...options,
4133
+ ...params
4134
+ });
4135
+ }
4136
+ /**
4137
+ * Create Webhook
4138
+ *
4139
+ * Create a webhook. Webhooks are workspace-wide — they fire for every agent.
4140
+ *
4141
+ * An empty `subscribed_events` subscribes to all events. A signing secret is
4142
+ * generated when none is supplied; either way the plaintext secret is returned
4143
+ * once here and never again.
4144
+ */
4145
+ create(parameters, options) {
4146
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ key: 'createWebhookRequest', map: 'body' }] }]);
4147
+ return (options?.client ?? this.client).post({
4148
+ responseStyle: 'data',
4149
+ security: [{ scheme: 'bearer', type: 'http' }, {
4150
+ in: 'cookie',
4151
+ name: 'talqing_session',
4152
+ type: 'apiKey'
4153
+ }],
4154
+ url: '/v1/webhooks',
4155
+ ...options,
4156
+ ...params,
4157
+ headers: {
4158
+ 'Content-Type': 'application/json',
4159
+ ...options?.headers,
4160
+ ...params.headers
4161
+ }
4162
+ });
4163
+ }
4164
+ /**
4165
+ * Event Types
4166
+ *
4167
+ * List every event a webhook can subscribe to, and which are emitted today.
4168
+ */
4169
+ eventTypes(options) {
4170
+ return (options?.client ?? this.client).get({
4171
+ responseStyle: 'data',
4172
+ security: [{ scheme: 'bearer', type: 'http' }, {
4173
+ in: 'cookie',
4174
+ name: 'talqing_session',
4175
+ type: 'apiKey'
4176
+ }],
4177
+ url: '/v1/webhooks/event-types',
4178
+ ...options
4179
+ });
4180
+ }
4181
+ /**
4182
+ * Delete Webhook
4183
+ *
4184
+ * Delete a webhook permanently.
4185
+ */
4186
+ delete(parameters, options) {
4187
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'webhook_id' }] }]);
4188
+ return (options?.client ?? this.client).delete({
4189
+ responseStyle: 'data',
4190
+ security: [{ scheme: 'bearer', type: 'http' }, {
4191
+ in: 'cookie',
4192
+ name: 'talqing_session',
4193
+ type: 'apiKey'
4194
+ }],
4195
+ url: '/v1/webhooks/{webhook_id}',
4196
+ ...options,
4197
+ ...params
4198
+ });
4199
+ }
4200
+ /**
4201
+ * Patch Webhook
4202
+ *
4203
+ * Update a webhook's URL, subscriptions or status. Omitted fields are left
4204
+ * unchanged; a disabled webhook stops receiving deliveries.
4205
+ */
4206
+ update(parameters, options) {
4207
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'webhook_id' }, { key: 'patchWebhookRequest', map: 'body' }] }]);
4208
+ return (options?.client ?? this.client).patch({
4209
+ responseStyle: 'data',
4210
+ security: [{ scheme: 'bearer', type: 'http' }, {
4211
+ in: 'cookie',
4212
+ name: 'talqing_session',
4213
+ type: 'apiKey'
4214
+ }],
4215
+ url: '/v1/webhooks/{webhook_id}',
4216
+ ...options,
4217
+ ...params,
4218
+ headers: {
4219
+ 'Content-Type': 'application/json',
4220
+ ...options?.headers,
4221
+ ...params.headers
4222
+ }
4223
+ });
4224
+ }
4225
+ /**
4226
+ * Webhook Deliveries
4227
+ *
4228
+ * List recent delivery attempts for one webhook — event, response status
4229
+ * and error — newest first. The place to look when a webhook seems silent.
4230
+ */
4231
+ deliveries(parameters, options) {
4232
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [
4233
+ { in: 'path', key: 'webhook_id' },
4234
+ { in: 'query', key: 'limit' },
4235
+ { in: 'query', key: 'offset' }
4236
+ ] }]);
4237
+ return (options?.client ?? this.client).get({
4238
+ responseStyle: 'data',
4239
+ security: [{ scheme: 'bearer', type: 'http' }, {
4240
+ in: 'cookie',
4241
+ name: 'talqing_session',
4242
+ type: 'apiKey'
4243
+ }],
4244
+ url: '/v1/webhooks/{webhook_id}/deliveries',
4245
+ ...options,
4246
+ ...params
4247
+ });
4248
+ }
4249
+ /**
4250
+ * Rotate Webhook Secret
4251
+ *
4252
+ * Issue a new signing secret, invalidating the old one immediately.
4253
+ *
4254
+ * The new plaintext secret is returned once here; the receiver must be updated
4255
+ * or signature checks will start failing.
4256
+ */
4257
+ rotateSecret(parameters, options) {
4258
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'webhook_id' }] }]);
4259
+ return (options?.client ?? this.client).post({
4260
+ responseStyle: 'data',
4261
+ security: [{ scheme: 'bearer', type: 'http' }, {
4262
+ in: 'cookie',
4263
+ name: 'talqing_session',
4264
+ type: 'apiKey'
4265
+ }],
4266
+ url: '/v1/webhooks/{webhook_id}/rotate-secret',
4267
+ ...options,
4268
+ ...params
4269
+ });
4270
+ }
4271
+ /**
4272
+ * Test Webhook
4273
+ *
4274
+ * Send a signed test event and return the endpoint's response, so delivery
4275
+ * and signature verification can be checked end to end.
4276
+ */
4277
+ test(parameters, options) {
4278
+ const params = (0, index_js_1.buildClientParams)([parameters], [{ args: [{ in: 'path', key: 'webhook_id' }] }]);
4279
+ return (options?.client ?? this.client).post({
4280
+ responseStyle: 'data',
4281
+ security: [{ scheme: 'bearer', type: 'http' }, {
4282
+ in: 'cookie',
4283
+ name: 'talqing_session',
4284
+ type: 'apiKey'
4285
+ }],
4286
+ url: '/v1/webhooks/{webhook_id}/test',
4287
+ ...options,
4288
+ ...params
4289
+ });
4290
+ }
4291
+ }
4292
+ exports.Webhooks = Webhooks;
4293
+ class TalqingApi extends HeyApiClient {
4294
+ constructor(args) {
4295
+ super(args);
4296
+ TalqingApi.__registry.set(this, args?.key);
4297
+ }
4298
+ /**
4299
+ * Health
4300
+ *
4301
+ * Liveness probe: `200` once this process is serving. Unauthenticated.
4302
+ *
4303
+ * It answers for the API process, not its dependencies — a `200` here does not
4304
+ * promise Postgres, Redis or LiveKit are reachable.
4305
+ */
4306
+ health(options) {
4307
+ return (options?.client ?? this.client).get({
4308
+ responseStyle: 'data',
4309
+ url: '/health',
4310
+ ...options
4311
+ });
4312
+ }
4313
+ get agents() {
4314
+ return this._agents ?? (this._agents = new Agents({ client: this.client }));
4315
+ }
4316
+ get auth() {
4317
+ return this._auth ?? (this._auth = new Auth({ client: this.client }));
4318
+ }
4319
+ get providerKeys() {
4320
+ return this._providerKeys ?? (this._providerKeys = new ProviderKeys({ client: this.client }));
4321
+ }
4322
+ get calls() {
4323
+ return this._calls ?? (this._calls = new Calls({ client: this.client }));
4324
+ }
4325
+ get catalog() {
4326
+ return this._catalog ?? (this._catalog = new Catalog({ client: this.client }));
4327
+ }
4328
+ get conversations() {
4329
+ return this._conversations ?? (this._conversations = new Conversations({ client: this.client }));
4330
+ }
4331
+ get copilot() {
4332
+ return this._copilot ?? (this._copilot = new Copilot({ client: this.client }));
4333
+ }
4334
+ get email() {
4335
+ return this._email ?? (this._email = new Email({ client: this.client }));
4336
+ }
4337
+ get integrations() {
4338
+ return this._integrations ?? (this._integrations = new Integrations({ client: this.client }));
4339
+ }
4340
+ get knowledge() {
4341
+ return this._knowledge ?? (this._knowledge = new Knowledge2({ client: this.client }));
4342
+ }
4343
+ get tokens() {
4344
+ return this._tokens ?? (this._tokens = new Tokens({ client: this.client }));
4345
+ }
4346
+ get observability() {
4347
+ return this._observability ?? (this._observability = new Observability({ client: this.client }));
4348
+ }
4349
+ get orgs() {
4350
+ return this._orgs ?? (this._orgs = new Orgs({ client: this.client }));
4351
+ }
4352
+ get schemas() {
4353
+ return this._schemas ?? (this._schemas = new Schemas({ client: this.client }));
4354
+ }
4355
+ get secrets() {
4356
+ return this._secrets ?? (this._secrets = new Secrets({ client: this.client }));
4357
+ }
4358
+ get tasks() {
4359
+ return this._tasks ?? (this._tasks = new Tasks2({ client: this.client }));
4360
+ }
4361
+ get telephony() {
4362
+ return this._telephony ?? (this._telephony = new Telephony({ client: this.client }));
4363
+ }
4364
+ get tools() {
4365
+ return this._tools ?? (this._tools = new Tools2({ client: this.client }));
4366
+ }
4367
+ get webhooks() {
4368
+ return this._webhooks ?? (this._webhooks = new Webhooks({ client: this.client }));
4369
+ }
4370
+ }
4371
+ exports.TalqingApi = TalqingApi;
4372
+ TalqingApi.__registry = new HeyApiRegistry();
4373
+ //# sourceMappingURL=sdk.gen.js.map