Skip to content

Commit 9bb514b

Browse files
committed
fix
1 parent a9a07d8 commit 9bb514b

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

lib/platformApi/PlatformApiLogicClient.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,15 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
9898
const secretId = secret.id;
9999
const secretName = secret.attributes.name.trim();
100100
let componentIds: any = [];
101-
if (secret.relationships.component) componentIds.push(secret.relationships.component.data.id);
102-
if (secret.relationships.auth_client) {
103-
const clientId = secret.relationships.auth_client.data.id;
104-
const clientResponse = await this.makeRequest({ method: 'GET', url: `/auth-clients/${clientId}` });
105-
componentIds = clientResponse.relationships.components.data.map(x => x.id);
101+
try {
102+
if (secret.relationships.component) componentIds.push(secret.relationships.component.data.id);
103+
if (secret.relationships.auth_client) {
104+
const clientId = secret.relationships.auth_client.data.id;
105+
const clientResponse = await this.makeRequest({ method: 'GET', url: `/auth-clients/${clientId}` });
106+
componentIds = clientResponse.data.relationships.components.data.map(x => x.id);
107+
}
108+
} catch (e: any) {
109+
this.emitter.logger.info(`Can't find related to secret component - ${e.message}`)
106110
}
107111
resp.push({ secretId, secretName, componentIds });
108112
}
@@ -176,7 +180,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
176180
const workspaces = await this.fetchWorkspaceList({});
177181
if (!workspaceId) {
178182
const nonFlatFlows = await mapLimit(workspaces, realSplitFactor,
179-
async workspace => this.fetchAllFlowsForWorkspace({ parallelCalls: parallelizationPerTask, workspaceId: workspace.workspaceId }));
183+
async workspace => this.fetchAllFlowsForWorkspace({ parallelCalls: parallelizationPerTask, workspaceId: workspace.workspaceId }));
180184
flows = nonFlatFlows.flat();
181185
} else {
182186
flows = await this.fetchAllFlowsForWorkspace({
@@ -270,7 +274,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
270274
/* eslint-disable-next-line no-param-reassign */
271275
soFar[contract.id] = contract;
272276
return soFar;
273-
}, {});
277+
}, {});
274278

275279
const nonFlatWorkspaces = await mapLimit(
276280
contracts,
@@ -547,7 +551,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
547551
/* eslint-disable-next-line no-param-reassign */
548552
soFar[sample.sampleId] = sample.sample;
549553
return soFar;
550-
}, {});
554+
}, {});
551555
flow.attributes.graph.nodes
552556
.filter(node => node.selected_data_samples)
553557
.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.4",
3+
"version": "1.2.0-dev.5",
44
"description": "Library for most common component development cases",
55
"author": {
66
"name": "elastic.io GmbH",

0 commit comments

Comments
 (0)