@prismatic-io/prism 4.6.9 → 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 +4 -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
package/lib/auth.js CHANGED
@@ -12,7 +12,7 @@ const url_1 = __importDefault(require("url"));
12
12
  const jwt_decode_1 = __importDefault(require("jwt-decode"));
13
13
  const config_1 = require("./config");
14
14
  const graphql_1 = require("./graphql");
15
- const core_1 = require("@oclif/core");
15
+ const open_1 = __importDefault(require("open"));
16
16
  const urlEncodeBase64 = (buffer) => {
17
17
  if (typeof buffer === "string") {
18
18
  buffer = Buffer.from(buffer);
@@ -134,7 +134,7 @@ class Authenticate {
134
134
  returnTo: this.options.successRedirectUri,
135
135
  };
136
136
  const queryString = (0, exports.createRequestParams)(params);
137
- await core_1.CliUx.ux.open(`https://${this.options.domain}/logout?${queryString}`);
137
+ await (0, open_1.default)(`https://${this.options.domain}/logout?${queryString}`);
138
138
  await (0, config_1.deleteConfig)();
139
139
  }
140
140
  async attemptServerCreate() {
@@ -190,7 +190,7 @@ class Authenticate {
190
190
  }
191
191
  async openChallengeBrowser(challenge, state, redirectUri) {
192
192
  const challengeUrl = await this.getChallengeUrl(challenge, state, redirectUri);
193
- await core_1.CliUx.ux.open(challengeUrl);
193
+ await (0, open_1.default)(challengeUrl);
194
194
  }
195
195
  async getChallengeUrl(challenge, state, redirectUri) {
196
196
  const { clientId, audience, scopes } = this.options;
@@ -27,7 +27,7 @@ class ListCommand extends core_1.Command {
27
27
  alertMonitorId,
28
28
  },
29
29
  });
30
- core_1.CliUx.ux.table(result.alertEvents.nodes, {
30
+ core_1.ux.table(result.alertEvents.nodes, {
31
31
  id: {
32
32
  minWidth: 8,
33
33
  extended: true,
@@ -45,13 +45,12 @@ class ListCommand extends core_1.Command {
45
45
  }
46
46
  exports.default = ListCommand;
47
47
  ListCommand.description = "List Alert Events for an Alert Monitor";
48
- ListCommand.args = [
49
- {
50
- name: "alertMonitorId",
48
+ ListCommand.args = {
49
+ alertMonitorId: core_1.Args.string({
51
50
  description: "ID of an alert monitor",
52
51
  required: true,
53
- },
54
- ];
52
+ }),
53
+ };
55
54
  ListCommand.flags = {
56
- ...core_1.CliUx.ux.table.flags(),
55
+ ...core_1.ux.table.flags(),
57
56
  };
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete an Alert Group";
30
- DeleteCommand.args = [
31
- {
32
- name: "group",
30
+ DeleteCommand.args = {
31
+ group: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the group to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -30,7 +30,7 @@ class ListCommand extends core_1.Command {
30
30
  cursor = pageInfo.endCursor;
31
31
  hasNextPage = pageInfo.hasNextPage;
32
32
  }
33
- core_1.CliUx.ux.table(alertGroups, {
33
+ core_1.ux.table(alertGroups, {
34
34
  id: {
35
35
  minWidth: 8,
36
36
  extended: true,
@@ -41,4 +41,4 @@ class ListCommand extends core_1.Command {
41
41
  }
42
42
  exports.default = ListCommand;
43
43
  ListCommand.description = "List Alert Groups in your Organization";
44
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
44
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -27,10 +27,9 @@ class ClearCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = ClearCommand;
29
29
  ClearCommand.description = "Clear an Alert Monitor";
30
- ClearCommand.args = [
31
- {
32
- name: "monitor",
30
+ ClearCommand.args = {
31
+ monitor: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the monitor to clear",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete an Alert Monitor";
30
- DeleteCommand.args = [
31
- {
32
- name: "monitor",
30
+ DeleteCommand.args = {
31
+ monitor: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the monitor to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -39,7 +39,7 @@ class ListCommand extends core_1.Command {
39
39
  cursor = pageInfo.endCursor;
40
40
  hasNextPage = pageInfo.hasNextPage;
41
41
  }
42
- core_1.CliUx.ux.table(alertMonitors, {
42
+ core_1.ux.table(alertMonitors, {
43
43
  id: {
44
44
  minWidth: 8,
45
45
  extended: true,
@@ -60,4 +60,4 @@ class ListCommand extends core_1.Command {
60
60
  }
61
61
  exports.default = ListCommand;
62
62
  ListCommand.description = "List Alert Monitors for Customer Instances";
63
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
63
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -17,7 +17,7 @@ class ListCommand extends core_1.Command {
17
17
  }
18
18
  `,
19
19
  });
20
- core_1.CliUx.ux.table(result.alertTriggers.nodes, {
20
+ core_1.ux.table(result.alertTriggers.nodes, {
21
21
  id: {
22
22
  minWidth: 8,
23
23
  extended: true,
@@ -28,4 +28,4 @@ class ListCommand extends core_1.Command {
28
28
  }
29
29
  exports.default = ListCommand;
30
30
  ListCommand.description = "List Alert Triggers";
31
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
31
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete an Alert Webhook";
30
- DeleteCommand.args = [
31
- {
32
- name: "webhook",
30
+ DeleteCommand.args = {
31
+ webhook: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the webhook to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -33,7 +33,7 @@ class ListCommand extends core_1.Command {
33
33
  cursor = pageInfo.endCursor;
34
34
  hasNextPage = pageInfo.hasNextPage;
35
35
  }
36
- core_1.CliUx.ux.table(alertWebhooks, {
36
+ core_1.ux.table(alertWebhooks, {
37
37
  id: {
38
38
  minWidth: 8,
39
39
  extended: true,
@@ -54,4 +54,4 @@ class ListCommand extends core_1.Command {
54
54
  }
55
55
  exports.default = ListCommand;
56
56
  ListCommand.description = "List Alert Webhooks";
57
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
57
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -24,7 +24,7 @@ class ListCommand extends core_1.Command {
24
24
  `,
25
25
  });
26
26
  const authMethods = result.authorizationMethods.nodes;
27
- core_1.CliUx.ux.table(authMethods, {
27
+ core_1.ux.table(authMethods, {
28
28
  id: {
29
29
  minWidth: 8,
30
30
  extended: true,
@@ -39,4 +39,4 @@ class ListCommand extends core_1.Command {
39
39
  }
40
40
  exports.default = ListCommand;
41
41
  ListCommand.description = "List Authorization Methods that Components can use";
42
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
42
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -4,7 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const graphql_1 = require("../../../graphql");
5
5
  class ListCommand extends core_1.Command {
6
6
  async run() {
7
- const { flags, args: { "Component Key": componentKey }, } = await this.parse(ListCommand);
7
+ const { flags, args: { componentKey }, } = await this.parse(ListCommand);
8
8
  let actions = [];
9
9
  let componentId;
10
10
  let hasNextPage = true;
@@ -52,7 +52,7 @@ class ListCommand extends core_1.Command {
52
52
  cursor = component.actions.pageInfo.endCursor;
53
53
  hasNextPage = component.actions.pageInfo.hasNextPage;
54
54
  }
55
- core_1.CliUx.ux.table(actions, {
55
+ core_1.ux.table(actions, {
56
56
  id: {
57
57
  minWidth: 8,
58
58
  extended: true,
@@ -77,7 +77,7 @@ class ListCommand extends core_1.Command {
77
77
  exports.default = ListCommand;
78
78
  ListCommand.description = "List Actions that Components implement";
79
79
  ListCommand.flags = {
80
- ...core_1.CliUx.ux.table.flags(),
80
+ ...core_1.ux.table.flags(),
81
81
  public: core_1.Flags.boolean({
82
82
  required: false,
83
83
  description: "Show actions for the public component with the given key. Use this flag when you have a private component with the same key as a public component.",
@@ -87,10 +87,10 @@ ListCommand.flags = {
87
87
  description: "Show actions for the private component with the given key. Use this flag when you have a private component with the same key as a public component.",
88
88
  }),
89
89
  };
90
- ListCommand.args = [
91
- {
90
+ ListCommand.args = {
91
+ componentKey: core_1.Args.string({
92
92
  name: "Component Key",
93
93
  required: true,
94
94
  description: "The key of the component to show actions for (e.g. 'salesforce')",
95
- },
96
- ];
95
+ }),
96
+ };
@@ -4,7 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const graphql_1 = require("../../../graphql");
5
5
  class ListCommand extends core_1.Command {
6
6
  async run() {
7
- const { flags, args: { "Component Key": componentKey }, } = await this.parse(ListCommand);
7
+ const { flags, args: { componentKey }, } = await this.parse(ListCommand);
8
8
  let dataSources = [];
9
9
  let componentId;
10
10
  let hasNextPage = true;
@@ -65,7 +65,7 @@ class ListCommand extends core_1.Command {
65
65
  cursor = component.actions.pageInfo.endCursor;
66
66
  hasNextPage = component.actions.pageInfo.hasNextPage;
67
67
  }
68
- core_1.CliUx.ux.table(dataSources, {
68
+ core_1.ux.table(dataSources, {
69
69
  id: {
70
70
  minWidth: 8,
71
71
  extended: true,
@@ -95,7 +95,7 @@ class ListCommand extends core_1.Command {
95
95
  exports.default = ListCommand;
96
96
  ListCommand.description = "List Data Sources that Components implement";
97
97
  ListCommand.flags = {
98
- ...core_1.CliUx.ux.table.flags(),
98
+ ...core_1.ux.table.flags(),
99
99
  public: core_1.Flags.boolean({
100
100
  required: false,
101
101
  description: "Show data sources for the public component with the given key. Use this flag when you have a private component with the same key as a public component.",
@@ -105,10 +105,10 @@ ListCommand.flags = {
105
105
  description: "Show data sources for the private component with the given key. Use this flag when you have a private component with the same key as a public component.",
106
106
  }),
107
107
  };
108
- ListCommand.args = [
109
- {
108
+ ListCommand.args = {
109
+ componentKey: core_1.Args.string({
110
110
  name: "Component Key",
111
111
  required: true,
112
112
  description: "The key of the component to show data sources for (e.g. 'salesforce')",
113
- },
114
- ];
113
+ }),
114
+ };
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete a Component";
30
- DeleteCommand.args = [
31
- {
32
- name: "component",
30
+ DeleteCommand.args = {
31
+ component: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the component to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -38,7 +38,7 @@ class RunCommand extends core_1.Command {
38
38
  const nodes = result.integration.testConfigVariables.nodes;
39
39
  const [connection] = nodes.filter(({ requiredConfigVariable: { key } }) => key === connectionKey);
40
40
  if (!connection) {
41
- core_1.CliUx.ux.error("Failed to find active connection.", { exit: 1 });
41
+ core_1.ux.error("Failed to find active connection.", { exit: 1 });
42
42
  }
43
43
  const { meta, inputs } = connection;
44
44
  const fields = inputs.nodes.reduce((result, { name, value }) => ({ ...result, [name]: value }), {});
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const util_1 = require("util");
7
7
  const dotenv_1 = __importDefault(require("dotenv"));
8
8
  const core_1 = require("@oclif/core");
9
+ const open_1 = __importDefault(require("open"));
9
10
  const inquirer_1 = __importDefault(require("inquirer"));
10
11
  const lodash_1 = require("lodash");
11
12
  const publish_1 = require("../../../utils/component/publish");
@@ -99,15 +100,15 @@ class TestCommand extends core_1.Command {
99
100
  if (await (0, fs_1.exists)(envPath)) {
100
101
  const { error } = dotenv_1.default.config({ path: envPath, override: true });
101
102
  if (error) {
102
- core_1.CliUx.ux.error(`Failed to load specified dotenv file: ${error}`, {
103
+ core_1.ux.error(`Failed to load specified dotenv file: ${error}`, {
103
104
  exit: 1,
104
105
  });
105
106
  }
106
107
  }
107
- core_1.CliUx.ux.action.start("Validating Component");
108
+ core_1.ux.action.start("Validating Component");
108
109
  const { name } = await (0, query_2.whoAmI)();
109
110
  if (!name) {
110
- core_1.CliUx.ux.error("Failed to determine the name of the currently logged in user.", {
111
+ core_1.ux.error("Failed to determine the name of the currently logged in user.", {
111
112
  exit: 1,
112
113
  });
113
114
  }
@@ -119,15 +120,15 @@ class TestCommand extends core_1.Command {
119
120
  await (0, publish_1.validateDefinition)(definition);
120
121
  const packagePath = await (0, publish_1.createComponentPackage)();
121
122
  const signatureMatches = await (0, publish_1.checkPackageSignature)(definition, packagePath);
122
- core_1.CliUx.ux.action.stop();
123
+ core_1.ux.action.stop();
123
124
  if (!signatureMatches) {
124
- core_1.CliUx.ux.action.start("Publishing Component");
125
+ core_1.ux.action.start("Publishing Component");
125
126
  const { iconUploadUrl, packageUploadUrl, connectionIconUploadUrls } = await (0, publish_1.publishDefinition)(definition);
126
127
  const { display: { iconPath }, } = definition;
127
128
  await (0, publish_1.uploadFile)(iconPath, iconUploadUrl);
128
129
  await (0, publish_1.uploadConnectionIcons)(definition, connectionIconUploadUrls);
129
130
  await (0, publish_1.uploadFile)(packagePath, packageUploadUrl);
130
- core_1.CliUx.ux.action.stop();
131
+ core_1.ux.action.stop();
131
132
  }
132
133
  const publishedTimestamp = Date.now();
133
134
  const actions = definition.actions || {};
@@ -177,7 +178,7 @@ class TestCommand extends core_1.Command {
177
178
  Object.assign(answers, { connection, connectionInputs });
178
179
  }
179
180
  const { actionInfo, connectionInfo } = valuesFromAnswers(answers);
180
- core_1.CliUx.ux.action.start("Assembling test integration");
181
+ core_1.ux.action.start("Assembling test integration");
181
182
  // FIXME: Wait for version to be available but due to issues we have to do a static wait.
182
183
  const wait = 5000 - (Date.now() - publishedTimestamp);
183
184
  if (wait > 0) {
@@ -192,24 +193,24 @@ class TestCommand extends core_1.Command {
192
193
  actionInfo,
193
194
  connectionInfo,
194
195
  });
195
- core_1.CliUx.ux.action.stop();
196
- core_1.CliUx.ux.action.start("Updating test Integration");
196
+ core_1.ux.action.stop();
197
+ core_1.ux.action.start("Updating test Integration");
197
198
  const { integrationId, flows: [{ id: flowId }], pendingAuthorizations, } = await (0, import_1.importDefinition)(harnessYaml);
198
- core_1.CliUx.ux.action.stop();
199
+ core_1.ux.action.stop();
199
200
  // Prompt for user authorization of pending connections
200
201
  if (pendingAuthorizations.length > 0) {
201
202
  const [{ id, url }] = pendingAuthorizations;
202
203
  if (!url) {
203
204
  throw new Error("Did not receive a valid URL for authorization. Verify your Connection inputs.");
204
205
  }
205
- core_1.CliUx.ux.url("Authorize URL", url);
206
- await core_1.CliUx.ux.anykey("Press any key to open your browser and authorize the Connection");
207
- await core_1.CliUx.ux.open(url);
208
- core_1.CliUx.ux.action.start("Waiting for Connection authorization");
206
+ core_1.ux.url("Authorize URL", url);
207
+ await core_1.ux.anykey("Press any key to open your browser and authorize the Connection");
208
+ await (0, open_1.default)(url);
209
+ core_1.ux.action.start("Waiting for Connection authorization");
209
210
  await (0, query_1.pollForActiveConfigVarState)(integrationId, id);
210
- core_1.CliUx.ux.action.stop();
211
+ core_1.ux.action.stop();
211
212
  }
212
- core_1.CliUx.ux.action.start("Running test Integration");
213
+ core_1.ux.action.start("Running test Integration");
213
214
  const { executionId } = await (0, invoke_1.runIntegrationFlow)({ integrationId, flowId });
214
215
  await (0, logs_1.displayLogs)(executionId);
215
216
  if (outputFile) {
@@ -221,14 +222,14 @@ class TestCommand extends core_1.Command {
221
222
  await (0, stepResults_1.printFinalStepResults)(executionId);
222
223
  }
223
224
  if (cleanUp) {
224
- core_1.CliUx.ux.action.start(`Cleaning up test Integration (${integrationId})`);
225
+ core_1.ux.action.start(`Cleaning up test Integration (${integrationId})`);
225
226
  await (0, invoke_1.deleteIntegration)(integrationId);
226
- core_1.CliUx.ux.action.stop();
227
- core_1.CliUx.ux.action.start(`Cleaning up test component (${definition.key})`);
227
+ core_1.ux.action.stop();
228
+ core_1.ux.action.start(`Cleaning up test component (${definition.key})`);
228
229
  await (0, deleteByKey_1.deleteComponentByKey)(definition.key);
229
- core_1.CliUx.ux.action.stop();
230
+ core_1.ux.action.stop();
230
231
  }
231
- core_1.CliUx.ux.action.stop();
232
+ core_1.ux.action.stop();
232
233
  }
233
234
  }
234
235
  exports.default = TestCommand;
@@ -137,10 +137,9 @@ InitializeComponent.flags = {
137
137
  description: "Output more verbose logging from Component generation",
138
138
  }),
139
139
  };
140
- InitializeComponent.args = [
141
- {
142
- name: "name",
140
+ InitializeComponent.args = {
141
+ name: core_1.Args.string({
143
142
  required: true,
144
143
  description: "Name of the new component to create (alphanumeric characters, hyphens, and underscores)",
145
- },
146
- ];
144
+ }),
145
+ };
@@ -44,7 +44,7 @@ class ListCommand extends core_1.Command {
44
44
  cursor = pageInfo.endCursor;
45
45
  hasNextPage = pageInfo.hasNextPage;
46
46
  }
47
- core_1.CliUx.ux.table(components, {
47
+ core_1.ux.table(components, {
48
48
  id: {
49
49
  minWidth: 8,
50
50
  extended: true,
@@ -69,7 +69,7 @@ class ListCommand extends core_1.Command {
69
69
  exports.default = ListCommand;
70
70
  ListCommand.description = "List available Components";
71
71
  ListCommand.flags = {
72
- ...core_1.CliUx.ux.table.flags(),
72
+ ...core_1.ux.table.flags(),
73
73
  showAllVersions: core_1.Flags.boolean({
74
74
  char: "a",
75
75
  required: false,
@@ -2,20 +2,24 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const publish_1 = require("../../utils/component/publish");
5
+ const query_1 = require("../../utils/user/query");
5
6
  class PublishCommand extends core_1.Command {
6
7
  async run() {
7
- const { flags: { comment, confirm, "check-signature": checkSignature, "skip-on-signature-match": skipOnSignatureMatch, customer, }, } = await this.parse(PublishCommand);
8
+ var _a;
9
+ const { flags: { comment, confirm, "check-signature": checkSignature, "skip-on-signature-match": skipOnSignatureMatch, customer: flagCustomer, }, } = await this.parse(PublishCommand);
10
+ const me = await (0, query_1.whoAmI)();
11
+ const customer = flagCustomer !== null && flagCustomer !== void 0 ? flagCustomer : (_a = me.customer) === null || _a === void 0 ? void 0 : _a.id;
8
12
  const definition = await (0, publish_1.loadEntrypoint)();
9
13
  await (0, publish_1.validateDefinition)(definition);
10
14
  const packagePath = await (0, publish_1.createComponentPackage)();
11
15
  if (checkSignature) {
12
- const signatureMatches = await (0, publish_1.checkPackageSignature)(definition, packagePath);
16
+ const signatureMatches = await (0, publish_1.checkPackageSignature)(definition, packagePath, customer);
13
17
  if (signatureMatches) {
14
18
  if (skipOnSignatureMatch ||
15
- !(await core_1.CliUx.ux.confirm("The new package signature matches the existing package signature. Continue publishing new package? (y/N)"))) {
19
+ !(await core_1.ux.confirm("The new package signature matches the existing package signature. Continue publishing new package? (y/N)"))) {
16
20
  // Signatures match and we've opted to skip on match, so bail.
17
- core_1.CliUx.ux.log("Package signatures match, skipping publish.");
18
- core_1.CliUx.ux.exit(0);
21
+ core_1.ux.log("Package signatures match, skipping publish.");
22
+ core_1.ux.exit(0);
19
23
  }
20
24
  }
21
25
  }
@@ -4,7 +4,7 @@ const core_1 = require("@oclif/core");
4
4
  const graphql_1 = require("../../../graphql");
5
5
  class ListCommand extends core_1.Command {
6
6
  async run() {
7
- const { flags, args: { "Component Key": componentKey }, } = await this.parse(ListCommand);
7
+ const { flags, args: { componentKey }, } = await this.parse(ListCommand);
8
8
  let triggers = [];
9
9
  let componentId;
10
10
  let hasNextPage = true;
@@ -52,7 +52,7 @@ class ListCommand extends core_1.Command {
52
52
  cursor = component.actions.pageInfo.endCursor;
53
53
  hasNextPage = component.actions.pageInfo.hasNextPage;
54
54
  }
55
- core_1.CliUx.ux.table(triggers, {
55
+ core_1.ux.table(triggers, {
56
56
  id: {
57
57
  minWidth: 8,
58
58
  extended: true,
@@ -77,7 +77,7 @@ class ListCommand extends core_1.Command {
77
77
  exports.default = ListCommand;
78
78
  ListCommand.description = "List Triggers that Components implement";
79
79
  ListCommand.flags = {
80
- ...core_1.CliUx.ux.table.flags(),
80
+ ...core_1.ux.table.flags(),
81
81
  public: core_1.Flags.boolean({
82
82
  required: false,
83
83
  description: "Show actions for the public component with the given key. Use this flag when you have a private component with the same key as a public component.",
@@ -87,10 +87,10 @@ ListCommand.flags = {
87
87
  description: "Show actions for the private component with the given key. Use this flag when you have a private component with the same key as a public component.",
88
88
  }),
89
89
  };
90
- ListCommand.args = [
91
- {
90
+ ListCommand.args = {
91
+ componentKey: core_1.Args.string({
92
92
  name: "Component Key",
93
93
  required: true,
94
94
  description: "The key of the component to show triggers for (e.g. 'salesforce')",
95
- },
96
- ];
95
+ }),
96
+ };
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete a Customer Credential";
30
- DeleteCommand.args = [
31
- {
32
- name: "credential",
30
+ DeleteCommand.args = {
31
+ credential: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the credential to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -28,7 +28,7 @@ class ListCommand extends core_1.Command {
28
28
  id: customer,
29
29
  },
30
30
  });
31
- core_1.CliUx.ux.table(result.customer.credentials.nodes, {
31
+ core_1.ux.table(result.customer.credentials.nodes, {
32
32
  id: {
33
33
  minWidth: 8,
34
34
  extended: true,
@@ -52,5 +52,5 @@ ListCommand.flags = {
52
52
  required: true,
53
53
  description: "ID of a customer",
54
54
  }),
55
- ...core_1.CliUx.ux.table.flags(),
55
+ ...core_1.ux.table.flags(),
56
56
  };
@@ -38,13 +38,12 @@ class UpdateCommand extends core_1.Command {
38
38
  }
39
39
  exports.default = UpdateCommand;
40
40
  UpdateCommand.description = "Update a Customer-specific Credential for use by Instance Actions";
41
- UpdateCommand.args = [
42
- {
43
- name: "credential",
41
+ UpdateCommand.args = {
42
+ credential: core_1.Args.string({
44
43
  required: true,
45
44
  description: "ID of a credential",
46
- },
47
- ];
45
+ }),
46
+ };
48
47
  UpdateCommand.flags = {
49
48
  label: core_1.Flags.string({
50
49
  char: "l",
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete a Customer";
30
- DeleteCommand.args = [
31
- {
32
- name: "customer",
30
+ DeleteCommand.args = {
31
+ customer: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the customer to delete",
35
- },
36
- ];
34
+ }),
35
+ };
@@ -32,7 +32,7 @@ class ListCommand extends core_1.Command {
32
32
  cursor = pageInfo.endCursor;
33
33
  hasNextPage = pageInfo.hasNextPage;
34
34
  }
35
- core_1.CliUx.ux.table(customers, {
35
+ core_1.ux.table(customers, {
36
36
  id: {
37
37
  minWidth: 8,
38
38
  extended: true,
@@ -48,4 +48,4 @@ class ListCommand extends core_1.Command {
48
48
  }
49
49
  exports.default = ListCommand;
50
50
  ListCommand.description = "List your Customers";
51
- ListCommand.flags = { ...core_1.CliUx.ux.table.flags() };
51
+ ListCommand.flags = { ...core_1.ux.table.flags() };
@@ -47,13 +47,12 @@ class UpdateCommand extends core_1.Command {
47
47
  exports.default = UpdateCommand;
48
48
  // TODO: Add more flags once optional updates are implemented
49
49
  UpdateCommand.description = "Update a Customer";
50
- UpdateCommand.args = [
51
- {
52
- name: "customer",
50
+ UpdateCommand.args = {
51
+ customer: core_1.Args.string({
53
52
  required: true,
54
53
  description: "ID of a customer",
55
- },
56
- ];
54
+ }),
55
+ };
57
56
  UpdateCommand.flags = {
58
57
  name: core_1.Flags.string({
59
58
  char: "n",
@@ -27,10 +27,9 @@ class DeleteCommand extends core_1.Command {
27
27
  }
28
28
  exports.default = DeleteCommand;
29
29
  DeleteCommand.description = "Delete a Customer User";
30
- DeleteCommand.args = [
31
- {
32
- name: "user",
30
+ DeleteCommand.args = {
31
+ user: core_1.Args.string({
33
32
  required: true,
34
33
  description: "ID of the user to delete",
35
- },
36
- ];
34
+ }),
35
+ };