@roarkanalytics/sdk 8.0.1 → 9.1.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 (118) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +7 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -3
  7. package/client.js.map +1 -1
  8. package/client.mjs +4 -4
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/agent-connection.d.mts +0 -88
  12. package/resources/agent-connection.d.mts.map +1 -1
  13. package/resources/agent-connection.d.ts +0 -88
  14. package/resources/agent-connection.d.ts.map +1 -1
  15. package/resources/agent.d.mts +2 -200
  16. package/resources/agent.d.mts.map +1 -1
  17. package/resources/agent.d.ts +2 -200
  18. package/resources/agent.d.ts.map +1 -1
  19. package/resources/config.d.mts +6 -6
  20. package/resources/config.d.mts.map +1 -1
  21. package/resources/config.d.ts +6 -6
  22. package/resources/config.d.ts.map +1 -1
  23. package/resources/conversation.d.mts +6 -95
  24. package/resources/conversation.d.mts.map +1 -1
  25. package/resources/conversation.d.ts +6 -95
  26. package/resources/conversation.d.ts.map +1 -1
  27. package/resources/conversation.js +5 -17
  28. package/resources/conversation.js.map +1 -1
  29. package/resources/conversation.mjs +5 -17
  30. package/resources/conversation.mjs.map +1 -1
  31. package/resources/customer-flow-folder.d.mts +157 -0
  32. package/resources/customer-flow-folder.d.mts.map +1 -0
  33. package/resources/customer-flow-folder.d.ts +157 -0
  34. package/resources/customer-flow-folder.d.ts.map +1 -0
  35. package/resources/customer-flow-folder.js +54 -0
  36. package/resources/customer-flow-folder.js.map +1 -0
  37. package/resources/customer-flow-folder.mjs +50 -0
  38. package/resources/customer-flow-folder.mjs.map +1 -0
  39. package/resources/customer-flow.d.mts +558 -2
  40. package/resources/customer-flow.d.mts.map +1 -1
  41. package/resources/customer-flow.d.ts +558 -2
  42. package/resources/customer-flow.d.ts.map +1 -1
  43. package/resources/customer-flow.js +2 -2
  44. package/resources/customer-flow.mjs +2 -2
  45. package/resources/dashboard.d.mts +3 -3
  46. package/resources/dashboard.d.ts +3 -3
  47. package/resources/dashboard.js +3 -3
  48. package/resources/dashboard.mjs +3 -3
  49. package/resources/index.d.mts +3 -3
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +3 -3
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js +3 -3
  54. package/resources/index.js.map +1 -1
  55. package/resources/index.mjs +2 -2
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/live-report.d.mts +10 -10
  58. package/resources/live-report.d.ts +10 -10
  59. package/resources/me.d.mts +20 -19
  60. package/resources/me.d.mts.map +1 -1
  61. package/resources/me.d.ts +20 -19
  62. package/resources/me.d.ts.map +1 -1
  63. package/resources/me.js +14 -13
  64. package/resources/me.js.map +1 -1
  65. package/resources/me.mjs +14 -13
  66. package/resources/me.mjs.map +1 -1
  67. package/resources/metric.d.mts +60 -60
  68. package/resources/metric.d.ts +60 -60
  69. package/resources/simulation-group.d.mts +13 -13
  70. package/resources/simulation-group.d.ts +13 -13
  71. package/resources/simulation-group.js +5 -5
  72. package/resources/simulation-group.mjs +5 -5
  73. package/resources/simulation-run-group.d.mts +2 -2
  74. package/resources/simulation-run-group.d.ts +2 -2
  75. package/resources/simulation-run-group.js +2 -2
  76. package/resources/simulation-run-group.mjs +2 -2
  77. package/resources/simulation.d.mts +1086 -4
  78. package/resources/simulation.d.mts.map +1 -1
  79. package/resources/simulation.d.ts +1086 -4
  80. package/resources/simulation.d.ts.map +1 -1
  81. package/resources/simulation.js +106 -0
  82. package/resources/simulation.js.map +1 -1
  83. package/resources/simulation.mjs +106 -0
  84. package/resources/simulation.mjs.map +1 -1
  85. package/resources/webhook.d.mts +4 -4
  86. package/resources/webhook.d.mts.map +1 -1
  87. package/resources/webhook.d.ts +4 -4
  88. package/resources/webhook.d.ts.map +1 -1
  89. package/src/client.ts +39 -43
  90. package/src/resources/agent-connection.ts +0 -103
  91. package/src/resources/agent.ts +2 -317
  92. package/src/resources/config.ts +12 -12
  93. package/src/resources/conversation.ts +6 -126
  94. package/src/resources/customer-flow-folder.ts +235 -0
  95. package/src/resources/customer-flow.ts +862 -2
  96. package/src/resources/dashboard.ts +3 -3
  97. package/src/resources/index.ts +18 -20
  98. package/src/resources/live-report.ts +10 -10
  99. package/src/resources/me.ts +20 -19
  100. package/src/resources/metric.ts +60 -60
  101. package/src/resources/simulation-group.ts +13 -13
  102. package/src/resources/simulation-run-group.ts +2 -2
  103. package/src/resources/simulation.ts +1759 -52
  104. package/src/resources/webhook.ts +8 -8
  105. package/src/version.ts +1 -1
  106. package/version.d.mts +1 -1
  107. package/version.d.ts +1 -1
  108. package/version.js +1 -1
  109. package/version.mjs +1 -1
  110. package/resources/agent-setup.d.mts +0 -1057
  111. package/resources/agent-setup.d.mts.map +0 -1
  112. package/resources/agent-setup.d.ts +0 -1057
  113. package/resources/agent-setup.d.ts.map +0 -1
  114. package/resources/agent-setup.js +0 -113
  115. package/resources/agent-setup.js.map +0 -1
  116. package/resources/agent-setup.mjs +0 -109
  117. package/resources/agent-setup.mjs.map +0 -1
  118. package/src/resources/agent-setup.ts +0 -1685
