@@ -92,17 +92,19 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
92
92
async fetchAllSecretsForWorkspace ( options : any = { } ) {
93
93
const { workspaceId } = options ;
94
94
const secrets = await this . makeRequest ( { method : 'GET' , url : `/workspaces/${ workspaceId } /secrets` } ) ;
95
- const resp : any = { } ;
95
+ const resp : any = [ ] ;
96
96
97
97
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 )
101
102
if ( secret . relationships . auth_client ) {
102
103
const clientId = secret . relationships . auth_client . data . id ;
103
104
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 ) ;
105
106
}
107
+ resp . push ( { secretId, secretName, componentIds } )
106
108
}
107
109
return resp ;
108
110
}
@@ -174,10 +176,10 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
174
176
const workspaces = await this . fetchWorkspaceList ( { } ) ;
175
177
if ( ! workspaceId ) {
176
178
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
+ } ) ) ;
181
183
flows = nonFlatFlows . flat ( ) ;
182
184
} else {
183
185
flows = await this . fetchAllFlowsForWorkspace ( {
@@ -271,7 +273,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
271
273
/* eslint-disable-next-line no-param-reassign */
272
274
soFar [ contract . id ] = contract ;
273
275
return soFar ;
274
- } , { } ) ;
276
+ } , { } ) ;
275
277
276
278
const nonFlatWorkspaces = await mapLimit (
277
279
contracts ,
@@ -548,7 +550,7 @@ export class PlatformApiLogicClient extends PlatformApiRestClient {
548
550
/* eslint-disable-next-line no-param-reassign */
549
551
soFar [ sample . sampleId ] = sample . sample ;
550
552
return soFar ;
551
- } , { } ) ;
553
+ } , { } ) ;
552
554
flow . attributes . graph . nodes
553
555
. filter ( node => node . selected_data_samples )
554
556
. forEach ( ( node ) => {
0 commit comments