@contextual-io/cli 0.3.1 → 0.5.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 (40) hide show
  1. package/README.md +383 -44
  2. package/dist/base.d.ts +5 -1
  3. package/dist/base.js +19 -4
  4. package/dist/commands/config/add.js +2 -1
  5. package/dist/commands/config/current.js +2 -2
  6. package/dist/commands/config/delete.js +1 -1
  7. package/dist/commands/config/get.js +3 -4
  8. package/dist/commands/config/index.js +1 -1
  9. package/dist/commands/config/list.js +6 -6
  10. package/dist/commands/config/login.js +1 -1
  11. package/dist/commands/config/use.js +1 -1
  12. package/dist/commands/records/add.js +1 -1
  13. package/dist/commands/records/delete.js +2 -2
  14. package/dist/commands/records/get.js +2 -2
  15. package/dist/commands/records/index.js +1 -1
  16. package/dist/commands/records/list.d.ts +1 -0
  17. package/dist/commands/records/list.js +2 -1
  18. package/dist/commands/records/patch.d.ts +25 -0
  19. package/dist/commands/records/patch.js +106 -0
  20. package/dist/commands/records/query.js +1 -1
  21. package/dist/commands/records/replace.js +2 -2
  22. package/dist/commands/types/add.d.ts +11 -0
  23. package/dist/commands/types/add.js +57 -0
  24. package/dist/commands/types/delete.d.ts +12 -0
  25. package/dist/commands/types/delete.js +35 -0
  26. package/dist/commands/types/get.d.ts +12 -0
  27. package/dist/commands/types/get.js +33 -0
  28. package/dist/commands/types/index.d.ts +9 -0
  29. package/dist/commands/types/index.js +13 -0
  30. package/dist/commands/types/list.d.ts +20 -0
  31. package/dist/commands/types/list.js +129 -0
  32. package/dist/commands/types/replace.d.ts +13 -0
  33. package/dist/commands/types/replace.js +57 -0
  34. package/dist/models/uri.js +5 -0
  35. package/dist/models/user-config.d.ts +2 -2
  36. package/dist/models/user-config.js +2 -0
  37. package/dist/utils/endpoints.d.ts +1 -0
  38. package/dist/utils/endpoints.js +1 -0
  39. package/oclif.manifest.json +457 -20
  40. package/package.json +1 -1
@@ -9,7 +9,7 @@
9
9
  "required": true
10
10
  }
11
11
  },
12
- "description": "add a new config",
12
+ "description": "Add a new config.",
13
13
  "examples": [
14
14
  "<%= config.bin %> <%= command.id %> some-config-id --tenant-id my-tenant"
15
15
  ],
@@ -17,6 +17,7 @@
17
17
  "silo": {
18
18
  "char": "s",
19
19
  "description": "silo",
20
+ "hidden": true,
20
21
  "name": "silo",
21
22
  "default": "prod",
22
23
  "hasDynamicHelp": false,
@@ -56,7 +57,7 @@
56
57
  "config:current": {
57
58
  "aliases": [],
58
59
  "args": {},
59
- "description": "get the current config",
60
+ "description": "Get the current config.",
60
61
  "examples": [
61
62
  "<%= config.bin %> <%= command.id %>"
62
63
  ],
@@ -94,7 +95,7 @@
94
95
  "required": true
95
96
  }
96
97
  },
97
- "description": "delete a config",
98
+ "description": "Delete a config.",
98
99
  "examples": [
99
100
  "<%= config.bin %> <%= command.id %> some-config-id"
100
101
  ],
@@ -123,7 +124,7 @@
123
124
  "name": "config-id"
124
125
  }
125
126
  },
