MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / mapUser

Method mapUser

server/src/db/slack-db.ts:112–136  ·  view source on GitHub ↗

* Map a Slack user to a WorkOS user

(input: {
    slack_user_id: string;
    workos_user_id: string;
    mapping_source: SlackMappingSource;
    mapped_by_user_id?: string;
  })

Source from the content-addressed store, hash-verified

110 * Map a Slack user to a WorkOS user
111 */
112 async mapUser(input: {
113 slack_user_id: string;
114 workos_user_id: string;
115 mapping_source: SlackMappingSource;
116 mapped_by_user_id?: string;
117 }): Promise<SlackUserMapping | null> {
118 const result = await query<SlackUserMapping>(
119 `UPDATE slack_user_mappings
120 SET workos_user_id = $1,
121 mapping_status = 'mapped',
122 mapping_source = $2,
123 mapped_at = NOW(),
124 mapped_by_user_id = $3,
125 updated_at = NOW()
126 WHERE slack_user_id = $4
127 RETURNING *`,
128 [
129 input.workos_user_id,
130 input.mapping_source,
131 input.mapped_by_user_id || null,
132 input.slack_user_id,
133 ]
134 );
135 return result.rows[0] || null;
136 }
137
138 /**
139 * Unmap a Slack user from a WorkOS user

Callers 5

setupAuthRoutesMethod · 0.95
createAdminSlackRouterFunction · 0.80
tryAutoMapByEmailFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected