@prismatic-io/prism 4.6.8 → 4.7.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 (66) hide show
  1. package/lib/auth.js +3 -3
  2. package/lib/commands/alerts/events/list.js +6 -7
  3. package/lib/commands/alerts/groups/delete.js +4 -5
  4. package/lib/commands/alerts/groups/list.js +2 -2
  5. package/lib/commands/alerts/monitors/clear.js +4 -5
  6. package/lib/commands/alerts/monitors/delete.js +4 -5
  7. package/lib/commands/alerts/monitors/list.js +2 -2
  8. package/lib/commands/alerts/triggers/list.js +2 -2
  9. package/lib/commands/alerts/webhooks/delete.js +4 -5
  10. package/lib/commands/alerts/webhooks/list.js +2 -2
  11. package/lib/commands/authorization-methods/list.js +2 -2
  12. package/lib/commands/components/actions/list.js +7 -7
  13. package/lib/commands/components/data-sources/list.js +7 -7
  14. package/lib/commands/components/delete.js +4 -5
  15. package/lib/commands/components/dev/run.js +1 -1
  16. package/lib/commands/components/dev/test.js +22 -21
  17. package/lib/commands/components/init/index.js +4 -5
  18. package/lib/commands/components/list.js +2 -2
  19. package/lib/commands/components/publish.js +9 -5
  20. package/lib/commands/components/triggers/list.js +7 -7
  21. package/lib/commands/customers/credentials/delete.js +4 -5
  22. package/lib/commands/customers/credentials/list.js +2 -2
  23. package/lib/commands/customers/credentials/update.js +4 -5
  24. package/lib/commands/customers/delete.js +4 -5
  25. package/lib/commands/customers/list.js +2 -2
  26. package/lib/commands/customers/update.js +4 -5
  27. package/lib/commands/customers/users/delete.js +4 -5
  28. package/lib/commands/customers/users/list.js +6 -7
  29. package/lib/commands/customers/users/roles.js +2 -2
  30. package/lib/commands/customers/users/update.js +4 -5
  31. package/lib/commands/instances/config-vars/list.js +5 -9
  32. package/lib/commands/instances/delete.js +4 -5
  33. package/lib/commands/instances/deploy.js +4 -5
  34. package/lib/commands/instances/disable.js +4 -5
  35. package/lib/commands/instances/enable.js +4 -5
  36. package/lib/commands/instances/flow-configs/list.js +5 -5
  37. package/lib/commands/instances/flow-configs/test.js +7 -8
  38. package/lib/commands/instances/list.js +2 -2
  39. package/lib/commands/instances/update.js +4 -5
  40. package/lib/commands/integrations/available.js +5 -5
  41. package/lib/commands/integrations/delete.js +4 -5
  42. package/lib/commands/integrations/export.js +4 -5
  43. package/lib/commands/integrations/flows/list.js +6 -7
  44. package/lib/commands/integrations/flows/test.js +6 -6
  45. package/lib/commands/integrations/fork.js +4 -5
  46. package/lib/commands/integrations/list.js +2 -2
  47. package/lib/commands/integrations/marketplace.js +4 -5
  48. package/lib/commands/integrations/publish.js +4 -5
  49. package/lib/commands/integrations/update.js +4 -5
  50. package/lib/commands/integrations/versions/index.js +6 -7
  51. package/lib/commands/login.js +1 -1
  52. package/lib/commands/logs/severities/list.js +2 -2
  53. package/lib/commands/organization/credentials/delete.js +4 -5
  54. package/lib/commands/organization/credentials/list.js +2 -2
  55. package/lib/commands/organization/credentials/update.js +4 -5
  56. package/lib/commands/organization/signingkeys/delete.js +4 -5
  57. package/lib/commands/organization/signingkeys/list.js +2 -2
  58. package/lib/commands/organization/users/delete.js +4 -5
  59. package/lib/commands/organization/users/list.js +2 -2
  60. package/lib/commands/organization/users/roles.js +2 -2
  61. package/lib/commands/organization/users/update.js +4 -5
  62. package/lib/utils/component/publish.js +18 -14
  63. package/lib/utils/execution/logs.js +1 -1
  64. package/lib/utils/user/query.js +2 -0
  65. package/oclif.manifest.json +4057 -1
  66. package/package.json +8 -7
@@ -46,13 +46,12 @@ class UpdateCommand extends core_1.Command {
46
46
  }
47
47
  exports.default = UpdateCommand;
48
48
  UpdateCommand.description = "Update a User";
