mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-25 06:28:59 -06:00
chore: Fix some eslint issues in services
/puter/packages/backend/src/services/ContextInitService.js 57:18 error 'async_factory' is not defined no-undef /puter/packages/backend/src/services/StorageService.js 22:5 error Expected to call 'super()' constructor-super /puter/packages/backend/src/services/WebServerService.js 258:35 error 'services' is not defined no-undef /puter/packages/backend/src/services/auth/AuthService.js 52:13 error Unreachable code no-unreachable /puter/packages/backend/src/services/drivers/implementations/BaseImplementation.js 64:25 error 'services' is not defined no-undef 75:39 error 'services' is not defined no-undef 117:39 error 'services' is not defined no-undef 123:42 error 'services' is not defined no-undef 149:42 error 'services' is not defined no-undef 168:38 error 'services' is not defined no-undef /puter/packages/backend/src/services/drivers/implementations/PuterDriverProxy.js 43:5 error Expected to call 'super()' constructor-super 44:9 error 'this' is not allowed before 'super()' no-this-before-super /puter/packages/backend/src/services/drivers/meta/Construct.js 125:9 error Unreachable code no-unreachable /puter/packages/backend/src/services/runtime-analysis/PagerService.js 49:41 error 'util' is not defined no-undef
This commit is contained in:
@@ -52,7 +52,7 @@ class ContextInitService extends BaseService {
|
||||
key, value,
|
||||
});
|
||||
}
|
||||
register_async_factory (key, factory) {
|
||||
register_async_factory (key, async_factory) {
|
||||
this.mw.register_initializer({
|
||||
key, async_factory,
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@ const { AdvancedBase } = require("@heyputer/puter-js-common");
|
||||
|
||||
class StorageService extends AdvancedBase {
|
||||
constructor ({ services }) {
|
||||
super(services);
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ class WebServerService extends BaseService {
|
||||
onFinished(res, () => {
|
||||
if ( res.statusCode !== 500 ) return;
|
||||
if ( req.__error_handled ) return;
|
||||
const alarm = services.get('alarm');
|
||||
const alarm = this.services.get('alarm');
|
||||
alarm.create('responded-500', 'server sent a 500 response', {
|
||||
error: req.__error_source,
|
||||
url: req.url,
|
||||
|
||||
@@ -55,27 +55,6 @@ class AuthService extends BaseService {
|
||||
|
||||
if ( ! decoded.hasOwnProperty('type') ) {
|
||||
throw new LegacyTokenError();
|
||||
const user = await this.db.requireRead(
|
||||
"SELECT * FROM `user` WHERE `uuid` = ? LIMIT 1",
|
||||
[decoded.uuid],
|
||||
);
|
||||
|
||||
if ( ! user[0] ) {
|
||||
throw APIError.create('token_auth_failed');
|
||||
}
|
||||
|
||||
if ( user[0].suspended ) {
|
||||
throw APIError.create('account_suspended');
|
||||
}
|
||||
|
||||
const actor_type = new UserActorType({
|
||||
user: user[0],
|
||||
});
|
||||
|
||||
return new Actor({
|
||||
user_uid: decoded.uuid,
|
||||
type: actor_type,
|
||||
});
|
||||
}
|
||||
|
||||
if ( decoded.type === 'session' ) {
|
||||
|
||||
@@ -60,6 +60,7 @@ class BaseImplementation extends AdvancedBase {
|
||||
|
||||
async _sla_enforcement (method) {
|
||||
const context = Context.get();
|
||||
const services = context.get('services');
|
||||
const method_key = `${this.constructor.ID}:${method}`;
|
||||
const svc_sla = services.get('sla');
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ class PuterDriverProxy extends AdvancedBase {
|
||||
}
|
||||
|
||||
constructor ({ target }) {
|
||||
super();
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
|
||||
@@ -119,10 +119,6 @@ class TypeSpec extends BasicBase {
|
||||
|
||||
equals (other) {
|
||||
return this.raw.$ === other.raw.$;
|
||||
// for ( k in this.raw ) {
|
||||
// if ( this.raw[k] !== other.raw[k] ) return false;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
toString () {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
const pdjs = require('@pagerduty/pdjs');
|
||||
const BaseService = require('../BaseService');
|
||||
const util = require('util');
|
||||
|
||||
class PagerService extends BaseService {
|
||||
async _construct () {
|
||||
|
||||
Reference in New Issue
Block a user