@contrail/cli 3.6.0-alpha.f45f126 → 3.7.0-alpha.fef3ff4

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 (95) hide show
  1. package/README.md +182 -1
  2. package/dist/api/types.d.ts +35 -0
  3. package/dist/api/types.js +49 -1
  4. package/dist/auth/login.d.ts +1 -1
  5. package/dist/auth/login.js +46 -29
  6. package/dist/auth/login.spec.js +31 -15
  7. package/dist/auth/sign-in-error.d.ts +7 -0
  8. package/dist/auth/sign-in-error.js +24 -0
  9. package/dist/auth/sign-in-error.spec.d.ts +1 -0
  10. package/dist/auth/sign-in-error.spec.js +22 -0
  11. package/dist/auth/sso.d.ts +5 -3
  12. package/dist/auth/sso.js +34 -18
  13. package/dist/auth/sso.spec.js +63 -10
  14. package/dist/basecommand.d.ts +3 -0
  15. package/dist/basecommand.js +10 -3
  16. package/dist/commands/app/getApiKey.js +2 -2
  17. package/dist/commands/entities/create.d.ts +49 -0
  18. package/dist/commands/entities/create.js +618 -0
  19. package/dist/commands/entities/create.spec.d.ts +1 -0
  20. package/dist/commands/entities/create.spec.js +581 -0
  21. package/dist/commands/entities/delete.d.ts +20 -0
  22. package/dist/commands/entities/delete.js +146 -0
  23. package/dist/commands/entities/get.d.ts +25 -0
  24. package/dist/commands/entities/get.js +298 -0
  25. package/dist/commands/entities/grammar.spec.d.ts +1 -0
  26. package/dist/commands/entities/grammar.spec.js +79 -0
  27. package/dist/commands/entities/output.spec.d.ts +1 -0
  28. package/dist/commands/entities/output.spec.js +72 -0
  29. package/dist/commands/entities/update.d.ts +32 -0
  30. package/dist/commands/entities/update.js +212 -0
  31. package/dist/commands/login.js +1 -1
  32. package/dist/commands/webhooks/delete.js +2 -3
  33. package/dist/common.d.ts +10 -1
  34. package/dist/common.js +37 -1
  35. package/dist/common.spec.d.ts +1 -0
  36. package/dist/common.spec.js +40 -0
  37. package/dist/helpers/config/config.d.ts +3 -3
  38. package/dist/helpers/config/config.js +3 -3
  39. package/dist/helpers/entities/assortment-items.d.ts +11 -0
  40. package/dist/helpers/entities/assortment-items.js +76 -0
  41. package/dist/helpers/entities/batchFetch.d.ts +11 -0
  42. package/dist/helpers/entities/batchFetch.js +50 -0
  43. package/dist/helpers/entities/index.d.ts +3 -0
  44. package/dist/helpers/entities/index.js +6 -0
  45. package/dist/helpers/entities/items.d.ts +6 -0
  46. package/dist/helpers/entities/items.js +60 -0
  47. package/dist/helpers/entities/items.spec.d.ts +1 -0
  48. package/dist/helpers/entities/items.spec.js +19 -0
  49. package/dist/helpers/entities/project-items.d.ts +2 -0
  50. package/dist/helpers/entities/project-items.js +44 -0
  51. package/dist/helpers/file-helpers.d.ts +1 -0
  52. package/dist/helpers/file-helpers.js +20 -3
  53. package/dist/helpers/propertySpecifications/dateRanges.d.ts +34 -0
  54. package/dist/helpers/propertySpecifications/dateRanges.js +91 -0
  55. package/dist/helpers/propertySpecifications/dateRanges.spec.d.ts +1 -0
  56. package/dist/helpers/propertySpecifications/dateRanges.spec.js +97 -0
  57. package/dist/helpers/propertySpecifications/propertySpecifications.d.ts +39 -0
  58. package/dist/helpers/propertySpecifications/propertySpecifications.js +102 -0
  59. package/dist/helpers/propertySpecifications/propertySpecifications.spec.d.ts +1 -0
  60. package/dist/helpers/propertySpecifications/propertySpecifications.spec.js +387 -0
  61. package/dist/helpers/propertySpecifications/propertyValues.d.ts +31 -0
  62. package/dist/helpers/propertySpecifications/propertyValues.js +132 -0
  63. package/dist/helpers/propertySpecifications/propertyValues.spec.d.ts +1 -0
  64. package/dist/helpers/propertySpecifications/propertyValues.spec.js +156 -0
  65. package/dist/logger.js +4 -1
  66. package/dist/logger.spec.d.ts +1 -0
  67. package/dist/logger.spec.js +12 -0
  68. package/node_modules/@contrail/entity-compare/package.json +6 -3
  69. package/node_modules/@contrail/loader/lib/common/conditional-columns.js +1 -1
  70. package/node_modules/@contrail/loader/lib/constants.d.ts +0 -8
  71. package/node_modules/@contrail/loader/lib/constants.js +1 -9
  72. package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.d.ts +0 -4
  73. package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.js +0 -57
  74. package/node_modules/@contrail/loader/lib/entities-v2/linesheet-v2/item-processor.spec.js +34 -492
  75. package/node_modules/@contrail/loader/lib/pipeline/validate.js +52 -2
  76. package/node_modules/@contrail/loader/lib/pipeline/validate.spec.js +85 -0
  77. package/node_modules/@contrail/loader/package.json +2 -2
  78. package/node_modules/@contrail/sdk/.github/workflows/publish-to-npm.yml +1 -4
  79. package/node_modules/@contrail/sdk/lib/auth/login.js +1 -1
  80. package/node_modules/@contrail/sdk/lib/config/config.d.ts +3 -0
  81. package/node_modules/@contrail/sdk/lib/config/config.js +13 -7
  82. package/node_modules/@contrail/sdk/lib/core/request.js +6 -2
  83. package/node_modules/@contrail/sdk/lib/entities/entities.client.d.ts +2 -0
  84. package/node_modules/@contrail/sdk/lib/entities/entities.client.js +3 -1
  85. package/node_modules/@contrail/sdk/lib/entities/entity.resource.registry.js +1 -0
  86. package/node_modules/@contrail/sdk/lib/image-search/image-search.d.ts +34 -0
  87. package/node_modules/@contrail/sdk/lib/image-search/image-search.js +42 -0
  88. package/node_modules/@contrail/sdk/lib/image-search/index.d.ts +1 -0
  89. package/node_modules/@contrail/sdk/lib/image-search/index.js +17 -0
  90. package/node_modules/@contrail/sdk/lib/index.d.ts +1 -0
  91. package/node_modules/@contrail/sdk/lib/index.js +1 -0
  92. package/node_modules/@contrail/sdk/package.json +1 -1
  93. package/node_modules/@contrail/sdk/scripts/replicate-bug.js +69 -0
  94. package/oclif.manifest.json +449 -1
  95. package/package.json +6 -12
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.6.0-alpha.f45f126",
2
+ "version": "3.7.0-alpha.fef3ff4",
3
3
  "commands": {
4
4
  "login": {
5
5
  "id": "login",
@@ -721,6 +721,454 @@
721
721
  }
722
722
  }
