@heymantle/core-api-client 0.1.20 → 0.1.22

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/dist/index.js CHANGED
@@ -2364,6 +2364,220 @@ var AiAgentRunsResource = class extends BaseResource {
2364
2364
  }
2365
2365
  };
2366
2366
 
2367
+ // src/resources/meetings.ts
2368
+ var MeetingsResource = class extends BaseResource {
2369
+ /**
2370
+ * List meetings with optional filters and pagination
2371
+ *
2372
+ * @param params - Filter and pagination parameters
2373
+ * @returns Paginated list of meetings
2374
+ *
2375
+ * @example
2376
+ * ```typescript
2377
+ * // List all meetings
2378
+ * const { meetings } = await client.meetings.list();
2379
+ *
2380
+ * // List meetings for a specific deal
2381
+ * const { meetings } = await client.meetings.list({ dealId: 'deal_123' });
2382
+ *
2383
+ * // List meetings from Google Meet
2384
+ * const { meetings } = await client.meetings.list({ platform: 'google_meet' });
2385
+ * ```
2386
+ */
2387
+ async list(params) {
2388
+ const response = await this.get("/meetings", params);
2389
+ return {
2390
+ meetings: response.meetings || [],
2391
+ hasNextPage: response.hasNextPage || false,
2392
+ hasPreviousPage: response.hasPreviousPage || false,
2393
+ total: response.total,
2394
+ page: response.page,
2395
+ totalPages: response.totalPages
2396
+ };
2397
+ }
2398
+ /**
2399
+ * Retrieve a single meeting by ID with full transcript and attendee data
2400
+ *
2401
+ * @param meetingId - The meeting ID
2402
+ * @returns The meeting with all related data
2403
+ *
2404
+ * @example
2405
+ * ```typescript
2406
+ * const { meeting } = await client.meetings.retrieve('meeting_123');
2407
+ * console.log(meeting.transcript?.fullText);
2408
+ * ```
2409
+ */
2410
+ async retrieve(meetingId) {
2411
+ return this.get(`/meetings/${meetingId}`);
2412
+ }
2413
+ /**
2414
+ * Create a new meeting
2415
+ *
2416
+ * Typically called when a recording starts in the browser extension.
2417
+ * The meeting can be created with optional transcript and attendee data,
2418
+ * or these can be added later via transcription.
2419
+ *
2420
+ * @param data - Meeting creation parameters
2421
+ * @returns The created meeting
2422
+ *
2423
+ * @example
2424
+ * ```typescript
2425
+ * // Create meeting when recording starts
2426
+ * const meeting = await client.meetings.create({
2427
+ * meetingData: {
2428
+ * platform: 'zoom',
2429
+ * title: 'Weekly Sync',
2430
+ * meetingUrl: 'https://zoom.us/j/123456789',
2431
+ * startTime: new Date().toISOString(),
2432
+ * recordingStatus: 'pending',
2433
+ * }
2434
+ * });
2435
+ *
2436
+ * // Create meeting with transcript (from local transcription)
2437
+ * const meeting = await client.meetings.create({
2438
+ * meetingData: { ... },
2439
+ * transcript: {
2440
+ * fullText: 'Hello, this is the transcript...',
2441
+ * utterances: [
2442
+ * { attendeeId: 'A', text: 'Hello', startTime: 0, endTime: 500 },
2443
+ * ],
2444
+ * },
2445
+ * attendees: [
2446
+ * { externalId: 'A', name: 'John Doe', email: 'john@example.com' },
2447
+ * ],
2448
+ * });
2449
+ * ```
2450
+ */
2451
+ async create(data) {
2452
+ return this.post("/meetings", data);
2453
+ }
2454
+ /**
2455
+ * Update an existing meeting
2456
+ *
2457
+ * @param meetingId - The meeting ID
2458
+ * @param data - Fields to update
2459
+ * @returns The updated meeting
2460
+ *
2461
+ * @example
2462
+ * ```typescript
2463
+ * // Update meeting title and link to a deal
2464
+ * const meeting = await client.meetings.update('meeting_123', {
2465
+ * title: 'Updated Meeting Title',
2466
+ * dealId: 'deal_456',
2467
+ * });
2468
+ * ```
2469
+ */
2470
+ async update(meetingId, data) {
2471
+ return this.put(`/meetings/${meetingId}`, data);
2472
+ }
2473
+ /**
2474
+ * Archive (soft delete) a meeting
2475
+ *
2476
+ * @param meetingId - The meeting ID
2477
+ * @returns Success response
2478
+ *
2479
+ * @example
2480
+ * ```typescript
2481
+ * await client.meetings.del('meeting_123');
2482
+ * ```
2483
+ */
2484
+ async del(meetingId) {
2485
+ return this._delete(`/meetings/${meetingId}`);
2486
+ }
2487
+ /**
2488
+ * Get a signed URL to upload a meeting recording
2489
+ *
2490
+ * Returns a pre-signed S3 URL that can be used to upload the recording
2491
+ * directly from the client. After uploading, call `startTranscription`
2492
+ * to begin server-side transcription.
2493
+ *
2494
+ * @param meetingId - The meeting ID
2495
+ * @param filename - Optional filename (default: "recording.webm")
2496
+ * @returns Upload URL and recording key
2497
+ *
2498
+ * @example
2499
+ * ```typescript
2500
+ * const { uploadUrl, recordingKey } = await client.meetings.getUploadUrl('meeting_123');
2501
+ *
2502
+ * // Upload the recording blob directly to S3
2503
+ * const response = await fetch(uploadUrl, {
2504
+ * method: 'PUT',
2505
+ * body: recordingBlob,
2506
+ * headers: { 'Content-Type': 'audio/webm' },
2507
+ * });
2508
+ *
2509
+ * // Then start transcription
2510
+ * await client.meetings.startTranscription('meeting_123', { recordingKey });
2511
+ * ```
2512
+ */
2513
+ async getUploadUrl(meetingId, filename) {
2514
+ return this.post(
2515
+ `/meetings/${meetingId}/transcribe/upload`,
2516
+ filename ? { filename } : {}
2517
+ );
2518
+ }
2519
+ /**
2520
+ * Start server-side transcription for a meeting
2521
+ *
2522
+ * The recording must first be uploaded using the URL from `getUploadUrl`.
2523
+ * Transcription is processed asynchronously - poll `getTranscriptionStatus`
2524
+ * or retrieve the meeting to check for completion.
2525
+ *
2526
+ * @param meetingId - The meeting ID
2527
+ * @param params - Transcription parameters including the recording key
2528
+ * @returns The meeting with pending transcription status
2529
+ *
2530
+ * @example
2531
+ * ```typescript
2532
+ * // Start transcription after uploading
2533
+ * const meeting = await client.meetings.startTranscription('meeting_123', {
2534
+ * recordingKey: 'meeting-recordings/org-id/meeting-123/uuid/recording.webm',
2535
+ * });
2536
+ *
2537
+ * // meeting.recordingStatus will be 'pending' or 'processing'
2538
+ * ```
2539
+ */
2540
+ async startTranscription(meetingId, params) {
2541
+ return this.post(`/meetings/${meetingId}/transcribe`, params);
2542
+ }
2543
+ /**
2544
+ * Get the current transcription status for a meeting
2545
+ *
2546
+ * Use this to poll for transcription completion after calling
2547
+ * `startTranscription`.
2548
+ *
2549
+ * @param meetingId - The meeting ID
2550
+ * @returns Current transcription status
2551
+ *
2552
+ * @example
2553
+ * ```typescript
2554
+ * // Poll for completion
2555
+ * const poll = async () => {
2556
+ * const status = await client.meetings.getTranscriptionStatus('meeting_123');
2557
+ *
2558
+ * if (status.recordingStatus === 'ready') {
2559
+ * // Transcription complete - fetch the full meeting
2560
+ * const meeting = await client.meetings.retrieve('meeting_123');
2561
+ * return meeting;
2562
+ * }
2563
+ *
2564
+ * if (status.recordingStatus === 'failed') {
2565
+ * throw new Error('Transcription failed');
2566
+ * }
2567
+ *
2568
+ * // Still processing - wait and retry
2569
+ * await new Promise(r => setTimeout(r, 5000));
2570
+ * return poll();
2571
+ * };
2572
+ * ```
2573
+ */
2574
+ async getTranscriptionStatus(meetingId) {
2575
+ return this.get(
2576
+ `/meetings/${meetingId}/transcribe`
2577
+ );
2578
+ }
2579
+ };
2580
+
2367
2581
  // src/client.ts
