enable connectors logging in code editor

This commit is contained in:
Bobby Wang
2022-11-23 22:08:35 +08:00
parent 74852a8a3d
commit cc2b86027d
2 changed files with 6 additions and 1 deletions

View File

@@ -15,6 +15,11 @@ type ConnectorContext = {
auth: firebaseauth.BaseAuth;
query: string;
user: ConnectorUser;
logging: {
log: (payload: any) => void;
warn: (payload: any) => void;
error: (payload: any) => void;
};
};
type ConnectorResult = any[];
type Connector = (

View File

@@ -11,7 +11,7 @@ export const replacer = (data: any) => (m: string, key: string) => {
return get(data, objKey, defaultValue);
};
export const baseFunction = `const connectorFn: Connector = async ({query, row, user}) => {
export const baseFunction = `const connectorFn: Connector = async ({query, row, user, logging}) => {
// TODO: Implement your service function here
return [];
};`;