@commercelayer/cli-plugin-metrics 1.0.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.
@@ -0,0 +1,674 @@
1
+ {
2
+ "commands": {
3
+ "metrics:breakdown": {
4
+ "aliases": [
5
+ "metrics:break",
6
+ "breakdown"
7
+ ],
8
+ "args": {
9
+ "resource": {
10
+ "name": "resource",
11
+ "options": [
12
+ "orders",
13
+ "returns",
14
+ "carts"
15
+ ],
16
+ "required": true
17
+ }
18
+ },
19
+ "description": "perform a breakdown query on the Metrics API endpoint",
20
+ "examples": [
21
+ "commercelayer metrics:breakdown orders -b order.country_code -f order.id -O value_count -s desc -l 20",
22
+ "cl breakdown orders -b order.country_code -f order.id -O value_count -s desc -l 20 -B '{\"by\": \"line_items.name\",\"field\": \"line_items.id\",\"operator\": \"value_count\",\"sort\": \"desc\",\"limit\": 20}'"
23
+ ],
24
+ "flags": {
25
+ "organization": {
26
+ "char": "o",
27
+ "description": "the slug of your organization",
28
+ "env": "CL_CLI_ORGANIZATION",
29
+ "hidden": true,
30
+ "name": "organization",
31
+ "required": true,
32
+ "hasDynamicHelp": false,
33
+ "multiple": false,
34
+ "type": "option"
35
+ },
36
+ "domain": {
37
+ "char": "d",
38
+ "dependsOn": [
39
+ "organization"
40
+ ],
41
+ "env": "CL_CLI_DOMAIN",
42
+ "hidden": true,
43
+ "name": "domain",
44
+ "required": false,
45
+ "hasDynamicHelp": false,
46
+ "multiple": false,
47
+ "type": "option"
48
+ },
49
+ "accessToken": {
50
+ "char": "a",
51
+ "dependsOn": [
52
+ "organization"
53
+ ],
54
+ "description": "custom access token to use instead of the one used for login",
55
+ "env": "CL_CLI_ACCESS_TOKEN",
56
+ "hidden": true,
57
+ "name": "accessToken",
58
+ "required": true,
59
+ "hasDynamicHelp": false,
60
+ "multiple": false,
61
+ "type": "option"
62
+ },
63
+ "filter": {
64
+ "char": "F",
65
+ "description": "the filter to apply to the query in JSON format (enclosed in single quotes)",
66
+ "name": "filter",
67
+ "hasDynamicHelp": false,
68
+ "multiple": false,
69
+ "type": "option"
70
+ },
71
+ "by": {
72
+ "char": "b",
73
+ "description": "the field you want the results of the query aggragated by",
74
+ "name": "by",
75
+ "required": true,
76
+ "hasDynamicHelp": false,
77
+ "multiple": false,
78
+ "type": "option"
79
+ },
80
+ "field": {
81
+ "char": "f",
82
+ "description": "the field you want the metrics or statistics computed on",
83
+ "name": "field",
84
+ "required": true,
85
+ "hasDynamicHelp": false,
86
+ "multiple": false,
87
+ "type": "option"
88
+ },
89
+ "operator": {
90
+ "aliases": [
91
+ "op"
92
+ ],
93
+ "char": "O",
94
+ "description": "the list of valid operators depends on the value of the field key",
95
+ "name": "operator",
96
+ "required": true,
97
+ "summary": "the computing operator",
98
+ "hasDynamicHelp": false,
99
+ "multiple": false,
100
+ "options": [
101
+ "avg",
102
+ "cardinality",
103
+ "max",
104
+ "min",
105
+ "percentiles",
106
+ "stats",
107
+ "sum",
108
+ "value_count"
109
+ ],
110
+ "type": "option"
111
+ },
112
+ "breakdown": {
113
+ "char": "B",
114
+ "description": "a JSON object (enclosed in single quotes) containing the nested breakdown",
115
+ "name": "breakdown",
116
+ "summary": "the optional nested breakdown",
117
+ "hasDynamicHelp": false,
118
+ "multiple": false,
119
+ "type": "option"
120
+ },
121
+ "condition": {
122
+ "char": "c",
123
+ "description": "the condition is applied to the computed results of the query and it is available for operators that return single numeric (float or integer) values.",
124
+ "name": "condition",
125
+ "summary": "an additional constraint to fine-tune the set of records",
126
+ "hasDynamicHelp": false,
127
+ "multiple": false,
128
+ "type": "option"
129
+ },
130
+ "sort": {
131
+ "char": "s",
132
+ "description": "the way you want the results of the query to be sorted",
133
+ "name": "sort",
134
+ "hasDynamicHelp": false,
135
+ "multiple": false,
136
+ "options": [
137
+ "asc",
138
+ "desc"
139
+ ],
140
+ "type": "option"
141
+ },
142
+ "limit": {
143
+ "char": "l",
144
+ "description": "the maximum number of records shown in the response",
145
+ "name": "limit",
146
+ "hasDynamicHelp": false,
147
+ "multiple": false,
148
+ "type": "option"
149
+ }
150
+ },
151
+ "hasDynamicHelp": false,
152
+ "hiddenAliases": [],
153
+ "id": "metrics:breakdown",
154
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
155
+ "pluginName": "@commercelayer/cli-plugin-metrics",
156
+ "pluginType": "core",
157
+ "strict": true,
158
+ "enableJsonFlag": false,
159
+ "operation": "breakdown",
160
+ "isESM": false,
161
+ "relativePath": [
162
+ "lib",
163
+ "commands",
164
+ "metrics",
165
+ "breakdown.js"
166
+ ]
167
+ },
168
+ "metrics:date_breakdown": {
169
+ "aliases": [
170
+ "metrics:breakdate",
171
+ "metrics:date",
172
+ "breakdate",
173
+ "date_breakdown"
174
+ ],
175
+ "args": {
176
+ "resource": {
177
+ "name": "resource",
178
+ "options": [
179
+ "orders",
180
+ "returns",
181
+ "carts"
182
+ ],
183
+ "required": true
184
+ }
185
+ },
186
+ "description": "perform a date breakdown query on the Metrics API endpoint",
187
+ "examples": [
188
+ "commercelayer metrics:date_breakdown orders -b order.placed_at -f order.total_amount_with_taxes -O stats -i month"
189
+ ],
190
+ "flags": {
191
+ "organization": {
192
+ "char": "o",
193
+ "description": "the slug of your organization",
194
+ "env": "CL_CLI_ORGANIZATION",
195
+ "hidden": true,
196
+ "name": "organization",
197
+ "required": true,
198
+ "hasDynamicHelp": false,
199
+ "multiple": false,
200
+ "type": "option"
201
+ },
202
+ "domain": {
203
+ "char": "d",
204
+ "dependsOn": [
205
+ "organization"
206
+ ],
207
+ "env": "CL_CLI_DOMAIN",
208
+ "hidden": true,
209
+ "name": "domain",
210
+ "required": false,
211
+ "hasDynamicHelp": false,
212
+ "multiple": false,
213
+ "type": "option"
214
+ },
215
+ "accessToken": {
216
+ "char": "a",
217
+ "dependsOn": [
218
+ "organization"
219
+ ],
220
+ "description": "custom access token to use instead of the one used for login",
221
+ "env": "CL_CLI_ACCESS_TOKEN",
222
+ "hidden": true,
223
+ "name": "accessToken",
224
+ "required": true,
225
+ "hasDynamicHelp": false,
226
+ "multiple": false,
227
+ "type": "option"
228
+ },
229
+ "filter": {
230
+ "char": "F",
231
+ "description": "the filter to apply to the query in JSON format (enclosed in single quotes)",
232
+ "name": "filter",
233
+ "hasDynamicHelp": false,
234
+ "multiple": false,
235
+ "type": "option"
236
+ },
237
+ "by": {
238
+ "char": "b",
239
+ "description": "the field you want the results of the query aggragated by",
240
+ "name": "by",
241
+ "required": true,
242
+ "hasDynamicHelp": false,
243
+ "multiple": false,
244
+ "type": "option"
245
+ },
246
+ "field": {
247
+ "char": "f",
248
+ "description": "the field you want the metrics or statistics computed on",
249
+ "name": "field",
250
+ "required": true,
251
+ "hasDynamicHelp": false,
252
+ "multiple": false,
253
+ "type": "option"
254
+ },
255
+ "operator": {
256
+ "aliases": [
257
+ "op"
258
+ ],
259
+ "char": "O",
260
+ "description": "the list of valid operators depends on the value of the field key",
261
+ "name": "operator",
262
+ "required": true,
263
+ "summary": "the computing operator",
264
+ "hasDynamicHelp": false,
265
+ "multiple": false,
266
+ "options": [
267
+ "avg",
268
+ "cardinality",
269
+ "max",
270
+ "min",
271
+ "percentiles",
272
+ "stats",
273
+ "sum",
274
+ "value_count"
275
+ ],
276
+ "type": "option"
277
+ },
278
+ "breakdown": {
279
+ "char": "B",
280
+ "description": "a JSON object (enclosed in single quotes) containing the nested breakdown",
281
+ "name": "breakdown",
282
+ "summary": "the optional nested breakdown",
283
+ "hasDynamicHelp": false,
284
+ "multiple": false,
285
+ "type": "option"
286
+ },
287
+ "interval": {
288
+ "char": "i",
289
+ "description": "the time interval over which the metrics are computed",
290
+ "name": "interval",
291
+ "hasDynamicHelp": false,
292
+ "multiple": false,
293
+ "options": [
294
+ "hour",
295
+ "day",
296
+ "week",
297
+ "month",
298
+ "year"
299
+ ],
300
+ "type": "option"
301
+ }
302
+ },
303
+ "hasDynamicHelp": false,
304
+ "hiddenAliases": [],
305
+ "id": "metrics:date_breakdown",
306
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
307
+ "pluginName": "@commercelayer/cli-plugin-metrics",
308
+ "pluginType": "core",
309
+ "strict": true,
310
+ "enableJsonFlag": false,
311
+ "operation": "date_breakdown",
312
+ "isESM": false,
313
+ "relativePath": [
314
+ "lib",
315
+ "commands",
316
+ "metrics",
317
+ "date_breakdown.js"
318
+ ]
319
+ },
320
+ "metrics:fbt": {
321
+ "aliases": [
322
+ "fbt"
323
+ ],
324
+ "args": {},
325
+ "description": "perform a Frequently Bought Together query on the Metrics API analysis endpoint",
326
+ "examples": [
327
+ "commercelayer metrics:fbt --in xYZkjABcde,yzXKjYzaCx"
328
+ ],
329
+ "flags": {
330
+ "organization": {
331
+ "char": "o",
332
+ "description": "the slug of your organization",
333
+ "env": "CL_CLI_ORGANIZATION",
334
+ "hidden": true,
335
+ "name": "organization",
336
+ "required": true,
337
+ "hasDynamicHelp": false,
338
+ "multiple": false,
339
+ "type": "option"
340
+ },
341
+ "domain": {
342
+ "char": "d",
343
+ "dependsOn": [
344
+ "organization"
345
+ ],
346
+ "env": "CL_CLI_DOMAIN",
347
+ "hidden": true,
348
+ "name": "domain",
349
+ "required": false,
350
+ "hasDynamicHelp": false,
351
+ "multiple": false,
352
+ "type": "option"
353
+ },
354
+ "accessToken": {
355
+ "char": "a",
356
+ "dependsOn": [
357
+ "organization"
358
+ ],
359
+ "description": "custom access token to use instead of the one used for login",
360
+ "env": "CL_CLI_ACCESS_TOKEN",
361
+ "hidden": true,
362
+ "name": "accessToken",
363
+ "required": true,
364
+ "hasDynamicHelp": false,
365
+ "multiple": false,
366
+ "type": "option"
367
+ },
368
+ "in": {
369
+ "char": "i",
370
+ "description": "a list of SKU or bundle IDs associated as line items to one or more orders",
371
+ "name": "in",
372
+ "required": true,
373
+ "hasDynamicHelp": false,
374
+ "multiple": true,
375
+ "type": "option"
376
+ }
377
+ },
378
+ "hasDynamicHelp": false,
379
+ "hiddenAliases": [],
380
+ "id": "metrics:fbt",
381
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
382
+ "pluginName": "@commercelayer/cli-plugin-metrics",
383
+ "pluginType": "core",
384
+ "strict": true,
385
+ "enableJsonFlag": false,
386
+ "operation": "fbt",
387
+ "isESM": false,
388
+ "relativePath": [
389
+ "lib",
390
+ "commands",
391
+ "metrics",
392
+ "fbt.js"
393
+ ]
394
+ },
395
+ "metrics:noc": {
396
+ "aliases": [],
397
+ "args": {},
398
+ "flags": {},
399
+ "hasDynamicHelp": false,
400
+ "hidden": true,
401
+ "hiddenAliases": [],
402
+ "id": "metrics:noc",
403
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
404
+ "pluginName": "@commercelayer/cli-plugin-metrics",
405
+ "pluginType": "core",
406
+ "strict": true,
407
+ "enableJsonFlag": false,
408
+ "isESM": false,
409
+ "relativePath": [
410
+ "lib",
411
+ "commands",
412
+ "metrics",
413
+ "noc.js"
414
+ ]
415
+ },
416
+ "metrics:search": {
417
+ "aliases": [
418
+ "search"
419
+ ],
420
+ "args": {
421
+ "resource": {
422
+ "name": "resource",
423
+ "options": [
424
+ "orders",
425
+ "returns",
426
+ "carts"
427
+ ],
428
+ "required": true
429
+ }
430
+ },
431
+ "description": "perform a search query on the Metrics API endpoint",
432
+ "examples": [
433
+ "commercelayewr metrics:search orders -l 5 -s asc -b order.placed_at -f order.id,order.number,order.placed_at,customer.email"
434
+ ],
435
+ "flags": {
436
+ "organization": {
437
+ "char": "o",
438
+ "description": "the slug of your organization",
439
+ "env": "CL_CLI_ORGANIZATION",
440
+ "hidden": true,
441
+ "name": "organization",
442
+ "required": true,
443
+ "hasDynamicHelp": false,
444
+ "multiple": false,
445
+ "type": "option"
446
+ },
447
+ "domain": {
448
+ "char": "d",
449
+ "dependsOn": [
450
+ "organization"
451
+ ],
452
+ "env": "CL_CLI_DOMAIN",
453
+ "hidden": true,
454
+ "name": "domain",
455
+ "required": false,
456
+ "hasDynamicHelp": false,
457
+ "multiple": false,
458
+ "type": "option"
459
+ },
460
+ "accessToken": {
461
+ "char": "a",
462
+ "dependsOn": [
463
+ "organization"
464
+ ],
465
+ "description": "custom access token to use instead of the one used for login",
466
+ "env": "CL_CLI_ACCESS_TOKEN",
467
+ "hidden": true,
468
+ "name": "accessToken",
469
+ "required": true,
470
+ "hasDynamicHelp": false,
471
+ "multiple": false,
472
+ "type": "option"
473
+ },
474
+ "filter": {
475
+ "char": "F",
476
+ "description": "the filter to apply to the query in JSON format (enclosed in single quotes)",
477
+ "name": "filter",
478
+ "hasDynamicHelp": false,
479
+ "multiple": false,
480
+ "type": "option"
481
+ },
482
+ "limit": {
483
+ "char": "l",
484
+ "description": "the maximum number of records shown in the response",
485
+ "name": "limit",
486
+ "hasDynamicHelp": false,
487
+ "multiple": false,
488
+ "type": "option"
489
+ },
490
+ "sort": {
491
+ "char": "s",
492
+ "dependsOn": [
493
+ "sort_by"
494
+ ],
495
+ "description": "the way you want the results of the query to be sorted",
496
+ "name": "sort",
497
+ "hasDynamicHelp": false,
498
+ "multiple": false,
499
+ "options": [
500
+ "asc",
501
+ "desc"
502
+ ],
503
+ "type": "option"
504
+ },
505
+ "sort_by": {
506
+ "char": "b",
507
+ "description": "the date field you want the results of the query sorted by",
508
+ "name": "sort_by",
509
+ "hasDynamicHelp": false,
510
+ "multiple": false,
511
+ "type": "option"
512
+ },
513
+ "fields": {
514
+ "char": "f",
515
+ "description": "comma-separated list of fields you want to be returned for each record in the response",
516
+ "name": "fields",
517
+ "required": true,
518
+ "hasDynamicHelp": false,
519
+ "multiple": true,
520
+ "type": "option"
521
+ },
522
+ "cursor": {
523
+ "char": "c",
524
+ "description": "the cursor pointing to a specific page in the paginated search results",
525
+ "name": "cursor",
526
+ "hasDynamicHelp": false,
527
+ "multiple": false,
528
+ "type": "option"
529
+ }
530
+ },
531
+ "hasDynamicHelp": false,
532
+ "hiddenAliases": [],
533
+ "id": "metrics:search",
534
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
535
+ "pluginName": "@commercelayer/cli-plugin-metrics",
536
+ "pluginType": "core",
537
+ "strict": true,
538
+ "enableJsonFlag": false,
539
+ "operation": "search",
540
+ "isESM": false,
541
+ "relativePath": [
542
+ "lib",
543
+ "commands",
544
+ "metrics",
545
+ "search.js"
546
+ ]
547
+ },
548
+ "metrics:stats": {
549
+ "aliases": [
550
+ "stats"
551
+ ],
552
+ "args": {
553
+ "resource": {
554
+ "name": "resource",
555
+ "options": [
556
+ "orders",
557
+ "returns",
558
+ "carts"
559
+ ],
560
+ "required": true
561
+ }
562
+ },
563
+ "description": "perform a stats query on the Metrics API endpoint",
564
+ "examples": [
565
+ "commercelayer metrics:stats orders -f order.total_amount_with_taxes --op avg",
566
+ "cl stats orders -f order.total_amount_with_taxes -O stats"
567
+ ],
568
+ "flags": {
569
+ "organization": {
570
+ "char": "o",
571
+ "description": "the slug of your organization",
572
+ "env": "CL_CLI_ORGANIZATION",
573
+ "hidden": true,
574
+ "name": "organization",
575
+ "required": true,
576
+ "hasDynamicHelp": false,
577
+ "multiple": false,
578
+ "type": "option"
579
+ },
580
+ "domain": {
581
+ "char": "d",
582
+ "dependsOn": [
583
+ "organization"
584
+ ],
585
+ "env": "CL_CLI_DOMAIN",
586
+ "hidden": true,
587
+ "name": "domain",
588
+ "required": false,
589
+ "hasDynamicHelp": false,
590
+ "multiple": false,
591
+ "type": "option"
592
+ },
593
+ "accessToken": {
594
+ "char": "a",
595
+ "dependsOn": [
596
+ "organization"
597
+ ],
598
+ "description": "custom access token to use instead of the one used for login",
599
+ "env": "CL_CLI_ACCESS_TOKEN",
600
+ "hidden": true,
601
+ "name": "accessToken",
602
+ "required": true,
603
+ "hasDynamicHelp": false,
604
+ "multiple": false,
605
+ "type": "option"
606
+ },
607
+ "filter": {
608
+ "char": "F",
609
+ "description": "the filter to apply to the query in JSON format (enclosed in single quotes)",
610
+ "name": "filter",
611
+ "hasDynamicHelp": false,
612
+ "multiple": false,
613
+ "type": "option"
614
+ },
615
+ "field": {
616
+ "char": "f",
617
+ "description": "the field you want the metrics or statistics computed on",
618
+ "name": "field",
619
+ "required": true,
620
+ "hasDynamicHelp": false,
621
+ "multiple": false,
622
+ "type": "option"
623
+ },
624
+ "operator": {
625
+ "aliases": [
626
+ "op"
627
+ ],
628
+ "char": "O",
629
+ "description": "the computing operator",
630
+ "name": "operator",
631
+ "required": true,
632
+ "hasDynamicHelp": false,
633
+ "multiple": false,
634
+ "options": [
635
+ "avg",
636
+ "cardinality",
637
+ "max",
638
+ "min",
639
+ "percentiles",
640
+ "stats",
641
+ "sum",
642
+ "value_count"
643
+ ],
644
+ "type": "option"
645
+ },
646
+ "description": {
647
+ "char": "D",
648
+ "description": "show the description of the operator used for the query",
649
+ "hidden": true,
650
+ "name": "description",
651
+ "allowNo": false,
652
+ "type": "boolean"
653
+ }
654
+ },
655
+ "hasDynamicHelp": false,
656
+ "hiddenAliases": [],
657
+ "id": "metrics:stats",
658
+ "pluginAlias": "@commercelayer/cli-plugin-metrics",
659
+ "pluginName": "@commercelayer/cli-plugin-metrics",
660
+ "pluginType": "core",
661
+ "strict": true,
662
+ "enableJsonFlag": false,
663
+ "operation": "stats",
664
+ "isESM": false,
665
+ "relativePath": [
666
+ "lib",
667
+ "commands",
668
+ "metrics",
669
+ "stats.js"
670
+ ]
671
+ }
672
+ },
673
+ "version": "1.0.0"
674
+ }