2368
2582
  var MantleCoreClient = class {
2369
2583
  constructor(config) {
@@ -2422,6 +2636,7 @@ var MantleCoreClient = class {
2422
2636
  this.emailUnsubscribeGroups = new EmailUnsubscribeGroupsResource(this);
2423
2637
  this.flowExtensions = new FlowExtensionsResource(this);
2424
2638
  this.aiAgentRuns = new AiAgentRunsResource(this);
2639
+ this.meetings = new MeetingsResource(this);
2425
2640
  }
2426
2641
  /**
2427
2642
  * Register a middleware function
package/dist/index.mjs CHANGED
@@ -2298,6 +2298,220 @@ var AiAgentRunsResource = class extends BaseResource {
2298
2298
  }
2299
2299
  };
2300
2300
 
2301
+ // src/resources/meetings.ts
2302
+ var MeetingsResource = class extends BaseResource {
2303
+ /**
2304
+ * List meetings with optional filters and pagination
2305
+ *
2306
+ * @param params - Filter and pagination parameters
2307
+ * @returns Paginated list of meetings
2308
+ *
2309
+ * @example
2310
+ * ```typescript
2311
+ * // List all meetings
2312
+ * const { meetings } = await client.meetings.list();
2313
+ *
2314
+ * // List meetings for a specific deal
2315
+ * const { meetings } = await client.meetings.list({ dealId: 'deal_123' });
2316
+ *
2317
+ * // List meetings from Google Meet
2318
+ * const { meetings } = await client.meetings.list({ platform: 'google_meet' });
2319
+ * ```
2320
+ */
2321
+ async list(params) {
2322
+ const response = await this.get("/meetings", params);
2323
+ return {
2324
+ meetings: response.meetings || [],
2325
+ hasNextPage: response.hasNextPage || false,
2326
+ hasPreviousPage: response.hasPreviousPage || false,
2327
+ total: response.total,
2328
+ page: response.page,
2329
+ totalPages: response.totalPages
2330
+ };
2331
+ }
2332
+ /**
2333
+ * Retrieve a single meeting by ID with full transcript and attendee data
2334
+ *
2335
+ * @param meetingId - The meeting ID
2336
+ * @returns The meeting with all related data
2337
+ *
2338
+ * @example
2339
+ * ```typescript
2340
+ * const { meeting } = await client.meetings.retrieve('meeting_123');
2341
+ * console.log(meeting.transcript?.fullText);
2342
+ * ```
2343
+ */
2344
+ async retrieve(meetingId) {
2345
+ return this.get(`/meetings/${meetingId}`);
2346
+ }
2347
+ /**
2348
+ * Create a new meeting
2349
+ *
2350
+ * Typically called when a recording starts in the browser extension.
2351
+ * The meeting can be created with optional transcript and attendee data,
2352
+ * or these can be added later via transcription.
2353
+ *
2354
+ * @param data - Meeting creation parameters
2355
+ * @returns The created meeting
2356
+ *
2357
+ * @example
2358
+ * ```typescript
2359
+ * // Create meeting when recording starts
2360
+ * const meeting = await client.meetings.create({
2361
+ * meetingData: {
2362
+ * platform: 'zoom',
2363
+ * title: 'Weekly Sync',
2364
+ * meetingUrl: 'https://zoom.us/j/123456789',
2365
+ * startTime: new Date().toISOString(),
2366
+ * recordingStatus: 'pending',
2367
+ * }
2368
+ * });
2369
+ *
2370
+ * // Create meeting with transcript (from local transcription)
2371
+ * const meeting = await client.meetings.create({
2372
+ * meetingData: { ... },
2373
+ * transcript: {
2374
+ * fullText: 'Hello, this is the transcript...',
2375
+ * utterances: [
2376
+ * { attendeeId: 'A', text: 'Hello', startTime: 0, endTime: 500 },
2377
+ * ],
2378
+ * },
2379
+ * attendees: [
2380
+ * { externalId: 'A', name: 'John Doe', email: 'john@example.com' },
2381
+ * ],
2382
+ * });
2383
+ * ```
2384
+ */
2385
+ async create(data) {
2386
+ return this.post("/meetings", data);
2387
+ }
2388
+ /**
2389
+ * Update an existing meeting
2390
+ *
2391
+ * @param meetingId - The meeting ID
2392
+ * @param data - Fields to update
2393
+ * @returns The updated meeting
2394
+ *
2395
+ * @example
2396
+ * ```typescript
2397
+ * // Update meeting title and link to a deal
2398
+ * const meeting = await client.meetings.update('meeting_123', {
2399
+ * title: 'Updated Meeting Title',
2400
+ * dealId: 'deal_456',
2401
+ * });
2402
+ * ```
2403
+ */
2404
+ async update(meetingId, data) {
2405
+ return this.put(`/meetings/${meetingId}`, data);
2406
+ }
2407
+ /**
2408
+ * Archive (soft delete) a meeting
2409
+ *
2410
+ * @param meetingId - The meeting ID
2411
+ * @returns Success response
2412
+ *
2413
+ * @example
2414
+ * ```typescript
2415
+ * await client.meetings.del('meeting_123');
2416
+ * ```
2417
+ */
2418
+ async del(meetingId) {
2419
+ return this._delete(`/meetings/${meetingId}`);
2420
+ }
2421
+ /**
2422
+ * Get a signed URL to upload a meeting recording
2423
+ *
2424
+ * Returns a pre-signed S3 URL that can be used to upload the recording
2425
+ * directly from the client. After uploading, call `startTranscription`
2426
+ * to begin server-side transcription.
2427
+ *
2428
+ * @param meetingId - The meeting ID
2429
+ * @param filename - Optional filename (default: "recording.webm")
2430
+ * @returns Upload URL and recording key
2431
+ *
2432
+ * @example
2433
+ * ```typescript
2434
+ * const { uploadUrl, recordingKey } = await client.meetings.getUploadUrl('meeting_123');
2435
+ *
2436
+ * // Upload the recording blob directly to S3
2437
+ * const response = await fetch(uploadUrl, {
2438
+ * method: 'PUT',
2439
+ * body: recordingBlob,
2440
+ * headers: { 'Content-Type': 'audio/webm' },
2441
+ * });
2442
+ *
2443
+ * // Then start transcription
2444
+ * await client.meetings.startTranscription('meeting_123', { recordingKey });
2445
+ * ```
2446
+ */
2447
+ async getUploadUrl(meetingId, filename) {
2448
+ return this.post(
2449
+ `/meetings/${meetingId}/transcribe/upload`,
2450
+ filename ? { filename } : {}
2451
+ );
2452
+ }
2453
+ /**
2454
+ * Start server-side transcription for a meeting
2455
+ *
2456
+ * The recording must first be uploaded using the URL from `getUploadUrl`.
2457
+ * Transcription is processed asynchronously - poll `getTranscriptionStatus`
2458
+ * or retrieve the meeting to check for completion.
2459
+ *
2460
+ * @param meetingId - The meeting ID
2461
+ * @param params - Transcription parameters including the recording key
2462
+ * @returns The meeting with pending transcription status
2463
+ *
2464
+ * @example
2465
+ * ```typescript
2466
+ * // Start transcription after uploading
2467
+ * const meeting = await client.meetings.startTranscription('meeting_123', {
2468
+ * recordingKey: 'meeting-recordings/org-id/meeting-123/uuid/recording.webm',
2469
+ * });
2470
+ *
2471
+ * // meeting.recordingStatus will be 'pending' or 'processing'
2472
+ * ```
2473
+ */
2474
+ async startTranscription(meetingId, params) {
2475
+ return this.post(`/meetings/${meetingId}/transcribe`, params);
2476
+ }
2477
+ /**
2478
+ * Get the current transcription status for a meeting
2479
+ *
2480
+ * Use this to poll for transcription completion after calling
2481
+ * `startTranscription`.
2482
+ *
2483
+ * @param meetingId - The meeting ID
2484
+ * @returns Current transcription status
2485
+ *
2486
+ * @example
2487
+ * ```typescript
2488
+ * // Poll for completion
2489
+ * const poll = async () => {
2490
+ * const status = await client.meetings.getTranscriptionStatus('meeting_123');
2491
+ *
2492
+ * if (status.recordingStatus === 'ready') {
2493
+ * // Transcription complete - fetch the full meeting
2494
+ * const meeting = await client.meetings.retrieve('meeting_123');
2495
+ * return meeting;
2496
+ * }
2497
+ *
2498
+ * if (status.recordingStatus === 'failed') {
2499
+ * throw new Error('Transcription failed');
2500
+ * }
2501
+ *
2502
+ * // Still processing - wait and retry
2503
+ * await new Promise(r => setTimeout(r, 5000));
2504
+ * return poll();
2505
+ * };
2506
+ * ```
2507
+ */
2508
+ async getTranscriptionStatus(meetingId) {
2509
+ return this.get(
2510
+ `/meetings/${meetingId}/transcribe`
2511
+ );
2512
+ }
2513
+ };
2514
+
2301
2515
  // src/client.ts
2302
2516
  var MantleCoreClient = class {
2303
2517
  constructor(config) {
@@ -2356,6 +2570,7 @@ var MantleCoreClient = class {
2356
2570
  this.emailUnsubscribeGroups = new EmailUnsubscribeGroupsResource(this);
2357
2571
  this.flowExtensions = new FlowExtensionsResource(this);
2358
2572
  this.aiAgentRuns = new AiAgentRunsResource(this);
2573
+ this.meetings = new MeetingsResource(this);
2359
2574
  }
2360
2575
  /**
2361
2576
  * Register a middleware function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heymantle/core-api-client",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "description": "TypeScript SDK for the Mantle Core API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",