@roarkanalytics/sdk 3.7.0 → 3.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.
@@ -49,6 +49,7 @@ export interface Bundle {
49
49
  | Bundle.ScriptedFlowConfig
50
50
  | Bundle.CollectorConfig
51
51
  | Bundle.MetricConfig
52
+ | Bundle.AlertConfig
52
53
  >;
53
54
 
54
55
  prune?: boolean;
@@ -362,6 +363,95 @@ export namespace Bundle {
362
363
  description?: string;
363
364
  }
364
365
  }
366
+
367
+ export interface AlertConfig {
368
+ kind: 'alert';
369
+
370
+ name: string;
371
+
372
+ trigger:
373
+ | AlertConfig.AlertThresholdTrigger
374
+ | AlertConfig.AlertEventTrigger
375
+ | AlertConfig.AlertSimulationTrigger;
376
+
377
+ actions?: AlertConfig.Actions;
378
+
379
+ enabled?: boolean;
380
+ }
381
+
382
+ export namespace AlertConfig {
383
+ export interface AlertThresholdTrigger {
384
+ aggregation: 'COUNT' | 'RATE_PER_MINUTE' | 'MEAN';
385
+
386
+ metric: string;
387
+
388
+ operator: 'GT' | 'GTE' | 'LT' | 'LTE';
389
+
390
+ thresholdValue: number;
391
+
392
+ type: 'threshold';
393
+
394
+ windowMinutes: number;
395
+
396
+ consecutiveOpen?: number;
397
+
398
+ consecutiveResolve?: number;
399
+
400
+ grouping?: 'NONE' | 'BY_AGENT';
401
+
402
+ metricVariant?: string;
403
+
404
+ minSampleSize?: number;
405
+ }
406
+
407
+ export interface AlertEventTrigger {
408
+ events: Array<
409
+ | 'CALL_ANALYSIS_COMPLETED'
410
+ | 'CALL_ANALYSIS_FAILED'
411
+ | 'CALL_ANALYSIS_CANCELLED'
412
+ | 'SIMULATION_RUN_PLAN_JOB_STARTED'
413
+ | 'SIMULATION_RUN_PLAN_JOB_COMPLETED'
414
+ | 'SIMULATION_RUN_PLAN_JOB_FAILED'
415
+ | 'SIMULATION_RUN_PLAN_JOB_CANCELLED'
416
+ | 'SIMULATION_JOB_STARTED'
417
+ | 'SIMULATION_JOB_COMPLETED'
418
+ | 'SIMULATION_JOB_FAILED'
419
+ | 'SIMULATION_JOB_CANCELLED'
420
+ | 'METRIC_COLLECTION_JOB_COMPLETED'
421
+ | 'METRIC_COLLECTION_JOB_FAILED'
422
+ | 'CHAT_ANALYSIS_COMPLETED'
423
+ | 'CHAT_ANALYSIS_FAILED'
424
+ | 'ISSUE_OPENED'
425
+ | 'ISSUE_RESOLVED'
426
+ >;
427
+
428
+ type: 'event';
429
+ }
430
+
431
+ export interface AlertSimulationTrigger {
432
+ conditions: Array<'SUCCESS' | 'FAILURE' | 'THRESHOLD_FAILED'>;
433
+
434
+ type: 'simulation';
435
+
436
+ deliveryFormat?: 'MESSAGE' | 'PDF';
437
+
438
+ runPlan?: string;
439
+ }
440
+
441
+ export interface Actions {
442
+ slack?: Array<Actions.Slack>;
443
+
444
+ webhooks?: Array<string>;
445
+ }
446
+
447
+ export namespace Actions {
448
+ export interface Slack {
449
+ channelId: string;
450
+
451
+ channelName: string;
452
+ }
453
+ }
454
+ }
365
455
  }
366
456
 
