import { Address , AppFilters , Network , SubscriptionCallback , SubscriptionHandler , } from '@aragon/connect-types' ; import { ConnectionContext } from '../types' ; import IOrganizationConnector from './IOrganizationConnector' ; import App from '../entities/App' ; import Organization from '../entities/Organization' ; import Permission from '../entities/Permission' ; import Repo from '../entities/Repo' ; import Role from '../entities/Role' ; export type ConnectorJsonConfig = { permissions : Permission [ ] ; network : Network ; } ; class ConnectorJson implements IOrganizationConnector { #permissions : Permission [ ] ; connection ? : ConnectionContext ; readonly config : ConnectorJsonConfig ; readonly name = 'json' ; readonly network : Network ; constructor ( config ) { this . config = config ; this . network = config . network ; this . #permissions = config . permissions ; } async connect ( connection ) { this . connection = connection ; } async disconnect ( ) { delete this . connection ; } async permissionsForOrg ( ) { return this . #permissions ; } onPermissionsForOrg ( organization , callback ) { return { unsubscribe : ( ) => { } , } ; } async app ( organization , filters ) { return this . appByAddress ( organization , '' ) ; } async apps ( filters ) { return [ ] ; } appForOrg ( organization ) { return new Promise ( ( resolve ) => { resolve ( ) ; } ) ; } onAppForOrg ( organization , filters , callback ) { return { unsubscribe : ( ) => { } , } ; } appsForOrg ( organization ) { return new Promise ( ( resolve ) => { resolve ( [ ] ) ; } ) ; } onAppsForOrg ( organization , filters , callback ) { return { unsubscribe : ( ) => { } , } ; } repoForApp ( organization , appAddress ) { return new Promise ( ( resolve ) => { resolve ( ) ; } ) ; } appByAddress ( organization , appAddress ) { return new Promise ( ( resolve ) => { resolve ( ) ; } ) ; } rolesForAddress ( organization , appAddress ) { return new Promise ( ( resolve ) => { resolve ( [ ] ) ; } ) ; } } export default ConnectorJson ;