@roarkanalytics/sdk 7.9.0 → 8.0.1

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 (205) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/client.d.mts +20 -5
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +20 -5
  5. package/client.d.ts.map +1 -1
  6. package/client.js +21 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +21 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-connection.d.mts +1952 -0
  12. package/resources/agent-connection.d.mts.map +1 -0
  13. package/resources/agent-connection.d.ts +1952 -0
  14. package/resources/agent-connection.d.ts.map +1 -0
  15. package/resources/agent-connection.js +173 -0
  16. package/resources/agent-connection.js.map +1 -0
  17. package/resources/agent-connection.mjs +169 -0
  18. package/resources/agent-connection.mjs.map +1 -0
  19. package/resources/agent-conversation.d.mts +110 -0
  20. package/resources/agent-conversation.d.mts.map +1 -0
  21. package/resources/agent-conversation.d.ts +110 -0
  22. package/resources/agent-conversation.d.ts.map +1 -0
  23. package/resources/agent-conversation.js +41 -0
  24. package/resources/agent-conversation.js.map +1 -0
  25. package/resources/agent-conversation.mjs +37 -0
  26. package/resources/agent-conversation.mjs.map +1 -0
  27. package/resources/agent-draft.d.mts +101 -35
  28. package/resources/agent-draft.d.mts.map +1 -1
  29. package/resources/agent-draft.d.ts +101 -35
  30. package/resources/agent-draft.d.ts.map +1 -1
  31. package/resources/agent-endpoint.d.mts +4 -4
  32. package/resources/agent-endpoint.d.mts.map +1 -1
  33. package/resources/agent-endpoint.d.ts +4 -4
  34. package/resources/agent-endpoint.d.ts.map +1 -1
  35. package/resources/agent-setup.d.mts +1057 -0
  36. package/resources/agent-setup.d.mts.map +1 -0
  37. package/resources/agent-setup.d.ts +1057 -0
  38. package/resources/agent-setup.d.ts.map +1 -0
  39. package/resources/agent-setup.js +113 -0
  40. package/resources/agent-setup.js.map +1 -0
  41. package/resources/agent-setup.mjs +109 -0
  42. package/resources/agent-setup.mjs.map +1 -0
  43. package/resources/agent-version.d.mts +57 -18
  44. package/resources/agent-version.d.mts.map +1 -1
  45. package/resources/agent-version.d.ts +57 -18
  46. package/resources/agent-version.d.ts.map +1 -1
  47. package/resources/agent.d.mts +263 -4
  48. package/resources/agent.d.mts.map +1 -1
  49. package/resources/agent.d.ts +263 -4
  50. package/resources/agent.d.ts.map +1 -1
  51. package/resources/calendar-connection.d.mts +834 -56
  52. package/resources/calendar-connection.d.mts.map +1 -1
  53. package/resources/calendar-connection.d.ts +834 -56
  54. package/resources/calendar-connection.d.ts.map +1 -1
  55. package/resources/calendar-connection.js +127 -8
  56. package/resources/calendar-connection.js.map +1 -1
  57. package/resources/calendar-connection.mjs +127 -8
  58. package/resources/calendar-connection.mjs.map +1 -1
  59. package/resources/call.d.mts +2 -2
  60. package/resources/call.d.mts.map +1 -1
  61. package/resources/call.d.ts +2 -2
  62. package/resources/call.d.ts.map +1 -1
  63. package/resources/config.d.mts +78 -36
  64. package/resources/config.d.mts.map +1 -1
  65. package/resources/config.d.ts +78 -36
  66. package/resources/config.d.ts.map +1 -1
  67. package/resources/conversation.d.mts +156 -0
  68. package/resources/conversation.d.mts.map +1 -0
  69. package/resources/conversation.d.ts +156 -0
  70. package/resources/conversation.d.ts.map +1 -0
  71. package/resources/conversation.js +40 -0
  72. package/resources/conversation.js.map +1 -0
  73. package/resources/conversation.mjs +36 -0
  74. package/resources/conversation.mjs.map +1 -0
  75. package/resources/customer-flow-edge-case.d.mts +637 -40
  76. package/resources/customer-flow-edge-case.d.mts.map +1 -1
  77. package/resources/customer-flow-edge-case.d.ts +637 -40
  78. package/resources/customer-flow-edge-case.d.ts.map +1 -1
  79. package/resources/customer-flow.d.mts +2583 -156
  80. package/resources/customer-flow.d.mts.map +1 -1
  81. package/resources/customer-flow.d.ts +2583 -156
  82. package/resources/customer-flow.d.ts.map +1 -1
  83. package/resources/{customer-profile.d.mts → customer.d.mts} +287 -92
  84. package/resources/customer.d.mts.map +1 -0
  85. package/resources/{customer-profile.d.ts → customer.d.ts} +287 -92
  86. package/resources/customer.d.ts.map +1 -0
  87. package/resources/customer.js +180 -0
  88. package/resources/customer.js.map +1 -0
  89. package/resources/customer.mjs +176 -0
  90. package/resources/customer.mjs.map +1 -0
  91. package/resources/index.d.mts +7 -2
  92. package/resources/index.d.mts.map +1 -1
  93. package/resources/index.d.ts +7 -2
  94. package/resources/index.d.ts.map +1 -1
  95. package/resources/index.js +13 -3
  96. package/resources/index.js.map +1 -1
  97. package/resources/index.mjs +6 -1
  98. package/resources/index.mjs.map +1 -1
  99. package/resources/mcp-server.d.mts +588 -0
  100. package/resources/mcp-server.d.mts.map +1 -0
  101. package/resources/mcp-server.d.ts +588 -0
  102. package/resources/mcp-server.d.ts.map +1 -0
  103. package/resources/mcp-server.js +109 -0
  104. package/resources/mcp-server.js.map +1 -0
  105. package/resources/mcp-server.mjs +105 -0
  106. package/resources/mcp-server.mjs.map +1 -0
  107. package/resources/metric-policy.d.mts +5 -4
  108. package/resources/metric-policy.d.mts.map +1 -1
  109. package/resources/metric-policy.d.ts +5 -4
  110. package/resources/metric-policy.d.ts.map +1 -1
  111. package/resources/metric-policy.js +1 -1
  112. package/resources/metric-policy.mjs +1 -1
  113. package/resources/metric-variant.d.mts +4 -1
  114. package/resources/metric-variant.d.mts.map +1 -1
  115. package/resources/metric-variant.d.ts +4 -1
  116. package/resources/metric-variant.d.ts.map +1 -1
  117. package/resources/metric.d.mts +7 -2
  118. package/resources/metric.d.mts.map +1 -1
  119. package/resources/metric.d.ts +7 -2
  120. package/resources/metric.d.ts.map +1 -1
  121. package/resources/simulation-environment.d.mts +366 -0
  122. package/resources/simulation-environment.d.mts.map +1 -1
  123. package/resources/simulation-environment.d.ts +366 -0
  124. package/resources/simulation-environment.d.ts.map +1 -1
  125. package/resources/simulation-job.d.mts +12 -8
  126. package/resources/simulation-job.d.mts.map +1 -1
  127. package/resources/simulation-job.d.ts +12 -8
  128. package/resources/simulation-job.d.ts.map +1 -1
  129. package/resources/simulation-persona.d.mts +25 -15
  130. package/resources/simulation-persona.d.mts.map +1 -1
  131. package/resources/simulation-persona.d.ts +25 -15
  132. package/resources/simulation-persona.d.ts.map +1 -1
  133. package/resources/simulation-run-plan-job.d.mts +32 -6
  134. package/resources/simulation-run-plan-job.d.mts.map +1 -1
  135. package/resources/simulation-run-plan-job.d.ts +32 -6
  136. package/resources/simulation-run-plan-job.d.ts.map +1 -1
  137. package/resources/simulation-run-plan.d.mts +126 -13
  138. package/resources/simulation-run-plan.d.mts.map +1 -1
  139. package/resources/simulation-run-plan.d.ts +126 -13
  140. package/resources/simulation-run-plan.d.ts.map +1 -1
  141. package/resources/simulation-template.d.mts +1 -1
  142. package/resources/simulation-template.d.mts.map +1 -1
  143. package/resources/simulation-template.d.ts +1 -1
  144. package/resources/simulation-template.d.ts.map +1 -1
  145. package/resources/simulation.d.mts +35 -3
  146. package/resources/simulation.d.mts.map +1 -1
  147. package/resources/simulation.d.ts +35 -3
  148. package/resources/simulation.d.ts.map +1 -1
  149. package/resources/tool.d.mts +565 -6
  150. package/resources/tool.d.mts.map +1 -1
  151. package/resources/tool.d.ts +565 -6
  152. package/resources/tool.d.ts.map +1 -1
  153. package/resources/tool.js +9 -6
  154. package/resources/tool.js.map +1 -1
  155. package/resources/tool.mjs +9 -6
  156. package/resources/tool.mjs.map +1 -1
  157. package/resources/usage.d.mts +1 -1
  158. package/resources/usage.d.mts.map +1 -1
  159. package/resources/usage.d.ts +1 -1
  160. package/resources/usage.d.ts.map +1 -1
  161. package/resources/webhook.d.mts +4 -4
  162. package/resources/webhook.d.mts.map +1 -1
  163. package/resources/webhook.d.ts +4 -4
  164. package/resources/webhook.d.ts.map +1 -1
  165. package/src/client.ts +200 -34
  166. package/src/resources/agent-connection.ts +2523 -0
  167. package/src/resources/agent-conversation.ts +139 -0
  168. package/src/resources/agent-draft.ts +239 -35
  169. package/src/resources/agent-endpoint.ts +8 -4
  170. package/src/resources/agent-setup.ts +1685 -0
  171. package/src/resources/agent-version.ts +126 -18
  172. package/src/resources/agent.ts +506 -4
  173. package/src/resources/calendar-connection.ts +1035 -63
  174. package/src/resources/call.ts +12 -2
  175. package/src/resources/config.ts +198 -36
  176. package/src/resources/conversation.ts +205 -0
  177. package/src/resources/customer-flow-edge-case.ts +709 -40
  178. package/src/resources/customer-flow.ts +3141 -156
  179. package/src/resources/{customer-profile.ts → customer.ts} +406 -294
  180. package/src/resources/index.ts +91 -17
  181. package/src/resources/mcp-server.ts +786 -0
  182. package/src/resources/metric-policy.ts +5 -4
  183. package/src/resources/metric-variant.ts +4 -1
  184. package/src/resources/metric.ts +7 -2
  185. package/src/resources/simulation-environment.ts +414 -0
  186. package/src/resources/simulation-job.ts +14 -8
  187. package/src/resources/simulation-persona.ts +25 -15
  188. package/src/resources/simulation-run-plan-job.ts +47 -6
  189. package/src/resources/simulation-run-plan.ts +140 -0
  190. package/src/resources/simulation-template.ts +1 -0
  191. package/src/resources/simulation.ts +39 -0
  192. package/src/resources/tool.ts +697 -6
  193. package/src/resources/usage.ts +6 -1
  194. package/src/resources/webhook.ts +8 -0
  195. package/src/version.ts +1 -1
  196. package/version.d.mts +1 -1
  197. package/version.d.ts +1 -1
  198. package/version.js +1 -1
  199. package/version.mjs +1 -1
  200. package/resources/customer-profile.d.mts.map +0 -1
  201. package/resources/customer-profile.d.ts.map +0 -1
  202. package/resources/customer-profile.js +0 -141
  203. package/resources/customer-profile.js.map +0 -1
  204. package/resources/customer-profile.mjs +0 -137
  205. package/resources/customer-profile.mjs.map +0 -1
