diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index 10457c8c41..b0b7ef2e79 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -184,6 +184,7 @@ export interface IRestApi { retryExecution(id: string, loadWorkflow?: boolean): Promise; getTimezones(): Promise; getBinaryBufferString(dataPath: string): Promise; + getScopes: (credentialType: string) => Promise; } export interface INodeTranslationHeaders { diff --git a/packages/editor-ui/src/components/mixins/restApi.ts b/packages/editor-ui/src/components/mixins/restApi.ts index 7dad40044f..72e22cad09 100644 --- a/packages/editor-ui/src/components/mixins/restApi.ts +++ b/packages/editor-ui/src/components/mixins/restApi.ts @@ -195,6 +195,11 @@ export const restApi = Vue.extend({ getBinaryBufferString: (dataPath: string): Promise => { return self.restApi().makeRestApiRequest('GET', `/data/${dataPath}`); }, + + // Returns scopes for OAuth credential types + getScopes: (credentialType: string): Promise => { + return self.restApi().makeRestApiRequest('GET', '/oauth2-credential/scopes', { credentialType }); + }, }; }, },