diff --git a/eslint.config.js b/eslint.config.js index 26cff7ee..3fc8b1af 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,6 +45,7 @@ const rules = { 'no-undef': 'error', 'custom/control-structure-spacing': 'error', '@stylistic/no-trailing-spaces': 'error', + '@stylistic/space-before-blocks': ['error', 'always'], }; export default defineConfig([ @@ -140,48 +141,7 @@ export default defineConfig([ i18n: 'readonly', }, }, - rules: { - - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', - }], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], - '@stylistic/indent': ['error', 4, { - 'CallExpression': { arguments: 4 }, - }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], - '@stylistic/quotes': ['error', 'single', { 'avoidEscape': true }], - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-template-curly-in-string': 'error', - 'prefer-template': 'error', - 'no-undef': 'error', - 'no-useless-concat': 'error', - 'template-curly-spacing': ['error', 'never'], - curly: ['error', 'multi-line'], - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', - }, + rules, }, { files: ['**/*.{js,mjs,cjs,ts}'], @@ -193,47 +153,7 @@ export default defineConfig([ i18n: 'readonly', }, }, - rules: { - 'no-unused-vars': ['error', { - 'vars': 'all', - 'args': 'after-used', - 'caughtErrors': 'all', - 'ignoreRestSiblings': false, - 'ignoreUsingDeclarations': false, - 'reportUsedIgnorePattern': false, - 'argsIgnorePattern': '^_', - 'caughtErrorsIgnorePattern': '^_', - 'destructuredArrayIgnorePattern': '^_', - }], - '@stylistic/curly-newline': ['error', 'always'], - '@stylistic/object-curly-spacing': ['error', 'always'], - '@stylistic/indent': ['error', 4, { - 'CallExpression': { arguments: 4 }, - }], - '@stylistic/indent-binary-ops': ['error', 4], - '@stylistic/array-bracket-newline': ['error', 'consistent'], - '@stylistic/semi': ['error', 'always'], - '@stylistic/quotes': ['error', 'single', { 'avoidEscape': true }], - '@stylistic/function-call-argument-newline': ['error', 'consistent'], - '@stylistic/arrow-spacing': ['error', { before: true, after: true }], - '@stylistic/space-before-function-paren': ['error', { 'anonymous': 'never', 'named': 'never', 'asyncArrow': 'always', 'catch': 'never' }], - '@stylistic/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }], - '@stylistic/keyword-spacing': ['error', { 'before': true, 'after': true }], - '@stylistic/no-multiple-empty-lines': ['error', { max: 1, maxEOF: 0 }], - '@stylistic/comma-spacing': ['error', { 'before': false, 'after': true }], - '@stylistic/comma-dangle': ['error', 'always-multiline'], - '@stylistic/object-property-newline': ['error', { allowAllPropertiesOnSameLine: true }], - '@stylistic/dot-location': ['error', 'property'], - '@stylistic/space-infix-ops': ['error'], - 'no-template-curly-in-string': 'error', - 'prefer-template': 'error', - 'no-undef': 'error', - 'no-useless-concat': 'error', - 'template-curly-spacing': ['error', 'never'], - curly: ['error', 'multi-line'], - 'custom/control-structure-spacing': 'error', - '@stylistic/no-trailing-spaces': 'error', - }, + rules, extends: ['js/recommended'], plugins: { js, diff --git a/extensions/api.d.ts b/extensions/api.d.ts index c303ff20..830bb165 100644 --- a/extensions/api.d.ts +++ b/extensions/api.d.ts @@ -66,6 +66,7 @@ interface ServiceNameMap { } interface Extension extends RouterMethods { exports: Record, + on(event: string, listener: (...args: T)=> void): void, // TODO DS: type events better import(module:'core'): CoreRuntimeModule, import(module:'fs'): FilesystemModule, import(module:'extensionController'): typeof ExtensionControllerExports diff --git a/src/backend/src/modules/web/WebServerService.js b/src/backend/src/modules/web/WebServerService.js index bd7ea879..c87c4bbd 100644 --- a/src/backend/src/modules/web/WebServerService.js +++ b/src/backend/src/modules/web/WebServerService.js @@ -626,7 +626,7 @@ class WebServerService extends BaseService { const allowed_headers = [ "Origin", "X-Requested-With", "Content-Type", "Accept", "Authorization", "sentry-trace", "baggage", - "Depth", "Destination", "Overwrite", "If", "Lock-Token", "DAV" + "Depth", "Destination", "Overwrite", "If", "Lock-Token", "DAV", "stripe-signature", ]; // Request headers to allow diff --git a/src/backend/src/services/database/SqliteDatabaseAccessService.js b/src/backend/src/services/database/SqliteDatabaseAccessService.js index 05e0036e..beb61a63 100644 --- a/src/backend/src/services/database/SqliteDatabaseAccessService.js +++ b/src/backend/src/services/database/SqliteDatabaseAccessService.js @@ -166,6 +166,9 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { [35, [ '0039_add-expireAt-to-kv-store.sql', ]], + [36, [ + '0040_create_app_store_tables.sql', + ]], ]; // Database upgrade logic @@ -220,7 +223,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { const stmt = stmts[i] + ';'; try { this.db.exec(stmt); - } catch( e ) { + } catch ( e ) { throw new CompositeError(`failed to apply: ${basename} at line ${i}`, e); } } @@ -231,7 +234,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { await this.run_js_migration_({ filename, contents, }); - } catch( e ) { + } catch ( e ) { throw new CompositeError(`failed to apply: ${basename}`, e); } break; @@ -395,7 +398,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { const fs = require('fs'); const contents = fs.readFileSync(filename, 'utf8'); this.db.exec(contents); - } catch( err ) { + } catch ( err ) { log.error(err.message); } }, @@ -408,7 +411,7 @@ class SqliteDatabaseAccessService extends BaseDatabaseAccessService { const [query] = args; const rows = this._read(query, []); log.log(rows); - } catch( err ) { + } catch ( err ) { log.error(err.message); } }, diff --git a/src/dev-center/js/apps.js b/src/dev-center/js/apps.js index de37c183..85b4f7bc 100644 --- a/src/dev-center/js/apps.js +++ b/src/dev-center/js/apps.js @@ -153,7 +153,7 @@ $(document).on('click', '.create-an-app-btn', async function(e) { } }); -if ( await puter.auth.getUser().hasDevAccountAccess ) $('.setup-account-btn').hide(); +if ( (await puter.auth.getUser()).hasDevAccountAccess ) $('.setup-account-btn').hide(); $('.setup-account-btn').on('click', async () => { await puter.ui.openDevPaymentsAccount(); });