@hailer/mcp 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +0 -7
- package/{.claude → dist}/CLAUDE.md +2 -2
- package/dist/app.js +18 -5
- package/dist/bot/bot-config.d.ts +10 -1
- package/dist/bot/bot-config.js +64 -3
- package/dist/bot/bot-manager.d.ts +2 -0
- package/dist/bot/bot-manager.js +9 -2
- package/dist/bot/bot.d.ts +33 -0
- package/dist/bot/bot.js +461 -160
- package/dist/bot/services/message-classifier.js +17 -0
- package/dist/bot/services/permission-guard.d.ts +52 -0
- package/dist/bot/services/permission-guard.js +149 -0
- package/dist/bot/services/types.d.ts +5 -0
- package/dist/bot/services/typing-indicator.d.ts +6 -1
- package/dist/bot/services/typing-indicator.js +19 -3
- package/dist/cli.js +0 -0
- package/dist/config.d.ts +6 -1
- package/dist/config.js +43 -0
- package/dist/core.js +3 -6
- package/dist/lib/discussion-lock.d.ts +42 -0
- package/dist/lib/discussion-lock.js +110 -0
- package/dist/mcp/UserContextCache.d.ts +5 -0
- package/dist/mcp/UserContextCache.js +51 -19
- package/dist/mcp/hailer-clients.d.ts +19 -1
- package/dist/mcp/hailer-clients.js +158 -24
- package/dist/mcp/session-store.d.ts +68 -0
- package/dist/mcp/session-store.js +169 -0
- package/dist/mcp/signal-handler.js +2 -0
- package/dist/mcp/tool-registry.d.ts +17 -4
- package/dist/mcp/tool-registry.js +37 -7
- package/dist/mcp/tools/activity.js +99 -7
- package/dist/mcp/tools/app-scaffold.js +304 -336
- package/dist/mcp/tools/bot-config/constants.d.ts +23 -0
- package/dist/mcp/tools/bot-config/constants.js +94 -0
- package/dist/mcp/tools/bot-config/core.d.ts +253 -0
- package/dist/mcp/tools/bot-config/core.js +2456 -0
- package/dist/mcp/tools/bot-config/index.d.ts +10 -0
- package/dist/mcp/tools/bot-config/index.js +59 -0
- package/dist/mcp/tools/bot-config/tools.d.ts +7 -0
- package/dist/mcp/tools/bot-config/tools.js +15 -0
- package/dist/mcp/tools/bot-config/types.d.ts +50 -0
- package/dist/mcp/tools/bot-config/types.js +6 -0
- package/dist/mcp/tools/bug-fixer-tools.d.ts +45 -0
- package/dist/mcp/tools/bug-fixer-tools.js +1096 -0
- package/dist/mcp/tools/company.d.ts +9 -0
- package/dist/mcp/tools/company.js +88 -0
- package/dist/mcp/tools/discussion.js +68 -0
- package/dist/mcp/tools/document.d.ts +11 -0
- package/dist/mcp/tools/document.js +741 -0
- package/dist/mcp/tools/investigate.d.ts +9 -0
- package/dist/mcp/tools/investigate.js +254 -0
- package/dist/mcp/tools/workflow-permissions.d.ts +15 -0
- package/dist/mcp/tools/workflow-permissions.js +204 -0
- package/dist/mcp/tools/workflow.js +57 -18
- package/dist/mcp/utils/index.d.ts +2 -0
- package/dist/mcp/utils/index.js +12 -1
- package/dist/mcp/utils/role-utils.d.ts +74 -0
- package/dist/mcp/utils/role-utils.js +151 -0
- package/dist/mcp/utils/types.d.ts +43 -1
- package/dist/mcp/utils/types.js +14 -0
- package/dist/mcp/webhook-handler.d.ts +4 -0
- package/dist/mcp/webhook-handler.js +8 -0
- package/dist/mcp-server.d.ts +23 -2
- package/dist/mcp-server.js +639 -127
- package/dist/plugins/vipunen/client.d.ts +150 -0
- package/dist/plugins/vipunen/client.js +535 -0
- package/dist/plugins/vipunen/config/schema-config.json +19 -0
- package/dist/plugins/vipunen/config/schema-doc.json +22 -0
- package/dist/plugins/vipunen/index.d.ts +41 -0
- package/dist/plugins/vipunen/index.js +88 -0
- package/dist/plugins/vipunen/tools.d.ts +26 -0
- package/dist/plugins/vipunen/tools.js +501 -0
- package/dist/stdio-server.d.ts +14 -0
- package/dist/stdio-server.js +101 -0
- package/package.json +2 -1
- package/.claude/agents/agent-ada-skill-builder.md +0 -94
- package/.claude/agents/agent-alejandro-function-fields.md +0 -342
- package/.claude/agents/agent-bjorn-config-audit.md +0 -103
- package/.claude/agents/agent-builder-agent-creator.md +0 -130
- package/.claude/agents/agent-code-simplifier.md +0 -53
- package/.claude/agents/agent-dmitri-activity-crud.md +0 -159
- package/.claude/agents/agent-giuseppe-app-builder.md +0 -247
- package/.claude/agents/agent-gunther-mcp-tools.md +0 -39
- package/.claude/agents/agent-helga-workflow-config.md +0 -204
- package/.claude/agents/agent-igor-activity-mover-automation.md +0 -125
- package/.claude/agents/agent-ingrid-doc-templates.md +0 -261
- package/.claude/agents/agent-ivan-monolith.md +0 -154
- package/.claude/agents/agent-kenji-data-reader.md +0 -86
- package/.claude/agents/agent-lars-code-inspector.md +0 -102
- package/.claude/agents/agent-marco-mockup-builder.md +0 -110
- package/.claude/agents/agent-marcus-api-documenter.md +0 -323
- package/.claude/agents/agent-marketplace-publisher.md +0 -280
- package/.claude/agents/agent-marketplace-reviewer.md +0 -309
- package/.claude/agents/agent-permissions-handler.md +0 -208
- package/.claude/agents/agent-simple-writer.md +0 -48
- package/.claude/agents/agent-svetlana-code-review.md +0 -171
- package/.claude/agents/agent-tanya-test-runner.md +0 -333
- package/.claude/agents/agent-ui-designer.md +0 -100
- package/.claude/agents/agent-viktor-sql-insights.md +0 -212
- package/.claude/agents/agent-web-search.md +0 -55
- package/.claude/agents/agent-yevgeni-discussions.md +0 -45
- package/.claude/agents/agent-zara-zapier.md +0 -159
- package/.claude/commands/app-squad.md +0 -135
- package/.claude/commands/audit-squad.md +0 -158
- package/.claude/commands/autoplan.md +0 -563
- package/.claude/commands/cleanup-squad.md +0 -98
- package/.claude/commands/config-squad.md +0 -106
- package/.claude/commands/crud-squad.md +0 -87
- package/.claude/commands/data-squad.md +0 -97
- package/.claude/commands/debug-squad.md +0 -303
- package/.claude/commands/doc-squad.md +0 -65
- package/.claude/commands/handoff.md +0 -137
- package/.claude/commands/health.md +0 -49
- package/.claude/commands/help.md +0 -29
- package/.claude/commands/help:agents.md +0 -151
- package/.claude/commands/help:commands.md +0 -78
- package/.claude/commands/help:faq.md +0 -79
- package/.claude/commands/help:plugins.md +0 -50
- package/.claude/commands/help:skills.md +0 -93
- package/.claude/commands/help:tools.md +0 -75
- package/.claude/commands/hotfix-squad.md +0 -112
- package/.claude/commands/integration-squad.md +0 -82
- package/.claude/commands/janitor-squad.md +0 -167
- package/.claude/commands/learn-auto.md +0 -120
- package/.claude/commands/learn.md +0 -120
- package/.claude/commands/mcp-list.md +0 -27
- package/.claude/commands/onboard-squad.md +0 -140
- package/.claude/commands/plan-workspace.md +0 -732
- package/.claude/commands/prd.md +0 -130
- package/.claude/commands/project-status.md +0 -82
- package/.claude/commands/publish.md +0 -138
- package/.claude/commands/recap.md +0 -69
- package/.claude/commands/restore.md +0 -64
- package/.claude/commands/review-squad.md +0 -152
- package/.claude/commands/save.md +0 -24
- package/.claude/commands/stats.md +0 -19
- package/.claude/commands/swarm.md +0 -210
- package/.claude/commands/tool-builder.md +0 -39
- package/.claude/commands/ws-pull.md +0 -44
- package/.claude/hooks/_shared-memory.cjs +0 -305
- package/.claude/hooks/_utils.cjs +0 -108
- package/.claude/hooks/agent-failure-detector.cjs +0 -383
- package/.claude/hooks/agent-usage-logger.cjs +0 -204
- package/.claude/hooks/app-edit-guard.cjs +0 -494
- package/.claude/hooks/auto-learn.cjs +0 -304
- package/.claude/hooks/bash-guard.cjs +0 -272
- package/.claude/hooks/builder-mode-manager.cjs +0 -354
- package/.claude/hooks/bulk-activity-guard.cjs +0 -271
- package/.claude/hooks/context-watchdog.cjs +0 -230
- package/.claude/hooks/delegation-reminder.cjs +0 -465
- package/.claude/hooks/design-system-lint.cjs +0 -271
- package/.claude/hooks/post-scaffold-hook.cjs +0 -181
- package/.claude/hooks/prompt-guard.cjs +0 -354
- package/.claude/hooks/publish-template-guard.cjs +0 -147
- package/.claude/hooks/session-start.cjs +0 -35
- package/.claude/hooks/shared-memory-writer.cjs +0 -147
- package/.claude/hooks/skill-injector.cjs +0 -140
- package/.claude/hooks/skill-usage-logger.cjs +0 -258
- package/.claude/hooks/src-edit-guard.cjs +0 -240
- package/.claude/hooks/sync-marketplace-agents.cjs +0 -346
- package/.claude/settings.json +0 -257
- package/.claude/skills/SDK-activity-patterns/SKILL.md +0 -428
- package/.claude/skills/SDK-document-templates/SKILL.md +0 -1033
- package/.claude/skills/SDK-function-fields/SKILL.md +0 -542
- package/.claude/skills/SDK-generate-skill/SKILL.md +0 -92
- package/.claude/skills/SDK-init-skill/SKILL.md +0 -127
- package/.claude/skills/SDK-insight-queries/SKILL.md +0 -787
- package/.claude/skills/SDK-ws-config-skill/SKILL.md +0 -1139
- package/.claude/skills/agent-structure/SKILL.md +0 -98
- package/.claude/skills/api-documentation-patterns/SKILL.md +0 -474
- package/.claude/skills/chrome-mcp-reference/SKILL.md +0 -370
- package/.claude/skills/delegation-routing/SKILL.md +0 -202
- package/.claude/skills/frontend-design/SKILL.md +0 -254
- package/.claude/skills/hailer-activity-mover/SKILL.md +0 -213
- package/.claude/skills/hailer-api-client/SKILL.md +0 -518
- package/.claude/skills/hailer-app-builder/SKILL.md +0 -1434
- package/.claude/skills/hailer-apps-pictures/SKILL.md +0 -269
- package/.claude/skills/hailer-design-system/SKILL.md +0 -235
- package/.claude/skills/hailer-monolith-automations/SKILL.md +0 -686
- package/.claude/skills/hailer-permissions-system/SKILL.md +0 -121
- package/.claude/skills/hailer-project-protocol/SKILL.md +0 -488
- package/.claude/skills/hailer-rest-api/SKILL.md +0 -61
- package/.claude/skills/hailer-rest-api/hailer-activities.md +0 -184
- package/.claude/skills/hailer-rest-api/hailer-admin.md +0 -473
- package/.claude/skills/hailer-rest-api/hailer-calendar.md +0 -256
- package/.claude/skills/hailer-rest-api/hailer-feed.md +0 -249
- package/.claude/skills/hailer-rest-api/hailer-insights.md +0 -195
- package/.claude/skills/hailer-rest-api/hailer-messaging.md +0 -276
- package/.claude/skills/hailer-rest-api/hailer-workflows.md +0 -283
- package/.claude/skills/insight-join-patterns/SKILL.md +0 -174
- package/.claude/skills/integration-patterns/SKILL.md +0 -421
- package/.claude/skills/json-only-output/SKILL.md +0 -72
- package/.claude/skills/lsp-setup/SKILL.md +0 -160
- package/.claude/skills/mcp-direct-tools/SKILL.md +0 -153
- package/.claude/skills/optional-parameters/SKILL.md +0 -72
- package/.claude/skills/publish-hailer-app/SKILL.md +0 -244
- package/.claude/skills/testing-patterns/SKILL.md +0 -630
- package/.claude/skills/tool-builder/SKILL.md +0 -250
- package/.claude/skills/tool-parameter-usage/SKILL.md +0 -126
- package/.claude/skills/tool-response-verification/SKILL.md +0 -92
- package/.claude/skills/zapier-hailer-patterns/SKILL.md +0 -581
- package/.mcp.json +0 -13
- package/.opencode/agent/agent-ada-skill-builder.md +0 -35
- package/.opencode/agent/agent-alejandro-function-fields.md +0 -39
- package/.opencode/agent/agent-bjorn-config-audit.md +0 -36
- package/.opencode/agent/agent-builder-agent-creator.md +0 -39
- package/.opencode/agent/agent-code-simplifier.md +0 -31
- package/.opencode/agent/agent-dmitri-activity-crud.md +0 -40
- package/.opencode/agent/agent-giuseppe-app-builder.md +0 -37
- package/.opencode/agent/agent-gunther-mcp-tools.md +0 -39
- package/.opencode/agent/agent-helga-workflow-config.md +0 -203
- package/.opencode/agent/agent-igor-activity-mover-automation.md +0 -46
- package/.opencode/agent/agent-ingrid-doc-templates.md +0 -39
- package/.opencode/agent/agent-ivan-monolith.md +0 -46
- package/.opencode/agent/agent-kenji-data-reader.md +0 -53
- package/.opencode/agent/agent-lars-code-inspector.md +0 -28
- package/.opencode/agent/agent-marco-mockup-builder.md +0 -42
- package/.opencode/agent/agent-marcus-api-documenter.md +0 -53
- package/.opencode/agent/agent-marketplace-publisher.md +0 -44
- package/.opencode/agent/agent-marketplace-reviewer.md +0 -42
- package/.opencode/agent/agent-permissions-handler.md +0 -50
- package/.opencode/agent/agent-simple-writer.md +0 -45
- package/.opencode/agent/agent-svetlana-code-review.md +0 -39
- package/.opencode/agent/agent-tanya-test-runner.md +0 -57
- package/.opencode/agent/agent-ui-designer.md +0 -56
- package/.opencode/agent/agent-viktor-sql-insights.md +0 -34
- package/.opencode/agent/agent-web-search.md +0 -42
- package/.opencode/agent/agent-yevgeni-discussions.md +0 -37
- package/.opencode/agent/agent-zara-zapier.md +0 -53
- package/.opencode/commands/app-squad.md +0 -135
- package/.opencode/commands/audit-squad.md +0 -158
- package/.opencode/commands/autoplan.md +0 -563
- package/.opencode/commands/cleanup-squad.md +0 -98
- package/.opencode/commands/config-squad.md +0 -106
- package/.opencode/commands/crud-squad.md +0 -87
- package/.opencode/commands/data-squad.md +0 -97
- package/.opencode/commands/debug-squad.md +0 -303
- package/.opencode/commands/doc-squad.md +0 -65
- package/.opencode/commands/handoff.md +0 -137
- package/.opencode/commands/health.md +0 -49
- package/.opencode/commands/help-agents.md +0 -151
- package/.opencode/commands/help-commands.md +0 -32
- package/.opencode/commands/help-faq.md +0 -29
- package/.opencode/commands/help-plugins.md +0 -28
- package/.opencode/commands/help-skills.md +0 -7
- package/.opencode/commands/help-tools.md +0 -40
- package/.opencode/commands/help.md +0 -28
- package/.opencode/commands/hotfix-squad.md +0 -112
- package/.opencode/commands/integration-squad.md +0 -82
- package/.opencode/commands/janitor-squad.md +0 -167
- package/.opencode/commands/learn-auto.md +0 -120
- package/.opencode/commands/learn.md +0 -120
- package/.opencode/commands/mcp-list.md +0 -27
- package/.opencode/commands/onboard-squad.md +0 -140
- package/.opencode/commands/plan-workspace.md +0 -732
- package/.opencode/commands/prd.md +0 -131
- package/.opencode/commands/project-status.md +0 -82
- package/.opencode/commands/publish.md +0 -138
- package/.opencode/commands/recap.md +0 -69
- package/.opencode/commands/restore.md +0 -64
- package/.opencode/commands/review-squad.md +0 -152
- package/.opencode/commands/save.md +0 -24
- package/.opencode/commands/stats.md +0 -19
- package/.opencode/commands/swarm.md +0 -210
- package/.opencode/commands/tool-builder.md +0 -39
- package/.opencode/commands/ws-pull.md +0 -44
- package/.opencode/opencode.json +0 -28
- package/SESSION-HANDOFF.md +0 -68
- package/inbox/2026-03-04-bot-config-patterns.md +0 -24
- package/scripts/postinstall.cjs +0 -64
- package/scripts/test-hal-tools.ts +0 -154
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
# Hailer Calendar API
|
|
2
|
-
|
|
3
|
-
Execute Hailer calendar and event operations via REST API.
|
|
4
|
-
|
|
5
|
-
## Base URL
|
|
6
|
-
- **Production:** `https://api.hailer.com/api`
|
|
7
|
-
- **Staging:** `https://api.hailer.biz/api`
|
|
8
|
-
|
|
9
|
-
## Authentication
|
|
10
|
-
All requests require `hlrkey` header with session key.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Calendars
|
|
15
|
-
|
|
16
|
-
### List All Calendars
|
|
17
|
-
```bash
|
|
18
|
-
curl -X POST "https://api.hailer.com/api/calendar/list_all" \
|
|
19
|
-
-H "Content-Type: application/json" \
|
|
20
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
21
|
-
-d '[{}]'
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Create Calendar
|
|
25
|
-
```bash
|
|
26
|
-
curl -X POST "https://api.hailer.com/api/calendar/create_calendar" \
|
|
27
|
-
-H "Content-Type: application/json" \
|
|
28
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
29
|
-
-d '[{"name": "My Calendar", "color": "#3498db", "cid": "WORKSPACE_ID"}]'
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Update Calendar
|
|
33
|
-
```bash
|
|
34
|
-
curl -X POST "https://api.hailer.com/api/calendar/update_calendar" \
|
|
35
|
-
-H "Content-Type: application/json" \
|
|
36
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
37
|
-
-d '[{"_id": "CALENDAR_ID", "name": "Updated Name", "color": "#e74c3c"}]'
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Remove Calendar
|
|
41
|
-
```bash
|
|
42
|
-
curl -X POST "https://api.hailer.com/api/calendar/remove_calendar" \
|
|
43
|
-
-H "Content-Type: application/json" \
|
|
44
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
45
|
-
-d '["CALENDAR_ID"]'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Set Calendar Permissions
|
|
49
|
-
```bash
|
|
50
|
-
curl -X POST "https://api.hailer.com/api/calendar/calendar_permission" \
|
|
51
|
-
-H "Content-Type: application/json" \
|
|
52
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
53
|
-
-d '[{"calendarId": "CALENDAR_ID", "userId": "USER_ID", "permission": "edit"}]'
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Save Selected Calendars (user preference)
|
|
57
|
-
```bash
|
|
58
|
-
curl -X POST "https://api.hailer.com/api/calendar/save_selected_calendars" \
|
|
59
|
-
-H "Content-Type: application/json" \
|
|
60
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
61
|
-
-d '[["CALENDAR_ID_1", "CALENDAR_ID_2"]]'
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Events
|
|
67
|
-
|
|
68
|
-
### Create Event
|
|
69
|
-
```bash
|
|
70
|
-
curl -X POST "https://api.hailer.com/api/calendar/create_event" \
|
|
71
|
-
-H "Content-Type: application/json" \
|
|
72
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
73
|
-
-d '[{
|
|
74
|
-
"calendarId": "CALENDAR_ID",
|
|
75
|
-
"subject": "Team Meeting",
|
|
76
|
-
"description": "Weekly sync",
|
|
77
|
-
"start": 1705400000000,
|
|
78
|
-
"end": 1705403600000,
|
|
79
|
-
"allDay": false,
|
|
80
|
-
"location": "Conference Room A",
|
|
81
|
-
"invites": ["USER_ID_1", "USER_ID_2"]
|
|
82
|
-
}]'
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Update Event
|
|
86
|
-
```bash
|
|
87
|
-
curl -X POST "https://api.hailer.com/api/calendar/update_event" \
|
|
88
|
-
-H "Content-Type: application/json" \
|
|
89
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
90
|
-
-d '[{
|
|
91
|
-
"_id": "EVENT_ID",
|
|
92
|
-
"subject": "Updated Meeting Title",
|
|
93
|
-
"start": 1705410000000,
|
|
94
|
-
"end": 1705413600000
|
|
95
|
-
}]'
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Load Single Event
|
|
99
|
-
```bash
|
|
100
|
-
curl -X POST "https://api.hailer.com/api/calendar/load_event" \
|
|
101
|
-
-H "Content-Type: application/json" \
|
|
102
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
103
|
-
-d '[{"eventId": "EVENT_ID"}]'
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Load Events (date range)
|
|
107
|
-
```bash
|
|
108
|
-
curl -X POST "https://api.hailer.com/api/calendar/load_events" \
|
|
109
|
-
-H "Content-Type: application/json" \
|
|
110
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
111
|
-
-d '[{
|
|
112
|
-
"start": 1704067200000,
|
|
113
|
-
"end": 1706745600000,
|
|
114
|
-
"calendarIds": ["CALENDAR_ID_1", "CALENDAR_ID_2"]
|
|
115
|
-
}]'
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### Remove Event
|
|
119
|
-
```bash
|
|
120
|
-
curl -X POST "https://api.hailer.com/api/calendar/remove_event" \
|
|
121
|
-
-H "Content-Type: application/json" \
|
|
122
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
123
|
-
-d '["EVENT_ID"]'
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### Get Upcoming Events
|
|
127
|
-
```bash
|
|
128
|
-
curl -X POST "https://api.hailer.com/api/calendar/upcoming_events" \
|
|
129
|
-
-H "Content-Type: application/json" \
|
|
130
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
131
|
-
-d '[{"limit": 10}]'
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
## Recurring Events
|
|
137
|
-
|
|
138
|
-
### Load Repeat Series
|
|
139
|
-
```bash
|
|
140
|
-
curl -X POST "https://api.hailer.com/api/calendar/load_repeat_series" \
|
|
141
|
-
-H "Content-Type: application/json" \
|
|
142
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
143
|
-
-d '["SERIES_ID"]'
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Create Recurring Event
|
|
147
|
-
```bash
|
|
148
|
-
curl -X POST "https://api.hailer.com/api/calendar/create_event" \
|
|
149
|
-
-H "Content-Type: application/json" \
|
|
150
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
151
|
-
-d '[{
|
|
152
|
-
"calendarId": "CALENDAR_ID",
|
|
153
|
-
"subject": "Daily Standup",
|
|
154
|
-
"start": 1705395600000,
|
|
155
|
-
"end": 1705396500000,
|
|
156
|
-
"repeat": {
|
|
157
|
-
"frequency": "daily",
|
|
158
|
-
"interval": 1,
|
|
159
|
-
"until": 1707984000000
|
|
160
|
-
}
|
|
161
|
-
}]'
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
Repeat frequency options: `daily`, `weekly`, `monthly`, `yearly`
|
|
165
|
-
|
|
166
|
-
---
|
|
167
|
-
|
|
168
|
-
## Event Invitations
|
|
169
|
-
|
|
170
|
-
### Invite User to Event
|
|
171
|
-
Include `invites` array when creating/updating event:
|
|
172
|
-
```bash
|
|
173
|
-
curl -X POST "https://api.hailer.com/api/calendar/update_event" \
|
|
174
|
-
-H "Content-Type: application/json" \
|
|
175
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
176
|
-
-d '[{
|
|
177
|
-
"_id": "EVENT_ID",
|
|
178
|
-
"invites": ["USER_ID_1", "USER_ID_2", "USER_ID_3"]
|
|
179
|
-
}]'
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Remove Invite
|
|
183
|
-
```bash
|
|
184
|
-
curl -X POST "https://api.hailer.com/api/calendar/remove_invite" \
|
|
185
|
-
-H "Content-Type: application/json" \
|
|
186
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
187
|
-
-d '["EVENT_ID", "USER_ID"]'
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### Respond to Invite
|
|
191
|
-
```bash
|
|
192
|
-
curl -X POST "https://api.hailer.com/api/calendar/invite_respond" \
|
|
193
|
-
-H "Content-Type: application/json" \
|
|
194
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
195
|
-
-d '[{"EVENT_ID": true}]'
|
|
196
|
-
# true = accept, false = decline, null = maybe
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## iCal Integration
|
|
202
|
-
|
|
203
|
-
### Generate iCal Link
|
|
204
|
-
```bash
|
|
205
|
-
curl -X POST "https://api.hailer.com/api/calendar/generate_ical_link" \
|
|
206
|
-
-H "Content-Type: application/json" \
|
|
207
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
208
|
-
-d '["CALENDAR_ID"]'
|
|
209
|
-
```
|
|
210
|
-
Returns a URL that can be subscribed to in external calendar apps.
|
|
211
|
-
|
|
212
|
-
### Remove iCal Link
|
|
213
|
-
```bash
|
|
214
|
-
curl -X POST "https://api.hailer.com/api/calendar/remove_ical_link" \
|
|
215
|
-
-H "Content-Type: application/json" \
|
|
216
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
217
|
-
-d '["CALENDAR_ID", {}]'
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## Event Object Structure
|
|
223
|
-
|
|
224
|
-
```json
|
|
225
|
-
{
|
|
226
|
-
"_id": "event_id",
|
|
227
|
-
"calendarId": "calendar_id",
|
|
228
|
-
"subject": "Meeting Title",
|
|
229
|
-
"description": "Meeting description",
|
|
230
|
-
"start": 1705400000000,
|
|
231
|
-
"end": 1705403600000,
|
|
232
|
-
"allDay": false,
|
|
233
|
-
"location": "Room 101",
|
|
234
|
-
"invites": ["user_id_1", "user_id_2"],
|
|
235
|
-
"responses": {
|
|
236
|
-
"user_id_1": true,
|
|
237
|
-
"user_id_2": null
|
|
238
|
-
},
|
|
239
|
-
"repeat": {
|
|
240
|
-
"frequency": "weekly",
|
|
241
|
-
"interval": 1,
|
|
242
|
-
"until": 1707984000000
|
|
243
|
-
},
|
|
244
|
-
"created": 1705123456789,
|
|
245
|
-
"createdBy": "user_id"
|
|
246
|
-
}
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
---
|
|
250
|
-
|
|
251
|
-
## Notes
|
|
252
|
-
- Timestamps are milliseconds since Unix epoch
|
|
253
|
-
- `allDay: true` events ignore time portion of start/end
|
|
254
|
-
- Each workspace can have multiple calendars
|
|
255
|
-
- Events can be linked to activities via the activity's calendar field
|
|
256
|
-
- Invite responses: `true` = accepted, `false` = declined, `null` = maybe/pending
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
# Hailer Feed (Wall) API
|
|
2
|
-
|
|
3
|
-
Execute Hailer feed/wall post operations via REST API.
|
|
4
|
-
|
|
5
|
-
## Base URL
|
|
6
|
-
- **Production:** `https://api.hailer.com/api`
|
|
7
|
-
- **Staging:** `https://api.hailer.biz/api`
|
|
8
|
-
|
|
9
|
-
## Authentication
|
|
10
|
-
All requests require `hlrkey` header with session key.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Posts
|
|
15
|
-
|
|
16
|
-
### Create New Post
|
|
17
|
-
```bash
|
|
18
|
-
curl -X POST "https://api.hailer.com/api/wall2/new_post" \
|
|
19
|
-
-H "Content-Type: application/json" \
|
|
20
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
21
|
-
-d '[{
|
|
22
|
-
"subject": "Announcement Title",
|
|
23
|
-
"text": "Post content goes here. Supports **markdown**.",
|
|
24
|
-
"files": ["FILE_ID_1", "FILE_ID_2"]
|
|
25
|
-
}]'
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
### Create Post to Specific Target
|
|
29
|
-
```bash
|
|
30
|
-
# Post to team
|
|
31
|
-
curl -X POST "https://api.hailer.com/api/wall2/new_post" \
|
|
32
|
-
-H "Content-Type: application/json" \
|
|
33
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
34
|
-
-d '[
|
|
35
|
-
{"subject": "Team Update", "text": "Content here"},
|
|
36
|
-
{"teamId": "TEAM_ID"}
|
|
37
|
-
]'
|
|
38
|
-
|
|
39
|
-
# Post to workspace
|
|
40
|
-
curl -X POST "https://api.hailer.com/api/wall2/new_post" \
|
|
41
|
-
-H "Content-Type: application/json" \
|
|
42
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
43
|
-
-d '[
|
|
44
|
-
{"subject": "Company Announcement", "text": "Content here"},
|
|
45
|
-
{"networkId": "WORKSPACE_ID"}
|
|
46
|
-
]'
|
|
47
|
-
|
|
48
|
-
# Post to group
|
|
49
|
-
curl -X POST "https://api.hailer.com/api/wall2/new_post" \
|
|
50
|
-
-H "Content-Type: application/json" \
|
|
51
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
52
|
-
-d '[
|
|
53
|
-
{"subject": "Group News", "text": "Content here"},
|
|
54
|
-
{"groupId": "GROUP_ID"}
|
|
55
|
-
]'
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Edit Post
|
|
59
|
-
```bash
|
|
60
|
-
curl -X POST "https://api.hailer.com/api/wall2/edit_post" \
|
|
61
|
-
-H "Content-Type: application/json" \
|
|
62
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
63
|
-
-d '["POST_ID", {
|
|
64
|
-
"subject": "Updated Title",
|
|
65
|
-
"text": "Updated content"
|
|
66
|
-
}]'
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Remove Post
|
|
70
|
-
```bash
|
|
71
|
-
curl -X POST "https://api.hailer.com/api/wall2/remove_post" \
|
|
72
|
-
-H "Content-Type: application/json" \
|
|
73
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
74
|
-
-d '["POST_ID"]'
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Loading Posts
|
|
80
|
-
|
|
81
|
-
### Load Posts (Feed)
|
|
82
|
-
```bash
|
|
83
|
-
curl -X POST "https://api.hailer.com/api/wall2/load_posts" \
|
|
84
|
-
-H "Content-Type: application/json" \
|
|
85
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
86
|
-
-d '[null, {"limit": 20}]'
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
### Load More Posts (Pagination)
|
|
90
|
-
```bash
|
|
91
|
-
curl -X POST "https://api.hailer.com/api/wall2/load_posts" \
|
|
92
|
-
-H "Content-Type: application/json" \
|
|
93
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
94
|
-
-d '["LAST_POST_ID", {"limit": 20}]'
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Comments
|
|
100
|
-
|
|
101
|
-
### Add Comment
|
|
102
|
-
```bash
|
|
103
|
-
curl -X POST "https://api.hailer.com/api/wall2/save_comment" \
|
|
104
|
-
-H "Content-Type: application/json" \
|
|
105
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
106
|
-
-d '[{
|
|
107
|
-
"text": "Great post!",
|
|
108
|
-
"files": []
|
|
109
|
-
}, "POST_ID"]'
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Load Comments
|
|
113
|
-
```bash
|
|
114
|
-
curl -X POST "https://api.hailer.com/api/wall2/load_comments" \
|
|
115
|
-
-H "Content-Type: application/json" \
|
|
116
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
117
|
-
-d '["POST_ID"]'
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### Load More Comments (Pagination)
|
|
121
|
-
```bash
|
|
122
|
-
curl -X POST "https://api.hailer.com/api/wall2/load_comments" \
|
|
123
|
-
-H "Content-Type: application/json" \
|
|
124
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
125
|
-
-d '["POST_ID", "LAST_COMMENT_ID"]'
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Edit Comment
|
|
129
|
-
```bash
|
|
130
|
-
curl -X POST "https://api.hailer.com/api/wall2/edit_comment" \
|
|
131
|
-
-H "Content-Type: application/json" \
|
|
132
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
133
|
-
-d '["POST_ID", "COMMENT_ID", {
|
|
134
|
-
"text": "Updated comment text"
|
|
135
|
-
}]'
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Remove Comment
|
|
139
|
-
```bash
|
|
140
|
-
curl -X POST "https://api.hailer.com/api/wall2/remove_comment" \
|
|
141
|
-
-H "Content-Type: application/json" \
|
|
142
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
143
|
-
-d '["POST_ID", "COMMENT_ID"]'
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Interactions
|
|
149
|
-
|
|
150
|
-
### Like/Unlike Post
|
|
151
|
-
```bash
|
|
152
|
-
curl -X POST "https://api.hailer.com/api/wall2/like_post" \
|
|
153
|
-
-H "Content-Type: application/json" \
|
|
154
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
155
|
-
-d '["POST_ID", {"like": true}]'
|
|
156
|
-
# like: true = like, false = unlike
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Pin/Unpin Post
|
|
160
|
-
```bash
|
|
161
|
-
curl -X POST "https://api.hailer.com/api/wall2/pin_post" \
|
|
162
|
-
-H "Content-Type: application/json" \
|
|
163
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
164
|
-
-d '["POST_ID", true]'
|
|
165
|
-
# true = pin, false = unpin
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Follow Post (get notifications)
|
|
169
|
-
```bash
|
|
170
|
-
curl -X POST "https://api.hailer.com/api/wall2/follow_post" \
|
|
171
|
-
-H "Content-Type: application/json" \
|
|
172
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
173
|
-
-d '["POST_ID"]'
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
### Unfollow Post
|
|
177
|
-
```bash
|
|
178
|
-
curl -X POST "https://api.hailer.com/api/wall2/unfollow_post" \
|
|
179
|
-
-H "Content-Type: application/json" \
|
|
180
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
181
|
-
-d '["POST_ID"]'
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
---
|
|
185
|
-
|
|
186
|
-
## Read Status
|
|
187
|
-
|
|
188
|
-
### Mark Posts as Seen
|
|
189
|
-
```bash
|
|
190
|
-
curl -X POST "https://api.hailer.com/api/wall2/seen" \
|
|
191
|
-
-H "Content-Type: application/json" \
|
|
192
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
193
|
-
-d '[{"postIds": ["POST_ID_1", "POST_ID_2"]}]'
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### Get Unread Posts
|
|
197
|
-
```bash
|
|
198
|
-
curl -X POST "https://api.hailer.com/api/wall2/unread" \
|
|
199
|
-
-H "Content-Type: application/json" \
|
|
200
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
201
|
-
-d '[{}]'
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
## Post Object Structure
|
|
207
|
-
|
|
208
|
-
```json
|
|
209
|
-
{
|
|
210
|
-
"_id": "post_id",
|
|
211
|
-
"subject": "Post Title",
|
|
212
|
-
"text": "Post content with **markdown** support",
|
|
213
|
-
"files": ["file_id_1", "file_id_2"],
|
|
214
|
-
"target": {
|
|
215
|
-
"type": "network",
|
|
216
|
-
"id": "workspace_id"
|
|
217
|
-
},
|
|
218
|
-
"likes": ["user_id_1", "user_id_2"],
|
|
219
|
-
"likeCount": 2,
|
|
220
|
-
"commentCount": 5,
|
|
221
|
-
"pinned": false,
|
|
222
|
-
"created": 1705123456789,
|
|
223
|
-
"createdBy": "user_id",
|
|
224
|
-
"modified": 1705123456789
|
|
225
|
-
}
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
## Comment Object Structure
|
|
229
|
-
|
|
230
|
-
```json
|
|
231
|
-
{
|
|
232
|
-
"_id": "comment_id",
|
|
233
|
-
"postId": "post_id",
|
|
234
|
-
"text": "Comment text",
|
|
235
|
-
"files": [],
|
|
236
|
-
"created": 1705123456789,
|
|
237
|
-
"createdBy": "user_id"
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## Notes
|
|
244
|
-
- Posts support markdown formatting in `text` field
|
|
245
|
-
- Files must be uploaded first via `/upload` endpoint
|
|
246
|
-
- Pinned posts appear at top of feed
|
|
247
|
-
- Following a post triggers notifications for new comments
|
|
248
|
-
- Target types: `user`, `team`, `network` (workspace), `group`
|
|
249
|
-
- Default target is the user's primary workspace feed
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# Hailer Insights API (v3)
|
|
2
|
-
|
|
3
|
-
Execute Hailer insight (SQL views/reports) operations via REST API.
|
|
4
|
-
|
|
5
|
-
## Base URL
|
|
6
|
-
- **Production:** `https://api.hailer.com/api`
|
|
7
|
-
- **Staging:** `https://api.hailer.biz/api`
|
|
8
|
-
|
|
9
|
-
## Authentication
|
|
10
|
-
All requests require `hlrkey` header with session key.
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Insight CRUD
|
|
15
|
-
|
|
16
|
-
### Create Insight
|
|
17
|
-
```bash
|
|
18
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/create" \
|
|
19
|
-
-H "Content-Type: application/json" \
|
|
20
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
21
|
-
-d '["WORKSPACE_ID", {"name": "My Report", "sql": "SELECT * FROM activities WHERE workflow_id = :workflowId"}]'
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Update Insight
|
|
25
|
-
```bash
|
|
26
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/update" \
|
|
27
|
-
-H "Content-Type: application/json" \
|
|
28
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
29
|
-
-d '["INSIGHT_ID", {"name": "Updated Report", "sql": "SELECT name, created FROM activities"}]'
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### List Insights
|
|
33
|
-
```bash
|
|
34
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/list" \
|
|
35
|
-
-H "Content-Type: application/json" \
|
|
36
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
37
|
-
-d '["WORKSPACE_ID"]'
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Copy Insight
|
|
41
|
-
```bash
|
|
42
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/copy" \
|
|
43
|
-
-H "Content-Type: application/json" \
|
|
44
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
45
|
-
-d '["INSIGHT_ID", {"name": "Copy of Report"}]'
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Remove Insight
|
|
49
|
-
```bash
|
|
50
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/remove" \
|
|
51
|
-
-H "Content-Type: application/json" \
|
|
52
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
53
|
-
-d '["INSIGHT_ID"]'
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Execute Insights
|
|
59
|
-
|
|
60
|
-
### Get Insight Data
|
|
61
|
-
```bash
|
|
62
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/data" \
|
|
63
|
-
-H "Content-Type: application/json" \
|
|
64
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
65
|
-
-d '["INSIGHT_ID", {"params": {"workflowId": "WF_ID"}, "limit": 100, "offset": 0}]'
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Preview Insight (test SQL without saving)
|
|
69
|
-
```bash
|
|
70
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/preview" \
|
|
71
|
-
-H "Content-Type: application/json" \
|
|
72
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
73
|
-
-d '["WORKSPACE_ID", {"sql": "SELECT COUNT(*) as total FROM activities", "params": {}}]'
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Public Insights
|
|
79
|
-
|
|
80
|
-
### Get Public Insight Data (no auth required)
|
|
81
|
-
```bash
|
|
82
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/public" \
|
|
83
|
-
-H "Content-Type: application/json" \
|
|
84
|
-
-d '["PUBLIC_INSIGHT_KEY"]'
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Note: Public insights use a special key, not the insight ID. The key is generated when making an insight public.
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Insight Members
|
|
92
|
-
|
|
93
|
-
### Add Member
|
|
94
|
-
```bash
|
|
95
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/member/add" \
|
|
96
|
-
-H "Content-Type: application/json" \
|
|
97
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
98
|
-
-d '["INSIGHT_ID", {"userId": "USER_ID"}]'
|
|
99
|
-
# Also supports: {"teamId": "TEAM_ID"}, {"groupId": "GROUP_ID"}, {"networkId": "WORKSPACE_ID"}
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Remove Member
|
|
103
|
-
```bash
|
|
104
|
-
curl -X POST "https://api.hailer.com/api/v3/insight/member/remove" \
|
|
105
|
-
-H "Content-Type: application/json" \
|
|
106
|
-
-H "hlrkey: YOUR_SESSION_KEY" \
|
|
107
|
-
-d '["INSIGHT_ID", {"userId": "USER_ID"}]'
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## SQL Reference
|
|
113
|
-
|
|
114
|
-
Hailer insights use a SQL-like syntax with these tables:
|
|
115
|
-
|
|
116
|
-
### Available Tables
|
|
117
|
-
- `activities` - All activities (rows) across workflows
|
|
118
|
-
- `workflows` - Workflow definitions
|
|
119
|
-
- `phases` - Phase definitions
|
|
120
|
-
- `users` - Workspace users
|
|
121
|
-
- `teams` - Teams in workspace
|
|
122
|
-
|
|
123
|
-
### Common Columns (activities)
|
|
124
|
-
- `_id` - Activity ID
|
|
125
|
-
- `name` - Activity name
|
|
126
|
-
- `workflow_id` - Parent workflow
|
|
127
|
-
- `phase_id` - Current phase
|
|
128
|
-
- `created` - Creation timestamp
|
|
129
|
-
- `modified` - Last modified timestamp
|
|
130
|
-
- `created_by` - Creator user ID
|
|
131
|
-
- `fields.FIELD_ID` - Custom field values
|
|
132
|
-
|
|
133
|
-
### Example Queries
|
|
134
|
-
|
|
135
|
-
**Count by phase:**
|
|
136
|
-
```sql
|
|
137
|
-
SELECT phase_id, COUNT(*) as count
|
|
138
|
-
FROM activities
|
|
139
|
-
WHERE workflow_id = :workflowId
|
|
140
|
-
GROUP BY phase_id
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
**Recent activities:**
|
|
144
|
-
```sql
|
|
145
|
-
SELECT name, created, phase_id
|
|
146
|
-
FROM activities
|
|
147
|
-
WHERE workflow_id = :workflowId
|
|
148
|
-
ORDER BY created DESC
|
|
149
|
-
LIMIT 10
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
**Activities with field filter:**
|
|
153
|
-
```sql
|
|
154
|
-
SELECT * FROM activities
|
|
155
|
-
WHERE workflow_id = :workflowId
|
|
156
|
-
AND fields.status = 'active'
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
**Join with users:**
|
|
160
|
-
```sql
|
|
161
|
-
SELECT a.name, u.firstname, u.lastname
|
|
162
|
-
FROM activities a
|
|
163
|
-
JOIN users u ON a.created_by = u._id
|
|
164
|
-
WHERE a.workflow_id = :workflowId
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
## Insight Object Structure
|
|
170
|
-
|
|
171
|
-
```json
|
|
172
|
-
{
|
|
173
|
-
"_id": "insight_id",
|
|
174
|
-
"name": "Report Name",
|
|
175
|
-
"sql": "SELECT * FROM activities",
|
|
176
|
-
"cid": "workspace_id",
|
|
177
|
-
"public": false,
|
|
178
|
-
"publicKey": null,
|
|
179
|
-
"members": [
|
|
180
|
-
{"type": "user", "id": "user_id"},
|
|
181
|
-
{"type": "team", "id": "team_id"}
|
|
182
|
-
],
|
|
183
|
-
"created": 1705123456789,
|
|
184
|
-
"modified": 1705123456789
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
## Notes
|
|
191
|
-
- Parameters in SQL use `:paramName` syntax
|
|
192
|
-
- Pass params via options object when calling data endpoint
|
|
193
|
-
- Public insights can be accessed without authentication
|
|
194
|
-
- Insights are scoped to a workspace (networkId/cid)
|
|
195
|
-
- Member types: `user_<id>`, `team_<id>`, `group_<id>`, `network_<id>`
|