/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { createRecordingDownload } from "../funcs/createRecordingDownload.js"; import { createWebhook } from "../funcs/createWebhook.js"; import { deleteWebhook } from "../funcs/deleteWebhook.js"; import { getRecordingDownload } from "../funcs/getRecordingDownload.js"; import { getRecordingSummary } from "../funcs/getRecordingSummary.js"; import { getRecordingTranscript } from "../funcs/getRecordingTranscript.js"; import { listMeetings } from "../funcs/listMeetings.js"; import { listMeetingTypes } from "../funcs/listMeetingTypes.js"; import { listTeamMembers } from "../funcs/listTeamMembers.js"; import { listTeams } from "../funcs/listTeams.js"; import { listUsers } from "../funcs/listUsers.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { PageIterator, unwrapResultIterator } from "../sdk/types/operations.js"; import * as operations from "./models/operations/index.js"; import * as shared from "./models/shared/index.js"; import { unwrapAsync } from "./types/fp.js"; // #region imports import { Webhook, WebhookRequiredHeaders, WebhookUnbrandedRequiredHeaders, } from "svix"; import { getAuthorizationUrl, GetAuthorizationUrlRequest, } from "../funcs/getAuthorizationUrl.js"; import { InMemoryTokenStore, TokenStore, withAuthorization, } from "../funcs/withAuthorization.js"; // #endregion imports export class Fathom extends ClientSDK { // #region sdk-class-body static newTokenStore(): TokenStore { return new InMemoryTokenStore(); } static getAuthorizationUrl( request: GetAuthorizationUrlRequest, ): string { return getAuthorizationUrl( request, ); } static withAuthorization( { clientId, clientSecret, code, redirectUri, tokenStore }: { clientId: string; clientSecret: string; code: string; redirectUri: string; tokenStore: TokenStore; }, ) { return withAuthorization({ clientId, clientSecret, code, redirectUri, tokenStore, }); } static verifyWebhook( webhookSecret: string, headers: | WebhookRequiredHeaders | WebhookUnbrandedRequiredHeaders | Record, payload: string | Buffer, ): unknown { const wh = new Webhook(webhookSecret); return wh.verify(payload, headers); } // #endregion sdk-class-body /** * List meetings */ async listMeetings( request?: operations.ListMeetingsRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(listMeetings( this, request, options, )); } /** * Get summary * * @remarks * This endpoint has two behaviors depending on your request payload: * - If you send `destination_url`, the endpoint will behave in an asynchronous manner. * - If you do not send `destination_url`, the endpoint will return the data directly. */ async getRecordingSummary( request: operations.GetRecordingSummaryRequest, options?: RequestOptions, ): Promise { return unwrapAsync(getRecordingSummary( this, request, options, )); } /** * Get transcript * * @remarks * This endpoint has two behaviors depending on your request payload: * - If you send `destination_url`, the endpoint will behave in an asynchronous manner. * - If you do not send `destination_url`, the endpoint will return the data directly. */ async getRecordingTranscript( request: operations.GetRecordingTranscriptRequest, options?: RequestOptions, ): Promise { return unwrapAsync(getRecordingTranscript( this, request, options, )); } /** * Request a download * * @remarks * Starts asynchronous generation of a downloadable file for the recording and returns a * `download_id` to poll. Video recordings are generated in the background; audio-only * recordings complete immediately, so the response may already carry `status: completed` * with the file payload. * * Downloads are private to the API client that created them, and their URLs expire * roughly 24 hours after generation - request a new download when one expires. * * Downloading requires more access than viewing: the recording's owner, teammates who * can view the recording, and people it was shared with at standard or admin level can * download it. Limited-access shares receive `403 Forbidden`. * * Receive the result either by polling the download status endpoint, or by sending * `destination_url` - when the download completes, Fathom POSTs the same payload the * status endpoint returns to it, signed like our webhooks. */ async createRecordingDownload( request: operations.CreateRecordingDownloadRequest, options?: RequestOptions, ): Promise { return unwrapAsync(createRecordingDownload( this, request, options, )); } /** * Get download status * * @remarks * Returns the status of a download created with the request-a-download endpoint. When the * download is completed, the payload carries a short-lived signed URL for the generated * file. Only the API client that created the download can read it. */ async getRecordingDownload( request: operations.GetRecordingDownloadRequest, options?: RequestOptions, ): Promise { return unwrapAsync(getRecordingDownload( this, request, options, )); } /** * List teams */ async listTeams( request?: operations.ListTeamsRequest | undefined, options?: RequestOptions, ): Promise> { return unwrapResultIterator(listTeams( this, request, options, )); } /** * List team members */ async listTeamMembers( request?: operations.ListTeamMembersRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(listTeamMembers( this, request, options, )); } /** * List users and their permissions * * @remarks * List every user in the account along with their permissions. Restricted to account admins: if the API key does not belong to a user whose `settings_access` level is `account_admin`, this endpoint returns `403 Forbidden`. * * By default the list contains active and deactivated members followed by pending invitees — keep following `next_cursor` to page through all of them. Use `status` to narrow to one group. Invited users have no permissions yet, so their items omit the `permissions` object and `created_at` is the date they were invited. */ async listUsers( request?: operations.ListUsersRequest | undefined, options?: RequestOptions, ): Promise> { return unwrapResultIterator(listUsers( this, request, options, )); } /** * List meeting types * * @remarks * List your team's published meeting types (both `active` and `inactive`). Draft meeting types, which are not yet fully created and never appear on meetings, are excluded. Use the returned `name` values to filter /meetings via its meeting_type parameter. */ async listMeetingTypes( request?: operations.ListMeetingTypesRequest | undefined, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(listMeetingTypes( this, request, options, )); } /** * Create a webhook * * @remarks * Create a webhook to receive new meeting content. * At least one of `include_transcript`, `include_crm_matches`, `include_summary`, or `include_action_items` must be true. */ async createWebhook( request: operations.CreateWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(createWebhook( this, request, options, )); } /** * Delete a webhook * * @remarks * Delete a webhook. */ async deleteWebhook( request: operations.DeleteWebhookRequest, options?: RequestOptions, ): Promise { return unwrapAsync(deleteWebhook( this, request, options, )); } }