126
- "description": "get a specific config",
127
+ "description": "Get a specific config.",
127
128
  "examples": [
128
129
  "<%= config.bin %> <%= command.id %>",
129
130
  "<%= config.bin %> <%= command.id %> some-config-id"
@@ -156,7 +157,7 @@
156
157
  "config": {
157
158
  "aliases": [],
158
159
  "args": {},
159
- "description": "manage configs",
160
+ "description": "Manage configs.",
160
161
  "examples": [],
161
162
  "flags": {},
162
163
  "hasDynamicHelp": false,
@@ -181,7 +182,7 @@
181
182
  "config:list": {
182
183
  "aliases": [],
183
184
  "args": {},
184
- "description": "list all available configs",
185
+ "description": "List all available configs.",
185
186
  "examples": [
186
187
  "<%= config.bin %> <%= command.id %>"
187
188
  ],
@@ -213,7 +214,7 @@
213
214
  "config:login": {
214
215
  "aliases": [],
215
216
  "args": {},
216
- "description": "login using the current config",
217
+ "description": "Login using the current config.",
217
218
  "examples": [
218
219
  "<%= config.bin %> <%= command.id %>"
219
220
  ],
@@ -243,7 +244,7 @@
243
244
  "required": true
244
245
  }
245
246
  },
246
- "description": "use a config",
247
+ "description": "Use a config.",
247
248
  "examples": [
248
249
  "<%= config.bin %> <%= command.id %> some-config-id"
249
250
  ],
@@ -275,7 +276,7 @@
275
276
  "name": "uri"
276
277
  }
277
278
  },
278
- "description": "create record(s)",
279
+ "description": "Create record(s).",
279
280
  "examples": [
280
281
  "<%= config.bin %> <%= command.id %> native-object:my-type",
281
282
  "<%= config.bin %> <%= command.id %> --type my-type --input-file records.json"
@@ -332,7 +333,7 @@
332
333
  "name": "uri"
333
334
  }
334
335
  },
335
- "description": "delete record(s)",
336
+ "description": "Delete record(s).",
336
337
  "examples": [
337
338
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1",
338
339
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1",
@@ -351,7 +352,7 @@
351
352
  "type": "option"
352
353
  },
353
354
  "id": {
354
- "char": "i",
355
+ "char": "I",
355
356
  "description": "id(s)",
356
357
  "name": "id",
357
358
  "hasDynamicHelp": false,
@@ -391,7 +392,7 @@
391
392
  "name": "uri"
392
393
  }
393
394
  },
394
- "description": "get a record",
395
+ "description": "Get a record.",
395
396
  "examples": [
396
397
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1",
397
398
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1",
@@ -410,7 +411,7 @@
410
411
  "type": "option"
411
412
  },
412
413
  "id": {
413
- "char": "i",
414
+ "char": "I",
414
415
  "description": "id(s)",
415
416
  "name": "id",
416
417
  "hasDynamicHelp": false,
@@ -445,7 +446,7 @@
445
446
  "records": {
446
447
  "aliases": [],
447
448
  "args": {},
448
- "description": "manage records",
449
+ "description": "Manage records.",
449
450
  "examples": [],
450
451
  "flags": {},
451
452
  "hasDynamicHelp": false,
@@ -468,14 +469,16 @@
468
469
  ]
469
470
  },
470
471
  "records:list": {
471
- "aliases": [],
472
+ "aliases": [
473
+ "records:search"
474
+ ],
472
475
  "args": {
473
476
  "uri": {
474
477
  "description": "uri of type",
475
478
  "name": "uri"
476
479
  }
477
480
  },
478
- "description": "list records",
481
+ "description": "List records.",
479
482
  "examples": [
480
483
  "<%= config.bin %> <%= command.id %> native-object:my-type",
481
484
  "<%= config.bin %> <%= command.id %> --type my-type",
@@ -591,6 +594,103 @@
591
594
  "list.js"
592
595
  ]
593
596
  },
