@carthooks/arcubase-cli 0.1.21 → 0.1.22

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 (56) hide show
  1. package/bundle/arcubase-admin.mjs +1297 -79
  2. package/bundle/arcubase.mjs +1297 -79
  3. package/dist/generated/command_registry.generated.d.ts +285 -0
  4. package/dist/generated/command_registry.generated.d.ts.map +1 -1
  5. package/dist/generated/command_registry.generated.js +395 -0
  6. package/dist/generated/help_examples.generated.d.ts +77 -0
  7. package/dist/generated/help_examples.generated.d.ts.map +1 -1
  8. package/dist/generated/help_examples.generated.js +122 -0
  9. package/dist/generated/type_index.generated.d.ts +40 -1
  10. package/dist/generated/type_index.generated.d.ts.map +1 -1
  11. package/dist/generated/type_index.generated.js +42 -1
  12. package/dist/generated/zod_registry.generated.d.ts +29 -1
  13. package/dist/generated/zod_registry.generated.d.ts.map +1 -1
  14. package/dist/generated/zod_registry.generated.js +37 -0
  15. package/dist/runtime/dev_sdk_gen.d.ts +9 -0
  16. package/dist/runtime/dev_sdk_gen.d.ts.map +1 -0
  17. package/dist/runtime/dev_sdk_gen.js +319 -0
  18. package/dist/runtime/execute.d.ts.map +1 -1
  19. package/dist/runtime/execute.js +280 -1
  20. package/dist/runtime/zod_registry.d.ts.map +1 -1
  21. package/dist/runtime/zod_registry.js +58 -0
  22. package/package.json +1 -1
  23. package/sdk-dist/api/admin/index.ts +1 -0
  24. package/sdk-dist/api/admin/public-link.ts +48 -0
  25. package/sdk-dist/api/shared-link/form.ts +42 -1
  26. package/sdk-dist/api/user/index.ts +0 -1
  27. package/sdk-dist/docs/runtime-reference/dashboard.md +15 -0
  28. package/sdk-dist/docs/runtime-reference/dev-sdk-gen.md +41 -0
  29. package/sdk-dist/docs/runtime-reference/help-examples/admin/dashboard/update-layout.json +16 -0
  30. package/sdk-dist/docs/runtime-reference/help-examples/admin/widget/create.json +33 -0
  31. package/sdk-dist/docs/runtime-reference/help-examples/admin/widget/preview-data.json +42 -0
  32. package/sdk-dist/docs/runtime-reference/widgets.md +40 -0
  33. package/sdk-dist/generated/command_registry.generated.ts +395 -0
  34. package/sdk-dist/generated/help_examples.generated.ts +122 -0
  35. package/sdk-dist/generated/type_index.generated.ts +42 -1
  36. package/sdk-dist/generated/zod_registry.generated.ts +56 -0
  37. package/sdk-dist/types/app.ts +37 -1
  38. package/sdk-dist/types/common.ts +77 -35
  39. package/sdk-dist/types/index.ts +1 -1
  40. package/sdk-dist/types/public-link.ts +10 -0
  41. package/sdk-dist/types/shared-link.ts +16 -1
  42. package/sdk-dist/types/user-action.ts +1 -43
  43. package/src/generated/command_registry.generated.ts +395 -0
  44. package/src/generated/help_examples.generated.ts +122 -0
  45. package/src/generated/type_index.generated.ts +42 -1
  46. package/src/generated/zod_registry.generated.ts +56 -0
  47. package/src/runtime/dev_sdk_gen.ts +360 -0
  48. package/src/runtime/execute.ts +325 -1
  49. package/src/runtime/zod_registry.ts +58 -0
  50. package/src/tests/command_registry.test.ts +20 -2
  51. package/src/tests/dev_sdk_gen.test.ts +226 -0
  52. package/src/tests/docs_readability.test.ts +15 -0
  53. package/src/tests/execute_validation.test.ts +129 -0
  54. package/src/tests/help.test.ts +70 -0
  55. package/sdk-dist/api/user/copilot.ts +0 -20
  56. package/sdk-dist/types/copilot.ts +0 -34
@@ -152,6 +152,148 @@ export const adminCommands = [
152
152
  "queryParams": [],
153
153
  "responseType": "boolean"
154
154
  },