@@ -7,28 +7,12 @@ import { path } from '../internal/utils/path';
7
7
 
8
8
  export class Conversation extends APIResource {
9
9
  /**
10
- * Calls and chats in the project as one list, most recent start first. A
11
- * conversation is listed once it is recorded: a call when it connects, a chat when
12
- * it ends. Listing calls needs `call:read`, chats `chat:read`, and both kinds
13
- * both.
14
- *
15
- * @example
16
- * ```ts
17
- * const conversations = await client.conversation.list();
18
- * ```
19
- */
20
- list(
21
- query: ConversationListParams | null | undefined = {},
22
- options?: RequestOptions,
23
- ): APIPromise<ConversationListResponse> {
24
- return this._client.get('/v1/conversation', { query, ...options });
25
- }
26
-
27
- /**
28
- * A call or chat by its id, whichever it is. One started through
10
+ * Fetches one conversation by its id, whether it is a call or a chat. The same
11
+ * endpoint reads both modalities, and `modality` in the response says which one it
12
+ * is, so you do not need to know it up front. A conversation started with
29
13
  * `POST /v1/agent/{agentId}/conversations` reads back from the moment it is
30
- * created, before it is recorded. For its transcript and metrics, read it as a
31
- * call or chat, as `modality` says.
14
+ * created, before it is recorded as a call or chat. For its transcript and
15
+ * metrics, use the call or chat endpoints that match its `modality`.
32
16
  *
33
17
  * @example
34
18
  * ```ts
@@ -42,79 +26,6 @@ export class Conversation extends APIResource {
42
26
  }
43
27
  }
44
28
 
45
- export interface ConversationListResponse {
46
- data: Array<ConversationListResponse.Data>;
47
-
48
- pagination: ConversationListResponse.Pagination;
49
- }
50
-
51
- export namespace ConversationListResponse {
52
- export interface Data {
53
- /**
54
- * The conversation id: its call id or chat id. `modality` says which, and where to
55
- * read its transcript and metrics (`/v1/call/{callId}` or `/v1/chat/{id}`).
56
- */
57
- id: string;
58
-
59
- createdAt: string;
60
-
61
- /**
62
- * How long it ran. Null until it ends.
63
- */
64
- durationMs: number | null;
65
-
66
- /**
67
- * When it ended (ISO 8601). Null until it ends.
68
- */
69
- endedAt: string | null;
70
-
71
- /**
72
- * Your own id for it, if one was given.
73
- */
74
- externalId: string | null;
75
-
76
- /**
77
- * `voice` or `chat`. A voice conversation is recorded as a call
78
- * (`/v1/call/{callId}`), a chat as a chat (`/v1/chat/{id}`).
79
- */
80
- modality: 'voice' | 'chat';
81
-
82
- projectId: string;
83
-
84
- /**
85
- * When it started, or was created while pending (ISO 8601).
86
- */
87
- startedAt: string;
88
-
89
- /**
90
- * `PENDING` until it starts (a call ringing, a chat nobody has joined yet),
91
- * `IN_PROGRESS`, then `ENDED`.
92
- */
93
- status: 'PENDING' | 'IN_PROGRESS' | 'ENDED';
94
-
95
- summary: string | null;
96
-
97
- title: string | null;
98
- }
99
-
100
- export interface Pagination {
101
- /**
102
- * Whether there are more items to fetch
103
- */
104
- hasMore: boolean;
105
-
106
- /**
107
- * Cursor for the next page of items
108
- */
109
- nextCursor: string | null;
110
-
111
- /**
112
- * Total number of items
113
- */
114
- total: number;
115
- }
116
- }
117
-
118
29
  export interface ConversationGetByIDResponse {
119
30
  data: ConversationGetByIDResponse.Data;
120
31
  }