49
- UpdateCommand.args = [
50
- {
51
- name: "user",
49
+ UpdateCommand.args = {
50
+ user: core_1.Args.string({
52
51
  required: true,
53
52
  description: "ID of a user",
54
- },
55
- ];
53
+ }),
54
+ };
56
55
  UpdateCommand.flags = {
57
56
  name: core_1.Flags.string({ char: "n", description: "name of the user" }),
58
57
  phone: core_1.Flags.string({ char: "p", description: "phone number of the user" }),
@@ -29,11 +29,11 @@ const seekComponentPackageDistDirectory = async () => {
29
29
  const tempDir = process.cwd();
30
30
  process.chdir("../");
31
31
  if (process.cwd() == tempDir) {
32
- core_1.CliUx.ux.error("Failed to find 'package.json' file. Is the current path a component?", { exit: 1 });
32
+ core_1.ux.error("Failed to find 'package.json' file. Is the current path a component?", { exit: 1 });
33
33
  }
34
34
  }
35
35
  if (!(await (0, fs_1.exists)("./dist"))) {
36
- core_1.CliUx.ux.error("Failed to find 'dist' folder. Is the current path a component?", {
36
+ core_1.ux.error("Failed to find 'dist' folder. Is the current path a component?", {
37
37
  exit: 1,
38
38
  });
39
39
  }
@@ -47,7 +47,7 @@ const loadEntrypoint = async () => {
47
47
  }
48
48
  // If we still didn't find index.js error out
49
49
  if (!(await (0, fs_1.exists)("index.js"))) {
50
- core_1.CliUx.ux.error("Failed to find 'index.js' entrypoint file. Is the current path a component?", { exit: 1 });
50
+ core_1.ux.error("Failed to find 'index.js' entrypoint file. Is the current path a component?", { exit: 1 });
51
51
  }
52
52
  // Require index.js and access its root-most default export which should be the Component config
53
53
  const cwd = process.cwd();
@@ -63,17 +63,19 @@ const validateDefinition = async (definition) => {
63
63
  // Output basic information to the user to confirm that this component is what they want to publish
64
64
  const { display: { label, description, iconPath }, connections, } = definition;
65
65
  if (!label || !description) {
66
- core_1.CliUx.ux.error("Missing required values `label` or `description`. Exiting.", { exit: 1 });
66
+ core_1.ux.error("Missing required values `label` or `description`. Exiting.", {
67
+ exit: 1,
68
+ });
67
69
  }
68
70
  const componentIconValid = await validateIcon(iconPath);
69
71
  if (!componentIconValid) {
70
- core_1.CliUx.ux.error(`Component icon does not exist or is not a png. Exiting.`, {
72
+ core_1.ux.error(`Component icon does not exist or is not a png. Exiting.`, {
71
73
  exit: 1,
72
74
  });
73
75
  }
74
76
  const connectionIconsValid = await Promise.all((connections !== null && connections !== void 0 ? connections : []).map(({ iconPath }) => validateIcon(iconPath)));
75
77
  if (connectionIconsValid.some((v) => !v)) {
76
- core_1.CliUx.ux.error(`One or more connection icons do not exist or are not a png. Exiting.`, {
78
+ core_1.ux.error(`One or more connection icons do not exist or are not a png. Exiting.`, {
77
79
  exit: 1,
78
80
  });
79
81
  }
@@ -88,12 +90,12 @@ const createComponentPackage = async () => {
88
90
  return pathPromise;
89
91
  };
90
92
  exports.createComponentPackage = createComponentPackage;
91
- const checkPackageSignature = async ({ key }, packagePath) => {
93
+ const checkPackageSignature = async ({ key, public: isPublic }, packagePath, customer) => {
92
94
  // Retrieve the existing signature of the component if it exists.
93
- const result = await (0, graphql_1.gqlRequest)({
95
+ const results = await (0, graphql_1.gqlRequest)({
94
96
  document: (0, graphql_1.gql) `
95
- query component($key: String!) {
96
- components(key: $key) {
97
+ query component($key: String!, $public: Boolean!, $customer: ID) {
98
+ components(key: $key, public: $public, customer: $customer) {
97
99
  nodes {
98
100
  signature
99
101
  }
@@ -102,9 +104,11 @@ const checkPackageSignature = async ({ key }, packagePath) => {
102
104
  `,
103
105
  variables: {
104
106
  key,
107
+ public: isPublic !== null && isPublic !== void 0 ? isPublic : false,
108
+ customer,
105
109
  },
106
110
  });
107
- const { components: { nodes: [{ signature: existingSignature } = { signature: null }], }, } = result;
111
+ const { components: { nodes: [{ signature: existingSignature } = { signature: null }], }, } = results;
108
112
  // Generate the signature of the package so we may compare it against the existing one.
109
113
  const packageSignature = crypto_1.default
110
114
  .createHash("sha1")
@@ -116,10 +120,10 @@ exports.checkPackageSignature = checkPackageSignature;
116
120
  const confirmPublish = async ({ display: { label, description } }, confirm = true) => {
117
121
  if (!confirm)
118
122
  return;
119
- core_1.CliUx.ux.log(label, "-", description);
120
- const continuePublish = await core_1.CliUx.ux.confirm(`Would you like to publish ${label}? (y/N)`);
123
+ core_1.ux.log(label, "-", description);
124
+ const continuePublish = await core_1.ux.confirm(`Would you like to publish ${label}? (y/N)`);
121
125
  if (!continuePublish)
122
- core_1.CliUx.ux.exit(0);
126
+ core_1.ux.exit(0);
123
127
  };
124
128
  exports.confirmPublish = confirmPublish;
125
129
  const publishDefinition = async ({ actions, triggers, dataSources, connections, ...rest }, comment, customer) => {
@@ -61,7 +61,7 @@ const displayLogs = async (executionId) => {
61
61
  variables: { executionId },
62
62
  });
63
63
  const logs = result.executionResult.logs.nodes;
64
- core_1.CliUx.ux.table(logs, {
64
+ core_1.ux.table(logs, {
65
65
  timestamp: {
66
66
  get: ({ timestamp }) => (0, date_1.formatTimestamp)(timestamp),
67
67
  },
@@ -13,12 +13,14 @@ const whoAmI = async () => {
13
13
  name
14
14
  }
15
15
  customer {
16
+ id
16
17
  name
17
18
  }
18
19
  }
19
20
  }
20
21
  `,
21
22
  });
23
+ authenticatedUser.userType = authenticatedUser.org ? "org" : "customer";
22
24
  return authenticatedUser;
23
25
  };
24
26
  exports.whoAmI = whoAmI;