Files
rowy/ft_build/sparksLib/template.ts
Sidney Alcantara 4950a15bd2 Merge branch 'develop' into feature/theme-customisation
* develop: (36 commits)
  update ReExecute to handle >500 documents
  Bump tar from 4.4.13 to 4.4.15 in /cloud_functions/functions
  update wikiLinks
  only allow required value if default value is undefined
  updated field settings
  Bump color-string from 1.5.4 to 1.6.0 in /cloud_functions/functions
  analytics column events test
  moved ft_build to FunctionsBuilder repo
  fix analytics
  redirect missing cloud run url to home/settings
  update ft_actions dependancies
  remove second deploy button
  Google Cloud Shell one click deploy UI
  upgrade dependencies
  fix rowHeight not updating
  SideDrawer Form: fix react-hook-form state calls
  fix dynamic value type not saving, add utilFns
  fix date field
  ConnectTable: add snapshotFields config
  .
  ...
2021-08-06 21:42:05 +10:00

49 lines
1.2 KiB
TypeScript

export const dependencies = {
// --- Add your dependencies
// algoliasearch: "^4.8.3",
};
// Define your spark
const sparkName = async (data, sparkContext) => {
// Your spark inputs
const { row, targetPath, fieldsToSync } = data;
const { triggerType, change } = sparkContext;
// ---------------------------------------------
// --- Utilise your dependencies ---
// const algoliasearch = require("algoliasearch");
// ---------------------------------------------
// --- Get the secret from Secrets Manager
// Example: Algolia Secret
// const { getSecret } = require("../utils");
// const { appId, adminKey } = await getSecret("algolia");
// ---------------------------------------------
// --- Connect to any third party extensions ---
// Example Algolia
// const client = algoliasearch(appId, adminKey);
// const _index = client.initIndex(index);
// ---------------------------------------------
// --- Handle required trigger actions ---
switch (triggerType) {
case "create":
// create trigger actions
break;
case "update":
// update trigger actions
break;
case "delete":
// delete trigger actions
break;
default:
break;
}
return true;
};
export default sparkName;