367
457
  export interface ConfigFlowStep {
@@ -405,7 +495,7 @@ export namespace ConfigApplyResponse {
405
495
  export interface Change {
406
496
  configKey: string;
407
497
 
408
- kind: 'agent' | 'persona' | 'flow' | 'collector' | 'metric';
498
+ kind: 'agent' | 'persona' | 'flow' | 'collector' | 'metric' | 'alert';
409
499
 
410
500
  name: string;
411
501
 
@@ -449,7 +539,7 @@ export namespace ConfigDiffResponse {
449
539
  export interface Change {
450
540
  configKey: string;
451
541
 
452
- kind: 'agent' | 'persona' | 'flow' | 'collector' | 'metric';
542
+ kind: 'agent' | 'persona' | 'flow' | 'collector' | 'metric' | 'alert';
453
543
 
454
544
  name: string;
455
545
 
@@ -478,6 +568,7 @@ export interface ConfigApplyParams {
478
568
  | ConfigApplyParams.ScriptedFlowConfig
479
569
  | ConfigApplyParams.CollectorConfig
480
570
  | ConfigApplyParams.MetricConfig
571
+ | ConfigApplyParams.AlertConfig
481
572
  >;
482
573
 
483
574
  prune?: boolean;
@@ -791,6 +882,95 @@ export namespace ConfigApplyParams {
791
882
  description?: string;
792
883
  }
793
884
  }
885
+
886
+ export interface AlertConfig {
887
+ kind: 'alert';
888
+
889
+ name: string;
890
+
891
+ trigger:
892
+ | AlertConfig.AlertThresholdTrigger
893
+ | AlertConfig.AlertEventTrigger
894
+ | AlertConfig.AlertSimulationTrigger;
895
+
896
+ actions?: AlertConfig.Actions;
897
+
898
+ enabled?: boolean;
899
+ }
900
+
901
+ export namespace AlertConfig {
902
+ export interface AlertThresholdTrigger {
903
+ aggregation: 'COUNT' | 'RATE_PER_MINUTE' | 'MEAN';
904
+
905
+ metric: string;
906
+
907
+ operator: 'GT' | 'GTE' | 'LT' | 'LTE';
908
+
909
+ thresholdValue: number;
910
+
911
+ type: 'threshold';
912
+
913
+ windowMinutes: number;
914
+
915
+ consecutiveOpen?: number;
916
+
917
+ consecutiveResolve?: number;
918
+
919
+ grouping?: 'NONE' | 'BY_AGENT';
920
+
921
+ metricVariant?: string;
922
+
923
+ minSampleSize?: number;
924
+ }
925
+
926
+ export interface AlertEventTrigger {
927
+ events: Array<
928
+ | 'CALL_ANALYSIS_COMPLETED'
929
+ | 'CALL_ANALYSIS_FAILED'
930
+ | 'CALL_ANALYSIS_CANCELLED'
931
+ | 'SIMULATION_RUN_PLAN_JOB_STARTED'
932
+ | 'SIMULATION_RUN_PLAN_JOB_COMPLETED'
933
+ | 'SIMULATION_RUN_PLAN_JOB_FAILED'
934
+ | 'SIMULATION_RUN_PLAN_JOB_CANCELLED'
935
+ | 'SIMULATION_JOB_STARTED'
936
+ | 'SIMULATION_JOB_COMPLETED'
937
+ | 'SIMULATION_JOB_FAILED'
938
+ | 'SIMULATION_JOB_CANCELLED'
939
+ | 'METRIC_COLLECTION_JOB_COMPLETED'
940
+ | 'METRIC_COLLECTION_JOB_FAILED'
941
+ | 'CHAT_ANALYSIS_COMPLETED'
942
+ | 'CHAT_ANALYSIS_FAILED'
943
+ | 'ISSUE_OPENED'
944
+ | 'ISSUE_RESOLVED'
945
+ >;
946
+
947
+ type: 'event';
948
+ }
949
+
950
+ export interface AlertSimulationTrigger {
951
+ conditions: Array<'SUCCESS' | 'FAILURE' | 'THRESHOLD_FAILED'>;
952
+
953
+ type: 'simulation';
954
+
955
+ deliveryFormat?: 'MESSAGE' | 'PDF';
956
+
957
+ runPlan?: string;
958
+ }
959
+
960
+ export interface Actions {
961
+ slack?: Array<Actions.Slack>;
962
+
963
+ webhooks?: Array<string>;
964
+ }
965
+
966
+ export namespace Actions {
967
+ export interface Slack {
968
+ channelId: string;
969
+
970
+ channelName: string;
971
+ }
972
+ }
973
+ }
794
974
  }
795
975
 
796
976
  export interface ConfigDiffParams {
@@ -801,6 +981,7 @@ export interface ConfigDiffParams {
801
981
  | ConfigDiffParams.ScriptedFlowConfig
802
982
  | ConfigDiffParams.CollectorConfig
803
983
  | ConfigDiffParams.MetricConfig
984
+ | ConfigDiffParams.AlertConfig
804
985
  >;
805
986
 
806
987
  prune?: boolean;
@@ -1114,6 +1295,95 @@ export namespace ConfigDiffParams {
1114
1295
  description?: string;
1115
1296
  }
1116
1297
  }
1298
+
1299
+ export interface AlertConfig {
1300
+ kind: 'alert';
1301
+
1302
+ name: string;
1303
+
1304
+ trigger:
1305
+ | AlertConfig.AlertThresholdTrigger
1306
+ | AlertConfig.AlertEventTrigger
1307
+ | AlertConfig.AlertSimulationTrigger;
1308
+
1309
+ actions?: AlertConfig.Actions;
1310
+
1311
+ enabled?: boolean;
1312
+ }
1313
+
1314
+ export namespace AlertConfig {
1315
+ export interface AlertThresholdTrigger {
1316
+ aggregation: 'COUNT' | 'RATE_PER_MINUTE' | 'MEAN';
1317
+
1318
+ metric: string;
1319
+
1320
+ operator: 'GT' | 'GTE' | 'LT' | 'LTE';
1321
+
1322
+ thresholdValue: number;
1323
+
1324
+ type: 'threshold';
1325
+
1326
+ windowMinutes: number;
1327
+
1328
+ consecutiveOpen?: number;
1329
+
1330
+ consecutiveResolve?: number;
1331
+
1332
+ grouping?: 'NONE' | 'BY_AGENT';
1333
+
1334
+ metricVariant?: string;
1335
+
1336
+ minSampleSize?: number;
1337
+ }
1338
+
1339
+ export interface AlertEventTrigger {
1340
+ events: Array<
1341
+ | 'CALL_ANALYSIS_COMPLETED'
1342
+ | 'CALL_ANALYSIS_FAILED'
1343
+ | 'CALL_ANALYSIS_CANCELLED'
1344
+ | 'SIMULATION_RUN_PLAN_JOB_STARTED'
1345
+ | 'SIMULATION_RUN_PLAN_JOB_COMPLETED'
1346
+ | 'SIMULATION_RUN_PLAN_JOB_FAILED'
1347
+ | 'SIMULATION_RUN_PLAN_JOB_CANCELLED'
1348
+ | 'SIMULATION_JOB_STARTED'
1349
+ | 'SIMULATION_JOB_COMPLETED'
1350
+ | 'SIMULATION_JOB_FAILED'
1351
+ | 'SIMULATION_JOB_CANCELLED'
1352
+ | 'METRIC_COLLECTION_JOB_COMPLETED'
1353
+ | 'METRIC_COLLECTION_JOB_FAILED'
1354
+ | 'CHAT_ANALYSIS_COMPLETED'
1355
+ | 'CHAT_ANALYSIS_FAILED'
1356
+ | 'ISSUE_OPENED'
1357
+ | 'ISSUE_RESOLVED'
1358
+ >;
1359
+
1360
+ type: 'event';
1361
+ }
1362
+
1363
+ export interface AlertSimulationTrigger {
1364
+ conditions: Array<'SUCCESS' | 'FAILURE' | 'THRESHOLD_FAILED'>;
1365
+
1366
+ type: 'simulation';
1367
+
1368
+ deliveryFormat?: 'MESSAGE' | 'PDF';
1369
+
1370
+ runPlan?: string;
1371
+ }
1372
+
1373
+ export interface Actions {
1374
+ slack?: Array<Actions.Slack>;
1375
+
1376
+ webhooks?: Array<string>;
1377
+ }
1378
+
1379
+ export namespace Actions {
1380
+ export interface Slack {
1381
+ channelId: string;
1382
+
1383
+ channelName: string;
1384
+ }
1385
+ }
1386
+ }
1117
1387
  }
1118
1388
 
1119
1389
  export declare namespace Config {
@@ -159,6 +159,16 @@ export namespace MetricCreateDefinitionResponse {
159
159
  */
160
160
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
161
161
 
162
+ /**
163
+ * Whether you can create a variant of this metric with POST
164
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
165
+ * configuration comes from the metric they derive from), for provider-computed
166
+ * metrics whose calculation lives in the collector rather than an editable prompt,
167
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
168
+ * metrics are false, so read this rather than discovering it from a 403.
169
+ */
170
+ supportsVariants: boolean;
171
+
162
172
  /**
163
173
  * Type of value this metric produces
164
174
  */
@@ -262,6 +272,16 @@ export namespace MetricCreateDefinitionResponse {
262
272
  */
263
273
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
264
274
 
275
+ /**
276
+ * Whether you can create a variant of this metric with POST
277
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
278
+ * configuration comes from the metric they derive from), for provider-computed
279
+ * metrics whose calculation lives in the collector rather than an editable prompt,
280
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
281
+ * metrics are false, so read this rather than discovering it from a 403.
282
+ */
283
+ supportsVariants: boolean;
284
+
265
285
  /**
266
286
  * Type of value this metric produces
267
287
  */
@@ -382,6 +402,16 @@ export namespace MetricCreateDefinitionResponse {
382
402
  */
383
403
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
384
404
 
405
+ /**
406
+ * Whether you can create a variant of this metric with POST
407
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
408
+ * configuration comes from the metric they derive from), for provider-computed
409
+ * metrics whose calculation lives in the collector rather than an editable prompt,
410
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
411
+ * metrics are false, so read this rather than discovering it from a 403.
412
+ */
413
+ supportsVariants: boolean;
414
+
385
415
  /**
386
416
  * Type of value this metric produces
387
417
  */
@@ -572,6 +602,16 @@ export namespace MetricListDefinitionsResponse {
572
602
  */
573
603
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
574
604
 
605
+ /**
606
+ * Whether you can create a variant of this metric with POST
607
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
608
+ * configuration comes from the metric they derive from), for provider-computed
609
+ * metrics whose calculation lives in the collector rather than an editable prompt,
610
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
611
+ * metrics are false, so read this rather than discovering it from a 403.
612
+ */
613
+ supportsVariants: boolean;
614
+
575
615
  /**
576
616
  * Type of value this metric produces
577
617
  */
@@ -670,6 +710,16 @@ export namespace MetricListDefinitionsResponse {
670
710
  */
671
711
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
672
712
 
713
+ /**
714
+ * Whether you can create a variant of this metric with POST
715
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
716
+ * configuration comes from the metric they derive from), for provider-computed
717
+ * metrics whose calculation lives in the collector rather than an editable prompt,
718
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
719
+ * metrics are false, so read this rather than discovering it from a 403.
720
+ */
721
+ supportsVariants: boolean;
722
+
673
723
  /**
674
724
  * Type of value this metric produces
675
725
  */
@@ -768,6 +818,16 @@ export namespace MetricListDefinitionsResponse {
768
818
  */
769
819
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
770
820
 
821
+ /**
822
+ * Whether you can create a variant of this metric with POST
823
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
824
+ * configuration comes from the metric they derive from), for provider-computed
825
+ * metrics whose calculation lives in the collector rather than an editable prompt,
826
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
827
+ * metrics are false, so read this rather than discovering it from a 403.
828
+ */
829
+ supportsVariants: boolean;
830
+
771
831
  /**
772
832
  * Type of value this metric produces
773
833
  */
@@ -901,6 +961,16 @@ export namespace MetricListDefinitionsResponse {
901
961
  */
902
962
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
903
963
 
964
+ /**
965
+ * Whether you can create a variant of this metric with POST
966
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
967
+ * configuration comes from the metric they derive from), for provider-computed
968
+ * metrics whose calculation lives in the collector rather than an editable prompt,
969
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
970
+ * metrics are false, so read this rather than discovering it from a 403.
971
+ */
972
+ supportsVariants: boolean;
973
+
904
974
  /**
905
975
  * Type of value this metric produces
906
976
  */
@@ -1021,6 +1091,16 @@ export namespace MetricListDefinitionsResponse {
1021
1091
  */
1022
1092
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
1023
1093
 
1094
+ /**
1095
+ * Whether you can create a variant of this metric with POST
1096
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
1097
+ * configuration comes from the metric they derive from), for provider-computed
1098
+ * metrics whose calculation lives in the collector rather than an editable prompt,
1099
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
1100
+ * metrics are false, so read this rather than discovering it from a 403.
1101
+ */
1102
+ supportsVariants: boolean;
1103
+
1024
1104
  /**
1025
1105
  * Type of value this metric produces
1026
1106
  */
@@ -1215,6 +1295,16 @@ export namespace MetricUpdateDefinitionResponse {
1215
1295
  */
1216
1296
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
1217
1297
 
1298
+ /**
1299
+ * Whether you can create a variant of this metric with POST
1300
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
1301
+ * configuration comes from the metric they derive from), for provider-computed
1302
+ * metrics whose calculation lives in the collector rather than an editable prompt,
1303
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
1304
+ * metrics are false, so read this rather than discovering it from a 403.
1305
+ */
1306
+ supportsVariants: boolean;
1307
+
1218
1308
  /**
1219
1309
  * Type of value this metric produces
1220
1310
  */
@@ -1318,6 +1408,16 @@ export namespace MetricUpdateDefinitionResponse {
1318
1408
  */
1319
1409
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
1320
1410
 
1411
+ /**
1412
+ * Whether you can create a variant of this metric with POST
1413
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
1414
+ * configuration comes from the metric they derive from), for provider-computed
1415
+ * metrics whose calculation lives in the collector rather than an editable prompt,
1416
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
1417
+ * metrics are false, so read this rather than discovering it from a 403.
1418
+ */
1419
+ supportsVariants: boolean;
1420
+
1321
1421
  /**
1322
1422
  * Type of value this metric produces
1323
1423
  */
@@ -1438,6 +1538,16 @@ export namespace MetricUpdateDefinitionResponse {
1438
1538
  */
1439
1539
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
1440
1540
 
1541
+ /**
1542
+ * Whether you can create a variant of this metric with POST
1543
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
1544
+ * configuration comes from the metric they derive from), for provider-computed
1545
+ * metrics whose calculation lives in the collector rather than an editable prompt,
1546
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
1547
+ * metrics are false, so read this rather than discovering it from a 403.
1548
+ */
1549
+ supportsVariants: boolean;
1550
+
1441
1551
  /**
1442
1552
  * Type of value this metric produces
1443
1553
  */
@@ -1593,6 +1703,16 @@ export namespace MetricUpdateDefinitionResponse {
1593
1703
  */
1594
1704
  supportedConversationSources: Array<'SIMULATED' | 'LIVE'> | null;
1595
1705
 
1706
+ /**
1707
+ * Whether you can create a variant of this metric with POST
1708
+ * /v1/metric/definitions/{idOrSlug}/variants. False for threshold metrics (their
1709
+ * configuration comes from the metric they derive from), for provider-computed
1710
+ * metrics whose calculation lives in the collector rather than an editable prompt,
1711
+ * and for metrics in a package that manages its own variants. Most of Roark’s own
1712
+ * metrics are false, so read this rather than discovering it from a 403.
1713
+ */
1714
+ supportsVariants: boolean;
1715
+
1596
1716
  /**
1597
1717
  * Type of value this metric produces
1598
1718
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '3.7.0'; // x-release-please-version
1
+ export const VERSION = '3.9.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.0";
1
+ export declare const VERSION = "3.9.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "3.7.0";
1
+ export declare const VERSION = "3.9.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '3.7.0'; // x-release-please-version
4
+ exports.VERSION = '3.9.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '3.7.0'; // x-release-please-version
1
+ export const VERSION = '3.9.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map