@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.
- package/lib/auth.js +3 -3
- package/lib/commands/alerts/events/list.js +6 -7
- package/lib/commands/alerts/groups/delete.js +4 -5
- package/lib/commands/alerts/groups/list.js +2 -2
- package/lib/commands/alerts/monitors/clear.js +4 -5
- package/lib/commands/alerts/monitors/delete.js +4 -5
- package/lib/commands/alerts/monitors/list.js +2 -2
- package/lib/commands/alerts/triggers/list.js +2 -2
- package/lib/commands/alerts/webhooks/delete.js +4 -5
- package/lib/commands/alerts/webhooks/list.js +2 -2
- package/lib/commands/authorization-methods/list.js +2 -2
- package/lib/commands/components/actions/list.js +7 -7
- package/lib/commands/components/data-sources/list.js +7 -7
- package/lib/commands/components/delete.js +4 -5
- package/lib/commands/components/dev/run.js +1 -1
- package/lib/commands/components/dev/test.js +22 -21
- package/lib/commands/components/init/index.js +4 -5
- package/lib/commands/components/list.js +2 -2
- package/lib/commands/components/publish.js +9 -5
- package/lib/commands/components/triggers/list.js +7 -7
- package/lib/commands/customers/credentials/delete.js +4 -5
- package/lib/commands/customers/credentials/list.js +2 -2
- package/lib/commands/customers/credentials/update.js +4 -5
- package/lib/commands/customers/delete.js +4 -5
- package/lib/commands/customers/list.js +2 -2
- package/lib/commands/customers/update.js +4 -5
- package/lib/commands/customers/users/delete.js +4 -5
- package/lib/commands/customers/users/list.js +6 -7
- package/lib/commands/customers/users/roles.js +2 -2
- package/lib/commands/customers/users/update.js +4 -5
- package/lib/commands/instances/config-vars/list.js +5 -9
- package/lib/commands/instances/delete.js +4 -5
- package/lib/commands/instances/deploy.js +4 -5
- package/lib/commands/instances/disable.js +4 -5
- package/lib/commands/instances/enable.js +4 -5
- package/lib/commands/instances/flow-configs/list.js +5 -5
- package/lib/commands/instances/flow-configs/test.js +7 -8
- package/lib/commands/instances/list.js +2 -2
- package/lib/commands/instances/update.js +4 -5
- package/lib/commands/integrations/available.js +4 -5
- package/lib/commands/integrations/delete.js +4 -5
- package/lib/commands/integrations/export.js +4 -5
- package/lib/commands/integrations/flows/list.js +6 -7
- package/lib/commands/integrations/flows/test.js +6 -6
- package/lib/commands/integrations/fork.js +4 -5
- package/lib/commands/integrations/list.js +2 -2
- package/lib/commands/integrations/marketplace.js +4 -5
- package/lib/commands/integrations/publish.js +4 -5
- package/lib/commands/integrations/update.js +4 -5
- package/lib/commands/integrations/versions/index.js +6 -7
- package/lib/commands/login.js +1 -1
- package/lib/commands/logs/severities/list.js +2 -2
- package/lib/commands/organization/credentials/delete.js +4 -5
- package/lib/commands/organization/credentials/list.js +2 -2
- package/lib/commands/organization/credentials/update.js +4 -5
- package/lib/commands/organization/signingkeys/delete.js +4 -5
- package/lib/commands/organization/signingkeys/list.js +2 -2
- package/lib/commands/organization/users/delete.js +4 -5
- package/lib/commands/organization/users/list.js +2 -2
- package/lib/commands/organization/users/roles.js +2 -2
- package/lib/commands/organization/users/update.js +4 -5
- package/lib/utils/component/publish.js +18 -14
- package/lib/utils/execution/logs.js +1 -1
- package/lib/utils/user/query.js +2 -0
- package/oclif.manifest.json +4057 -1
- 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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 }], }, } =
|
|
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.
|
|
120
|
-
const continuePublish = await core_1.
|
|
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.
|
|
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.
|
|
64
|
+
core_1.ux.table(logs, {
|
|
65
65
|
timestamp: {
|
|
66
66
|
get: ({ timestamp }) => (0, date_1.formatTimestamp)(timestamp),
|
|
67
67
|
},
|
package/lib/utils/user/query.js
CHANGED