@contrail/cli 3.3.0-alpha → 3.3.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 (43) hide show
  1. package/README.md +1 -142
  2. package/dist/api/types.d.ts +0 -35
  3. package/dist/api/types.js +1 -47
  4. package/dist/basecommand.d.ts +1 -3
  5. package/dist/basecommand.js +1 -1
  6. package/dist/commands/app/create.js +15 -0
  7. package/dist/commands/app/init.js +14 -0
  8. package/dist/commands/app/upgrade.js +6 -6
  9. package/dist/common.d.ts +1 -1
  10. package/dist/helpers/app/app-deployer.js +16 -20
  11. package/dist/helpers/app/setup-template.d.ts +2 -0
  12. package/dist/helpers/app/setup-template.js +2 -1
  13. package/dist/helpers/file-helpers.d.ts +0 -1
  14. package/dist/helpers/file-helpers.js +1 -19
  15. package/dist/interfaces.d.ts +2 -9
  16. package/dist/interfaces.js +1 -8
  17. package/dist/templates/typescript/app.yml +1 -0
  18. package/oclif.manifest.json +1 -341
  19. package/package.json +4 -5
  20. package/dist/commands/entities/create.d.ts +0 -37
  21. package/dist/commands/entities/create.js +0 -532
  22. package/dist/commands/entities/create.spec.d.ts +0 -1
  23. package/dist/commands/entities/create.spec.js +0 -514
  24. package/dist/commands/entities/delete.d.ts +0 -16
  25. package/dist/commands/entities/delete.js +0 -103
  26. package/dist/commands/entities/get.d.ts +0 -19
  27. package/dist/commands/entities/get.js +0 -151
  28. package/dist/commands/entities/update.d.ts +0 -17
  29. package/dist/commands/entities/update.js +0 -86
  30. package/dist/helpers/entities/assortment-items.d.ts +0 -10
  31. package/dist/helpers/entities/assortment-items.js +0 -86
  32. package/dist/helpers/entities/batchFetch.d.ts +0 -8
  33. package/dist/helpers/entities/batchFetch.js +0 -41
  34. package/dist/helpers/entities/index.d.ts +0 -3
  35. package/dist/helpers/entities/index.js +0 -6
  36. package/dist/helpers/entities/items.d.ts +0 -10
  37. package/dist/helpers/entities/items.js +0 -84
  38. package/dist/helpers/entities/project-items.d.ts +0 -3
  39. package/dist/helpers/entities/project-items.js +0 -65
  40. package/dist/helpers/propertySpecifications/propertySpecifications.d.ts +0 -26
  41. package/dist/helpers/propertySpecifications/propertySpecifications.js +0 -58
  42. package/dist/helpers/propertySpecifications/propertySpecifications.spec.d.ts +0 -1
  43. package/dist/helpers/propertySpecifications/propertySpecifications.spec.js +0 -266
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.3.0-alpha",
2
+ "version": "3.3.0",
3
3
  "commands": {
4
4
  "app:create": {
5
5
  "id": "app:create",
@@ -672,346 +672,6 @@
672
672
  }
673
673
  }
674
674
  },
