@roarkanalytics/sdk 9.7.0 → 9.9.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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/config.d.mts +12 -0
  10. package/resources/config.d.mts.map +1 -1
  11. package/resources/config.d.ts +12 -0
  12. package/resources/config.d.ts.map +1 -1
  13. package/resources/customer-flow-folder.d.mts +118 -16
  14. package/resources/customer-flow-folder.d.mts.map +1 -1
  15. package/resources/customer-flow-folder.d.ts +118 -16
  16. package/resources/customer-flow-folder.d.ts.map +1 -1
  17. package/resources/customer-flow-folder.js +28 -7
  18. package/resources/customer-flow-folder.js.map +1 -1
  19. package/resources/customer-flow-folder.mjs +28 -7
  20. package/resources/customer-flow-folder.mjs.map +1 -1
  21. package/resources/customer-flow.d.mts +136 -45
  22. package/resources/customer-flow.d.mts.map +1 -1
  23. package/resources/customer-flow.d.ts +136 -45
  24. package/resources/customer-flow.d.ts.map +1 -1
  25. package/resources/index.d.mts +1 -1
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +1 -1
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/simulation.d.mts +60 -18
  32. package/resources/simulation.d.mts.map +1 -1
  33. package/resources/simulation.d.ts +60 -18
  34. package/resources/simulation.d.ts.map +1 -1
  35. package/src/client.ts +4 -0
  36. package/src/resources/config.ts +24 -0
  37. package/src/resources/customer-flow-folder.ts +166 -15
  38. package/src/resources/customer-flow.ts +152 -45
  39. package/src/resources/index.ts +2 -0
  40. package/src/resources/simulation.ts +66 -18
  41. package/src/version.ts +1 -1
  42. package/version.d.mts +1 -1
  43. package/version.d.ts +1 -1
  44. package/version.js +1 -1
  45. package/version.mjs +1 -1
@@ -7,9 +7,11 @@ import { path } from '../internal/utils/path';
7
7
 
8
8
  export class CustomerFlowFolder extends APIResource {
9
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.
10
+ * Creates a folder to group customer flows, at the top level or inside another
11
+ * folder with `parentId`. Folders nest up to 5 levels deep. File a flow into it by
12
+ * sending its `folderId` when you create or update the flow. Names are unique
13
+ * within their parent folder, ignoring case. Customer flows were previously called
14
+ * scenarios.
13
15
  *
14
16
  * @example
15
17
  * ```ts
@@ -24,11 +26,34 @@ export class CustomerFlowFolder extends APIResource {
24
26
  return this._client.post('/v1/customer-flow/folder', { body, ...options });
25
27
  }
26
28
 
29
+ /**
30
+ * Renames, recolors or moves a folder. Send `parentId` to move it, with its flows
31
+ * and subfolders, inside another folder, or null to move it to the top level.
32
+ * Fields you omit are left as they are. Built-in folders cannot be changed.
33
+ * Customer flows were previously called scenarios.
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * const customerFlowFolder =
38
+ * await client.customerFlowFolder.update(
39
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
40
+ * );
41
+ * ```
42
+ */
43
+ update(
44
+ folderID: string,
45
+ body: CustomerFlowFolderUpdateParams | null | undefined = {},
46
+ options?: RequestOptions,
47
+ ): APIPromise<CustomerFlowFolderUpdateResponse> {
48
+ return this._client.put(path`/v1/customer-flow/folder/${folderID}`, { body, ...options });
49
+ }
50
+
27
51
  /**
28
52
  * 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.
53
+ * flows each holds, in the order the app shows them. Subfolders are included, each
54
+ * with the `parentId` of the folder it sits in. Filter the flow list to one folder
55
+ * with `GET /v1/customer-flow?folderId=`, adding `includeSubfolders=true` to take
56
+ * in the folders inside it. Customer flows were previously called scenarios.
32
57
  *
33
58
  * @example
34
59
  * ```ts
@@ -41,7 +66,8 @@ export class CustomerFlowFolder extends APIResource {
41
66
  }
42
67
 
43
68
  /**
44
- * Deletes a folder. The flows in it are kept and no longer sit in any folder.
69
+ * Deletes a folder. Its flows and subfolders are kept and move up one level: into
70
+ * the folder it sat in, or out of any folder when it was a top-level folder.
45
71
  * Built-in folders cannot be deleted.
46
72
  *
47
73
  * @example
@@ -59,14 +85,83 @@ export class CustomerFlowFolder extends APIResource {
59
85
 
60
86
  export interface CustomerFlowFolderCreateResponse {
61
87
  /**
62
- * A folder that groups customer flows. A flow sits in at most one folder.
88
+ * A folder that groups customer flows. A flow sits in at most one folder. Folders
89
+ * can sit inside other folders, up to 5 levels deep.
63
90
  */
64
91
  data: CustomerFlowFolderCreateResponse.Data;
65
92
  }