597
+ "records:patch": {
598
+ "aliases": [],
599
+ "args": {
600
+ "uri": {
601
+ "description": "uri of record",
602
+ "name": "uri"
603
+ }
604
+ },
605
+ "description": "Patch a record.",
606
+ "examples": [
607
+ "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1 --set field1=value1",
608
+ "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1 --remove field2",
609
+ "<%= config.bin %> <%= command.id %> --type my-type --id instance-1 --increment field3=2"
610
+ ],
611
+ "flags": {
612
+ "config-id": {
613
+ "char": "C",
614
+ "helpGroup": "GLOBAL",
615
+ "name": "config-id",
616
+ "summary": "Specify config id to use for call.",
617
+ "hasDynamicHelp": false,
618
+ "multiple": false,
619
+ "type": "option"
620
+ },
621
+ "add": {
622
+ "char": "a",
623
+ "description": "add field",
624
+ "name": "add",
625
+ "hasDynamicHelp": false,
626
+ "multiple": true,
627
+ "type": "option"
628
+ },
629
+ "id": {
630
+ "char": "I",
631
+ "description": "id",
632
+ "name": "id",
633
+ "hasDynamicHelp": false,
634
+ "multiple": false,
635
+ "type": "option"
636
+ },
637
+ "increment": {
638
+ "char": "i",
639
+ "description": "increment field",
640
+ "name": "increment",
641
+ "hasDynamicHelp": false,
642
+ "multiple": true,
643
+ "type": "option"
644
+ },
645
+ "remove": {
646
+ "char": "d",
647
+ "description": "remove field",
648
+ "name": "remove",
649
+ "hasDynamicHelp": false,
650
+ "multiple": true,
651
+ "type": "option"
652
+ },
653
+ "replace": {
654
+ "char": "r",
655
+ "description": "replace field",
656
+ "name": "replace",
657
+ "hasDynamicHelp": false,
658
+ "multiple": true,
659
+ "type": "option"
660
+ },
661
+ "set": {
662
+ "char": "s",
663
+ "description": "set field",
664
+ "name": "set",
665
+ "hasDynamicHelp": false,
666
+ "multiple": true,
667
+ "type": "option"
668
+ },
669
+ "type": {
670
+ "char": "T",
671
+ "description": "type",
672
+ "name": "type",
673
+ "hasDynamicHelp": false,
674
+ "multiple": false,
675
+ "type": "option"
676
+ }
677
+ },
678
+ "hasDynamicHelp": false,
679
+ "hiddenAliases": [],
680
+ "id": "records:patch",
681
+ "pluginAlias": "@contextual-io/cli",
682
+ "pluginName": "@contextual-io/cli",
683
+ "pluginType": "core",
684
+ "strict": true,
685
+ "enableJsonFlag": false,
686
+ "isESM": true,
687
+ "relativePath": [
688
+ "dist",
689
+ "commands",
690
+ "records",
691
+ "patch.js"
692
+ ]
693
+ },
594
694
  "records:query": {
595
695
  "aliases": [],
596
696
  "args": {
@@ -599,7 +699,7 @@
599
699
  "name": "uri"
600
700
  }
601
701
  },
602
- "description": "query records",
702
+ "description": "Query records.",
603
703
  "examples": [
604
704
  "<%= config.bin %> <%= command.id %> native-object:my-type",
605
705
  "<%= config.bin %> <%= command.id %> --type my-type --query-file query.json",
@@ -700,7 +800,7 @@
700
800
  "name": "uri"
701
801
  }
702
802
  },
703
- "description": "replace a record",
803
+ "description": "Replace a record.",
704
804
  "examples": [
705
805
  "<%= config.bin %> <%= command.id %> native-object:my-type/instance-1 --input-file record.json",
706
806
  "<%= config.bin %> <%= command.id %> native-object:my-type --id instance-1 --input-file record.json",
@@ -717,7 +817,7 @@
717
817
  "type": "option"
718
818
  },
719
819
  "id": {
720
- "char": "i",
820
+ "char": "I",
721
821
  "description": "id",
722
822
  "name": "id",
723
823
  "hasDynamicHelp": false,
@@ -757,7 +857,344 @@
757
857
  "records",
758
858
  "replace.js"
759
859
  ]