155
+ {
156
+ "scope": "admin",
157
+ "module": "dashboard",
158
+ "functionName": "getDashboardList",
159
+ "commandPath": [
160
+ "dashboard",
161
+ "list"
162
+ ],
163
+ "method": "GET",
164
+ "endpoint": "/api/apps/:app_id/dashboard",
165
+ "pathParams": [
166
+ {
167
+ "param": "app_id",
168
+ "flag": "app-id"
169
+ }
170
+ ],
171
+ "controller": "Dashboard.GetList",
172
+ "requestType": null,
173
+ "queryParams": [],
174
+ "responseType": "DashboardGetListRespVO"
175
+ },
176
+ {
177
+ "scope": "admin",
178
+ "module": "dashboard",
179
+ "functionName": "createDashboard",
180
+ "commandPath": [
181
+ "dashboard",
182
+ "create"
183
+ ],
184
+ "method": "POST",
185
+ "endpoint": "/api/apps/:app_id/dashboard",
186
+ "pathParams": [
187
+ {
188
+ "param": "app_id",
189
+ "flag": "app-id"
190
+ }
191
+ ],
192
+ "controller": "Dashboard.Create",
193
+ "requestType": "DashboardCreateReqVO",
194
+ "queryParams": [],
195
+ "responseType": "DashboardCreateRespVO"
196
+ },
197
+ {
198
+ "scope": "admin",
199
+ "module": "dashboard",
200
+ "functionName": "getDashboardOptions",
201
+ "commandPath": [
202
+ "dashboard",
203
+ "get-options"
204
+ ],
205
+ "method": "GET",
206
+ "endpoint": "/api/apps/:app_id/dashboard/:dashboard_id/options",
207
+ "pathParams": [
208
+ {
209
+ "param": "app_id",
210
+ "flag": "app-id"
211
+ },
212
+ {
213
+ "param": "dashboard_id",
214
+ "flag": "dashboard-id"
215
+ }
216
+ ],
217
+ "controller": "Dashboard.FetchOptions",
218
+ "requestType": null,
219
+ "queryParams": [],
220
+ "responseType": "DashboardFetchOptionsRespVO"
221
+ },
222
+ {
223
+ "scope": "admin",
224
+ "module": "dashboard",
225
+ "functionName": "updateDashboardOptions",
226
+ "commandPath": [
227
+ "dashboard",
228
+ "update-options"
229
+ ],
230
+ "method": "PUT",
231
+ "endpoint": "/api/apps/:app_id/dashboard/:dashboard_id/options",
232
+ "pathParams": [
233
+ {
234
+ "param": "app_id",
235
+ "flag": "app-id"
236
+ },
237
+ {
238
+ "param": "dashboard_id",
239
+ "flag": "dashboard-id"
240
+ }
241
+ ],
242
+ "controller": "Dashboard.UpdateOptions",
243
+ "requestType": "DashboardUpdateOptionsReqVO",
244
+ "queryParams": [],
245
+ "responseType": "DashboardUpdateOptionsRespVO"
246
+ },
247
+ {
248
+ "scope": "admin",
249
+ "module": "dashboard",
250
+ "functionName": "updateDashboardLayout",
251
+ "commandPath": [
252
+ "dashboard",
253
+ "update-layout"
254
+ ],
255
+ "method": "PUT",
256
+ "endpoint": "/api/apps/:app_id/dashboard/:dashboard_id/layout",
257
+ "pathParams": [
258
+ {
259
+ "param": "app_id",
260
+ "flag": "app-id"
261
+ },
262
+ {
263
+ "param": "dashboard_id",
264
+ "flag": "dashboard-id"
265
+ }
266
+ ],
267
+ "controller": "Dashboard.UpdateLayout",
268
+ "requestType": "DashboardUpdateLayoutReqVO",
269
+ "queryParams": [],
270
+ "responseType": "DashboardUpdateLayoutRespVO"
271
+ },
272
+ {
273
+ "scope": "admin",
274
+ "module": "dashboard",
275
+ "functionName": "updateDashboardTitle",
276
+ "commandPath": [
277
+ "dashboard",
278
+ "rename"
279
+ ],
280
+ "method": "PUT",
281
+ "endpoint": "/api/apps/:app_id/dashboard/:dashboard_id/label",
282
+ "pathParams": [
283
+ {
284
+ "param": "app_id",
285
+ "flag": "app-id"
286
+ },
287
+ {
288
+ "param": "dashboard_id",
289
+ "flag": "dashboard-id"
290
+ }
291
+ ],
292
+ "controller": "Dashboard.UpdateTitle",
293
+ "requestType": "DashboardUpdateTitleReqVO",
294
+ "queryParams": [],
295
+ "responseType": "DashboardUpdateTitleRespVO"
296
+ },
155
297
  {
156
298
  "scope": "admin",
157
299
  "module": "table",
@@ -587,6 +729,188 @@ export const adminCommands = [
587
729
  "requestType": "EntityWorkflowUpdateReqVO",
588
730
  "queryParams": [],
589
731
  "responseType": "EntityWorkflowUpdateRespVO"
732
+ },
733
+ {
734
+ "scope": "admin",
735
+ "module": "widget",
736
+ "functionName": "widgetsList",
737
+ "commandPath": [
738
+ "widget",
739
+ "list"
740
+ ],
741
+ "method": "GET",
742
+ "endpoint": "/api/apps/:app_id/widgets",
743
+ "pathParams": [
744
+ {
745
+ "param": "app_id",
746
+ "flag": "app-id"
747
+ }
748
+ ],
749
+ "controller": "App.WidgetsList",
750
+ "requestType": null,
751
+ "queryParams": [
752
+ {
753
+ "key": "type",
754
+ "flag": "type",
755
+ "type": "string",
756
+ "hasDefault": true
757
+ },
758
+ {
759
+ "key": "dashboard_id",
760
+ "flag": "dashboard-id",
761
+ "type": "number",
762
+ "hasDefault": true
763
+ },
764
+ {
765
+ "key": "ingress_id",
766
+ "flag": "ingress-id",
767
+ "type": "number",
768
+ "hasDefault": true
769
+ }
770
+ ],
771
+ "responseType": "AppWidgetsListRespVO"
772
+ },
773
+ {
774
+ "scope": "admin",
775
+ "module": "widget",
776
+ "functionName": "getWidgets",
777
+ "commandPath": [
778
+ "widget",
779
+ "get"
780
+ ],
781
+ "method": "GET",
782
+ "endpoint": "/api/apps/:app_id/widgets/:widgets_id",
783
+ "pathParams": [
784
+ {
785
+ "param": "app_id",
786
+ "flag": "app-id"
787
+ },
788
+ {
789
+ "param": "widgets_id",
790
+ "flag": "widget-id"
791
+ }
792
+ ],
793
+ "controller": "App.GetWidgets",
794
+ "requestType": null,
795
+ "queryParams": [],
796
+ "responseType": "AppGetWidgetsRespVO"
797
+ },
798
+ {
799
+ "scope": "admin",
800
+ "module": "widget",
801
+ "functionName": "newWidgets",
802
+ "commandPath": [
803
+ "widget",
804
+ "create"
805
+ ],
806
+ "method": "POST",
807
+ "endpoint": "/api/apps/:app_id/widgets",
808
+ "pathParams": [
809
+ {
810
+ "param": "app_id",
811
+ "flag": "app-id"
812
+ }
813
+ ],
814
+ "controller": "App.NewWidgets",
815
+ "requestType": "AppNewWidgetsReqVO",
816
+ "queryParams": [],
817
+ "responseType": "AppNewWidgetsRespVO"
818
+ },
819
+ {
820
+ "scope": "admin",
821
+ "module": "widget",
822
+ "functionName": "updateWidgets",
823
+ "commandPath": [
824
+ "widget",
825
+ "update"
826
+ ],
827
+ "method": "PUT",
828
+ "endpoint": "/api/apps/:app_id/widgets/:widgets_id",
829
+ "pathParams": [
830
+ {
831
+ "param": "app_id",
832
+ "flag": "app-id"
833
+ },
834
+ {
835
+ "param": "widgets_id",
836
+ "flag": "widget-id"
837
+ }
838
+ ],
839
+ "controller": "App.UpdateWidgets",
840
+ "requestType": "AppUpdateWidgetsReqVO",
841
+ "queryParams": [],
842
+ "responseType": "AppUpdateWidgetsRespVO"
843
+ },
844
+ {
845
+ "scope": "admin",
846
+ "module": "widget",
847
+ "functionName": "updateWidgetsIngressOptions",
848
+ "commandPath": [
849
+ "widget",
850
+ "update-ingress-options"
851
+ ],
852
+ "method": "PUT",
853
+ "endpoint": "/api/apps/:app_id/widgets/:widgets_id/ingress-options",
854
+ "pathParams": [
855
+ {
856
+ "param": "app_id",
857
+ "flag": "app-id"
858
+ },
859
+ {
860
+ "param": "widgets_id",
861
+ "flag": "widget-id"
862
+ }
863
+ ],
864
+ "controller": "App.UpdateWidgetsIngressOptions",
865
+ "requestType": "AppUpdateWidgetsIngressOptionsReqVO",
866
+ "queryParams": [],
867
+ "responseType": "AppUpdateWidgetsIngressOptionsRespVO"
868
+ },
869
+ {
870
+ "scope": "admin",
871
+ "module": "widget",
872
+ "functionName": "previewWidgetsData",
873
+ "commandPath": [
874
+ "widget",
875
+ "preview-data"
876
+ ],
877
+ "method": "POST",
878
+ "endpoint": "/api/apps/:app_id/widgets-preview",
879
+ "pathParams": [
880
+ {
881
+ "param": "app_id",
882
+ "flag": "app-id"
883
+ }
884
+ ],
885
+ "controller": "App.PreviewWidgetsData",
886
+ "requestType": "AppPreviewWidgetsDataReqVO",
887
+ "queryParams": [],
888
+ "responseType": "AppPreviewWidgetsDataRespVO"
889
+ },
890
+ {
891
+ "scope": "admin",
892
+ "module": "widget",
893
+ "functionName": "deleteWidgets",
894
+ "commandPath": [
895
+ "widget",
896
+ "delete"
897
+ ],
898
+ "method": "DELETE",
899
+ "endpoint": "/api/apps/:app_id/widgets/:widgets_id",
900
+ "pathParams": [
901
+ {
902
+ "param": "app_id",
903
+ "flag": "app-id"
904
+ },
905
+ {
906
+ "param": "widgets_id",
907
+ "flag": "widget-id"
908
+ }
909
+ ],
910
+ "controller": "App.DeleteWidgets",
911
+ "requestType": null,
912
+ "queryParams": [],
913
+ "responseType": "boolean"
590
914
  }
591
915
  ];
