mirror of
https://github.com/HeyPuter/puter.git
synced 2026-01-06 05:00:29 -06:00
fix: allow stripe header and commit db migration (#1877)
* fix: allow stripe header * fix: commit db migration
This commit is contained in:
@@ -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,
|
||||
|
||||
1
extensions/api.d.ts
vendored
1
extensions/api.d.ts
vendored
@@ -66,6 +66,7 @@ interface ServiceNameMap {
|
||||
}
|
||||
interface Extension extends RouterMethods {
|
||||
exports: Record<string, unknown>,
|
||||
on<T extends unknown[]>(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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user