Skip to content

Commit f917d69

Browse files
committed
fix
1 parent cdfeea0 commit f917d69

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

lib/platformApi/PlatformApiLogicClient.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,19 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
9292
async fetchAllSecretsForWorkspace(options: any = {}) {
9393
const { workspaceId } = options;
9494
const secrets = await this.makeRequest({ method: 'GET', url: `/workspaces/${workspaceId}/secrets` });
95-
const resp: any = {};
95+
const resp: any = [];
9696

9797
for (const secret of secrets.data) {
98-
resp.secretId = secret.id;
99-
resp.secretName = secret.attributes.name.trim();
100-
if (secret.relationships.component) resp.componentIds = [secret.relationships.component.data.id];
98+
const secretId = secret.id;
99+
const secretName = secret.attributes.name.trim();
100+
let componentIds: any = [];
101+
if (secret.relationships.component) componentIds.push(secret.relationships.component.data.id)
101102
if (secret.relationships.auth_client) {
102103
const clientId = secret.relationships.auth_client.data.id;
103104
const clientResponse = await this.makeRequest({ method: 'GET', url: `/auth-clients/${clientId}` });
104-
resp.componentIds = clientResponse.relationships.components.data.map(x => x.id);
105+
componentIds = clientResponse.relationships.components.data.map(x => x.id);
105106
}
107+
resp.push({ secretId, secretName, componentIds })
106108
}
107109
return resp;
108110
}
@@ -174,10 +176,10 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
174176
const workspaces = await this.fetchWorkspaceList({});
175177
if (!workspaceId) {
176178
const nonFlatFlows = await mapLimit(workspaces, realSplitFactor,
177-
async workspace => this.fetchAllFlowsForWorkspace({
178-
parallelCalls: parallelizationPerTask,
179-
workspaceId: workspace.workspaceId,
180-
}));
179+
async workspace => this.fetchAllFlowsForWorkspace({
180+
parallelCalls: parallelizationPerTask,
181+
workspaceId: workspace.workspaceId,
182+
}));
181183
flows = nonFlatFlows.flat();
182184
} else {
183185
flows = await this.fetchAllFlowsForWorkspace({
@@ -271,7 +273,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
271273
/* eslint-disable-next-line no-param-reassign */
272274
soFar[contract.id] = contract;
273275
return soFar;
274-
}, {});
276+
}, {});
275277

276278
const nonFlatWorkspaces = await mapLimit(
277279
contracts,
@@ -548,7 +550,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
548550
/* eslint-disable-next-line no-param-reassign */
549551
soFar[sample.sampleId] = sample.sample;
550552
return soFar;
551-
}, {});
553+
}, {});
552554
flow.attributes.graph.nodes
553555
.filter(node => node.selected_data_samples)
554556
.forEach((node) => {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elastic.io/component-commons-library",
3-
"version": "1.2.0-dev.2",
3+
"version": "1.2.0-dev.3",
44
"description": "Library for most common component development cases",
55
"author": {
66
"name": "elastic.io GmbH",

0 commit comments

Comments
 (0)