d25d482dc2
Publish CLI Package / publish-npm (push) Waiting to run
Publish Python SDK / publish-pypi (push) Waiting to run
Publish TypeScript SDK / publish-npm (push) Waiting to run
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
89 lines
2.4 KiB
TypeScript
89 lines
2.4 KiB
TypeScript
import {
|
|
countGuests,
|
|
type LumaSendInvitesParams,
|
|
type LumaSendInvitesResponse,
|
|
} from '@/tools/luma/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const sendInvitesTool: ToolConfig<LumaSendInvitesParams, LumaSendInvitesResponse> = {
|
|
id: 'luma_send_invites',
|
|
name: 'Luma Send Invites',
|
|
description:
|
|
'Send email invitations to guests for a Luma event. Unlike Add Guests (which registers guests directly), this emails an invite that recipients can accept.',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
apiKey: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-only',
|
|
description: 'Luma API key',
|
|
},
|
|
eventId: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'Event ID to invite guests to (starts with evt-)',
|
|
},
|
|
guests: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description:
|
|
'JSON array of guest objects. Each guest requires an "email" field and optionally "name". Example: [{"email": "user@example.com", "name": "John Doe"}]',
|
|
},
|
|
message: {
|
|
type: 'string',
|
|
required: false,
|
|
visibility: 'user-or-llm',
|
|
description: 'Optional custom message included in the invite email (max 200 characters)',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: 'https://public-api.luma.com/v1/event/send-invites',
|
|
method: 'POST',
|
|
headers: (params) => ({
|
|
'x-luma-api-key': params.apiKey,
|
|
'Content-Type': 'application/json',
|
|
Accept: 'application/json',
|
|
}),
|
|
body: (params) => {
|
|
let guestsArray: unknown[]
|
|
try {
|
|
guestsArray = typeof params.guests === 'string' ? JSON.parse(params.guests) : params.guests
|
|
} catch {
|
|
guestsArray = [{ email: params.guests }]
|
|
}
|
|
const body: Record<string, unknown> = {
|
|
event_id: params.eventId.trim(),
|
|
guests: guestsArray,
|
|
}
|
|
if (params.message) body.message = params.message
|
|
return body
|
|
},
|
|
},
|
|
|
|
transformResponse: async (response: Response, params) => {
|
|
const data = await response.json().catch(() => ({}))
|
|
|
|
if (!response.ok) {
|
|
throw new Error(data.message || data.error || 'Failed to send invites')
|
|
}
|
|
|
|
return {
|
|
success: true,
|
|
output: {
|
|
invited: countGuests(params?.guests ?? ''),
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
invited: {
|
|
type: 'number',
|
|
description: 'Number of guests invited to the event',
|
|
},
|
|
},
|
|
}
|