message: initializables loader
diff: @@ -5,9 +5,9 @@ import * as admin from "firebase-admin";
  // Initialize Firebase Admin
  //const serverTimestamp = admin.firestore.FieldValue.serverTimestamp;
  -admin.initializeApp();
  -// const serviceAccount = require("./antler-vc-firebase.json");
  -// admin.initializeApp({ credential: admin.credential.cert(serviceAccount) });
  +//admin.initializeApp();
  +const serviceAccount = require("./antler-vc-firebase.json");
  +admin.initializeApp({ credential: admin.credential.cert(serviceAccount) });
  const db = admin.firestore();
  export const generateConfigFromTableSchema = async (schemaDocPath) => {
  @@ -41,16 +41,23 @@ export const generateConfigFromTableSchema = async (schemaDocPath) => {
  ""
  )}]`;
  - const initializableColumns = Object.values(schemaData.columns).filter(
  - (col: any) => col.config?.["initialValue.script"]
  - );
  - console.log(initializableColumns);
  + const initializableColumns = Object.values(
  + schemaData.columns
  + ).filter((col: any) => Boolean(col.config.defaultValue));
  + console.log({ initializableColumns });
  const initializeConfig = `[${initializableColumns.reduce(
  (acc, currColumn: any) => {
  - return `${acc}{\nfieldName:'${currColumn.key}',\nfn:(snapshot)=>{if(snapshot.get("${currColumn.key}")){
  - return snapshot.get("${currColumn.key}")
  - }
  - ${currColumn.config["initialValue.script"]}}\n},\n`;
  + return `${acc}{\nfieldName:'${currColumn.key}',
  + type:"${currColumn.config.defaultValue.type}",
  + value:${
  + typeof currColumn.config.defaultValue.value === "string"
  + ? `"${currColumn.config.defaultValue.value}"`
  + : currColumn.config.defaultValue.value
  + },
  + script:async ({row,ref,db,auth,utilFns}) =>{${
  + currColumn.config.defaultValue.script
  + }},
  + },\n`;
  },
  ""
  )}]`;
  