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.7 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\n        WITH user_source_ids AS (\n            SELECT cp.channel_id::text AS source_id\n            FROM comms_channel_participants cp\n            WHERE cp.user_id = $1 AND cp.left_at IS NULL\n            UNION ALL\n            SELECT t.team_id::text\n            FROM team_user t\n            WHERE t.user_id = $1\n            UNION ALL\n            SELECT $1\n        )\n        SELECT\n            i.id,\n            i.name,\n            i.updated_at\n        FROM initiative i\n        JOIN \"SharePermission\" sp ON sp.id = i.share_permission_id\n        WHERE EXISTS (\n            SELECT 1\n            FROM entity_access ea\n            WHERE ea.entity_id = i.id\n              AND ea.entity_type = 'initiative'\n              AND ea.source_id IN (SELECT source_id FROM user_source_ids)\n        )\n        OR (\n            sp.\"linkShare\" = 'TEAM'\n            AND EXISTS (\n                SELECT 1\n                FROM team_user owner_tu\n                WHERE owner_tu.user_id = i.owner_user_id\n                  AND owner_tu.team_id::text IN (SELECT source_id FROM user_source_ids)\n            )\n        )\n        ORDER BY i.updated_at DESC\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "name",
        "type_info": "Text"
      },
      {
        "ordinal": 2,
        "name": "updated_at",
        "type_info": "Timestamptz"
      }
    ],
    "parameters": {
      "Left": [
        "Text"
      ]
    },
    "nullable": [
      false,
      false,
      false
    ]
  },
  "hash": "0db268a5567c7bdebc00f26715bd6e99507f6244b6b37f1a88317a24d86687fe"
}