@roarkanalytics/cli 0.45.0 → 0.48.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.
package/commands.js CHANGED
@@ -14,6 +14,8 @@ exports.GROUPS = {
14
14
  'agent prompt version': 'Read agent prompt versions',
15
15
  'agent-config': 'Manage agent configs',
16
16
  'agent-config staging': 'Manage agent config staging',
17
+ analytics: 'Read analyticses',
18
+ 'analytics schema': 'Read analytics schema',
17
19
  autoimprove: 'Manage autoimproves',
18
20
  'autoimprove job': 'Manage autoimprove jobs',
19
21
  'autoimprove job guidance': 'Read autoimprove job guidance',
@@ -36,6 +38,10 @@ exports.GROUPS = {
36
38
  'customer-flow edge-case': 'Manage customer flow edge cases',
37
39
  'customer-flow graph': 'Manage customer flow graph',
38
40
  'customer-flow happy-path': 'Manage customer flow happy path',
41
+ dashboard: 'Manage dashboards',
42
+ 'dashboard data': 'Read dashboard data',
43
+ 'dashboard widget': 'Manage dashboard widgets',
44
+ 'dashboard widget-data': 'Read dashboard widget data',
39
45
  'http-request-definition': 'Manage HTTP request definitions',
40
46
  metric: 'Manage metrics',
41
47
  'metric collection-job': 'Manage metric collection jobs',
@@ -58,6 +64,7 @@ exports.GROUPS = {
58
64
  'simulation template': 'Read simulation templates',
59
65
  'simulation tool': 'Read simulation tool',
60
66
  'simulation tool-fixture': 'Manage simulation tool fixtures',
67
+ usage: 'Read usage',
61
68
  webhook: 'Manage webhooks',
62
69
  };
63
70
  exports.COMMANDS = [
@@ -751,6 +758,115 @@ exports.COMMANDS = [
751
758
  acceptsBody: true,
752
759
  requiresAuth: true,
753
760
  },
761
+ {
762
+ commandPath: ['analytics', 'query'],
763
+ clientProperty: 'analytics',
764
+ methodName: 'query',
765
+ httpMethod: 'post',
766
+ httpPath: '/v1/analytics/query',
767
+ summary: 'Run an analytics query',
768
+ description: "Aggregates metric values and conversation counts over a time window and returns one series per measure, with a total for the window and per-interval buckets. The same query a dashboard widget runs, without saving anything. - `measures`: what to aggregate. A METRIC measure names its metric by slug; CONVERSATION counts conversations; UPTIME reads health checks. The aggregation defaults by the metric's output type. - `timeRange`: LAST n DAYS/WEEKS/MONTHS, a CALENDAR_ALIGNED period (TODAY, THIS_MONTH, ...), FIXED from/to, or SINCE. Defaults to the last 30 days; at most 731 days. Calendar periods and buckets align to `timezone` (IANA, default UTC). - `filters` apply to every measure; a measure's own `filters` add to them. - `breakdown` on a measure returns one series per value (largest 50 kept). - `comparisonGroups` (2 to 5) run every measure once per named filter set; `comparisonMode: PREVIOUS_PERIOD` adds the preceding window's values. Values are in the metric's display units. A PASS_RATE is a 0 to 1 share; `sampleSize` 0 means no data. A query the analytics store cannot answer returns 400 naming the unsupported part.",
769
+ positionals: [],
770
+ flags: [
771
+ {
772
+ name: 'measures',
773
+ path: ['measures'],
774
+ location: 'body',
775
+ required: true,
776
+ description: 'What to aggregate: 1 to 10 measures.',
777
+ valueKind: 'array',
778
+ repeatable: false,
779
+ },
780
+ {
781
+ name: 'filters',
782
+ path: ['filters'],
783
+ location: 'body',
784
+ required: false,
785
+ description: "Applied to every measure, on top of each measure's own filters.",
786
+ valueKind: 'array',
787
+ repeatable: false,
788
+ },
789
+ {
790
+ name: 'interval',
791
+ path: ['interval'],
792
+ location: 'body',
793
+ required: false,
794
+ description: "Bucket size. Defaults from the window's length and steps coarser when the window would exceed 500 buckets.",
795
+ valueKind: 'string',
796
+ enumValues: ['HOUR', 'DAY', 'WEEK', 'MONTH'],
797
+ repeatable: false,
798
+ },
799
+ {
800
+ name: 'comparison-mode',
801
+ path: ['comparisonMode'],
802
+ location: 'body',
803
+ required: false,
804
+ description: 'PREVIOUS_PERIOD adds the preceding window of the same length to every series.',
805
+ valueKind: 'string',
806
+ enumValues: ['NONE', 'PREVIOUS_PERIOD'],
807
+ repeatable: false,
808
+ },
809
+ {
810
+ name: 'comparison-groups',
811
+ path: ['comparisonGroups'],
812
+ location: 'body',
813
+ required: false,
814
+ description: 'Run every measure once per named filter set, e.g. one group per agent.',
815
+ valueKind: 'array',
816
+ repeatable: false,
817
+ },
818
+ {
819
+ name: 'time-range',
820
+ path: ['timeRange'],
821
+ location: 'body',
822
+ required: false,
823
+ description: 'Defaults to the last 30 days.',
824
+ valueKind: 'string',
825
+ repeatable: false,
826
+ },
827
+ {
828
+ name: 'timezone',
829
+ path: ['timezone'],
830
+ location: 'body',
831
+ required: false,
832
+ description: 'IANA zone that buckets and calendar periods align to, e.g. America/New_York. Defaults to UTC.',
833
+ valueKind: 'string',
834
+ repeatable: false,
835
+ },
836
+ {
837
+ name: 'include-buckets',
838
+ path: ['includeBuckets'],
839
+ location: 'body',
840
+ required: false,
841
+ description: 'Set false to return only the window totals.',
842
+ valueKind: 'boolean',
843
+ repeatable: false,
844
+ },
845
+ ],
846
+ hasParams: true,
847
+ paramsAllOptional: false,
848
+ bodyOpaque: false,
849
+ bodyVariants: [],
850
+ acceptsBody: true,
851
+ requiresAuth: true,
852
+ },
853
+ {
854
+ commandPath: ['analytics', 'schema', 'get'],
855
+ clientProperty: 'analytics',
856
+ methodName: 'getSchema',
857
+ httpMethod: 'get',
858
+ httpPath: '/v1/analytics/schema',
859
+ summary: 'Get the analytics schema',
860
+ description: 'Lists what can go into an analytics query for this project: every metric by slug with its output type, default aggregation and the aggregations it supports; the measure types; the filter and breakdown types with the properties each accepts; and the custom call properties seen in the project. Read this first when building a query.',
861
+ positionals: [],
862
+ flags: [],
863
+ hasParams: false,
864
+ paramsAllOptional: true,
865
+ bodyOpaque: false,
866
+ bodyVariants: [],
867
+ acceptsBody: false,
868
+ requiresAuth: true,
869
+ },
754
870
  {
755
871
  commandPath: ['autoimprove', 'job', 'answer'],
756
872
  clientProperty: 'autoimproveJob',
@@ -2723,6 +2839,562 @@ exports.COMMANDS = [
2723
2839
  acceptsBody: true,
2724
2840
  requiresAuth: true,
2725
2841
  },
2842
+ {
2843
+ commandPath: ['dashboard', 'create'],
2844
+ clientProperty: 'dashboard',
2845
+ methodName: 'create',
2846
+ httpMethod: 'post',
2847
+ httpPath: '/v1/dashboard',
2848
+ summary: 'Create a dashboard',
2849
+ description: "Creates a dashboard with its widgets. Each widget is an analytics query (see POST /v1/analytics/query) with a name unique on the dashboard, a `display` (LINE, NUMBER, RADAR, STACKED_BAR, TABLE) and a `size` (SMALL, MEDIUM, LARGE, EXTRA_LARGE). Widgets render top to bottom in the order given. Dashboard `filters` apply over every widget and must be conversation-level: AGENT_PROPERTY, CALL_PROPERTY, MODALITY, DATASET or METRIC_VALUE. On a field a widget already filters, the dashboard's wins.",
2850
+ positionals: [],
2851
+ flags: [
2852
+ {
2853
+ name: 'name',
2854
+ path: ['name'],
2855
+ location: 'body',
2856
+ required: true,
2857
+ valueKind: 'string',
2858
+ repeatable: false,
2859
+ },
2860
+ {
2861
+ name: 'description',
2862
+ path: ['description'],
2863
+ location: 'body',
2864
+ required: false,
2865
+ valueKind: 'string',
2866
+ repeatable: false,
2867
+ },
2868
+ {
2869
+ name: 'time-range',
2870
+ path: ['timeRange'],
2871
+ location: 'body',
2872
+ required: false,
2873
+ description: 'The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).',
2874
+ valueKind: 'string',
2875
+ repeatable: false,
2876
+ },
2877
+ {
2878
+ name: 'filters',
2879
+ path: ['filters'],
2880
+ location: 'body',
2881
+ required: false,
2882
+ valueKind: 'array',
2883
+ repeatable: false,
2884
+ },
2885
+ {
2886
+ name: 'is-default',
2887
+ path: ['isDefault'],
2888
+ location: 'body',
2889
+ required: false,
2890
+ valueKind: 'boolean',
2891
+ repeatable: false,
2892
+ },
2893
+ {
2894
+ name: 'widgets',
2895
+ path: ['widgets'],
2896
+ location: 'body',
2897
+ required: false,
2898
+ valueKind: 'array',
2899
+ repeatable: false,
2900
+ },
2901
+ ],
2902
+ hasParams: true,
2903
+ paramsAllOptional: false,
2904
+ bodyOpaque: false,
2905
+ bodyVariants: [],
2906
+ acceptsBody: true,
2907
+ requiresAuth: true,
2908
+ },
2909
+ {
2910
+ commandPath: ['dashboard', 'data', 'get'],
2911
+ clientProperty: 'dashboard',
2912
+ methodName: 'getData',
2913
+ httpMethod: 'get',
2914
+ httpPath: '/v1/dashboard/{dashboardId}/data',
2915
+ summary: 'Get dashboard data',
2916
+ description: "Runs every widget on the dashboard and returns each one's series, exactly as the dashboard shows them: over the dashboard's saved window and with its filters applied. Pass `from` (and optionally `to`) to read a different window, and `timezone` to align buckets to a zone.",
2917
+ positionals: [
2918
+ {
2919
+ name: 'dashboard-id',
2920
+ paramKey: 'dashboardId',
2921
+ },
2922
+ ],
2923
+ flags: [
2924
+ {
2925
+ name: 'from',
2926
+ path: ['from'],
2927
+ location: 'query',
2928
+ required: false,
2929
+ description: 'ISO 8601 start. Overrides the saved window; without `to`, runs until now.',
2930
+ valueKind: 'string',
2931
+ repeatable: false,
2932
+ },
2933
+ {
2934
+ name: 'to',
2935
+ path: ['to'],
2936
+ location: 'query',
2937
+ required: false,
2938
+ description: 'ISO 8601 end. Requires `from`.',
2939
+ valueKind: 'string',
2940
+ repeatable: false,
2941
+ },
2942
+ {
2943
+ name: 'timezone',
2944
+ path: ['timezone'],
2945
+ location: 'query',
2946
+ required: false,
2947
+ description: 'IANA zone buckets and calendar periods align to. Default UTC.',
2948
+ valueKind: 'string',
2949
+ repeatable: false,
2950
+ },
2951
+ ],
2952
+ hasParams: true,
2953
+ paramsAllOptional: true,
2954
+ bodyOpaque: false,
2955
+ bodyVariants: [],
2956
+ acceptsBody: false,
2957
+ requiresAuth: true,
2958
+ },
2959
+ {
2960
+ commandPath: ['dashboard', 'delete'],
2961
+ clientProperty: 'dashboard',
2962
+ methodName: 'delete',
2963
+ httpMethod: 'delete',
2964
+ httpPath: '/v1/dashboard/{dashboardId}',
2965
+ summary: 'Delete a dashboard',
2966
+ description: 'Deletes a dashboard and its widgets. If it was the default, another dashboard becomes the default. A dashboard managed by config as code returns 409.',
2967
+ positionals: [
2968
+ {
2969
+ name: 'dashboard-id',
2970
+ paramKey: 'dashboardId',
2971
+ description: 'The dashboard ID',
2972
+ },
2973
+ ],
2974
+ flags: [],
2975
+ hasParams: false,
2976
+ paramsAllOptional: true,
2977
+ bodyOpaque: false,
2978
+ bodyVariants: [],
2979
+ acceptsBody: false,
2980
+ requiresAuth: true,
2981
+ },
2982
+ {
2983
+ commandPath: ['dashboard', 'get'],
2984
+ clientProperty: 'dashboard',
2985
+ methodName: 'getByID',
2986
+ httpMethod: 'get',
2987
+ httpPath: '/v1/dashboard/{dashboardId}',
2988
+ summary: 'Get a dashboard',
2989
+ description: 'Returns a dashboard with its widgets top to bottom, each in the shape POST /v1/dashboard accepts, so a dashboard can be read, edited and written back.',
2990
+ positionals: [
2991
+ {
2992
+ name: 'dashboard-id',
2993
+ paramKey: 'dashboardId',
2994
+ description: 'The dashboard ID',
2995
+ },
2996
+ ],
2997
+ flags: [],
2998
+ hasParams: false,
2999
+ paramsAllOptional: true,
3000
+ bodyOpaque: false,
3001
+ bodyVariants: [],
3002
+ acceptsBody: false,
3003
+ requiresAuth: true,
3004
+ },
3005
+ {
3006
+ commandPath: ['dashboard', 'list'],
3007
+ clientProperty: 'dashboard',
3008
+ methodName: 'list',
3009
+ httpMethod: 'get',
3010
+ httpPath: '/v1/dashboard',
3011
+ summary: 'List dashboards',
3012
+ description: "Lists the project's dashboards, the default first. GET /v1/dashboard/{dashboardId} returns the widgets.",
3013
+ positionals: [],
3014
+ flags: [],
3015
+ hasParams: false,
3016
+ paramsAllOptional: true,
3017
+ bodyOpaque: false,
3018
+ bodyVariants: [],
3019
+ acceptsBody: false,
3020
+ requiresAuth: true,
3021
+ },
3022
+ {
3023
+ commandPath: ['dashboard', 'update'],
3024
+ clientProperty: 'dashboard',
3025
+ methodName: 'update',
3026
+ httpMethod: 'put',
3027
+ httpPath: '/v1/dashboard/{dashboardId}',
3028
+ summary: 'Update a dashboard',
3029
+ description: 'Edits a dashboard. Omitted fields keep their current value. `widgets`, when sent, replaces the list: widgets are matched by name, so a widget that keeps its name keeps its id; a new name adds a widget and a name no longer listed removes it. To change one widget, PUT /v1/dashboard/{dashboardId}/widget/{widgetId}.',
3030
+ positionals: [
3031
+ {
3032
+ name: 'dashboard-id',
3033
+ paramKey: 'dashboardId',
3034
+ description: 'The dashboard ID',
3035
+ },
3036
+ ],
3037
+ flags: [
3038
+ {
3039
+ name: 'name',
3040
+ path: ['name'],
3041
+ location: 'body',
3042
+ required: false,
3043
+ valueKind: 'string',
3044
+ repeatable: false,
3045
+ },
3046
+ {
3047
+ name: 'description',
3048
+ path: ['description'],
3049
+ location: 'body',
3050
+ required: false,
3051
+ valueKind: 'string',
3052
+ repeatable: false,
3053
+ },
3054
+ {
3055
+ name: 'time-range',
3056
+ path: ['timeRange'],
3057
+ location: 'body',
3058
+ required: false,
3059
+ description: 'The window: LAST n DAYS/WEEKS/MONTHS up to now, a CALENDAR_ALIGNED period (TODAY, YESTERDAY, THIS_WEEK, LAST_WEEK, THIS_MONTH, LAST_MONTH, THIS_YEAR, LAST_YEAR), FIXED from/to, or SINCE a date. At most 731 days (two years).',
3060
+ valueKind: 'string',
3061
+ repeatable: false,
3062
+ },
3063
+ {
3064
+ name: 'filters',
3065
+ path: ['filters'],
3066
+ location: 'body',
3067
+ required: false,
3068
+ valueKind: 'array',
3069
+ repeatable: false,
3070
+ },
3071
+ {
3072
+ name: 'is-default',
3073
+ path: ['isDefault'],
3074
+ location: 'body',
3075
+ required: false,
3076
+ valueKind: 'boolean',
3077
+ repeatable: false,
3078
+ },
3079
+ {
3080
+ name: 'widgets',
3081
+ path: ['widgets'],
3082
+ location: 'body',
3083
+ required: false,
3084
+ valueKind: 'array',
3085
+ repeatable: false,
3086
+ },
3087
+ ],
3088
+ hasParams: true,
3089
+ paramsAllOptional: true,
3090
+ bodyOpaque: false,
3091
+ bodyVariants: [],
3092
+ acceptsBody: true,
3093
+ requiresAuth: true,
3094
+ },
3095
+ {
3096
+ commandPath: ['dashboard', 'widget', 'create'],
3097
+ clientProperty: 'dashboard',
3098
+ methodName: 'createWidget',
3099
+ httpMethod: 'post',
3100
+ httpPath: '/v1/dashboard/{dashboardId}/widget',
3101
+ summary: 'Add a widget',
3102
+ description: 'Adds a widget to the top of a dashboard. Its name must be unique on the dashboard.',
3103
+ positionals: [
3104
+ {
3105
+ name: 'dashboard-id',
3106
+ paramKey: 'dashboardId',
3107
+ description: 'The dashboard ID',
3108
+ },
3109
+ ],
3110
+ flags: [
3111
+ {
3112
+ name: 'measures',
3113
+ path: ['measures'],
3114
+ location: 'body',
3115
+ required: true,
3116
+ description: 'What to aggregate: 1 to 10 measures.',
3117
+ valueKind: 'array',
3118
+ repeatable: false,
3119
+ },
3120
+ {
3121
+ name: 'filters',
3122
+ path: ['filters'],
3123
+ location: 'body',
3124
+ required: false,
3125
+ description: "Applied to every measure, on top of each measure's own filters.",
3126
+ valueKind: 'array',
3127
+ repeatable: false,
3128
+ },
3129
+ {
3130
+ name: 'interval',
3131
+ path: ['interval'],
3132
+ location: 'body',
3133
+ required: false,
3134
+ description: "Bucket size. Defaults from the window's length and steps coarser when the window would exceed 500 buckets.",
3135
+ valueKind: 'string',
3136
+ enumValues: ['HOUR', 'DAY', 'WEEK', 'MONTH'],
3137
+ repeatable: false,
3138
+ },
3139
+ {
3140
+ name: 'comparison-mode',
3141
+ path: ['comparisonMode'],
3142
+ location: 'body',
3143
+ required: false,
3144
+ description: 'PREVIOUS_PERIOD adds the preceding window of the same length to every series.',
3145
+ valueKind: 'string',
3146
+ enumValues: ['NONE', 'PREVIOUS_PERIOD'],
3147
+ repeatable: false,
3148
+ },
3149
+ {
3150
+ name: 'comparison-groups',
3151
+ path: ['comparisonGroups'],
3152
+ location: 'body',
3153
+ required: false,
3154
+ description: 'Run every measure once per named filter set, e.g. one group per agent.',
3155
+ valueKind: 'array',
3156
+ repeatable: false,
3157
+ },
3158
+ {
3159
+ name: 'name',
3160
+ path: ['name'],
3161
+ location: 'body',
3162
+ required: true,
3163
+ description: 'Unique on the dashboard: how the widget is matched on update.',
3164
+ valueKind: 'string',
3165
+ repeatable: false,
3166
+ },
3167
+ {
3168
+ name: 'description',
3169
+ path: ['description'],
3170
+ location: 'body',
3171
+ required: false,
3172
+ valueKind: 'string',
3173
+ repeatable: false,
3174
+ },
3175
+ {
3176
+ name: 'display',
3177
+ path: ['display'],
3178
+ location: 'body',
3179
+ required: false,
3180
+ description: 'Chart type. Defaults to LINE.',
3181
+ valueKind: 'string',
3182
+ enumValues: ['LINE', 'NUMBER', 'RADAR', 'STACKED_BAR', 'TABLE'],
3183
+ repeatable: false,
3184
+ },
3185
+ {
3186
+ name: 'size',
3187
+ path: ['size'],
3188
+ location: 'body',
3189
+ required: false,
3190
+ description: 'Grid width. Defaults to MEDIUM.',
3191
+ valueKind: 'string',
3192
+ enumValues: ['SMALL', 'MEDIUM', 'LARGE', 'EXTRA_LARGE'],
3193
+ repeatable: false,
3194
+ },
3195
+ ],
3196
+ hasParams: true,
3197
+ paramsAllOptional: false,
3198
+ bodyOpaque: false,
3199
+ bodyVariants: [],
3200
+ acceptsBody: true,
3201
+ requiresAuth: true,
3202
+ },
3203
+ {
3204
+ commandPath: ['dashboard', 'widget', 'delete'],
3205
+ clientProperty: 'dashboard',
3206
+ methodName: 'deleteWidget',
3207
+ httpMethod: 'delete',
3208
+ httpPath: '/v1/dashboard/{dashboardId}/widget/{widgetId}',
3209
+ summary: 'Remove a widget',
3210
+ description: 'Removes a widget from a dashboard.',
3211
+ positionals: [
3212
+ {
3213
+ name: 'dashboard-id',
3214
+ paramKey: 'dashboardId',
3215
+ description: 'The dashboard ID',
3216
+ },
3217
+ {
3218
+ name: 'widget-id',
3219
+ paramKey: 'widgetId',
3220
+ description: 'The widget ID',
3221
+ },
3222
+ ],
3223
+ flags: [],
3224
+ hasParams: true,
3225
+ paramsAllOptional: false,
3226
+ bodyOpaque: false,
3227
+ bodyVariants: [],
3228
+ acceptsBody: false,
3229
+ requiresAuth: true,
3230
+ },
3231
+ {
3232
+ commandPath: ['dashboard', 'widget', 'update'],
3233
+ clientProperty: 'dashboard',
3234
+ methodName: 'updateWidget',
3235
+ httpMethod: 'put',
3236
+ httpPath: '/v1/dashboard/{dashboardId}/widget/{widgetId}',
3237
+ summary: 'Replace a widget',
3238
+ description: "Replaces a widget's definition. It keeps its id and its place on the dashboard.",
3239
+ positionals: [
3240
+ {
3241
+ name: 'dashboard-id',
3242
+ paramKey: 'dashboardId',
3243
+ description: 'The dashboard ID',
3244
+ },
3245
+ {
3246
+ name: 'widget-id',
3247
+ paramKey: 'widgetId',
3248
+ description: 'The widget ID',
3249
+ },
3250
+ ],
3251
+ flags: [
3252
+ {
3253
+ name: 'measures',
3254
+ path: ['measures'],
3255
+ location: 'body',
3256
+ required: true,
3257
+ description: 'What to aggregate: 1 to 10 measures.',
3258
+ valueKind: 'array',
3259
+ repeatable: false,
3260
+ },
3261
+ {
3262
+ name: 'filters',
3263
+ path: ['filters'],
3264
+ location: 'body',
3265
+ required: false,
3266
+ description: "Applied to every measure, on top of each measure's own filters.",
3267
+ valueKind: 'array',
3268
+ repeatable: false,
3269
+ },
3270
+ {
3271
+ name: 'interval',
3272
+ path: ['interval'],
3273
+ location: 'body',
3274
+ required: false,
3275
+ description: "Bucket size. Defaults from the window's length and steps coarser when the window would exceed 500 buckets.",
3276
+ valueKind: 'string',
3277
+ enumValues: ['HOUR', 'DAY', 'WEEK', 'MONTH'],
3278
+ repeatable: false,
3279
+ },
3280
+ {
3281
+ name: 'comparison-mode',
3282
+ path: ['comparisonMode'],
3283
+ location: 'body',
3284
+ required: false,
3285
+ description: 'PREVIOUS_PERIOD adds the preceding window of the same length to every series.',
3286
+ valueKind: 'string',
3287
+ enumValues: ['NONE', 'PREVIOUS_PERIOD'],
3288
+ repeatable: false,
3289
+ },
3290
+ {
3291
+ name: 'comparison-groups',
3292
+ path: ['comparisonGroups'],
3293
+ location: 'body',
3294
+ required: false,
3295
+ description: 'Run every measure once per named filter set, e.g. one group per agent.',
3296
+ valueKind: 'array',
3297
+ repeatable: false,
3298
+ },
3299
+ {
3300
+ name: 'name',
3301
+ path: ['name'],
3302
+ location: 'body',
3303
+ required: true,
3304
+ description: 'Unique on the dashboard: how the widget is matched on update.',
3305
+ valueKind: 'string',
3306
+ repeatable: false,
3307
+ },
3308
+ {
3309
+ name: 'description',
3310
+ path: ['description'],
3311
+ location: 'body',
3312
+ required: false,
3313
+ valueKind: 'string',
3314
+ repeatable: false,
3315
+ },
3316
+ {
3317
+ name: 'display',
3318
+ path: ['display'],
3319
+ location: 'body',
3320
+ required: false,
3321
+ description: 'Chart type. Defaults to LINE.',
3322
+ valueKind: 'string',
3323
+ enumValues: ['LINE', 'NUMBER', 'RADAR', 'STACKED_BAR', 'TABLE'],
3324
+ repeatable: false,
3325
+ },
3326
+ {
3327
+ name: 'size',
3328
+ path: ['size'],
3329
+ location: 'body',
3330
+ required: false,
3331
+ description: 'Grid width. Defaults to MEDIUM.',
3332
+ valueKind: 'string',
3333
+ enumValues: ['SMALL', 'MEDIUM', 'LARGE', 'EXTRA_LARGE'],
3334
+ repeatable: false,
3335
+ },
3336
+ ],
3337
+ hasParams: true,
3338
+ paramsAllOptional: false,
3339
+ bodyOpaque: false,
3340
+ bodyVariants: [],
3341
+ acceptsBody: true,
3342
+ requiresAuth: true,
3343
+ },
3344
+ {
3345
+ commandPath: ['dashboard', 'widget-data', 'get'],
3346
+ clientProperty: 'dashboard',
3347
+ methodName: 'getWidgetData',
3348
+ httpMethod: 'get',
3349
+ httpPath: '/v1/dashboard/{dashboardId}/widget/{widgetId}/data',
3350
+ summary: 'Get widget data',
3351
+ description: "Runs one widget and returns its series, as it reads on its dashboard (the dashboard's window and filters). Accepts the same `from` / `to` / `timezone` overrides as GET /v1/dashboard/{dashboardId}/data.",
3352
+ positionals: [
3353
+ {
3354
+ name: 'dashboard-id',
3355
+ paramKey: 'dashboardId',
3356
+ },
3357
+ {
3358
+ name: 'widget-id',
3359
+ paramKey: 'widgetId',
3360
+ },
3361
+ ],
3362
+ flags: [
3363
+ {
3364
+ name: 'from',
3365
+ path: ['from'],
3366
+ location: 'query',
3367
+ required: false,
3368
+ description: 'ISO 8601 start. Overrides the saved window; without `to`, runs until now.',
3369
+ valueKind: 'string',
3370
+ repeatable: false,
3371
+ },
3372
+ {
3373
+ name: 'to',
3374
+ path: ['to'],
3375
+ location: 'query',
3376
+ required: false,
3377
+ description: 'ISO 8601 end. Requires `from`.',
3378
+ valueKind: 'string',
3379
+ repeatable: false,
3380
+ },
3381
+ {
3382
+ name: 'timezone',
3383
+ path: ['timezone'],
3384
+ location: 'query',
3385
+ required: false,
3386
+ description: 'IANA zone buckets and calendar periods align to. Default UTC.',
3387
+ valueKind: 'string',
3388
+ repeatable: false,
3389
+ },
3390
+ ],
3391
+ hasParams: true,
3392
+ paramsAllOptional: false,
3393
+ bodyOpaque: false,
3394
+ bodyVariants: [],
3395
+ acceptsBody: false,
3396
+ requiresAuth: true,
3397
+ },
2726
3398
  {
2727
3399
  commandPath: ['health'],
2728
3400
  clientProperty: 'health',
@@ -3422,7 +4094,7 @@ exports.COMMANDS = [
3422
4094
  path: ['metrics'],
3423
4095
  location: 'body',
3424
4096
  required: true,
3425
- description: 'Metric definitions to collect when this policy matches',
4097
+ description: 'Metric definitions to collect when this policy matches, each with an optional setting',
3426
4098
  valueKind: 'array',
3427
4099
  repeatable: false,
3428
4100
  },
@@ -3575,7 +4247,7 @@ exports.COMMANDS = [
3575
4247
  path: ['metrics'],
3576
4248
  location: 'body',
3577
4249
  required: false,
3578
- description: 'Metric definitions to collect when this policy matches',
4250
+ description: "Metric definitions to collect when this policy matches. Replaces the policy's whole metric list: a metric sent without settings goes back to its default, so resend a metric's settings to keep them. Omit to keep the current metrics.",
3579
4251
  valueKind: 'array',
3580
4252
  repeatable: false,
3581
4253
  },
@@ -6159,6 +6831,51 @@ exports.COMMANDS = [
6159
6831
  acceptsBody: true,
6160
6832
  requiresAuth: true,
6161
6833
  },
6834
+ {
6835
+ commandPath: ['usage', 'get'],
6836
+ clientProperty: 'usage',
6837
+ methodName: 'get',
6838
+ httpMethod: 'get',
6839
+ httpPath: '/v1/usage',
6840
+ summary: 'Get usage & cost',
6841
+ description: 'Report billable usage and cost for the organization over a time window, broken down by project (highest spend first). Pass `from`/`to` as ISO 8601 timestamps; optionally pass `projectId` to scope the report to one project. Amounts are billable spend only (what we absorb is never included). Authenticated by an organization API key with the `usage:read` permission.',
6842
+ positionals: [],
6843
+ flags: [
6844
+ {
6845
+ name: 'from',
6846
+ path: ['from'],
6847
+ location: 'query',
6848
+ required: true,
6849
+ description: 'Start of the window (inclusive), ISO 8601.',
6850
+ valueKind: 'string',
6851
+ repeatable: false,
6852
+ },
6853
+ {
6854
+ name: 'to',
6855
+ path: ['to'],
6856
+ location: 'query',
6857
+ required: true,
6858
+ description: 'End of the window (exclusive), ISO 8601. Must be after `from`, and the window may not exceed 366 days.',
6859
+ valueKind: 'string',
6860
+ repeatable: false,
6861
+ },
6862
+ {
6863
+ name: 'project-id',
6864
+ path: ['projectId'],
6865
+ location: 'query',
6866
+ required: false,
6867
+ description: 'Limit the report to a single project. Omit for the whole organization.',
6868
+ valueKind: 'string',
6869
+ repeatable: false,
6870
+ },
6871
+ ],
6872
+ hasParams: true,
6873
+ paramsAllOptional: false,
6874
+ bodyOpaque: false,
6875
+ bodyVariants: [],
6876
+ acceptsBody: false,
6877
+ requiresAuth: true,
6878
+ },
6162
6879
  {
6163
6880
  commandPath: ['webhook', 'create'],
6164
6881
  clientProperty: 'webhook',