723
723
  },
724
+ "entities:create": {
725
+ "id": "entities:create",
726
+ "description": "Create entities",
727
+ "strict": false,
728
+ "pluginName": "@contrail/cli",
729
+ "pluginAlias": "@contrail/cli",
730
+ "pluginType": "core",
731
+ "aliases": [],
732
+ "examples": [
733
+ "contrail entities create color -g -n=10 # creates 10 random colors",
734
+ "contrail entities create color -- name=\"Electric Blue\" green=1 red=2 blue=3 # creates one color with specified properties only",
735
+ "contrail entities create custom-entity:franchise",
736
+ "contrail entities create project-item -n=10 -- projectId=abc # creates 10 project items within project ABC",
737
+ "contrail entities create color -g -r # creates a random color with a human readable ID",
738
+ "contrail entities create color -d -- name=test # simulates the creation of a color without actually creating it",
739
+ "contrail entities create custom-entity:franchise -S # creates an entity and the response does not contain hydrated relationships",
740
+ "contrail entities create color -g -- name=\"Electric Blue\" # creates a color with the name specified and other properties auto-generated",
741
+ "contrail entities create color -o /tmp/colors.json -- name=Blue green=1 red=2 blue=3 # creates a color and saves the output to /tmp/colors.json"
742
+ ],
743
+ "flags": {
744
+ "logLevel": {
745
+ "name": "logLevel",
746
+ "type": "option",
747
+ "char": "l",
748
+ "description": "The Log Level",
749
+ "required": false,
750
+ "multiple": false,
751
+ "options": [
752
+ "error",
753
+ "warn",
754
+ "info",
755
+ "debug"
756
+ ]
757
+ },
758
+ "alwaysConfirmEnv": {
759
+ "name": "alwaysConfirmEnv",
760
+ "type": "option",
761
+ "char": "e",
762
+ "description": "The Environment variables",
763
+ "required": false,
764
+ "multiple": false,
765
+ "options": [
766
+ "true",
767
+ "false"
768
+ ],
769
+ "default": "true"
770
+ },
771
+ "count": {
772
+ "name": "count",
773
+ "type": "option",
774
+ "char": "n",
775
+ "description": "Number of random entities to create",
776
+ "required": false,
777
+ "multiple": false
778
+ },
779
+ "dryRun": {
780
+ "name": "dryRun",
781
+ "type": "boolean",
782
+ "char": "d",
783
+ "description": "If true, does not create the entity but simulates the creation",
784
+ "required": false,
785
+ "allowNo": false
786
+ },
787
+ "inputFile": {
788
+ "name": "inputFile",
789
+ "type": "option",
790
+ "char": "i",
791
+ "description": "A file with a JSON array of objects where each object is one entity to create. Cannot be used with --count. Unless --generateValues is specified, only the properties in the file will be used.",
792
+ "required": false,
793
+ "multiple": false
794
+ },
795
+ "outputFile": {
796
+ "name": "outputFile",
797
+ "type": "option",
798
+ "char": "o",
799
+ "description": "File to save the output (optional)",
800
+ "required": false,
801
+ "multiple": false
802
+ },
803
+ "generateValues": {
804
+ "name": "generateValues",
805
+ "type": "boolean",
806
+ "char": "g",
807
+ "description": "If true, generates random values for properties that are not specified. By default, only specified properties are used.",
808
+ "required": false,
809
+ "allowNo": false
810
+ },
811
+ "readableIds": {
812
+ "name": "readableIds",
813
+ "type": "boolean",
814
+ "char": "r",
815
+ "description": "If true, uses readable IDs for the created entities",
816
+ "required": false,
817
+ "allowNo": false
818
+ },
819
+ "skipHydrateRelationships": {
820
+ "name": "skipHydrateRelationships",
821
+ "type": "boolean",
822
+ "char": "S",
823
+ "description": "If true, does not hydrate relationships for the created entities",
824
+ "required": false,
825
+ "allowNo": false
826
+ },
827
+ "suffix": {
828
+ "name": "suffix",
829
+ "type": "option",
830
+ "description": "Append a sub-route to the entity endpoint (e.g. --suffix=synchronous targets /<entities>/synchronous)",
831
+ "required": false,
832
+ "multiple": false
833
+ },
834
+ "apiVersion": {
835
+ "name": "apiVersion",
836
+ "type": "option",
837
+ "description": "Api-Version header to send; selects the V1 or V2 variant of the endpoint",
838
+ "required": false,
839
+ "multiple": false,
840
+ "options": [
841
+ "1",
842
+ "2"
843
+ ]
844
+ }
845
+ },
846
+ "args": {
847
+ "typePath": {
848
+ "name": "typePath",
849
+ "description": "The type path of the entity to create (e.g. color, custom-entity:franchise)",
850
+ "required": true
851
+ }
852
+ }
853
+ },
854
+ "entities:delete": {
855
+ "id": "entities:delete",
856
+ "description": "Delete entities by id",
857
+ "strict": false,
858
+ "pluginName": "@contrail/cli",
859
+ "pluginAlias": "@contrail/cli",
860
+ "pluginType": "core",
861
+ "aliases": [],
862
+ "examples": [
863
+ "contrail entities delete color 123",
864
+ "contrail entities delete color id1 id2 id3",
865
+ "contrail entities delete item -i ids.json"
866
+ ],
867
+ "flags": {
868
+ "logLevel": {
869
+ "name": "logLevel",
870
+ "type": "option",
871
+ "char": "l",
872
+ "description": "The Log Level",
873
+ "required": false,
874
+ "multiple": false,
875
+ "options": [
876
+ "error",
877
+ "warn",
878
+ "info",
879
+ "debug"
880
+ ]
881
+ },
882
+ "alwaysConfirmEnv": {
883
+ "name": "alwaysConfirmEnv",
884
+ "type": "option",
885
+ "char": "e",
886
+ "description": "The Environment variables",
887
+ "required": false,
888
+ "multiple": false,
889
+ "options": [
890
+ "true",
891
+ "false"
892
+ ],
893
+ "default": "true"
894
+ },
895
+ "dryRun": {
896
+ "name": "dryRun",
897
+ "type": "boolean",
898
+ "char": "d",
899
+ "description": "If true, does not delete the entities but simulates the deletion",
900
+ "required": false,
901
+ "allowNo": false
902
+ },
903
+ "inputFile": {
904
+ "name": "inputFile",
905
+ "type": "option",
906
+ "char": "i",
907
+ "description": "A file with a JSON array of objects; only each object's id is used. Deletes every entity in the file.",
908
+ "required": false,
909
+ "multiple": false
910
+ },
911
+ "suffix": {
912
+ "name": "suffix",
913
+ "type": "option",
914
+ "description": "Append a sub-route to the entity endpoint (e.g. --suffix=synchronous targets /<entities>/synchronous)",
915
+ "required": false,
916
+ "multiple": false
917
+ },
918
+ "apiVersion": {
919
+ "name": "apiVersion",
920
+ "type": "option",
921
+ "description": "Api-Version header to send; selects the V1 or V2 variant of the endpoint",
922
+ "required": false,
923
+ "multiple": false,
924
+ "options": [
925
+ "1",
926
+ "2"
927
+ ]
928
+ }
929
+ },
930
+ "args": {
931
+ "entityName": {
932
+ "name": "entityName",
933
+ "description": "The name of the entity type to delete (type paths are not supported)",
934
+ "required": true
935
+ },
936
+ "ids": {
937
+ "name": "ids",
938
+ "description": "One or more entity ids to delete",
939
+ "required": false
940
+ }
941
+ }
942
+ },
943
+ "entities:get": {
944
+ "id": "entities:get",
945
+ "description": "Get an entity",
946
+ "strict": false,
947
+ "pluginName": "@contrail/cli",
948
+ "pluginAlias": "@contrail/cli",
949
+ "pluginType": "core",
950
+ "aliases": [],
951
+ "examples": [
952
+ "contrail entities get color 123",
953
+ "contrail entities get color id1 id2 id3",
954
+ "contrail entities get color -- id=123",
955
+ "contrail entities get loader-process -- createdOn=2026-09-01..2026-09-11",
956
+ "contrail entities get loader-process -- createdOn=2026-09-05..",
957
+ "contrail entities get loader-process -- createdOn=..2026-09-05"
958
+ ],
959
+ "flags": {
960
+ "logLevel": {
961
+ "name": "logLevel",
962
+ "type": "option",
963
+ "char": "l",
964
+ "description": "The Log Level",
965
+ "required": false,
966
+ "multiple": false,
967
+ "options": [
968
+ "error",
969
+ "warn",
970
+ "info",
971
+ "debug"
972
+ ]
973
+ },
974
+ "alwaysConfirmEnv": {
975
+ "name": "alwaysConfirmEnv",
976
+ "type": "option",
977
+ "char": "e",
978
+ "description": "The Environment variables",
979
+ "required": false,
980
+ "multiple": false,
981
+ "options": [
982
+ "true",
983
+ "false"
984
+ ],
985
+ "default": "true"
986
+ },
987
+ "outputFile": {
988
+ "name": "outputFile",
989
+ "type": "option",
990
+ "char": "o",
991
+ "description": "File to save the output (optional)",
992
+ "required": false,
993
+ "multiple": false
994
+ },
995
+ "propertySlugs": {
996
+ "name": "propertySlugs",
997
+ "type": "option",
998
+ "char": "p",
999
+ "description": "Comma-separated list of property slugs to include in the output. Only some entity types support this; the rest return full records.",
1000
+ "required": false,
1001
+ "multiple": false
1002
+ },
1003
+ "paginated": {
1004
+ "name": "paginated",
1005
+ "type": "boolean",
1006
+ "char": "P",
1007
+ "description": "If true, fetches all entities in a paginated manner",
1008
+ "required": false,
1009
+ "allowNo": false
1010
+ },
1011
+ "skip": {
1012
+ "name": "skip",
1013
+ "type": "option",
1014
+ "char": "s",
1015
+ "description": "Number of entities to skip",
1016
+ "required": false,
1017
+ "multiple": false
1018
+ },
1019
+ "skipHydrateRelationships": {
1020
+ "name": "skipHydrateRelationships",
1021
+ "type": "boolean",
1022
+ "char": "S",
1023
+ "description": "Skip hydrating relationships when fetching the entity",
1024
+ "required": false,
1025
+ "allowNo": false
1026
+ },
1027
+ "take": {
1028
+ "name": "take",
1029
+ "type": "option",
1030
+ "char": "t",
1031
+ "description": "Number of entities to fetch in a single request (default is 100)",
1032
+ "required": false,
1033
+ "multiple": false
1034
+ },
1035
+ "relations": {
1036
+ "name": "relations",
1037
+ "type": "option",
1038
+ "char": "r",
1039
+ "description": "Comma-separated list of relations to include in the output",
1040
+ "required": false,
1041
+ "multiple": false
1042
+ },
1043
+ "suffix": {
1044
+ "name": "suffix",
1045
+ "type": "option",
1046
+ "description": "Append a sub-route to the entity endpoint (e.g. --suffix=synchronous targets /<entities>/synchronous)",
1047
+ "required": false,
1048
+ "multiple": false
1049
+ },
1050
+ "apiVersion": {
1051
+ "name": "apiVersion",
1052
+ "type": "option",
1053
+ "description": "Api-Version header to send; selects the V1 or V2 variant of the endpoint",
1054
+ "required": false,
1055
+ "multiple": false,
1056
+ "options": [
1057
+ "1",
1058
+ "2"
1059
+ ]
1060
+ }
1061
+ },
1062
+ "args": {
1063
+ "entityName": {
1064
+ "name": "entityName",
1065
+ "description": "The name of the entity type to fetch (type paths are not supported)",
1066
+ "required": true
1067
+ },
1068
+ "ids": {
1069
+ "name": "ids",
1070
+ "description": "One or more entity ids; shorthand for the id/ids criteria",
1071
+ "required": false
1072
+ }
1073
+ }
1074
+ },
1075
+ "entities:update": {
1076
+ "id": "entities:update",
1077
+ "description": "Update an entity",
1078
+ "strict": false,
1079
+ "pluginName": "@contrail/cli",
1080
+ "pluginAlias": "@contrail/cli",
1081
+ "pluginType": "core",
1082
+ "aliases": [],
1083
+ "examples": [
1084
+ "contrail entities update color 123 -- name=obsidian hex=000000",
1085
+ "contrail entities update item id1 id2 id3 -- colorName=obsidian # apply the same change to several entities",
1086
+ "contrail entities update color 123 -- federatedId= name='\"\"' # Unset federatedId, set name to empty string"
1087
+ ],
1088
+ "flags": {
1089
+ "logLevel": {
1090
+ "name": "logLevel",
1091
+ "type": "option",
1092
+ "char": "l",
1093
+ "description": "The Log Level",
1094
+ "required": false,
1095
+ "multiple": false,
1096
+ "options": [
1097
+ "error",
1098
+ "warn",
1099
+ "info",
1100
+ "debug"
1101
+ ]
1102
+ },
1103
+ "alwaysConfirmEnv": {
1104
+ "name": "alwaysConfirmEnv",
1105
+ "type": "option",
1106
+ "char": "e",
1107
+ "description": "The Environment variables",
1108
+ "required": false,
1109
+ "multiple": false,
1110
+ "options": [
1111
+ "true",
1112
+ "false"
1113
+ ],
1114
+ "default": "true"
1115
+ },
1116
+ "skipHydrateRelationships": {
1117
+ "name": "skipHydrateRelationships",
1118
+ "type": "boolean",
1119
+ "char": "S",
1120
+ "description": "Skip hydrating relationships when updating the entity",
1121
+ "required": false,
1122
+ "allowNo": false
1123
+ },
1124
+ "dryRun": {
1125
+ "name": "dryRun",
1126
+ "type": "boolean",
1127
+ "char": "d",
1128
+ "description": "If true, does not update the entities but simulates the update",
1129
+ "required": false,
1130
+ "allowNo": false
1131
+ },
1132
+ "inputFile": {
1133
+ "name": "inputFile",
1134
+ "type": "option",
1135
+ "char": "i",
1136
+ "description": "A file with a JSON array of {id, ...} objects; each object is one entity to update.",
1137
+ "required": false,
1138
+ "multiple": false
1139
+ },
1140
+ "suffix": {
1141
+ "name": "suffix",
1142
+ "type": "option",
1143
+ "description": "Append a sub-route to the entity endpoint (e.g. --suffix=synchronous targets /<entities>/synchronous)",
1144
+ "required": false,
1145
+ "multiple": false
1146
+ },
1147
+ "apiVersion": {
1148
+ "name": "apiVersion",
1149
+ "type": "option",
1150
+ "description": "Api-Version header to send; selects the V1 or V2 variant of the endpoint",
1151
+ "required": false,
1152
+ "multiple": false,
1153
+ "options": [
1154
+ "1",
1155
+ "2"
1156
+ ]
1157
+ }
1158
+ },
1159
+ "args": {
1160
+ "entityName": {
1161
+ "name": "entityName",
1162
+ "description": "The name of the entity type to update (type paths are not supported)",
1163
+ "required": true
1164
+ },
1165
+ "ids": {
1166
+ "name": "ids",
1167
+ "description": "One or more entity ids to update",
1168
+ "required": false
1169
+ }
1170
+ }
1171
+ },
724
1172
  "feature-flags:export": {
725
1173
  "id": "feature-flags:export",
726
1174
  "description": "Export the enabled feature flags for your Org",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.6.0-alpha.f45f126",
3
+ "version": "3.7.0-alpha.fef3ff4",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -21,7 +21,7 @@
21
21
  "/npm-shrinkwrap.json",
22
22
  "/oclif.manifest.json"
23
23
  ],