@@ -0,0 +1,156 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { RequestOptions } from "../internal/request-options.mjs";
4
+ export declare class Conversation extends APIResource {
5
+ /**
6
+ * Calls and chats in the project as one list, most recent start first. A
7
+ * conversation is listed once it is recorded: a call when it connects, a chat when
8
+ * it ends. Listing calls needs `call:read`, chats `chat:read`, and both kinds
9
+ * both.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const conversations = await client.conversation.list();
14
+ * ```
15
+ */
16
+ list(query?: ConversationListParams | null | undefined, options?: RequestOptions): APIPromise<ConversationListResponse>;
17
+ /**
18
+ * A call or chat by its id, whichever it is. One started through
19
+ * `POST /v1/agent/{agentId}/conversations` reads back from the moment it is
20
+ * created, before it is recorded. For its transcript and metrics, read it as a
21
+ * call or chat, as `modality` says.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const response = await client.conversation.getByID(
26
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
27
+ * );
28
+ * ```
29
+ */
30
+ getByID(conversationID: string, options?: RequestOptions): APIPromise<ConversationGetByIDResponse>;
31
+ }
32
+ export interface ConversationListResponse {
33
+ data: Array<ConversationListResponse.Data>;
34
+ pagination: ConversationListResponse.Pagination;
35
+ }
36
+ export declare namespace ConversationListResponse {
37
+ interface Data {
38
+ /**
39
+ * The conversation id: its call id or chat id. `modality` says which, and where to
40
+ * read its transcript and metrics (`/v1/call/{callId}` or `/v1/chat/{id}`).
41
+ */
42
+ id: string;
43
+ createdAt: string;
44
+ /**
45
+ * How long it ran. Null until it ends.
46
+ */
47
+ durationMs: number | null;
48
+ /**
49
+ * When it ended (ISO 8601). Null until it ends.
50
+ */
51
+ endedAt: string | null;
52
+ /**
53
+ * Your own id for it, if one was given.
54
+ */
55
+ externalId: string | null;
56
+ /**
57
+ * `voice` or `chat`. A voice conversation is recorded as a call
58
+ * (`/v1/call/{callId}`), a chat as a chat (`/v1/chat/{id}`).
59
+ */
60
+ modality: 'voice' | 'chat';
61
+ projectId: string;
62
+ /**
63
+ * When it started, or was created while pending (ISO 8601).
64
+ */
65
+ startedAt: string;
66
+ /**
67
+ * `PENDING` until it starts (a call ringing, a chat nobody has joined yet),
68
+ * `IN_PROGRESS`, then `ENDED`.
69
+ */
70
+ status: 'PENDING' | 'IN_PROGRESS' | 'ENDED';
71
+ summary: string | null;
72
+ title: string | null;
73
+ }
74
+ interface Pagination {
75
+ /**
76
+ * Whether there are more items to fetch
77
+ */
78
+ hasMore: boolean;
79
+ /**
80
+ * Cursor for the next page of items
81
+ */
82
+ nextCursor: string | null;
83
+ /**
84
+ * Total number of items
85
+ */
86
+ total: number;
87
+ }
88
+ }
89
+ export interface ConversationGetByIDResponse {
90
+ data: ConversationGetByIDResponse.Data;
91
+ }
92
+ export declare namespace ConversationGetByIDResponse {
93
+ interface Data {
94
+ /**
95
+ * The conversation id: its call id or chat id. `modality` says which, and where to
96
+ * read its transcript and metrics (`/v1/call/{callId}` or `/v1/chat/{id}`).
97
+ */
98
+ id: string;
99
+ createdAt: string;
100
+ /**
101
+ * How long it ran. Null until it ends.
102
+ */
103
+ durationMs: number | null;
104
+ /**
105
+ * When it ended (ISO 8601). Null until it ends.
106
+ */
107
+ endedAt: string | null;
108
+ /**
109
+ * Your own id for it, if one was given.
110
+ */
111
+ externalId: string | null;
112
+ /**
113
+ * `voice` or `chat`. A voice conversation is recorded as a call
114
+ * (`/v1/call/{callId}`), a chat as a chat (`/v1/chat/{id}`).
115
+ */
116
+ modality: 'voice' | 'chat';
117
+ projectId: string;
118
+ /**
119
+ * When it started, or was created while pending (ISO 8601).
120
+ */
121
+ startedAt: string;
122
+ /**
123
+ * `PENDING` until it starts (a call ringing, a chat nobody has joined yet),
124
+ * `IN_PROGRESS`, then `ENDED`.
125
+ */
126
+ status: 'PENDING' | 'IN_PROGRESS' | 'ENDED';
127
+ summary: string | null;
128
+ title: string | null;
129
+ }
130
+ }
131
+ export interface ConversationListParams {
132
+ /**
133
+ * The `nextCursor` of the previous page.
134
+ */
135
+ after?: string;
136
+ /**
137
+ * How many to return (default 20, max 100).
138
+ */
139
+ limit?: number;
140
+ /**
141
+ * Only `voice`, or only `chat`. Both by default.
142
+ */
143
+ modality?: 'voice' | 'chat' | 'call';
144
+ /**
145
+ * Only conversations that started at or after this time.
146
+ */
147
+ startedFrom?: string;
148
+ /**
149
+ * Only conversations that started at or before this time.
150
+ */
151
+ startedTo?: string;
152
+ }
153
+ export declare namespace Conversation {
154
+ export { type ConversationListResponse as ConversationListResponse, type ConversationGetByIDResponse as ConversationGetByIDResponse, type ConversationListParams as ConversationListParams, };
155
+ }
156
+ //# sourceMappingURL=conversation.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.mts","sourceRoot":"","sources":["../src/resources/conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGnG;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAE3C,UAAU,EAAE,wBAAwB,CAAC,UAAU,CAAC;CACjD;AAED,yBAAiB,wBAAwB,CAAC;IACxC,UAAiB,IAAI;QACnB;;;WAGG;QACH,EAAE,EAAE,MAAM,CAAC;QAEX,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAE1B;;WAEG;QACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAEvB;;WAEG;QACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAE1B;;;WAGG;QACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAE3B,SAAS,EAAE,MAAM,CAAC;QAElB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;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,156 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { RequestOptions } from "../internal/request-options.js";
4
+ export declare class Conversation extends APIResource {
5
+ /**
6
+ * Calls and chats in the project as one list, most recent start first. A
7
+ * conversation is listed once it is recorded: a call when it connects, a chat when
8
+ * it ends. Listing calls needs `call:read`, chats `chat:read`, and both kinds
9
+ * both.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const conversations = await client.conversation.list();
14
+ * ```
15
+ */
16
+ list(query?: ConversationListParams | null | undefined, options?: RequestOptions): APIPromise<ConversationListResponse>;
17
+ /**
18
+ * A call or chat by its id, whichever it is. One started through
19
+ * `POST /v1/agent/{agentId}/conversations` reads back from the moment it is
20
+ * created, before it is recorded. For its transcript and metrics, read it as a
21
+ * call or chat, as `modality` says.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const response = await client.conversation.getByID(
26
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
27
+ * );
28
+ * ```
29
+ */
30
+ getByID(conversationID: string, options?: RequestOptions): APIPromise<ConversationGetByIDResponse>;
31
+ }
32
+ export interface ConversationListResponse {
33
+ data: Array<ConversationListResponse.Data>;
34
+ pagination: ConversationListResponse.Pagination;
35
+ }
36
+ export declare namespace ConversationListResponse {
37
+ interface Data {
38
+ /**
39
+ * The conversation id: its call id or chat id. `modality` says which, and where to
40
+ * read its transcript and metrics (`/v1/call/{callId}` or `/v1/chat/{id}`).
41
+ */
42
+ id: string;
43
+ createdAt: string;
44
+ /**
45
+ * How long it ran. Null until it ends.
46
+ */
47
+ durationMs: number | null;
48
+ /**
49
+ * When it ended (ISO 8601). Null until it ends.
50
+ */
51
+ endedAt: string | null;
52
+ /**
53
+ * Your own id for it, if one was given.
54
+ */
55
+ externalId: string | null;
56
+ /**
57
+ * `voice` or `chat`. A voice conversation is recorded as a call
58
+ * (`/v1/call/{callId}`), a chat as a chat (`/v1/chat/{id}`).
59
+ */
60
+ modality: 'voice' | 'chat';
61
+ projectId: string;
62
+ /**
63
+ * When it started, or was created while pending (ISO 8601).
64
+ */
65
+ startedAt: string;
66
+ /**
67
+ * `PENDING` until it starts (a call ringing, a chat nobody has joined yet),
68
+ * `IN_PROGRESS`, then `ENDED`.
69
+ */
70
+ status: 'PENDING' | 'IN_PROGRESS' | 'ENDED';
71
+ summary: string | null;
72
+ title: string | null;
73
+ }
74
+ interface Pagination {
75
+ /**
76
+ * Whether there are more items to fetch
77
+ */
78
+ hasMore: boolean;
79
+ /**
80
+ * Cursor for the next page of items
81
+ */
82
+ nextCursor: string | null;
83
+ /**
84
+ * Total number of items
85
+ */
86
+ total: number;
87
+ }
88
+ }
89
+ export interface ConversationGetByIDResponse {
90
+ data: ConversationGetByIDResponse.Data;
91
+ }
92
+ export declare namespace ConversationGetByIDResponse {
93
+ interface Data {
94
+ /**
95
+ * The conversation id: its call id or chat id. `modality` says which, and where to
96
+ * read its transcript and metrics (`/v1/call/{callId}` or `/v1/chat/{id}`).
97
+ */
98
+ id: string;
99
+ createdAt: string;
100
+ /**
101
+ * How long it ran. Null until it ends.
102
+ */
103
+ durationMs: number | null;
104
+ /**
105
+ * When it ended (ISO 8601). Null until it ends.
106
+ */
107
+ endedAt: string | null;
108
+ /**
109
+ * Your own id for it, if one was given.
110
+ */
111
+ externalId: string | null;
112
+ /**
113
+ * `voice` or `chat`. A voice conversation is recorded as a call
114
+ * (`/v1/call/{callId}`), a chat as a chat (`/v1/chat/{id}`).
115
+ */
116
+ modality: 'voice' | 'chat';
117
+ projectId: string;
118
+ /**
119
+ * When it started, or was created while pending (ISO 8601).
120
+ */
121
+ startedAt: string;
122
+ /**
123
+ * `PENDING` until it starts (a call ringing, a chat nobody has joined yet),
124
+ * `IN_PROGRESS`, then `ENDED`.
125
+ */
126
+ status: 'PENDING' | 'IN_PROGRESS' | 'ENDED';
127
+ summary: string | null;
128
+ title: string | null;
129
+ }
130
+ }
131
+ export interface ConversationListParams {
132
+ /**
133
+ * The `nextCursor` of the previous page.
134
+ */
135
+ after?: string;
136
+ /**
137
+ * How many to return (default 20, max 100).
138
+ */
139
+ limit?: number;
140
+ /**
141
+ * Only `voice`, or only `chat`. Both by default.
142
+ */
143
+ modality?: 'voice' | 'chat' | 'call';
144
+ /**
145
+ * Only conversations that started at or after this time.
146
+ */
147
+ startedFrom?: string;
148
+ /**
149
+ * Only conversations that started at or before this time.
150
+ */
151
+ startedTo?: string;
152
+ }
153
+ export declare namespace Conversation {
154
+ export { type ConversationListResponse as ConversationListResponse, type ConversationGetByIDResponse as ConversationGetByIDResponse, type ConversationListParams as ConversationListParams, };
155
+ }
156
+ //# sourceMappingURL=conversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/resources/conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AACjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D,qBAAa,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACrD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,wBAAwB,CAAC;IAIvC;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGnG;AAED,MAAM,WAAW,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AE1B;;;WAGG;QACH,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;QAE3B,SAAS,EAAE,MAAM,CAAC;QAElB;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;QAElB;;;WAGG;QACH,MAAM,EAAE,SAAS,GAAG,aAAa,GAAG,OAAO,CAAC;QAE5C,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QAEvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;KACtB;CACF;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAErC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,WAAW,YAAY,CAAC;IACpC,OAAO,EACL,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Conversation = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const path_1 = require("../internal/utils/path.js");
7
+ class Conversation extends resource_1.APIResource {
8
+ /**
9
+ * Calls and chats in the project as one list, most recent start first. A
10
+ * conversation is listed once it is recorded: a call when it connects, a chat when
11
+ * it ends. Listing calls needs `call:read`, chats `chat:read`, and both kinds
12
+ * both.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const conversations = await client.conversation.list();
17
+ * ```
18
+ */
19
+ list(query = {}, options) {
20
+ return this._client.get('/v1/conversation', { query, ...options });
21
+ }
22
+ /**
23
+ * A call or chat by its id, whichever it is. One started through
24
+ * `POST /v1/agent/{agentId}/conversations` reads back from the moment it is
25
+ * created, before it is recorded. For its transcript and metrics, read it as a
26
+ * call or chat, as `modality` says.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const response = await client.conversation.getByID(
31
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
32
+ * );
33
+ * ```
34
+ */
35
+ getByID(conversationID, options) {
36
+ return this._client.get((0, path_1.path) `/v1/conversation/${conversationID}`, options);
37
+ }
38
+ }
39
+ exports.Conversation = Conversation;
40
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.js","sourceRoot":"","sources":["../src/resources/conversation.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,YAAa,SAAQ,sBAAW;IAC3C;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAsB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF;AAnCD,oCAmCC"}
@@ -0,0 +1,36 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { path } from "../internal/utils/path.mjs";
4
+ export class Conversation extends APIResource {
5
+ /**
6
+ * Calls and chats in the project as one list, most recent start first. A
7
+ * conversation is listed once it is recorded: a call when it connects, a chat when
8
+ * it ends. Listing calls needs `call:read`, chats `chat:read`, and both kinds
9
+ * both.
10
+ *
11
+ * @example
12
+ * ```ts
13
+ * const conversations = await client.conversation.list();
14
+ * ```
15
+ */
16
+ list(query = {}, options) {
17
+ return this._client.get('/v1/conversation', { query, ...options });
18
+ }
19
+ /**
20
+ * A call or chat by its id, whichever it is. One started through
21
+ * `POST /v1/agent/{agentId}/conversations` reads back from the moment it is
22
+ * created, before it is recorded. For its transcript and metrics, read it as a
23
+ * call or chat, as `modality` says.
24
+ *
25
+ * @example
26
+ * ```ts
27
+ * const response = await client.conversation.getByID(
28
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
29
+ * );
30
+ * ```
31
+ */
32
+ getByID(conversationID, options) {
33
+ return this._client.get(path `/v1/conversation/${conversationID}`, options);
34
+ }
35
+ }
36
+ //# sourceMappingURL=conversation.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.mjs","sourceRoot":"","sources":["../src/resources/conversation.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAG/C,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C;;;;;;;;;;OAUG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,cAAsB,EAAE,OAAwB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,cAAc,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF"}