592
916
  export const userCommands = [
@@ -613,6 +937,56 @@ export const userCommands = [
613
937
  ],
614
938
  "responseType": "GlobalActionEntryRespVO"
615
939
  },
940
+ {
941
+ "scope": "user",
942
+ "module": "dashboard",
943
+ "functionName": "getDashboard",
944
+ "commandPath": [
945
+ "dashboard",
946
+ "get"
947
+ ],
948
+ "method": "GET",
949
+ "endpoint": "/api/dashboard/:app_id/:dashboard_id",
950
+ "pathParams": [
951
+ {
952
+ "param": "app_id",
953
+ "flag": "app-id"
954
+ },
955
+ {
956
+ "param": "dashboard_id",
957
+ "flag": "dashboard-id"
958
+ }
959
+ ],
960
+ "controller": "UserAction.DashboardGet",
961
+ "requestType": null,
962
+ "queryParams": [],
963
+ "responseType": "DashboardGetRespVO"
964
+ },
965
+ {
966
+ "scope": "user",
967
+ "module": "dashboard",
968
+ "functionName": "getDashboardWidgets",
969
+ "commandPath": [
970
+ "dashboard",
971
+ "widgets"
972
+ ],
973
+ "method": "GET",
974
+ "endpoint": "/api/dashboard/:app_id/:dashboard_id/widgets",
975
+ "pathParams": [
976
+ {
977
+ "param": "app_id",
978
+ "flag": "app-id"
979
+ },
980
+ {
981
+ "param": "dashboard_id",
982
+ "flag": "dashboard-id"
983
+ }
984
+ ],
985
+ "controller": "UserAction.DashboardWidgets",
986
+ "requestType": null,
987
+ "queryParams": [],
988
+ "responseType": "DashboardWidgets[]"
989
+ },
616
990
  {
617
991
  "scope": "user",
618
992
  "module": "table",
@@ -1034,6 +1408,27 @@ export const userCommands = [
1034
1408
  "queryParams": [],
1035
1409
  "responseType": "MobileUploadCheckRespVO"
1036
1410
  },
1411
+ {
1412
+ "scope": "user",
1413
+ "module": "widget",
1414
+ "functionName": "fetchWidgetsData",
1415
+ "commandPath": [
1416
+ "widget",
1417
+ "data"
1418
+ ],
1419
+ "method": "POST",
1420
+ "endpoint": "/api/apps/:app_id/widgets-data",
1421
+ "pathParams": [
1422
+ {
1423
+ "param": "app_id",
1424
+ "flag": "app-id"
1425
+ }
1426
+ ],
1427
+ "controller": "UserAction.FetchWidgetsData",
1428
+ "requestType": "FetchWidgetsDataReqVO",
1429
+ "queryParams": [],
1430
+ "responseType": "FetchWidgetsDataRespVO"
1431
+ },
1037
1432
  {
1038
1433
  "scope": "user",
1039
1434
  "module": "profile",
@@ -248,6 +248,83 @@ export declare const helpExamplesIndex: {
248
248
  readonly notes: readonly ["actor means Arcubase role id", "condition mode \"and\" and \"or\" are canonical; legacy \"all\" also reads as AND", "nested OR uses subset and leaves the wrapper column/operator empty"];
249
249
  }];
250
250
  };