860
+ },
861
+ "types:add": {
862
+ "aliases": [
863
+ "types:create",
864
+ "types:import"
865
+ ],
866
+ "args": {},
867
+ "description": "Create type(s).",
868
+ "examples": [
869
+ "<%= config.bin %> <%= command.id %>",
870
+ "<%= config.bin %> <%= command.id %> --input-file types.json"
871
+ ],
872
+ "flags": {
873
+ "config-id": {
874
+ "char": "C",
875
+ "helpGroup": "GLOBAL",
876
+ "name": "config-id",
877
+ "summary": "Specify config id to use for call.",
878
+ "hasDynamicHelp": false,
879
+ "multiple": false,
880
+ "type": "option"
881
+ },
882
+ "input-file": {
883
+ "char": "i",
884
+ "description": "file to read. can read stdin if value is '-'",
885
+ "name": "input-file",
886
+ "default": "-",
887
+ "hasDynamicHelp": false,
888
+ "multiple": false,
889
+ "type": "option"
890
+ }
891
+ },
892
+ "hasDynamicHelp": false,
893
+ "hiddenAliases": [],
894
+ "id": "types:add",
895
+ "pluginAlias": "@contextual-io/cli",
896
+ "pluginName": "@contextual-io/cli",
897
+ "pluginType": "core",
898
+ "strict": true,
899
+ "enableJsonFlag": false,
900
+ "isESM": true,
901
+ "relativePath": [
902
+ "dist",
903
+ "commands",
904
+ "types",
905
+ "add.js"
906
+ ]
907
+ },
908
+ "types:delete": {
909
+ "aliases": [],
910
+ "args": {
911
+ "uri": {
912
+ "description": "uri of type",
913
+ "name": "uri"
914
+ }
915
+ },
916
+ "description": "Delete a type.",
917
+ "examples": [
918
+ "<%= config.bin %> <%= command.id %> native-object:my-type",
919
+ "<%= config.bin %> <%= command.id %> --type my-type"
920
+ ],
921
+ "flags": {
922
+ "config-id": {
923
+ "char": "C",
924
+ "helpGroup": "GLOBAL",
925
+ "name": "config-id",
926
+ "summary": "Specify config id to use for call.",
927
+ "hasDynamicHelp": false,
928
+ "multiple": false,
929
+ "type": "option"
930
+ },
931
+ "type": {
932
+ "char": "T",
933
+ "description": "type",
934
+ "name": "type",
935
+ "hasDynamicHelp": false,
936
+ "multiple": false,
937
+ "type": "option"
938
+ }
939
+ },
940
+ "hasDynamicHelp": false,
941
+ "hiddenAliases": [],
942
+ "id": "types:delete",
943
+ "pluginAlias": "@contextual-io/cli",
944
+ "pluginName": "@contextual-io/cli",
945
+ "pluginType": "core",
946
+ "strict": true,
947
+ "enableJsonFlag": false,
948
+ "isESM": true,
949
+ "relativePath": [
950
+ "dist",
951
+ "commands",
952
+ "types",
953
+ "delete.js"
954
+ ]
955
+ },
956
+ "types:get": {
957
+ "aliases": [],
958
+ "args": {
959
+ "uri": {
960
+ "description": "uri of type",
961
+ "name": "uri"
962
+ }
963
+ },
964
+ "description": "Get a type.",
965
+ "examples": [
966
+ "<%= config.bin %> <%= command.id %> native-object:my-type",
967
+ "<%= config.bin %> <%= command.id %> --type my-type"
968
+ ],
969
+ "flags": {
970
+ "config-id": {
971
+ "char": "C",
972
+ "helpGroup": "GLOBAL",
973
+ "name": "config-id",
974
+ "summary": "Specify config id to use for call.",
975
+ "hasDynamicHelp": false,
976
+ "multiple": false,
977
+ "type": "option"
978
+ },
979
+ "type": {
980
+ "char": "T",
981
+ "description": "type",
982
+ "name": "type",
983
+ "hasDynamicHelp": false,
984
+ "multiple": false,
985
+ "type": "option"
986
+ }
987
+ },
988
+ "hasDynamicHelp": false,
989
+ "hiddenAliases": [],
990
+ "id": "types:get",
991
+ "pluginAlias": "@contextual-io/cli",
992
+ "pluginName": "@contextual-io/cli",
993
+ "pluginType": "core",
994
+ "strict": true,
995
+ "enableJsonFlag": false,
996
+ "isESM": true,
997
+ "relativePath": [
998
+ "dist",
999
+ "commands",
1000
+ "types",
1001
+ "get.js"
1002
+ ]
1003
+ },
1004
+ "types": {
1005
+ "aliases": [],
1006
+ "args": {},
1007
+ "description": "Manage types.",
1008
+ "examples": [],
1009
+ "flags": {},
1010
+ "hasDynamicHelp": false,
1011
+ "hiddenAliases": [],
1012
+ "id": "types",
1013
+ "pluginAlias": "@contextual-io/cli",
1014
+ "pluginName": "@contextual-io/cli",
1015
+ "pluginType": "core",
1016
+ "strict": true,
1017
+ "usage": [
1018
+ "<%= command.id %> <COMMAND>"
1019
+ ],
1020
+ "enableJsonFlag": false,
1021
+ "isESM": true,
1022
+ "relativePath": [
1023
+ "dist",
1024
+ "commands",
1025
+ "types",
1026
+ "index.js"
1027
+ ]
1028
+ },
1029
+ "types:list": {
1030
+ "aliases": [
1031
+ "types:search"
1032
+ ],
1033
+ "args": {},
1034
+ "description": "List types.",
1035
+ "examples": [
1036
+ "<%= config.bin %> <%= command.id %>",
1037
+ "<%= config.bin %> <%= command.id %> --order-by field1:desc",
1038
+ "<%= config.bin %> <%= command.id %> -s field1=value1 -s field2=value2 --include-total"
1039
+ ],
1040
+ "flags": {
1041
+ "config-id": {
1042
+ "char": "C",
1043
+ "helpGroup": "GLOBAL",
1044
+ "name": "config-id",
1045
+ "summary": "Specify config id to use for call.",
1046
+ "hasDynamicHelp": false,
1047
+ "multiple": false,
1048
+ "type": "option"
1049
+ },
1050
+ "exact-search": {
1051
+ "char": "S",
1052
+ "description": "search fields exactly",
1053
+ "name": "exact-search",
1054
+ "hasDynamicHelp": false,
1055
+ "multiple": true,
1056
+ "type": "option"
1057
+ },
1058
+ "export": {
1059
+ "char": "e",
1060
+ "description": "export data as JSONL",
1061
+ "name": "export",
1062
+ "allowNo": false,
1063
+ "type": "boolean"
1064
+ },
1065
+ "from": {
1066
+ "char": "f",
1067
+ "description": "search from",
1068
+ "name": "from",
1069
+ "hasDynamicHelp": false,
1070
+ "multiple": true,
1071
+ "type": "option"
1072
+ },
1073
+ "include-total": {
1074
+ "description": "include total count",
1075
+ "name": "include-total",
1076
+ "allowNo": false,
1077
+ "type": "boolean"
1078
+ },
1079
+ "order-by": {
1080
+ "char": "o",
1081
+ "description": "order fields",
1082
+ "name": "order-by",
1083
+ "hasDynamicHelp": false,
1084
+ "multiple": true,
1085
+ "type": "option"
1086
+ },
1087
+ "page-size": {
1088
+ "description": "number of types per page",
1089
+ "name": "page-size",
1090
+ "hasDynamicHelp": false,
1091
+ "multiple": false,
1092
+ "type": "option"
1093
+ },
1094
+ "page-token": {
1095
+ "description": "page token to fetch",
1096
+ "name": "page-token",
1097
+ "hasDynamicHelp": false,
1098
+ "multiple": false,
1099
+ "type": "option"
1100
+ },
1101
+ "progress": {
1102
+ "char": "p",
1103
+ "description": "show progress during export",
1104
+ "name": "progress",
1105
+ "allowNo": false,
1106
+ "type": "boolean"
1107
+ },
1108
+ "search": {
1109
+ "char": "s",
1110
+ "description": "search fields",
1111
+ "name": "search",
1112
+ "hasDynamicHelp": false,
1113
+ "multiple": true,
1114
+ "type": "option"
1115
+ },
1116
+ "to": {
1117
+ "char": "t",
1118
+ "description": "search to",
1119
+ "name": "to",
1120
+ "hasDynamicHelp": false,
1121
+ "multiple": true,
1122
+ "type": "option"
1123
+ }
1124
+ },
1125
+ "hasDynamicHelp": false,
1126
+ "hiddenAliases": [],
1127
+ "id": "types:list",
1128
+ "pluginAlias": "@contextual-io/cli",
1129
+ "pluginName": "@contextual-io/cli",
1130
+ "pluginType": "core",
1131
+ "strict": true,
1132
+ "enableJsonFlag": false,
1133
+ "isESM": true,
1134
+ "relativePath": [
1135
+ "dist",
1136
+ "commands",
1137
+ "types",
1138
+ "list.js"
1139
+ ]
1140
+ },
1141
+ "types:replace": {
1142
+ "aliases": [],
1143
+ "args": {
1144
+ "uri": {
1145
+ "description": "uri of type",
1146
+ "name": "uri"
1147
+ }
1148
+ },
1149
+ "description": "Replace a type.",
1150
+ "examples": [
1151
+ "<%= config.bin %> <%= command.id %> native-object:my-type --input-file record.json",
1152
+ "<%= config.bin %> <%= command.id %> --type my-type --input-file record.json"
1153
+ ],
1154
+ "flags": {
1155
+ "config-id": {
1156
+ "char": "C",
1157
+ "helpGroup": "GLOBAL",
1158
+ "name": "config-id",
1159
+ "summary": "Specify config id to use for call.",
1160
+ "hasDynamicHelp": false,
1161
+ "multiple": false,
1162
+ "type": "option"
1163
+ },
1164
+ "input-file": {
1165
+ "char": "i",
1166
+ "description": "file to read. can read stdin if value is '-'",
1167
+ "name": "input-file",
1168
+ "default": "-",
1169
+ "hasDynamicHelp": false,
1170
+ "multiple": false,
1171
+ "type": "option"
1172
+ },
1173
+ "type": {
1174
+ "char": "T",
1175
+ "description": "type",
1176
+ "name": "type",
1177
+ "hasDynamicHelp": false,
1178
+ "multiple": false,
1179
+ "type": "option"
1180
+ }
1181
+ },
1182
+ "hasDynamicHelp": false,
1183
+ "hiddenAliases": [],
1184
+ "id": "types:replace",
1185
+ "pluginAlias": "@contextual-io/cli",
1186
+ "pluginName": "@contextual-io/cli",
1187
+ "pluginType": "core",
1188
+ "strict": true,
1189
+ "enableJsonFlag": false,
1190
+ "isESM": true,
1191
+ "relativePath": [
1192
+ "dist",
1193
+ "commands",
1194
+ "types",
1195
+ "replace.js"
1196
+ ]
760
1197
  }
761
1198
  },
762
- "version": "0.3.1"
1199
+ "version": "0.5.0"
763
1200
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@contextual-io/cli",
3
3
  "description": "Contextual CLI",
4
- "version": "0.3.1",
4
+ "version": "0.5.0",
5
5
  "author": "Nasser Oloumi",
6
6
  "bin": {
7
7
  "ctxl": "./bin/run.js"