Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

1.9 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\n            SELECT co.id AS \"company_id?\", ct.id AS \"contact_id?\",\n                   LOWER(BTRIM(d.domain)) AS \"domain?\", LOWER(BTRIM(ct.email)) AS \"email?\"\n            FROM crm_companies co\n            JOIN team_crm_settings tcs ON tcs.team_id = co.team_id AND tcs.crm_enabled\n            LEFT JOIN team_user tu ON tu.team_id = co.team_id AND tu.user_id = $1\n            LEFT JOIN crm_contacts ct ON ct.company_id = co.id AND NOT ct.hidden\n            LEFT JOIN crm_domains d ON d.company_id = co.id\n            WHERE NOT co.hidden\n              AND (($1::text IS NOT NULL AND tu.user_id IS NOT NULL)\n                   OR ($2::uuid IS NOT NULL AND co.team_id = $2))\n            UNION ALL\n            -- Contacts without a company.\n            SELECT NULL, ct.id, NULL, LOWER(BTRIM(ct.email))\n            FROM crm_contacts ct\n            JOIN team_crm_settings tcs ON tcs.team_id = ct.team_id AND tcs.crm_enabled\n            LEFT JOIN team_user tu ON tu.team_id = ct.team_id AND tu.user_id = $1\n            WHERE ct.company_id IS NULL\n              AND NOT ct.hidden\n              AND (($1::text IS NOT NULL AND tu.user_id IS NOT NULL)\n                   OR ($2::uuid IS NOT NULL AND ct.team_id = $2))\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "company_id?",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "contact_id?",
        "type_info": "Uuid"
      },
      {
        "ordinal": 2,
        "name": "domain?",
        "type_info": "Text"
      },
      {
        "ordinal": 3,
        "name": "email?",
        "type_info": "Text"
      }
    ],
    "parameters": {
      "Left": [
        "Text",
        "Uuid"
      ]
    },
    "nullable": [
      null,
      null,
      null,
      null
    ]
  },
  "hash": "26ecfa4760564375bb494b9f5badeba375ffc7a465aa84438ad6e7b7cf266df9"
}