251
+ readonly "admin.dashboard.update-layout": {
252
+ readonly command: readonly ["dashboard", "update-layout"];
253
+ readonly examples: readonly [{
254
+ readonly title: "place one dashboard widget in the top-left area";
255
+ readonly body: readonly [{
256
+ readonly id: 2188892001;
257
+ readonly x: 0;
258
+ readonly y: 0;
259
+ readonly w: 12;
260
+ readonly h: 6;
261
+ }];
262
+ readonly notes: readonly ["the request body is a top-level array", "do not wrap the array as {\"layout\":[...]}"];
263
+ }];
264
+ };
265
+ readonly "admin.widget.create": {
266
+ readonly command: readonly ["widget", "create"];
267
+ readonly examples: readonly [{
268
+ readonly title: "create a dashboard chart widget";
269
+ readonly body: {
270
+ readonly type: "chart";
271
+ readonly options: {
272
+ readonly dashboard_id: 2188892001;
273
+ };
274
+ };
275
+ readonly notes: readonly ["do not set options.type by hand", "dashboard_id selects a dashboard widget", "use widget update next to save chart options"];
276
+ }, {
277
+ readonly title: "create an ingress list widget";
278
+ readonly body: {
279
+ readonly type: "list";
280
+ readonly options: {
281
+ readonly ingress_id: 2188893001;
282
+ };
283
+ };
284
+ readonly notes: readonly ["ingress_id selects an ingress widget", "do not place ingress widgets with dashboard update-layout"];
285
+ }];
286
+ };
287
+ readonly "admin.widget.preview-data": {
288
+ readonly command: readonly ["widget", "preview-data"];
289
+ readonly examples: readonly [{
290
+ readonly title: "preview dashboard chart data from a table";
291
+ readonly body: {
292
+ readonly dataSource: 2188891001;
293
+ readonly dataSourceType: "entity";
294
+ readonly dimensions: readonly [{
295
+ readonly IsField: true;
296
+ readonly FieldID: 1004;
297
+ readonly Name: "Source";
298
+ }];
299
+ readonly measures: readonly [{
300
+ readonly FieldID: 1005;
301
+ readonly Aggregate: "sum";
302
+ readonly Name: "Total Amount";
303
+ }];
304
+ };
305
+ readonly notes: readonly ["preview-data does not accept --widget-id", "do not send widget_id or id in the request body", "copy dimensions and measures from the chart query you want to preview"];
306
+ }, {
307
+ readonly title: "preview count and distinct_count in one grouped chart";
308
+ readonly body: {
309
+ readonly dataSource: 2188891001;
310
+ readonly dataSourceType: "entity";
311
+ readonly dimensions: readonly [{
312
+ readonly IsField: true;
313
+ readonly FieldID: 1004;
314
+ readonly Name: "Source";
315
+ }];
316
+ readonly measures: readonly [{
317
+ readonly Aggregate: "count";
318
+ readonly Name: "Lead Count";
319
+ }, {
320
+ readonly FieldID: 1002;
321
+ readonly Aggregate: "distinct_count";
322
+ readonly Name: "Distinct Customers";
323
+ }];
324
+ };
325
+ readonly notes: readonly ["supported Aggregate values are sum, avg, max, min, count, and distinct_count", "unsupported aggregate names fail local body validation before the request is sent"];
326
+ }];
327
+ };
251
328
  readonly "user.row.bulk-update": {
252
329
  readonly command: readonly ["row", "bulk-update"];
253
330
  readonly examples: readonly [{
@@ -1 +1 @@
1
- {"version":3,"file":"help_examples.generated.d.ts","sourceRoot":"","sources":["../../src/generated/help_examples.generated.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmbgF,CAAA"}
1
+ {"version":3,"file":"help_examples.generated.d.ts","sourceRoot":"","sources":["../../src/generated/help_examples.generated.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6iBgF,CAAA"}
@@ -339,6 +339,128 @@ export const helpExamplesIndex = {
339
339
  }
340
340
  ]
341
341
  },
342
+ "admin.dashboard.update-layout": {
343
+ "command": [
344
+ "dashboard",
345
+ "update-layout"
346
+ ],
347
+ "examples": [
348
+ {
349
+ "title": "place one dashboard widget in the top-left area",
350
+ "body": [
351
+ {
352
+ "id": 2188892001,
353
+ "x": 0,
354
+ "y": 0,
355
+ "w": 12,
356
+ "h": 6
357
+ }
358
+ ],
359
+ "notes": [
360
+ "the request body is a top-level array",
361
+ "do not wrap the array as {\"layout\":[...]}"
362
+ ]
363
+ }
364
+ ]
365
+ },
366
+ "admin.widget.create": {
367
+ "command": [
368
+ "widget",
369
+ "create"
370
+ ],
371
+ "examples": [
372
+ {
373
+ "title": "create a dashboard chart widget",
374
+ "body": {
375
+ "type": "chart",
376
+ "options": {
377
+ "dashboard_id": 2188892001
378
+ }
379
+ },
380
+ "notes": [
381
+ "do not set options.type by hand",
382
+ "dashboard_id selects a dashboard widget",
383
+ "use widget update next to save chart options"
384
+ ]
385
+ },
386
+ {
387
+ "title": "create an ingress list widget",
388
+ "body": {
389
+ "type": "list",
390
+ "options": {
391
+ "ingress_id": 2188893001
392
+ }
393
+ },
394
+ "notes": [
395
+ "ingress_id selects an ingress widget",
396
+ "do not place ingress widgets with dashboard update-layout"
397
+ ]
398
+ }
399
+ ]
400
+ },
401
+ "admin.widget.preview-data": {
402
+ "command": [
403
+ "widget",
404
+ "preview-data"
405
+ ],
406
+ "examples": [
407
+ {
408
+ "title": "preview dashboard chart data from a table",
409
+ "body": {
410
+ "dataSource": 2188891001,
411
+ "dataSourceType": "entity",
412
+ "dimensions": [
413
+ {
414
+ "IsField": true,
415
+ "FieldID": 1004,
416
+ "Name": "Source"
417
+ }
418
+ ],
419
+ "measures": [
420
+ {
421
+ "FieldID": 1005,
422
+ "Aggregate": "sum",
423
+ "Name": "Total Amount"
424
+ }
425
+ ]
426
+ },
427
+ "notes": [
428
+ "preview-data does not accept --widget-id",
429
+ "do not send widget_id or id in the request body",
430
+ "copy dimensions and measures from the chart query you want to preview"
431
+ ]
432
+ },
433
+ {
434
+ "title": "preview count and distinct_count in one grouped chart",
435
+ "body": {
436
+ "dataSource": 2188891001,
437
+ "dataSourceType": "entity",
438
+ "dimensions": [
439
+ {
440
+ "IsField": true,
441
+ "FieldID": 1004,
442
+ "Name": "Source"
443
+ }
444
+ ],
445
+ "measures": [
446
+ {
447
+ "Aggregate": "count",
448
+ "Name": "Lead Count"
449
+ },
450
+ {
451
+ "FieldID": 1002,
452
+ "Aggregate": "distinct_count",
453
+ "Name": "Distinct Customers"
454
+ }
455
+ ]
456
+ },
457
+ "notes": [
458
+ "supported Aggregate values are sum, avg, max, min, count, and distinct_count",
459
+ "unsupported aggregate names fail local body validation before the request is sent"
460
+ ]
461
+ }
462
+ ]
463
+ },
342
464
  "user.row.bulk-update": {
343
465
  "command": [
344
466
  "row",