24
- "bundledDependencies": [
24
+ "bundleDependencies": [
25
25
  "@contrail/entity-types",
26
26
  "@contrail/loader",
27
27
  "@contrail/org-config-migration",
@@ -33,7 +33,7 @@
33
33
  "@contrail/entity-types": "^1.6.1",
34
34
  "@contrail/loader": "^2.0.9",
35
35
  "@contrail/org-config-migration": "^1.2.0",
36
- "@contrail/sdk": "^1.5.13",
36
+ "@contrail/sdk": "^1.6.0",
37
37
  "@contrail/types": "^3.1.5",
38
38
  "@contrail/util": "^1.2.0",
39
39
  "@oclif/core": "^2",
@@ -57,8 +57,10 @@
57
57
  "listr": "^0.14.3",
58
58
  "lodash": "^4.17.21",
59
59
  "ncp": "^2.0.0",
60
+ "p-limit": "^3.1.0",
60
61
  "pkg-install": "^1.0.0",
61
62
  "semver": "^7.5.4",
63
+ "unique-names-generator": "^4.7.1",
62
64
  "winston": "^3.10.0",
63
65
  "zip-a-folder": "^1.1.5"
64
66
  },
@@ -161,13 +163,5 @@
161
163
  },
162
164
  "coverageDirectory": "../coverage",
163
165
  "testEnvironment": "node"
164
- },
165
- "bundleDependencies": [
166
- "@contrail/entity-types",
167
- "@contrail/loader",
168
- "@contrail/org-config-migration",
169
- "@contrail/sdk",
170
- "@contrail/types",
171
- "@contrail/util"
172
- ]
166
+ }
173
167
  }