@erdoai/cli 0.85.0 → 0.85.1
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/dist/index.js +10 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1225,10 +1225,11 @@ var ErdoClient = class {
|
|
|
1225
1225
|
`/v1/integrations/${encodeURIComponent(integrationId)}`
|
|
1226
1226
|
);
|
|
1227
1227
|
}
|
|
1228
|
-
getConnectionScope(integrationId) {
|
|
1228
|
+
getConnectionScope(integrationId, params = {}) {
|
|
1229
|
+
const query = params.include_options === void 0 ? "" : `?include_options=${params.include_options}`;
|
|
1229
1230
|
return this.request(
|
|
1230
1231
|
"GET",
|
|
1231
|
-
`/v1/integrations/${encodeURIComponent(integrationId)}/connection-scope`
|
|
1232
|
+
`/v1/integrations/${encodeURIComponent(integrationId)}/connection-scope${query}`
|
|
1232
1233
|
);
|
|
1233
1234
|
}
|
|
1234
1235
|
setConnectionScope(integrationId, accountId) {
|
|
@@ -6147,20 +6148,24 @@ integrationsCmd.command("status <app>").description("Check whether an app is con
|
|
|
6147
6148
|
}
|
|
6148
6149
|
});
|
|
6149
6150
|
var accountCmd = integrationsCmd.command("account").description("Read or set which provider account a connection operates");
|
|
6150
|
-
accountCmd.command("show <integration-id>").description("Show which account a connection operates, and which it could (see: erdo integrations list)").action(async (integrationId) => {
|
|
6151
|
+
accountCmd.command("show <integration-id>").description("Show which account a connection operates, and which it could (see: erdo integrations list)").option("--no-options", "Read the stored account without contacting the provider").action(async (integrationId, opts) => {
|
|
6151
6152
|
try {
|
|
6152
|
-
const scope = await new ErdoClient().getConnectionScope(integrationId);
|
|
6153
|
+
const scope = await new ErdoClient().getConnectionScope(integrationId, { include_options: opts.options });
|
|
6153
6154
|
if (!scope.has_connection_scope) {
|
|
6154
6155
|
console.log("This integration does not choose a provider account per connection.");
|
|
6155
6156
|
return;
|
|
6156
6157
|
}
|
|
6157
6158
|
console.log(scope.description);
|
|
6158
6159
|
const selected = new Set(scope.selected.map((a) => a.id));
|
|
6159
|
-
for (const account of scope.options) {
|
|
6160
|
+
for (const account of opts.options ? scope.options : scope.selected) {
|
|
6160
6161
|
const marker = selected.has(account.id) ? "*" : " ";
|
|
6161
6162
|
const owner = account.parent ? ` ${account.parent}` : "";
|
|
6162
6163
|
console.log(`${marker} ${account.id} ${account.name} ${account.type}${owner}`);
|
|
6163
6164
|
}
|
|
6165
|
+
if (!opts.options) {
|
|
6166
|
+
if (scope.selected.length === 0) console.error("No account recorded on this connection.");
|
|
6167
|
+
return;
|
|
6168
|
+
}
|
|
6164
6169
|
if (scope.options.length === 0) {
|
|
6165
6170
|
console.error(
|
|
6166
6171
|
`
|