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.

6.9 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\nSELECT\n    ep.id as entity_property_id,\n    ep.entity_id,\n    ep.entity_type as \"entity_type: EntityType\",\n    ep.property_definition_id,\n    ep.values as \"values: sqlx::types::JsonValue\",\n    ep.created_at as entity_property_created_at,\n    ep.updated_at as entity_property_updated_at,\n    pd.team_id as definition_team_id,\n    pd.user_id as definition_user_id,\n    pd.database_id as definition_database_id,\n    pd.display_name,\n    pd.data_type as \"data_type: DataType\",\n    pd.is_multi_select,\n    pd.specific_entity_type as \"specific_entity_type: Option<EntityType>\",\n    pd.created_at as definition_created_at,\n    pd.updated_at as definition_updated_at,\n    pd.is_system as definition_is_system\nFROM entity_properties ep\nINNER JOIN property_definitions pd ON ep.property_definition_id = pd.id\nWHERE (ep.entity_id, ep.entity_type) IN (\n    SELECT * FROM UNNEST($1::TEXT[], $2::property_entity_type[])\n)\nAND (\n    pd.id = ANY($3::UUID[])\n    OR (\n        $4::text IS NOT NULL\n        AND pd.data_type = $5\n        AND (\n            pd.user_id = $4\n            OR pd.team_id IN (SELECT tu.team_id FROM team_user tu WHERE tu.user_id = $4)\n        )\n    )\n    OR (\n        $4::text IS NOT NULL\n        AND pd.is_system = FALSE\n        AND pd.is_multi_select = FALSE\n        AND pd.data_type = $6\n        AND pd.display_name = $7\n        AND pd.team_id IN (SELECT tu.team_id FROM team_user tu WHERE tu.user_id = $4)\n    )\n)\n        ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "entity_property_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 1,
        "name": "entity_id",
        "type_info": "Text"
      },
      {
        "ordinal": 2,
        "name": "entity_type: EntityType",
        "type_info": {
          "Custom": {
            "name": "property_entity_type",
            "kind": {
              "Enum": [
                "CHANNEL",
                "CHAT",
                "DOCUMENT",
                "PROJECT",
                "THREAD",
                "USER",
                "COMPANY",
                "TASK",
                "CALL_RECORD",
                "CALENDAR_EVENT",
                "INITIATIVE",
                "CONTACT",
                "DATABASE_ROW"
              ]
            }
          }
        }
      },
      {
        "ordinal": 3,
        "name": "property_definition_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 4,
        "name": "values: sqlx::types::JsonValue",
        "type_info": "Jsonb"
      },
      {
        "ordinal": 5,
        "name": "entity_property_created_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 6,
        "name": "entity_property_updated_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 7,
        "name": "definition_team_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 8,
        "name": "definition_user_id",
        "type_info": "Text"
      },
      {
        "ordinal": 9,
        "name": "definition_database_id",
        "type_info": "Uuid"
      },
      {
        "ordinal": 10,
        "name": "display_name",
        "type_info": "Text"
      },
      {
        "ordinal": 11,
        "name": "data_type: DataType",
        "type_info": {
          "Custom": {
            "name": "property_data_type",
            "kind": {
              "Enum": [
                "BOOLEAN",
                "DATE",
                "NUMBER",
                "STRING",
                "SELECT_NUMBER",
                "SELECT_STRING",
                "ENTITY",
                "LINK",
                "TAG",
                "DATE_RANGE"
              ]
            }
          }
        }
      },
      {
        "ordinal": 12,
        "name": "is_multi_select",
        "type_info": "Bool"
      },
      {
        "ordinal": 13,
        "name": "specific_entity_type: Option<EntityType>",
        "type_info": {
          "Custom": {
            "name": "property_entity_type",
            "kind": {
              "Enum": [
                "CHANNEL",
                "CHAT",
                "DOCUMENT",
                "PROJECT",
                "THREAD",
                "USER",
                "COMPANY",
                "TASK",
                "CALL_RECORD",
                "CALENDAR_EVENT",
                "INITIATIVE",
                "CONTACT",
                "DATABASE_ROW"
              ]
            }
          }
        }
      },
      {
        "ordinal": 14,
        "name": "definition_created_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 15,
        "name": "definition_updated_at",
        "type_info": "Timestamptz"
      },
      {
        "ordinal": 16,
        "name": "definition_is_system",
        "type_info": "Bool"
      }
    ],
    "parameters": {
      "Left": [
        "TextArray",
        {
          "Custom": {
            "name": "property_entity_type[]",
            "kind": {
              "Array": {
                "Custom": {
                  "name": "property_entity_type",
                  "kind": {
                    "Enum": [
                      "CHANNEL",
                      "CHAT",
                      "DOCUMENT",
                      "PROJECT",
                      "THREAD",
                      "USER",
                      "COMPANY",
                      "TASK",
                      "CALL_RECORD",
                      "CALENDAR_EVENT",
                      "INITIATIVE",
                      "CONTACT",
                      "DATABASE_ROW"
                    ]
                  }
                }
              }
            }
          }
        },
        "UuidArray",
        "Text",
        {
          "Custom": {
            "name": "property_data_type",
            "kind": {
              "Enum": [
                "BOOLEAN",
                "DATE",
                "NUMBER",
                "STRING",
                "SELECT_NUMBER",
                "SELECT_STRING",
                "ENTITY",
                "LINK",
                "TAG",
                "DATE_RANGE"
              ]
            }
          }
        },
        {
          "Custom": {
            "name": "property_data_type",
            "kind": {
              "Enum": [
                "BOOLEAN",
                "DATE",
                "NUMBER",
                "STRING",
                "SELECT_NUMBER",
                "SELECT_STRING",
                "ENTITY",
                "LINK",
                "TAG",
                "DATE_RANGE"
              ]
            }
          }
        },
        "Text"
      ]
    },
    "nullable": [
      false,
      false,
      false,
      false,
      true,
      false,
      false,
      true,
      true,
      true,
      false,
      false,
      false,
      true,
      false,
      false,
      false
    ]
  },
  "hash": "aa7c232e56ba29f9d6377e4e65db1a8379914a7a75b3537c104cff341e67cd13"
}