675
- "entities:create": {
676
- "id": "entities:create",
677
- "description": "(BETA) Create entities",
678
- "strict": false,
679
- "pluginName": "@contrail/cli",
680
- "pluginAlias": "@contrail/cli",
681
- "pluginType": "core",
682
- "aliases": [],
683
- "examples": [
684
- "contrail entities create color -n=10 # creates 10 random colors",
685
- "contrail entities create color # creates one item",
686
- "contrail entities create custom-entities:franchise",
687
- "contrail entities create project-item -n=1 -- projectId=abc # creates 10 project items within project ABC",
688
- "contrail entities create color -r # creates a random color with a human readable ID",
689
- "contrail entities create color -d # simulates the creation of a random color without actually creating it",
690
- "contrail entities create custom-entity:franchise -s # creates a random color and the response does not contain hydrating relationships",
691
- "contrail entities create color -p -- name=Electric Blue green=1 red=2 blue=3 # creates a color with specified properties",
692
- "contrail entities create color -o /tmp/colors.json # creates a random color and saves the output to /tmp/colors.json"
693
- ],
694
- "flags": {
695
- "logLevel": {
696
- "name": "logLevel",
697
- "type": "option",
698
- "char": "l",
699
- "description": "The Log Level",
700
- "required": false,
701
- "multiple": false,
702
- "options": [
703
- "error",
704
- "warn",
705
- "info",
706
- "debug"
707
- ]
708
- },
709
- "alwaysConfirmEnv": {
710
- "name": "alwaysConfirmEnv",
711
- "type": "option",
712
- "char": "e",
713
- "description": "The Environment variables",
714
- "required": false,
715
- "multiple": false,
716
- "options": [
717
- "true",
718
- "false"
719
- ],
720
- "default": "true"
721
- },
722
- "count": {
723
- "name": "count",
724
- "type": "option",
725
- "char": "n",
726
- "description": "Number of random entities to create",
727
- "required": false,
728
- "multiple": false
729
- },
730
- "dryRun": {
731
- "name": "dryRun",
732
- "type": "boolean",
733
- "char": "d",
734
- "description": "If true, does not create the entity but simulates the creation",
735
- "required": false,
736
- "allowNo": false
737
- },
738
- "input": {
739
- "name": "input",
740
- "type": "option",
741
- "char": "i",
742
- "description": "A JSON array of objects where each object is one entity to create. Cannot be used with --count. Unless --precise is specified, any missing values will be populated with random values.",
743
- "required": false,
744
- "multiple": false
745
- },
746
- "outputFile": {
747
- "name": "outputFile",
748
- "type": "option",
749
- "char": "o",
750
- "description": "File to save the output (optional)",
751
- "required": false,
752
- "multiple": false
753
- },
754
- "preciseProperties": {
755
- "name": "preciseProperties",
756
- "type": "boolean",
757
- "char": "p",
758
- "description": "If true, does not generate random values for properties. All values must be specified.",
759
- "required": false,
760
- "allowNo": false
761
- },
762
- "readableIds": {
763
- "name": "readableIds",
764
- "type": "boolean",
765
- "char": "r",
766
- "description": "If true, uses readable IDs for the created entities",
767
- "required": false,
768
- "allowNo": false
769
- },
770
- "skipHydrateRelationships": {
771
- "name": "skipHydrateRelationships",
772
- "type": "boolean",
773
- "char": "s",
774
- "description": "If true, does not hydrate relationships for the created entities",
775
- "required": false,
776
- "allowNo": false
777
- }
778
- },
779
- "args": {
780
- "path": {
781
- "name": "path",
782
- "description": "Path of the entity type to create",
783
- "required": true
784
- }
785
- }
786
- },
787
- "entities:delete": {
788
- "id": "entities:delete",
789
- "description": "(BETA) Delete an entity",
790
- "strict": true,
791
- "pluginName": "@contrail/cli",
792
- "pluginAlias": "@contrail/cli",
793
- "pluginType": "core",
794
- "aliases": [],
795
- "examples": [
796
- "contrail entities delete color 123"
797
- ],
798
- "flags": {
799
- "logLevel": {
800
- "name": "logLevel",
801
- "type": "option",
802
- "char": "l",
803
- "description": "The Log Level",
804
- "required": false,
805
- "multiple": false,
806
- "options": [
807
- "error",
808
- "warn",
809
- "info",
810
- "debug"
811
- ]
812
- },
813
- "alwaysConfirmEnv": {
814
- "name": "alwaysConfirmEnv",
815
- "type": "option",
816
- "char": "e",
817
- "description": "The Environment variables",
818
- "required": false,
819
- "multiple": false,
820
- "options": [
821
- "true",
822
- "false"
823
- ],
824
- "default": "true"
825
- },
826
- "dryRun": {
827
- "name": "dryRun",
828
- "type": "boolean",
829
- "char": "d",
830
- "description": "If true, does not delete the entity but simulates the deletion",
831
- "required": false,
832
- "allowNo": false
833
- },
834
- "input": {
835
- "name": "input",
836
- "type": "option",
837
- "char": "i",
838
- "description": "A JSON array of objects where each object is one entity to create. Cannot be used with --count. Unless --precise is specified, any missing values will be populated with random values.",
839
- "required": false,
840
- "multiple": false
841
- },
842
- "id": {
843
- "name": "id",
844
- "type": "option",
845
- "description": "The unique identifier of the entity",
846
- "required": false,
847
- "multiple": false
848
- }
849
- },
850
- "args": {
851
- "entityName": {
852
- "name": "entityName",
853
- "description": "The name of the entity type to delete",
854
- "required": true
855
- }
856
- }
857
- },
858
- "entities:get": {
859
- "id": "entities:get",
860
- "description": "(BETA) Get an entity",
861
- "strict": false,
862
- "pluginName": "@contrail/cli",
863
- "pluginAlias": "@contrail/cli",
864
- "pluginType": "core",
865
- "aliases": [],
866
- "examples": [
867
- "contrail entities get color -- id=123"
868
- ],
869
- "flags": {
870
- "logLevel": {
871
- "name": "logLevel",
872
- "type": "option",
873
- "char": "l",
874
- "description": "The Log Level",
875
- "required": false,
876
- "multiple": false,
877
- "options": [
878
- "error",
879
- "warn",
880
- "info",
881
- "debug"
882
- ]
883
- },
884
- "alwaysConfirmEnv": {
885
- "name": "alwaysConfirmEnv",
886
- "type": "option",
887
- "char": "e",
888
- "description": "The Environment variables",
889
- "required": false,
890
- "multiple": false,
891
- "options": [
892
- "true",
893
- "false"
894
- ],
895
- "default": "true"
896
- },
897
- "outputFile": {
898
- "name": "outputFile",
899
- "type": "option",
900
- "char": "o",
901
- "description": "File to save the output (optional)",
902
- "required": false,
903
- "multiple": false
904
- },
905
- "skipHydrateRelationships": {
906
- "name": "skipHydrateRelationships",
907
- "type": "boolean",
908
- "char": "s",
909
- "description": "Skip hydrating relationships when fetching the entity",
910
- "required": false,
911
- "allowNo": false
912
- },
913
- "relations": {
914
- "name": "relations",
915
- "type": "option",
916
- "char": "r",
917
- "description": "Comma-separated list of relations to include in the output",
918
- "required": false,
919
- "multiple": false
920
- },
921
- "propertySlugs": {
922
- "name": "propertySlugs",
923
- "type": "option",
924
- "char": "p",
925
- "description": "Comma-separated list of property slugs to include in the output",
926
- "required": false,
927
- "multiple": false
928
- },
929
- "paginated": {
930
- "name": "paginated",
931
- "type": "boolean",
932
- "char": "P",
933
- "description": "If true, fetches all entities in a paginated manner",
934
- "required": false,
935
- "allowNo": false
936
- }
937
- },
938
- "args": {
939
- "typePath": {
940
- "name": "typePath",
941
- "description": "The name of the entity type to fetch",
942
- "required": true
943
- }
944
- }
945
- },
946
- "entities:update": {
947
- "id": "entities:update",
948
- "description": "(BETA) Update an entity",
949
- "strict": false,
950
- "pluginName": "@contrail/cli",
951
- "pluginAlias": "@contrail/cli",
952
- "pluginType": "core",
953
- "aliases": [],
954
- "examples": [
955
- "contrail entities update color 123 -- name=obsidian hex=000000"
956
- ],
957
- "flags": {
958
- "logLevel": {
959
- "name": "logLevel",
960
- "type": "option",
961
- "char": "l",
962
- "description": "The Log Level",
963
- "required": false,
964
- "multiple": false,
965
- "options": [
966
- "error",
967
- "warn",
968
- "info",
969
- "debug"
970
- ]
971
- },
972
- "alwaysConfirmEnv": {
973
- "name": "alwaysConfirmEnv",
974
- "type": "option",
975
- "char": "e",
976
- "description": "The Environment variables",
977
- "required": false,
978
- "multiple": false,
979
- "options": [
980
- "true",
981
- "false"
982
- ],
983
- "default": "true"
984
- },
985
- "skipHydrateRelationships": {
986
- "name": "skipHydrateRelationships",
987
- "type": "boolean",
988
- "char": "s",
989
- "description": "Skip hydrating relationships when updating the entity",
990
- "required": false,
991
- "allowNo": false
992
- },
993
- "dryRun": {
994
- "name": "dryRun",
995
- "type": "boolean",
996
- "char": "d",
997
- "description": "If true, does not create the entity but simulates the creation",
998
- "required": false,
999
- "allowNo": false
1000
- }
1001
- },
1002
- "args": {
1003
- "entityName": {
1004
- "name": "entityName",
1005
- "description": "The name of the entity type to update",
1006
- "required": true
1007
- },
1008
- "id": {
1009
- "name": "id",
1010
- "description": "The unique identifier of the entity",
1011
- "required": true
1012
- }
1013
- }
1014
- },
1015
675
  "file:upload": {
1016
676
  "id": "file:upload",
1017
677
  "description": "Uploads a file to the VibeIQ platform",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/cli",
3
- "version": "3.3.0-alpha",
3
+ "version": "3.3.0",
4
4
  "description": "VibeIQ's Contrail Platform CLI.",
5
5
  "bin": {
6
6
  "contrail-cli": "./bin/run",
@@ -22,11 +22,11 @@
22
22
  "/oclif.manifest.json"
23
23
  ],
24
24
  "dependencies": {
25
- "@contrail/entity-types": "^1.1.65-alpha-create-entities-2",
25
+ "@contrail/entity-types": "^1.3.0",
26
26
  "@contrail/org-config-migration": "^1.1.4",
27
- "@contrail/sdk": "^1.5.0",
27
+ "@contrail/sdk": "^1.4.6",
28
28
  "@contrail/types": "^3.0.48",
29
- "@contrail/util": "^1.1.15",
29
+ "@contrail/util": "^1.1.10",
30
30
  "@oclif/core": "^2",
31
31
  "@oclif/plugin-autocomplete": "^2.1.4",
32
32
  "@oclif/plugin-help": "^5",
@@ -49,7 +49,6 @@
49
49
  "ncp": "^2.0.0",
50
50
  "pkg-install": "^1.0.0",
51
51
  "semver": "^7.5.4",
52
- "unique-names-generator": "^4.7.1",
53
52
  "winston": "^3.10.0",
54
53
  "zip-a-folder": "^1.1.5"
55
54
  },
@@ -1,37 +0,0 @@
1
- import { PropertyLevel } from '@contrail/types';
2
- import { ColonDelimited, TypeProperty as ExtendedTypeProperty, TypeReferencesCacheByPath } from '../../api/types';
3
- import { TypeWithProperties } from '../../api/types';
4
- import { BaseCommand } from '../../basecommand';
5
- import { Role } from '../../helpers/entities';
6
- export default class CreateEntity extends BaseCommand {
7
- static description: string;
8
- static examples: string[];
9
- static flags: {
10
- count: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- dryRun: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
- input: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
- outputFile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
- preciseProperties: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
- readableIds: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
- skipHydrateRelationships: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
- alwaysConfirmEnv: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
- logLevel: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
19
- };
20
- static args: {
21
- path: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
22
- };
23
- static strict: boolean;
24
- run(): Promise<void>;
25
- }
26
- export type WithId = {
27
- id: string;
28
- [key: string]: any;
29
- };
30
- export type ObjectReferenceCache = Map<string, WithId>;
31
- type ObjectReferenceCachesByTypePath = Map<string, ObjectReferenceCache>;
32
- export declare function pickRandomValueForProperty(property: ExtendedTypeProperty, objectReferencesCache: ObjectReferenceCachesByTypePath, typeReferencesCache: TypeReferencesCacheByPath): number | string | string[] | boolean | null;
33
- export declare function getReferencedObjectPaths(type: TypeWithProperties): ColonDelimited[];
34
- export declare function buildObjectReferenceCache(entities: any[]): ObjectReferenceCache;
35
- export declare function selectRandomObject(cache: ObjectReferenceCache): WithId;
36
- export declare function doesPropertyLevelMatchRole(propertyLevel: PropertyLevel, role: Role): boolean;
37
- export {};