mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 03:15:24 +00:00
setup eslint on noco-integrations batch size now customizable per integration
This commit is contained in:
@@ -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>;
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user