@1hive/connect-core
Version:
Access and interact with Aragon Organizations and their apps.
87 lines • 2.63 kB
JavaScript
;
// TODO: Remove these linting exceptions after implementation.
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to set private field on non-instance");
}
privateMap.set(receiver, value);
return value;
};
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
if (!privateMap.has(receiver)) {
throw new TypeError("attempted to get private field on non-instance");
}
return privateMap.get(receiver);
};
var _permissions;
Object.defineProperty(exports, "__esModule", { value: true });
class ConnectorJson {
constructor(config) {
_permissions.set(this, void 0);
this.name = 'json';
this.config = config;
this.network = config.network;
__classPrivateFieldSet(this, _permissions, config.permissions);
}
async connect(connection) {
this.connection = connection;
}
async disconnect() {
delete this.connection;
}
async permissionsForOrg() {
return __classPrivateFieldGet(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([]);
});
}
}
_permissions = new WeakMap();
exports.default = ConnectorJson;
//# sourceMappingURL=ConnectorJson.js.map