66
93
 
67
94
  export namespace CustomerFlowFolderCreateResponse {
68
95
  /**
69
- * A folder that groups customer flows. A flow sits in at most one folder.
96
+ * A folder that groups customer flows. A flow sits in at most one folder. Folders
97
+ * can sit inside other folders, up to 5 levels deep.
98
+ */
99
+ export interface Data {
100
+ id: string;
101
+
102
+ /**
103
+ * Whether Roark curates this folder. Built-in folders cannot be deleted or have
104
+ * your flows filed in them.
105
+ */
106
+ builtIn: boolean;
107
+
108
+ /**
109
+ * The color the folder is shown with in the app. Folders share the palette labels
110
+ * use.
111
+ */
112
+ color:
113
+ | 'GREEN'
114
+ | 'RED'
115
+ | 'ORANGE'
116
+ | 'PURPLE'
117
+ | 'GREY'
118
+ | 'BLUE'
119
+ | 'PEACH'
120
+ | 'TEAL'
121
+ | 'INDIGO'
122
+ | 'AMBER'
123
+ | 'ROSE'
124
+ | 'CYAN';
125
+
126
+ /**
127
+ * Creation timestamp in ISO 8601 format
128
+ */
129
+ createdAt: string;
130
+
131
+ /**
132
+ * What belongs in this folder.
133
+ */
134
+ description: string | null;
135
+
136
+ /**
137
+ * The folder name, unique within its parent folder.
138
+ */
139
+ name: string;
140
+
141
+ /**
142
+ * The folder this one sits inside, or null when it is a top-level folder.
143
+ */
144
+ parentId: string | null;
145
+
146
+ /**
147
+ * Last update timestamp in ISO 8601 format
148
+ */
149
+ updatedAt: string;
150
+ }
151
+ }
152
+
153
+ export interface CustomerFlowFolderUpdateResponse {
154
+ /**
155
+ * A folder that groups customer flows. A flow sits in at most one folder. Folders
156
+ * can sit inside other folders, up to 5 levels deep.
157
+ */
158
+ data: CustomerFlowFolderUpdateResponse.Data;
159
+ }
160
+
161
+ export namespace CustomerFlowFolderUpdateResponse {
162
+ /**
163
+ * A folder that groups customer flows. A flow sits in at most one folder. Folders
164
+ * can sit inside other folders, up to 5 levels deep.
70
165
  */
71
166
  export interface Data {
72
167
  id: string;
@@ -106,10 +201,15 @@ export namespace CustomerFlowFolderCreateResponse {
106
201
  description: string | null;
107
202
 
108
203
  /**
109
- * The folder name, unique within the project.
204
+ * The folder name, unique within its parent folder.
110
205
  */
111
206
  name: string;
112
207
 
208
+ /**
209
+ * The folder this one sits inside, or null when it is a top-level folder.
210
+ */
211
+ parentId: string | null;
212
+
113
213
  /**
114
214
  * Last update timestamp in ISO 8601 format
115
215
  */
@@ -118,7 +218,8 @@ export namespace CustomerFlowFolderCreateResponse {
118
218
  }
119
219
 
120
220
  /**
121
- * The project's customer flow folders, in the order the app shows them.
221
+ * The project's customer flow folders, in the order the app shows them. Subfolders
222
+ * are listed with the rest; rebuild the tree from each folder's `parentId`.
122
223
  */
123
224
  export interface CustomerFlowFolderListResponse {
124
225
  data: Array<CustomerFlowFolderListResponse.Data>;
@@ -126,7 +227,8 @@ export interface CustomerFlowFolderListResponse {
126
227
 
127
228
  export namespace CustomerFlowFolderListResponse {
128
229
  /**
129
- * A folder that groups customer flows. A flow sits in at most one folder.
230
+ * A folder that groups customer flows. A flow sits in at most one folder. Folders
231
+ * can sit inside other folders, up to 5 levels deep.
130
232
  */
131
233
  export interface Data {
132
234
  id: string;
@@ -166,15 +268,20 @@ export namespace CustomerFlowFolderListResponse {
166
268
  description: string | null;
167
269
 
168
270
  /**
169
- * How many flows are in this folder.
271
+ * How many flows are directly in this folder, not counting its subfolders.
170
272
  */
171
273
  flowCount: number;
172
274
 
173
275
  /**
174
- * The folder name, unique within the project.
276
+ * The folder name, unique within its parent folder.
175
277
  */
176
278
  name: string;
177
279
 
280
+ /**
281
+ * The folder this one sits inside, or null when it is a top-level folder.
282
+ */
283
+ parentId: string | null;
284
+
178
285
  /**
179
286
  * Last update timestamp in ISO 8601 format
180
287
  */
@@ -197,7 +304,7 @@ export namespace CustomerFlowFolderDeleteResponse {
197
304
 
198
305
  export interface CustomerFlowFolderCreateParams {
199
306
  /**
200
- * The folder name. Must be unique in the project.
307
+ * The folder name. Must be unique within its parent folder, ignoring case.
201
308
  */
202
309
  name: string;
203
310
 
@@ -223,13 +330,57 @@ export interface CustomerFlowFolderCreateParams {
223
330
  * What belongs in this folder.
224
331
  */
225
332
  description?: string | null;
333
+
334
+ /**
335
+ * Create the folder inside this folder. Omit it, or send null, for a top-level
336
+ * folder.
337
+ */
338
+ parentId?: string | null;
339
+ }
340
+
341
+ export interface CustomerFlowFolderUpdateParams {
342
+ /**
343
+ * The color the folder is shown with in the app. Folders share the palette labels
344
+ * use.
345
+ */
346
+ color?:
347
+ | 'GREEN'
348
+ | 'RED'
349
+ | 'ORANGE'
350
+ | 'PURPLE'
351
+ | 'GREY'
352
+ | 'BLUE'
353
+ | 'PEACH'
354
+ | 'TEAL'
355
+ | 'INDIGO'
356
+ | 'AMBER'
357
+ | 'ROSE'
358
+ | 'CYAN';
359
+
360
+ /**
361
+ * What belongs in this folder. Null clears it.
362
+ */
363
+ description?: string | null;
364
+
365
+ /**
366
+ * A new name. Must be unique within the parent folder, ignoring case.
367
+ */
368
+ name?: string;
369
+
370
+ /**
371
+ * Moves the folder, with everything in it, inside this folder. Null moves it to
372
+ * the top level; omit it to leave it where it is.
373
+ */
374
+ parentId?: string | null;
226
375
  }
227
376
 
228
377
  export declare namespace CustomerFlowFolder {
229
378
  export {
230
379
  type CustomerFlowFolderCreateResponse as CustomerFlowFolderCreateResponse,
380
+ type CustomerFlowFolderUpdateResponse as CustomerFlowFolderUpdateResponse,
231
381
  type CustomerFlowFolderListResponse as CustomerFlowFolderListResponse,
232
382
  type CustomerFlowFolderDeleteResponse as CustomerFlowFolderDeleteResponse,
233
383
  type CustomerFlowFolderCreateParams as CustomerFlowFolderCreateParams,
384
+ type CustomerFlowFolderUpdateParams as CustomerFlowFolderUpdateParams,
234
385
  };
235
386
  }