import { Activity } from "../models/activity"; import { Biometrics } from "../models/biometrics"; import { Body } from "../models/body"; import { ConnectedUserInfo } from "../models/common/connected-user-info"; import { ProviderSource } from "../models/common/provider-source"; import { Nutrition } from "../models/nutrition"; import { Sleep } from "../models/sleep"; import { User } from "../models/user"; import { SettingsResponse } from "./models/settings-response"; import { WebhookStatusResponse } from "./models/webhook-status-response"; export type Options = { sandbox?: boolean; timeout?: number; baseAddress?: string; }; export declare class MetriportDevicesApi { private api; /** * Creates a new instance of the Metriport Devices API client. * * @param apiKey - Your Metriport API key. * @param options - Optional parameters * @param options.sandbox - Indicates whether to connect to the sandbox, default false. * @param options.timeout - Connection timeout in milliseconds, default 20 seconds. */ constructor(apiKey: string, options?: Options); /** * For your given user ID, returns the Metriport user ID used for identifying * the user and making subsequent calls for the user's data. * * @param {string} appUserId - The unique ID for the user in your app. * @returns The userId of the user. */ getMetriportUserId(appUserId: string): Promise; /** * For your given user ID, returns the user's connected providers * * @param {string} userId - The unique ID for the user in your app. * @returns Object containing array of connected providers. */ getConnectedProviders(userId: string): Promise<{ connectedProviders: string[]; }>; /** * Returns all your users and their connected providers. * * @returns List of connected users, containing their ids and providers. */ getConnectedUsers(): Promise<{ connectedUsers: ConnectedUserInfo[]; }>; /** * For the given user ID, get a token to be used for a Metriport Connect session. * * @param {string} userId - The user ID of the user that will be using the Connect widget. * @returns The Metriport Connect session token. */ getConnectToken(userId: string): Promise; /** * For the given user ID, revokes the user's access to the specified provider. * * @param {string} userId - The user ID of the user for which to revoke access. * @param {ProviderSource} provider - The data provider to revoke access to. * @returns void. */ revokeUserAccessToProvider(userId: string, provider: ProviderSource): Promise; /** * For the given user ID, revokes access tokens for all providers and deletes the user. * * @param {string} userId - The user ID of the user to be deleted. * @returns void. */ deleteUser(userId: string): Promise; /** * Connects the user to a remote patient monitoring (RPM) device provider. * * @param {string} provider - A healthcare data provider (currently only includes `tenovi`). * @param {string} token - The connect token that was generated by the getConnectToken method. * @param {string[]} deviceIds - A list of device IDs to connect to the user. * @param {string} deviceUserId - The user ID (patient ID, for Tenovi) of the user that is connected to the device. */ connectRpmProvider(provider: ProviderSource.tenovi, token: string, deviceIds: string[], deviceUserId: string): Promise; /** * Disconnects a single RPM device from the user. * @param userId - The Metriport user ID of the user to disconnect the given device from. * @param provider - The RPM device provider (currently only includes `tenovi`). * @param deviceId - The HWI ID of the device to be disconnected. * @param x_tenovi_api_key - Your Tenovi API key. * @param x_tenovi_client_name - Your Tenovi Client name. */ disconnectDevice(userId: string, provider: ProviderSource.tenovi, deviceId: string, x_tenovi_api_key: string, x_tenovi_client_name: string): Promise; /** * Gets the activity info for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of activity data from each connected provider. */ getActivityData(userId: string, date: string, timezoneId?: string): Promise; /** * Gets the body data for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of body data from each connected provider. */ getBodyData(userId: string, date: string, timezoneId?: string): Promise; /** * Gets the biometrics data for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of biometrics data from each connected provider. */ getBiometricsData(userId: string, date: string, timezoneId?: string): Promise; /** * Gets the nutrition data for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of nutrition data from each connected provider. */ getNutritionData(userId: string, date: string, timezoneId?: string): Promise; /** * Gets the sleep data for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of sleep data from each connected provider. */ getSleepData(userId: string, date: string, timezoneId?: string): Promise; /** * Gets the user info for the specified user ID and date. * * @param {string} userId - The userId of the user you want to get data for. * @param {string} date - The date you want to get the data for (YYYY-MM-DD). * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns An array of user data from each connected provider. */ getUserData(userId: string, date: string, timezoneId?: string): Promise; /** * If the userId is empty or the date is not in the correct format, throw an error. Otherwise, return * an object with the userId and date. * * @param {string} userId - The userId of the user you want to get the data for. * @param {string} date - The date to get the user's data for. * @param {string} timezoneId - The timezoneId to get the user's data for (for example: America/Los_Angeles). * @returns an object with the userId and date properties. */ private validateAndBuildParams; /** * Gets the settings for your account. * * @returns Your account settings. */ getSettings(): Promise; /** * Update the settings for your account. * * @returns Your updated account settings. */ updateSettings(webhookUrl: string): Promise; /** * Gets the status of communication with your app's webhook. * * @returns The status of communication with your app's webhook. */ getWebhookStatus(): Promise; /** * Retries failed webhook requests. * * @returns void */ retryWebhookRequests(): Promise; } //# sourceMappingURL=metriport.d.ts.map