setup eslint on noco-integrations batch size now customizable per integration

This commit is contained in:
Fendy Heryanto
2025-12-02 06:02:53 +00:00
parent 020257c20f
commit f4988d199f
2 changed files with 36 additions and 0 deletions

View File

@@ -54,6 +54,40 @@ export abstract class SyncIntegration<T = any> extends IntegrationWrapper<T> {
getTitle() {
return 'Sync Integration';
}
/**
* Returns the number of sync's batch size. If this number is reached in stream, it'll commit the current stream and flush.
* Override this method to provide a custom batch size.
*
* @returns The batch size
*/
get batchSize(): number {
return 100;
}
/**
* Retrieves the schema definition for the destination tables.
* Defines what tables, columns, and relationships will be created during sync.
*
* @param auth - The authenticated integration instance with automatic token refresh
* @returns A promise resolving to either a standard SyncSchema or CustomSyncSchema
*
* @example
* ```typescript
* async getDestinationSchema(auth: AuthIntegration<any, any>) {
* return auth.use(async (client) => {
* const tables = await client.getTables();
* return {
* [TARGET_TABLES.CONTACTS]: {
* title: 'Contacts',
* columns: [...],
* relations: [...]
* }
* };
* });
* }
* ```
*/
abstract getDestinationSchema(
auth: AuthResponse<any>,
): Promise<SyncSchema | CustomSyncSchema>;

View File

@@ -1,11 +1,13 @@
import js from '@eslint/js';
import tseslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import eslintPrettier from 'eslint-plugin-prettier/recommended';
import importPlugin from 'eslint-plugin-import';
import globals from 'globals';
export default [
js.configs.recommended,
eslintPrettier,
{
files: ['packages/**/src/**/*.{ts,tsx}'],
languageOptions: {