@@ -169,37 +80,6 @@ export namespace ConversationGetByIDResponse {
169
80
  }
170
81
  }
171
82
 
172
- export interface ConversationListParams {
173
- /**
174
- * The `nextCursor` of the previous page.
175
- */
176
- after?: string;
177
-
178
- /**
179
- * How many to return (default 20, max 100).
180
- */
181
- limit?: number;
182
-
183
- /**
184
- * Only `voice`, or only `chat`. Both by default.
185
- */
186
- modality?: 'voice' | 'chat' | 'call';
187
-
188
- /**
189
- * Only conversations that started at or after this time.
190
- */
191
- startedFrom?: string;
192
-
193
- /**
194
- * Only conversations that started at or before this time.
195
- */
196
- startedTo?: string;
197
- }
198
-
199
83
  export declare namespace Conversation {
200
- export {
201
- type ConversationListResponse as ConversationListResponse,
202
- type ConversationGetByIDResponse as ConversationGetByIDResponse,
203
- type ConversationListParams as ConversationListParams,
204
- };
84
+ export { type ConversationGetByIDResponse as ConversationGetByIDResponse };
205
85
  }
@@ -0,0 +1,235 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class CustomerFlowFolder extends APIResource {
9
+ /**
10
+ * Creates a folder to group customer flows. File a flow into it by sending its
11
+ * `folderId` when you create or update the flow. Names are unique within a
12
+ * project, ignoring case. Customer flows were previously called scenarios.
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * const customerFlowFolder =
17
+ * await client.customerFlowFolder.create({ name: 'x' });
18
+ * ```
19
+ */
20
+ create(
21
+ body: CustomerFlowFolderCreateParams,
22
+ options?: RequestOptions,
23
+ ): APIPromise<CustomerFlowFolderCreateResponse> {
24
+ return this._client.post('/v1/customer-flow/folder', { body, ...options });
25
+ }
26
+
27
+ /**
28
+ * Returns every folder the project groups its customer flows into, with how many
29
+ * flows each holds, in the order the app shows them. Filter the flow list to one
30
+ * folder with `GET /v1/customer-flow?folderId=`. Customer flows were previously
31
+ * called scenarios.
32
+ *
33
+ * @example
34
+ * ```ts
35
+ * const customerFlowFolders =
36
+ * await client.customerFlowFolder.list();
37
+ * ```
38
+ */
39
+ list(options?: RequestOptions): APIPromise<CustomerFlowFolderListResponse> {
40
+ return this._client.get('/v1/customer-flow/folder', options);
41
+ }
42
+
43
+ /**
44
+ * Deletes a folder. The flows in it are kept and no longer sit in any folder.
45
+ * Built-in folders cannot be deleted.
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const customerFlowFolder =
50
+ * await client.customerFlowFolder.delete(
51
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
52
+ * );
53
+ * ```
54
+ */
55
+ delete(folderID: string, options?: RequestOptions): APIPromise<CustomerFlowFolderDeleteResponse> {
56
+ return this._client.delete(path`/v1/customer-flow/folder/${folderID}`, options);
57
+ }
58
+ }
59
+
60
+ export interface CustomerFlowFolderCreateResponse {
61
+ /**
62
+ * A folder that groups customer flows. A flow sits in at most one folder.
63
+ */
64
+ data: CustomerFlowFolderCreateResponse.Data;
65
+ }
66
+
67
+ export namespace CustomerFlowFolderCreateResponse {
68
+ /**
69
+ * A folder that groups customer flows. A flow sits in at most one folder.
70
+ */
71
+ export interface Data {
72
+ id: string;
73
+
74
+ /**
75
+ * Whether Roark curates this folder. Built-in folders cannot be deleted or have
76
+ * your flows filed in them.
77
+ */
78
+ builtIn: boolean;
79
+
80
+ /**
81
+ * The color the folder is shown with in the app. Folders share the palette labels
82
+ * use.
83
+ */
84
+ color:
85
+ | 'GREEN'
86
+ | 'RED'
87
+ | 'ORANGE'
88
+ | 'PURPLE'
89
+ | 'GREY'
90
+ | 'BLUE'
91
+ | 'PEACH'
92
+ | 'TEAL'
93
+ | 'INDIGO'
94
+ | 'AMBER'
95
+ | 'ROSE'
96
+ | 'CYAN';
97
+
98
+ /**
99
+ * Creation timestamp in ISO 8601 format
100
+ */
101
+ createdAt: string;
102
+
103
+ /**
104
+ * What belongs in this folder.
105
+ */
106
+ description: string | null;
107
+
108
+ /**
109
+ * The folder name, unique within the project.
110
+ */
111
+ name: string;
112
+
113
+ /**
114
+ * Last update timestamp in ISO 8601 format
115
+ */
116
+ updatedAt: string;
117
+ }
118
+ }
119
+
120
+ /**
121
+ * The project's customer flow folders, in the order the app shows them.
122
+ */
123
+ export interface CustomerFlowFolderListResponse {
124
+ data: Array<CustomerFlowFolderListResponse.Data>;
125
+ }
126
+
127
+ export namespace CustomerFlowFolderListResponse {
128
+ /**
129
+ * A folder that groups customer flows. A flow sits in at most one folder.
130
+ */
131
+ export interface Data {
132
+ id: string;
133
+
134
+ /**
135
+ * Whether Roark curates this folder. Built-in folders cannot be deleted or have
136
+ * your flows filed in them.
137
+ */
138
+ builtIn: boolean;
139
+
140
+ /**
141
+ * The color the folder is shown with in the app. Folders share the palette labels
142
+ * use.
143
+ */
144
+ color:
145
+ | 'GREEN'
146
+ | 'RED'
147
+ | 'ORANGE'
148
+ | 'PURPLE'
149
+ | 'GREY'
150
+ | 'BLUE'
151
+ | 'PEACH'
152
+ | 'TEAL'
153
+ | 'INDIGO'
154
+ | 'AMBER'
155
+ | 'ROSE'
156
+ | 'CYAN';
157
+
158
+ /**
159
+ * Creation timestamp in ISO 8601 format
160
+ */
161
+ createdAt: string;
162
+
163
+ /**
164
+ * What belongs in this folder.
165
+ */
166
+ description: string | null;
167
+
168
+ /**
169
+ * How many flows are in this folder.
170
+ */
171
+ flowCount: number;
172
+
173
+ /**
174
+ * The folder name, unique within the project.
175
+ */
176
+ name: string;
177
+
178
+ /**
179
+ * Last update timestamp in ISO 8601 format
180
+ */
181
+ updatedAt: string;
182
+ }
183
+ }
184
+
185
+ export interface CustomerFlowFolderDeleteResponse {
186
+ data: CustomerFlowFolderDeleteResponse.Data;
187
+ }
188
+
189
+ export namespace CustomerFlowFolderDeleteResponse {
190
+ export interface Data {
191
+ /**
192
+ * Whether the folder was deleted
193
+ */
194
+ deleted: boolean;
195
+ }
196
+ }
197
+
198
+ export interface CustomerFlowFolderCreateParams {
199
+ /**
200
+ * The folder name. Must be unique in the project.
201
+ */
202
+ name: string;
203
+
204
+ /**
205
+ * The color the folder is shown with in the app. Folders share the palette labels
206
+ * use. Defaults to GREY.
207
+ */
208
+ color?:
209
+ | 'GREEN'
210
+ | 'RED'
211
+ | 'ORANGE'
212
+ | 'PURPLE'
213
+ | 'GREY'
214
+ | 'BLUE'
215
+ | 'PEACH'
216
+ | 'TEAL'
217
+ | 'INDIGO'
218
+ | 'AMBER'
219
+ | 'ROSE'
220
+ | 'CYAN';
221
+
222
+ /**
223
+ * What belongs in this folder.
224
+ */
225
+ description?: string | null;
226
+ }
227
+
228
+ export declare namespace CustomerFlowFolder {
229
+ export {
230
+ type CustomerFlowFolderCreateResponse as CustomerFlowFolderCreateResponse,
231
+ type CustomerFlowFolderListResponse as CustomerFlowFolderListResponse,
232
+ type CustomerFlowFolderDeleteResponse as CustomerFlowFolderDeleteResponse,
233
+ type CustomerFlowFolderCreateParams as CustomerFlowFolderCreateParams,
234
+ };
235
+ }