@yannelli/nextvisit-sdk 1.0.1

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts","../src/http.ts","../src/resources/base.ts","../src/resources/auth.ts","../src/resources/users.ts","../src/resources/patients.ts","../src/resources/progress-notes.ts","../src/resources/billing.ts","../src/resources/transcription.ts","../src/client.ts"],"names":[],"mappings":";AAKO,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,KAAA,CAAM;AAAA,EACxC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,gBAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,eAAA,CAAe,SAAS,CAAA;AAAA,EACtD;AACF;AAKO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,cAAA,CAAe;AAAA,EAMpD,WAAA,CAAY,QAAgB,KAAA,EAAiB;AAC3C,IAAA,KAAA,CAAM,MAAM,OAAO,CAAA;AACnB,IAAA,IAAA,CAAK,IAAA,GAAO,mBAAA;AACZ,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,IAAA,IAAA,CAAK,SAAS,KAAA,CAAM,MAAA;AACpB,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF;AAKO,IAAM,iBAAA,GAAN,MAAM,kBAAA,SAA0B,iBAAA,CAAkB;AAAA,EACvD,YAAY,KAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,KAAK,KAAK,CAAA;AAChB,IAAA,IAAA,CAAK,IAAA,GAAO,mBAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,kBAAA,CAAkB,SAAS,CAAA;AAAA,EACzD;AACF;AAKO,IAAM,cAAA,GAAN,MAAM,eAAA,SAAuB,i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AA,CAAK,IAAI,CAAA;AACxD,IAAA,IAAA,CAAK,QAAA,GAAW,IAAI,gBAAA,CAAiB,IAAA,CAAK,IAAI,CAAA;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,SAAS,KAAA,EAAqB;AAC5B,IAAA,IAAA,CAAK,IAAA,CAAK,SAAS,KAAK,CAAA;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcA,UAAA,GAAmB;AACjB,IAAA,IAAA,CAAK,IAAA,CAAK,SAAS,MAAS,CAAA;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAA,GAAoB;AAClB,IAAA,OAAO,IAAA,CAAK,IAAA,CAAK,QAAA,EAAS,KAAM,MAAA;AAAA,EAClC;AACF","file":"index.mjs","sourcesContent":["import type { ApiError } from \"./types\";\n\n/**\n * Base error class for Nextvisit API errors\n */\nexport class NextvisitError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"NextvisitError\";\n Object.setPrototypeOf(this, NextvisitError.prototype);\n }\n}\n\n/**\n * Error thrown when the API returns an error response\n */\nexport class NextvisitApiError extends NextvisitError {\n /** HTTP status code */\n readonly status: number;\n /** Detailed validation errors by field */\n readonly errors?: Record<string, string[]>;\n\n constructor(status: number, error: ApiError) {\n super(error.message);\n this.name = \"NextvisitApiError\";\n this.status = status;\n this.errors = error.errors;\n Object.setPrototypeOf(this, NextvisitApiError.prototype);\n }\n}\n\n/**\n * Error thrown when authentication fails (401)\n */\nexport class UnauthorizedError extends NextvisitApiError {\n constructor(error: ApiError) {\n super(401, error);\n this.name = \"UnauthorizedError\";\n Object.setPrototypeOf(this, UnauthorizedError.prototype);\n }\n}\n\n/**\n * Error thrown when access is forbidden (403)\n */\nexport class ForbiddenError extends NextvisitApiError {\n constructor(error: ApiError) {\n super(403, error);\n this.name = \"ForbiddenError\";\n Object.setPrototypeOf(this, ForbiddenError.prototype);\n }\n}\n\n/**\n * Error thrown when a resource is not found (404)\n */\nexport class NotFoundError extends NextvisitApiError {\n constructor(error: ApiError) {\n super(404, error);\n this.name = \"NotFoundError\";\n Object.setPrototypeOf(this, NotFoundError.prototype);\n }\n}\n\n/**\n * Error thrown when validation fails (422)\n */\nexport class ValidationError extends NextvisitApiError {\n constructor(error: ApiError) {\n super(422, error);\n this.name = \"ValidationError\";\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\n/**\n * Error thrown when a network request fails\n */\nexport class NetworkError extends NextvisitError {\n readonly cause?: Error;\n\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = \"NetworkError\";\n this.cause = cause;\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n","import type { ApiError } from \"./types\";\nimport {\n NextvisitApiError,\n UnauthorizedError,\n ForbiddenError,\n NotFoundError,\n ValidationError,\n NetworkError,\n} from \"./errors\";\n\n/**\n * HTTP client configuration options\n */\nexport interface HttpClientConfig {\n /** Base URL for API requests */\n baseUrl: string;\n /** Authentication token */\n token?: string;\n /** Custom fetch implementation (for testing or custom environments) */\n fetch?: typeof fetch;\n /** Request timeout in milliseconds */\n timeout?: number;\n}\n\n/**\n * Request options for HTTP methods\n */\nexport interface RequestOptions {\n /** Query parameters */\n params?: Record<string, string | number | boolean | undefined>;\n /** Request headers */\n headers?: Record<string, string>;\n /** Abort signal for request cancellation */\n signal?: AbortSignal;\n}\n\n/**\n * Internal HTTP client for making API requests\n */\nexport class HttpClient {\n private readonly baseUrl: string;\n private token?: string;\n private readonly fetchFn: typeof fetch;\n private readonly timeout: number;\n\n constructor(config: HttpClientConfig) {\n this.baseUrl = config.baseUrl.replace(/\\/$/, \"\");\n this.token = config.token;\n this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);\n this.timeout = config.timeout ?? 30000;\n }\n\n /**\n * Set the authentication token\n */\n setToken(token: string | undefined): void {\n this.token = token;\n }\n\n /**\n * Get the current authentication token\n */\n getToken(): string | undefined {\n return this.token;\n }\n\n /**\n * Build URL with query parameters\n */\n private buildUrl(path: string, params?: RequestOptions[\"params\"]): string {\n const url = new URL(`${this.baseUrl}${path}`);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n return url.toString();\n }\n\n /**\n * Build request headers\n */\n private buildHeaders(\n options?: RequestOptions,\n contentType?: string\n ): Record<string, string> {\n const headers: Record<string, string> = {\n Accept: \"application/json\",\n ...options?.headers,\n };\n\n if (contentType) {\n headers[\"Content-Type\"] = contentType;\n }\n\n if (this.token) {\n headers[\"Authorization\"] = `Bearer ${this.token}`;\n }\n\n return headers;\n }\n\n /**\n * Handle API error responses\n */\n private async handleError(response: Response): Promise<never> {\n let error: ApiError;\n\n try {\n error = (await response.json()) as ApiError;\n } catch {\n error = { message: response.statusText || \"Unknown error\" };\n }\n\n switch (response.status) {\n case 401:\n throw new UnauthorizedError(error);\n case 403:\n throw new ForbiddenError(error);\n case 404:\n throw new NotFoundError(error);\n case 422:\n throw new ValidationError(error);\n default:\n throw new NextvisitApiError(response.status, error);\n }\n }\n\n /**\n * Execute a fetch request with timeout\n */\n private async executeFetch(\n url: string,\n init: RequestInit,\n signal?: AbortSignal\n ): Promise<Response> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n const combinedSignal = signal\n ? AbortSignal.any([signal, controller.signal])\n : controller.signal;\n\n try {\n const response = await this.fetchFn(url, {\n ...init,\n signal: combinedSignal,\n });\n clearTimeout(timeoutId);\n return response;\n } catch (err) {\n clearTimeout(timeoutId);\n if (err instanceof Error) {\n if (err.name === \"AbortError\") {\n throw new NetworkError(\"Request was aborted or timed out\", err);\n }\n throw new NetworkError(`Network request failed: ${err.message}`, err);\n }\n throw new NetworkError(\"Network request failed\");\n }\n }\n\n /**\n * Make a GET request\n */\n async get<T>(path: string, options?: RequestOptions): Promise<T> {\n const url = this.buildUrl(path, options?.params);\n const headers = this.buildHeaders(options);\n\n const response = await this.executeFetch(\n url,\n { method: \"GET\", headers },\n options?.signal\n );\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Make a POST request with JSON body\n */\n async post<T>(\n path: string,\n body?: unknown,\n options?: RequestOptions\n ): Promise<T> {\n const url = this.buildUrl(path, options?.params);\n const headers = this.buildHeaders(options, \"application/json\");\n\n const response = await this.executeFetch(\n url,\n {\n method: \"POST\",\n headers,\n body: body ? JSON.stringify(body) : undefined,\n },\n options?.signal\n );\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Make a POST request with FormData body (for file uploads)\n */\n async postForm<T>(\n path: string,\n formData: FormData,\n options?: RequestOptions\n ): Promise<T> {\n const url = this.buildUrl(path, options?.params);\n // Don't set Content-Type for FormData - browser will set it with boundary\n const headers = this.buildHeaders(options);\n\n const response = await this.executeFetch(\n url,\n {\n method: \"POST\",\n headers,\n body: formData,\n },\n options?.signal\n );\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Make a PUT request with JSON body\n */\n async put<T>(\n path: string,\n body?: unknown,\n options?: RequestOptions\n ): Promise<T> {\n const url = this.buildUrl(path, options?.params);\n const headers = this.buildHeaders(options, \"application/json\");\n\n const response = await this.executeFetch(\n url,\n {\n method: \"PUT\",\n headers,\n body: body ? JSON.stringify(body) : undefined,\n },\n options?.signal\n );\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n }\n\n /**\n * Make a DELETE request\n */\n async delete<T>(path: string, options?: RequestOptions): Promise<T> {\n const url = this.buildUrl(path, options?.params);\n const headers = this.buildHeaders(options);\n\n const response = await this.executeFetch(\n url,\n { method: \"DELETE\", headers },\n options?.signal\n );\n\n if (!response.ok) {\n await this.handleError(response);\n }\n\n return (await response.json()) as T;\n }\n}\n","import type { HttpClient } from \"../http\";\n\n/**\n * Base class for API resources\n */\nexport abstract class BaseResource {\n protected readonly http: HttpClient;\n\n constructor(http: HttpClient) {\n this.http = http;\n }\n}\n","import { BaseResource } from \"./base\";\nimport type {\n LoginRequest,\n TokenResponse,\n RevokeTokenResponse,\n TokensListResponse,\n GoogleAuthRequest,\n GoogleAuthResponse,\n} from \"../types\";\n\n/**\n * Authentication resource for managing access tokens\n */\nexport class AuthResource extends BaseResource {\n /**\n * Create a new access token (login)\n *\n * Authenticates a user with email and password, returning an access token\n * that can be used for subsequent API requests.\n *\n * @param credentials - Login credentials\n * @returns Token response with access token and user info\n *\n * @example\n * ```typescript\n * const response = await client.auth.createToken({\n * email: \"user@example.com\",\n * password: \"password123\",\n * device_name: \"My App\"\n * });\n *\n * console.log(response.token); // Use this token for authentication\n * ```\n */\n async createToken(credentials: LoginRequest): Promise<TokenResponse> {\n return this.http.post<TokenResponse>(\"/v1/auth/tokens\", credentials);\n }\n\n /**\n * Authenticate with Google Sign-In\n *\n * Authenticates a user using a Google ID token obtained from Google Sign-In SDK.\n * Supports tokens from web applications, Chrome extensions, iOS apps, and Android apps.\n * If the user doesn't exist, a new account is automatically created.\n *\n * @param params - Google authentication parameters\n * @returns Authentication response with access token and user info\n *\n * @example\n * ```typescript\n * // Web application\n * const response = await client.auth.googleAuth({\n * id_token: \"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...\",\n * device_name: \"Web Browser\"\n * });\n *\n * if (response.is_new_user) {\n * console.log(\"Welcome! Your account has been created.\");\n * }\n *\n * // Use response.token for subsequent requests\n * client.setToken(response.token);\n * ```\n */\n async googleAuth(params: GoogleAuthRequest): Promise<GoogleAuthResponse> {\n return this.http.post<GoogleAuthResponse>(\"/v1/auth/google\", params);\n }\n\n /**\n * Revoke the current access token (logout)\n *\n * Invalidates the current authentication token. After calling this method,\n * the token can no longer be used for API requests.\n *\n * @returns Confirmation message\n *\n * @example\n * ```typescript\n * await client.auth.revokeCurrentToken();\n * // Token is now invalid\n * ```\n */\n async revokeCurrentToken(): Promise<RevokeTokenResponse> {\n return this.http.delete<RevokeTokenResponse>(\"/v1/auth/tokens/current\");\n }\n\n /**\n * List all tokens for the authenticated user\n *\n * Returns a list of all active tokens associated with the current user,\n * including information about when each token was created and last used.\n *\n * @returns List of tokens\n *\n * @example\n * ```typescript\n * const response = await client.auth.listTokens();\n *\n * for (const token of response.tokens) {\n * console.log(`${token.name} - Created: ${token.created_at}`);\n * }\n * ```\n */\n async listTokens(): Promise<TokensListResponse> {\n return this.http.get<TokensListResponse>(\"/v1/auth/tokens\");\n }\n\n /**\n * Revoke a specific token by ID\n *\n * Invalidates a specific token by its ID. This can be used to revoke\n * tokens on other devices or applications.\n *\n * @param id - The unique identifier of the token to revoke\n * @returns Confirmation message\n *\n * @example\n * ```typescript\n * // List tokens and revoke a specific one\n * const { tokens } = await client.auth.listTokens();\n * const oldToken = tokens.find(t => t.name === \"Old Device\");\n *\n * if (oldToken) {\n * await client.auth.revokeToken(oldToken.id);\n * console.log(\"Token revoked\");\n * }\n * ```\n */\n async revokeToken(id: number): Promise<RevokeTokenResponse> {\n return this.http.delete<RevokeTokenResponse>(`/v1/auth/tokens/${id}`);\n }\n}\n","import { BaseResource } from \"./base\";\nimport type { User } from \"../types\";\n\n/**\n * Users resource for managing user accounts\n */\nexport class UsersResource extends BaseResource {\n /**\n * Get the currently authenticated user\n *\n * Retrieves the full profile of the user associated with the current\n * authentication token.\n *\n * @returns The authenticated user's details\n *\n * @example\n * ```typescript\n * const user = await client.users.getCurrentUser();\n * console.log(`Logged in as ${user.name} (${user.email})`);\n * ```\n */\n async getCurrentUser(): Promise<User> {\n return this.http.get<User>(\"/user\");\n }\n}\n","import { BaseResource } from \"./base\";\nimport type {\n PatientFull,\n PatientResponse,\n ListPatientsParams,\n CreatePatientParams,\n UpdatePatientParams,\n SearchPatientsParams,\n PaginatedResponse,\n MessageResponse,\n} from \"../types\";\n\n/**\n * Patients resource for managing patient records\n */\nexport class PatientsResource extends BaseResource {\n /**\n * List patients\n *\n * Returns a paginated list of patients with optional filtering\n * and customizable pagination/sorting.\n *\n * @param params - Optional filtering and pagination parameters\n * @returns Paginated list of patients\n *\n * @example\n * ```typescript\n * // Get all patients\n * const patients = await client.patients.list();\n *\n * // Filter and sort patients\n * const filtered = await client.patients.list({\n * \"filter[last_name]\": \"Smith\",\n * sort: \"-created_at\",\n * per_page: 25\n * });\n *\n * // Include soft-deleted patients\n * const withTrashed = await client.patients.list({\n * \"filter[trashed]\": \"with\"\n * });\n * ```\n */\n async list(\n params?: ListPatientsParams\n ): Promise<PaginatedResponse<PatientFull>> {\n return this.http.get<PaginatedResponse<PatientFull>>(\"/v1/patients\", {\n params: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Get a specific patient\n *\n * Retrieves detailed information about a single patient by their ID.\n *\n * @param id - The patient ID\n * @returns The patient details wrapped in a response object\n *\n * @example\n * ```typescript\n * const response = await client.patients.get(123);\n * console.log(response.data.first_name);\n * console.log(response.data.date_of_birth);\n * ```\n */\n async get(id: number): Promise<PatientResponse> {\n return this.http.get<PatientResponse>(`/v1/patients/${id}`);\n }\n\n /**\n * Create a new patient\n *\n * Creates a new patient record with the provided information.\n *\n * @param params - The patient data\n * @returns The created patient wrapped in a response object\n *\n * @example\n * ```typescript\n * const response = await client.patients.create({\n * first_name: \"John\",\n * last_name: \"Doe\",\n * date_of_birth: \"1990-05-15\",\n * notes: \"New patient referral\",\n * allergies: \"Penicillin\"\n * });\n *\n * console.log(response.data.id);\n * ```\n */\n async create(params: CreatePatientParams): Promise<PatientResponse> {\n return this.http.post<PatientResponse>(\"/v1/patients\", params);\n }\n\n /**\n * Update a patient\n *\n * Updates an existing patient's information.\n *\n * @param id - The patient ID\n * @param params - The fields to update\n * @returns The updated patient wrapped in a response object\n *\n * @example\n * ```typescript\n * const response = await client.patients.update(123, {\n * first_name: \"Jonathan\",\n * notes: \"Updated contact information\"\n * });\n *\n * console.log(response.data.first_name); // \"Jonathan\"\n * ```\n */\n async update(\n id: number,\n params: UpdatePatientParams\n ): Promise<PatientResponse> {\n return this.http.put<PatientResponse>(`/v1/patients/${id}`, params);\n }\n\n /**\n * Delete a patient (soft delete)\n *\n * Soft deletes a patient record. The patient can be restored or\n * permanently deleted later. Use the trashed filter to view deleted patients.\n *\n * @param id - The patient ID\n * @returns Confirmation message\n *\n * @example\n * ```typescript\n * await client.patients.delete(123);\n * console.log(\"Patient soft deleted successfully\");\n *\n * // View deleted patients\n * const deleted = await client.patients.list({\n * \"filter[trashed]\": \"only\"\n * });\n * ```\n */\n async delete(id: number): Promise<MessageResponse> {\n return this.http.delete<MessageResponse>(`/v1/patients/${id}`);\n }\n\n /**\n * Search patients\n *\n * Searches for patients matching the query string within the authenticated\n * user's current team.\n *\n * @param params - Search parameters including query string\n * @returns Paginated list of matching patients\n *\n * @example\n * ```typescript\n * // Search for patients by name\n * const results = await client.patients.search({\n * query: \"John\",\n * per_page: 10,\n * sort_by: \"desc\"\n * });\n *\n * console.log(`Found ${results.meta.total} patients`);\n * results.data.forEach(patient => {\n * console.log(`${patient.first_name} ${patient.last_name}`);\n * });\n * ```\n */\n async search(\n params: SearchPatientsParams\n ): Promise<PaginatedResponse<PatientFull>> {\n return this.http.get<PaginatedResponse<PatientFull>>(\n `/v1/patients/search`,\n {\n params: params as unknown as Record<\n string,\n string | number | boolean | undefined\n >,\n }\n );\n }\n}\n","import { BaseResource } from \"./base\";\nimport type {\n ProgressNote,\n ListProgressNotesParams,\n CreateProgressNoteParams,\n CreateProgressNoteWithFileParams,\n CreateProgressNoteTextParams,\n UpdateProgressNoteParams,\n PaginatedResponse,\n MessageResponse,\n AudioUrlResponse,\n} from \"../types\";\n\n/**\n * Progress Notes resource for managing clinical documentation\n */\nexport class ProgressNotesResource extends BaseResource {\n /**\n * List progress notes\n *\n * Returns a paginated list of progress notes with optional filtering\n * by patient and customizable pagination/sorting.\n *\n * @param params - Optional filtering and pagination parameters\n * @returns Paginated list of progress notes\n *\n * @example\n * ```typescript\n * // Get latest notes\n * const notes = await client.progressNotes.list();\n *\n * // Filter by patient\n * const patientNotes = await client.progressNotes.list({\n * patient_id: 123,\n * per_page: 25,\n * sort_by: \"oldest\"\n * });\n * ```\n */\n async list(\n params?: ListProgressNotesParams\n ): Promise<PaginatedResponse<ProgressNote>> {\n return this.http.get<PaginatedResponse<ProgressNote>>(\"/v1/progress-notes\", {\n params: params as Record<string, string | number | boolean | undefined>,\n });\n }\n\n /**\n * Get a specific progress note\n *\n * Retrieves detailed information about a single progress note by its ID.\n *\n * @param id - The progress note ID\n * @returns The progress note details\n *\n * @example\n * ```typescript\n * const note = await client.progressNotes.get(123);\n * console.log(note.name);\n * console.log(note.transcription);\n * ```\n */\n async get(id: number): Promise<ProgressNote> {\n return this.http.get<ProgressNote>(`/v1/progress-notes/${id}`);\n }\n\n /**\n * Get audio URL for a progress note\n *\n * Retrieves a temporary URL to access the audio file associated with\n * a progress note. The URL is time-limited and will expire.\n *\n * @param id - The progress note ID\n * @returns Object containing the temporary audio URL\n *\n * @example\n * ```typescript\n * const response = await client.progressNotes.getAudioUrl(123);\n * console.log(response.url); // Temporary URL to audio file\n * ```\n */\n async getAudioUrl(id: number): Promise<AudioUrlResponse> {\n return this.http.get<AudioUrlResponse>(`/v1/progress-notes/${id}/audio-url`);\n }\n\n /**\n * Create a new progress note\n *\n * Creates a new progress note with either an audio file or text content.\n * For audio files, the audio will be transcribed and analyzed asynchronously.\n * For text-only notes, provide the note content directly.\n *\n * @param params - The progress note data (audio file or text-only)\n * @returns The created progress note\n *\n * @example\n * ```typescript\n * // With audio file\n * const audioFile = new File([audioBlob], \"recording.mp3\", {\n * type: \"audio/mpeg\"\n * });\n *\n * const note = await client.progressNotes.create({\n * name: \"Follow-up Visit - John Doe\",\n * patient_id: 456,\n * file: audioFile,\n * model_id: 1 // Optional template\n * });\n *\n * // Text-only note\n * const textNote = await client.progressNotes.create({\n * name: \"Patient Consultation\",\n * note: \"Patient presented with symptoms of...\",\n * model_id: 1,\n * patient_id: 456\n * });\n * ```\n */\n async create(params: CreateProgressNoteParams): Promise<ProgressNote> {\n const formData = new FormData();\n formData.append(\"name\", params.name);\n\n if (params.patient_id !== undefined) {\n formData.append(\"patient_id\", String(params.patient_id));\n }\n\n if (params.context !== undefined) {\n formData.append(\"context\", params.context);\n }\n\n // Check if this is a file upload or text-only note\n if (\"file\" in params) {\n // Audio file variant\n const fileParams = params as CreateProgressNoteWithFileParams;\n formData.append(\"file\", fileParams.file);\n\n if (fileParams.model_id !== undefined) {\n formData.append(\"model_id\", String(fileParams.model_id));\n }\n } else {\n // Text-only variant\n const textParams = params as CreateProgressNoteTextParams;\n formData.append(\"note\", textParams.note);\n formData.append(\"model_id\", String(textParams.model_id));\n\n if (textParams.documents !== undefined && textParams.documents.length > 0) {\n for (const docId of textParams.documents) {\n formData.append(\"documents[]\", String(docId));\n }\n }\n }\n\n return this.http.postForm<ProgressNote>(\"/v1/progress-notes\", formData);\n }\n\n /**\n * Update a progress note\n *\n * Updates an existing progress note's metadata, transcription, or analysis.\n *\n * @param id - The progress note ID\n * @param params - The fields to update\n * @returns The updated progress note\n *\n * @example\n * ```typescript\n * const updated = await client.progressNotes.update(123, {\n * name: \"Updated Visit Name\",\n * transcription: \"Corrected transcription text...\"\n * });\n * ```\n */\n async update(\n id: number,\n params: UpdateProgressNoteParams\n ): Promise<ProgressNote> {\n return this.http.put<ProgressNote>(`/v1/progress-notes/${id}`, params);\n }\n\n /**\n * Delete a progress note\n *\n * Permanently deletes a progress note and its associated audio files.\n * This action cannot be undone.\n *\n * @param id - The progress note ID\n * @returns Confirmation message\n *\n * @example\n * ```typescript\n * await client.progressNotes.delete(123);\n * console.log(\"Note deleted successfully\");\n * ```\n */\n async delete(id: number): Promise<MessageResponse> {\n return this.http.delete<MessageResponse>(`/v1/progress-notes/${id}`);\n }\n\n /**\n * Sign a progress note\n *\n * Marks a progress note as reviewed and signed. A note can only be signed\n * after transcription and analysis have been completed.\n *\n * @param id - The progress note ID\n * @returns The signed progress note\n *\n * @example\n * ```typescript\n * const signedNote = await client.progressNotes.sign(123);\n * console.log(signedNote.has?.signed); // true\n * ```\n */\n async sign(id: number): Promise<ProgressNote> {\n return this.http.put<ProgressNote>(`/v1/progress-notes/${id}/sign`);\n }\n}\n","import { BaseResource } from \"./base\";\nimport type {\n BillingPlansResponse,\n BillingEstimate,\n BillingUsage,\n} from \"../types\";\n\n/**\n * Billing resource for managing subscription and usage\n */\nexport class BillingResource extends BaseResource {\n /**\n * List available billing plans\n *\n * Retrieves all available billing plans that can be subscribed to,\n * including pricing information and features.\n *\n * @returns List of available billing plans\n *\n * @example\n * ```typescript\n * const response = await client.billing.listPlans();\n *\n * for (const plan of response.plans) {\n * console.log(`${plan.name}: ${plan.price_prefix}${plan.price}${plan.price_suffix}`);\n * if (plan.features) {\n * plan.features.forEach(feature => console.log(` - ${feature}`));\n * }\n * }\n * ```\n */\n async listPlans(): Promise<BillingPlansResponse> {\n return this.http.get<BillingPlansResponse>(\"/v1/billing/plans\");\n }\n\n /**\n * Get billing cost estimate\n *\n * Calculates the estimated billing cost based on the current number\n * of users in the team and any child teams.\n *\n * @returns Billing cost estimate with user count and formatted total\n *\n * @example\n * ```typescript\n * const estimate = await client.billing.getEstimate();\n *\n * console.log(`Users: ${estimate.users}`);\n * console.log(`Estimated cost: ${estimate.total_formatted}`);\n * console.log(`Next renewal: ${estimate.renewal_date}`);\n * ```\n */\n async getEstimate(): Promise<BillingEstimate> {\n return this.http.get<BillingEstimate>(\"/v1/billing/estimate\");\n }\n\n /**\n * Get billing usage statistics\n *\n * Retrieves usage statistics for a specific billing module, including\n * the current subscription plan status and detailed usage metrics.\n *\n * @param module - The billing module to get usage for (e.g., 'notes')\n * @returns Billing usage with plan status and usage statistics\n *\n * @example\n * ```typescript\n * const usage = await client.billing.getUsage(\"notes\");\n *\n * console.log(`Plan: ${usage.plan.name} (${usage.plan.status})`);\n * console.log(`Usage: ${usage.usage.used} / ${usage.usage.limit}`);\n * console.log(`Period: ${usage.usage.period_start} to ${usage.usage.period_end}`);\n *\n * if (usage.plan.trial.on_trial) {\n * console.log(`Trial ends: ${usage.plan.trial.trial_ends_at}`);\n * }\n * ```\n */\n async getUsage(module: string): Promise<BillingUsage> {\n return this.http.get<BillingUsage>(`/v1/billing/usage/${module}`);\n }\n}\n","import { BaseResource } from \"./base\";\nimport type {\n TranscriptionResponse,\n TranscriptionTokenResponse,\n TranscribeFileParams,\n} from \"../types\";\n\n/**\n * Transcription resource for audio transcription services\n */\nexport class TranscriptionResource extends BaseResource {\n /**\n * Transcribe an audio file\n *\n * Uploads an audio file and returns the transcribed text using AI-powered speech recognition.\n * Supported formats: mp3, mp4, m4a, wav, ogg, webm, flac, aac, pcm, opus\n * Maximum file size: 200MB\n *\n * @param params - The transcription parameters including the audio file\n * @returns Transcription response with the transcribed text\n *\n * @example\n * ```typescript\n * // Transcribe an audio file from a file input\n * const fileInput = document.querySelector('input[type=\"file\"]');\n * const file = fileInput.files[0];\n *\n * const response = await client.transcription.transcribeFile({ file });\n *\n * if (response.success) {\n * console.log(response.text); // The transcribed text\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Transcribe a Blob from recorded audio\n * const audioBlob = new Blob(audioChunks, { type: 'audio/webm' });\n *\n * const response = await client.transcription.transcribeFile({\n * file: audioBlob\n * });\n *\n * console.log(response.message); // Status message\n * ```\n */\n async transcribeFile(\n params: TranscribeFileParams\n ): Promise<TranscriptionResponse> {\n const formData = new FormData();\n formData.append(\"file\", params.file);\n return this.http.postForm<TranscriptionResponse>(\n \"/v1/transcribe/file\",\n formData\n );\n }\n\n /**\n * Get a temporary transcription token\n *\n * Returns a temporary Deepgram API token for client-side audio transcription.\n * The token is short-lived and should be used immediately.\n *\n * @returns Token response with the temporary API token\n *\n * @example\n * ```typescript\n * const response = await client.transcription.getToken();\n *\n * if (response.success && response.token) {\n * // Use the token for client-side Deepgram SDK\n * const deepgram = createClient(response.token);\n * }\n * ```\n */\n async getToken(): Promise<TranscriptionTokenResponse> {\n return this.http.get<TranscriptionTokenResponse>(\"/v1/transcribe/token\");\n }\n}\n","import { HttpClient, type HttpClientConfig } from \"./http\";\nimport {\n AuthResource,\n UsersResource,\n ProgressNotesResource,\n BillingResource,\n TranscriptionResource,\n PatientsResource,\n} from \"./resources\";\n\n/**\n * Default production API base URL\n */\nexport const DEFAULT_BASE_URL = \"https://nextvisit.app/api\";\n\n/**\n * Configuration options for the Nextvisit client\n */\nexport interface NextvisitClientConfig {\n /**\n * Authentication token for API requests\n *\n * Can be obtained by calling `client.auth.createToken()` or from\n * a previously stored token.\n */\n token?: string;\n\n /**\n * Base URL for API requests\n *\n * Defaults to the production API (https://nextvisit.app/api).\n * Use \"http://localhost/api\" for local development.\n */\n baseUrl?: string;\n\n /**\n * Custom fetch implementation\n *\n * Useful for testing or custom HTTP handling. If not provided,\n * the global `fetch` function will be used.\n */\n fetch?: typeof fetch;\n\n /**\n * Request timeout in milliseconds\n *\n * Defaults to 30000 (30 seconds).\n */\n timeout?: number;\n}\n\n/**\n * Nextvisit API client\n *\n * The main entry point for interacting with the Nextvisit Clinical\n * Documentation API. Provides access to all API resources through\n * typed, promise-based methods.\n *\n * @example\n * ```typescript\n * import { NextvisitClient } from \"@yannelli/nextvisit-sdk\";\n *\n * // Create a client with an existing token\n * const client = new NextvisitClient({\n * token: \"nv-sk-...\"\n * });\n *\n * // Or authenticate to get a token\n * const client = new NextvisitClient();\n * const { token } = await client.auth.createToken({\n * email: \"user@example.com\",\n * password: \"password\",\n * device_name: \"My App\"\n * });\n * client.setToken(token);\n *\n * // Use the API\n * const user = await client.users.getCurrentUser();\n * const notes = await client.progressNotes.list();\n * ```\n */\nexport class NextvisitClient {\n private readonly http: HttpClient;\n\n /**\n * Authentication resource for managing access tokens\n */\n readonly auth: AuthResource;\n\n /**\n * Users resource for managing user accounts\n */\n readonly users: UsersResource;\n\n /**\n * Progress Notes resource for managing clinical documentation\n */\n readonly progressNotes: ProgressNotesResource;\n\n /**\n * Billing resource for managing subscription and usage\n */\n readonly billing: BillingResource;\n\n /**\n * Transcription resource for audio transcription services\n */\n readonly transcription: TranscriptionResource;\n\n /**\n * Patients resource for managing patient records\n */\n readonly patients: PatientsResource;\n\n /**\n * Create a new Nextvisit API client\n *\n * @param config - Client configuration options\n */\n constructor(config: NextvisitClientConfig = {}) {\n const httpConfig: HttpClientConfig = {\n baseUrl: config.baseUrl ?? DEFAULT_BASE_URL,\n token: config.token,\n fetch: config.fetch,\n timeout: config.timeout,\n };\n\n this.http = new HttpClient(httpConfig);\n\n // Initialize resources\n this.auth = new AuthResource(this.http);\n this.users = new UsersResource(this.http);\n this.progressNotes = new ProgressNotesResource(this.http);\n this.billing = new BillingResource(this.http);\n this.transcription = new TranscriptionResource(this.http);\n this.patients = new PatientsResource(this.http);\n }\n\n /**\n * Set the authentication token\n *\n * Updates the token used for API requests. Call this after\n * authenticating with `auth.createToken()`.\n *\n * @param token - The authentication token\n *\n * @example\n * ```typescript\n * const { token } = await client.auth.createToken(credentials);\n * client.setToken(token);\n * ```\n */\n setToken(token: string): void {\n this.http.setToken(token);\n }\n\n /**\n * Clear the authentication token\n *\n * Removes the current token. Subsequent requests will be\n * unauthenticated.\n *\n * @example\n * ```typescript\n * await client.auth.revokeCurrentToken();\n * client.clearToken();\n * ```\n */\n clearToken(): void {\n this.http.setToken(undefined);\n }\n\n /**\n * Check if the client has an authentication token set\n *\n * @returns `true` if a token is set, `false` otherwise\n */\n hasToken(): boolean {\n return this.http.getToken() !== undefined;\n }\n}\n"]}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@yannelli/nextvisit-sdk",
3
+ "version": "1.0.1",
4
+ "description": "Official JavaScript/TypeScript SDK for the Nextvisit AI Clinical Documentation API",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "scripts": {
19
+ "build": "tsup",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
22
+ "test:coverage": "vitest run --coverage",
23
+ "lint": "eslint src --ext .ts",
24
+ "typecheck": "tsc --noEmit",
25
+ "prepublishOnly": "npm run build"
26
+ },
27
+ "keywords": [
28
+ "nextvisit",
29
+ "api",
30
+ "clinical",
31
+ "documentation",
32
+ "healthcare",
33
+ "medical",
34
+ "progress-notes",
35
+ "transcription"
36
+ ],
37
+ "author": "Ryan Yannelli // Nextvisit AI Inc.",
38
+ "license": "MIT",
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "https://github.com/yannelli/nextvisit-sdk.git"
45
+ },
46
+ "bugs": {
47
+ "url": "https://github.com/yannelli/nextvisit-sdk/issues"
48
+ },
49
+ "homepage": "https://docs.nextvisitai.com",
50
+ "engines": {
51
+ "node": ">=18.0.0"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^20.10.0",
55
+ "tsup": "^8.0.0",
56
+ "typescript": "^5.3.0",
57
+ "vitest": "^4.0.17"
58
+ }
59
+ }