UNPKG

@nuralogix.ai/dfx-api-client

Version:

DeepAffex API JavaScript Client Library

1,775 lines (1,756 loc) 116 kB
/** * HTTP request methods. * * HTTP defines a set of request methods to indicate the desired action to be * performed for a given resource. Although they can also be nouns, these * request methods are sometimes referred as HTTP verbs. Each of them implements * a different semantic, but some common features are shared by a group of them: * e.g. a request method can be safe, idempotent, or cacheable. * * @public */ declare enum HTTPMethod { /** * The `DELETE` method deletes the specified resource. */ DELETE = "DELETE", /** * The `GET` method requests a representation of the specified resource. * Requests using GET should only retrieve data. */ GET = "GET", /** * The PATCH method is used to apply partial modifications to a resource. */ PATCH = "PATCH", /** * The `POST` method is used to submit an entity to the specified resource, * often causing a change in state or side effects on the server. */ POST = "POST", /** * The `PUT` method replaces all current representations of the target * resource with the request payload. */ PUT = "PUT", /** * The CONNECT method starts two-way communications with the requested * resource. It can be used to open a tunnel. */ CONNECT = "CONNECT" } /** * 200 - 299 */ declare enum HttpSuccessfulResponseStatus { OK = "200" } /** @internal */ type HttpSuccessfulResponseStatusCodes = `${HttpSuccessfulResponseStatus}`; /** * 300 - 399 */ declare enum HttpRedirectionResponseStatus { NotModified = "304" } /** @internal */ type HttpRedirectionResponseStatusCodes = `${HttpRedirectionResponseStatus}`; /** * 400 - 499 */ declare enum HttpClientResponseStatus { BadRequest = "400", Unauthorized = "401", Forbidden = "403", NotFound = "404", NotAcceptable = "406", RequestTimeout = "408", TooManyRequests = "429" } /** @internal */ type HttpClientResponseStatusCodes = `${HttpClientResponseStatus}`; /** * 500 - 599 */ declare enum HttpServerResponseStatus { InternalServerError = "500", BadGateway = "502", ServiceUnavailable = "503", GatewayTimeout = "504" } /** @internal */ type HttpServerResponseStatusCodes = `${HttpServerResponseStatus}`; declare enum FetchErrors { UNSUPPORTED_RESPONSE_CONTENT_TYPE = "UNSUPPORTED_RESPONSE_CONTENT_TYPE", UNEXPECTED_ERROR = "UNEXPECTED_ERROR", SYNTAX_ERROR = "SYNTAX_ERROR", UNKNOWN = "UNKNOWN" } /** @internal */ type FetchErrorsCodes = `${FetchErrors}`; declare enum OnBeforeRESTCallErrors { ON_BEFORE_REST_CALL_ERROR = "ON_BEFORE_REST_CALL_ERROR" } /** @internal */ type OnBeforeRESTCallErrorCodes = `${OnBeforeRESTCallErrors}`; type HeadersObject = { [key: string]: string; }; interface IBeforeRESTCallError { Code: OnBeforeRESTCallErrorCodes; Message: OnBeforeRESTCallErrorCodes; } interface IBeforeRESTCallSuccess { Code: 'SUCCESS'; Message: 'SUCCESS'; } declare abstract class Main { protected parent: IClient; /** @internal */ constructor(parent: IClient); protected onBeforeRESTCall(): Promise<IBeforeRESTCallError | IBeforeRESTCallSuccess>; protected getDefaults(method: HTTPMethod): { baseUrl: string; method: HTTPMethod; headers: Headers; }; protected getHeaderWithDeviceToken(): Headers; protected getHeaderWithUserToken(): Headers; protected getHeaderWithSessionEnabled(): Headers; } /** * Base shape for a Response. This interface is extended * to provide the specific shape for the responses * of each resource+verb. */ interface Response { status: string; body?: unknown; headers: Headers | HeadersObject; } interface HttpError { Code: string; Message: string; } /** @noInheritDoc */ interface HttpErrorResponse extends Response { status: HttpClientResponseStatusCodes | HttpServerResponseStatusCodes; body: HttpError; } interface FetchError { Code: FetchErrorsCodes; Message: FetchErrorsCodes; } /** @noInheritDoc */ interface FetchErrorResponse extends Response { status: FetchErrorsCodes; body: FetchError; } interface OnBeforeRESTCallError { Code: OnBeforeRESTCallErrorCodes; Message: OnBeforeRESTCallErrorCodes; } /** @noInheritDoc */ interface OnBeforeRESTCallErrorResponse extends Response { status: OnBeforeRESTCallErrorCodes; body: OnBeforeRESTCallError; } type ErrorResponse = HttpErrorResponse | FetchErrorResponse | OnBeforeRESTCallErrorResponse; /** * Reset password link */ interface AuthResetPasswordLink { success: boolean; } /** @noInheritDoc */ interface AuthResetPasswordLink200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Reset password link response */ body: AuthResetPasswordLink; } /** * Login code sent */ interface AuthLoginCodeSent { success: boolean; } /** @noInheritDoc */ interface AuthLoginCodeSent200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Login code sent response */ body: AuthLoginCodeSent; } /** * Renew token */ interface AuthRenewToken { Token: string; RefreshToken: string; } /** @noInheritDoc */ interface AuthRenewToken200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Renew token response */ body: AuthRenewToken; } interface AuthSendResetMobile { success: boolean; } /** @noInheritDoc */ interface AuthSendResetMobile200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Send reset mobile response */ body: AuthSendResetMobile; } interface AuthGetOrgClientCredentials { orgName: string; logoURL: string; userPoolId: string; nativeAuthEnabled: boolean; cognitoDomainUrl: string; identityProviders: Array<{ iconURL: string; displayName: string; identityProviderName: string; }>; } /** @noInheritDoc */ interface AuthGetOrgClientCredentials200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: AuthGetOrgClientCredentials; } /** * Authenticate */ interface AuthAuthenticate { OrganizationID: string; ID: string; Type: string; SessionGen: number; Region: string; exp: number; iat: number; iss: string; RoleID: string; Policies: { LoginUser: boolean; }; Permissions: object; } /** @noInheritDoc */ interface AuthAuthenticate200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Authenticate body response */ body: AuthAuthenticate; } /** * Validate */ interface AuthValidate { OrganizationID: string; ID: string; Type: string; SessionGen: number; Region: string; exp: number; iat: number; iss: string; RoleID: string; Policies: { LoginUser: boolean; }; Permissions: object; } /** @noInheritDoc */ interface AuthValidate200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Validate body response */ body: AuthValidate; } /** * SSO Token */ interface AuthSSOToken { idToken: string; accessToken: string; refreshToken: string; expiresIn: number; tokenType: string; } /** @noInheritDoc */ interface AuthSSOToken200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * SSO Token body response */ body: AuthSSOToken; } /** * Auth generate token */ interface AuthGenerateToken { Token: string; } /** @noInheritDoc */ interface AuthGenerateToken200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Generate Token body response */ body: AuthGenerateToken; } /** * Reset password link request */ interface AuthResetPasswordLinkRequest { Email: string; /** organization_identifier */ Identifier: string; } /** * Login code request */ interface AuthLoginCodeRequest { PhoneNumber: string; /** organization_identifier */ Identifier: string; } /** * Renew token request */ interface AuthRenewTokenRequest { Token: string; RefreshToken: string; } interface AuthSendResetMobileRequest { Email?: string; PhoneNumber?: string; } /** * SSO Token request */ interface AuthSSOTokenRequest { redirectURL: string; orgIdentifier: string; /** AWS code */ code: string; } interface AuthGenerateTokenRequest { Token: string; RefreshToken: string; } /** * Auths end points * * These endpoints provide user/device authentication. */ declare class Auths extends Main { /** * Request to send password reset link to user's email. * * Endpoint Action ID = 2300 */ requestResetPasswordLink(data: AuthResetPasswordLinkRequest): Promise<AuthResetPasswordLink200Response | ErrorResponse>; /** * Request to send password reset link to user's email. * * Edpoint Action ID = 2302 */ sendResetMobile(data: AuthSendResetMobileRequest): Promise<AuthSendResetMobile200Response | ErrorResponse>; /** * Request to send login code. * * Endpoint Action ID = 2303 */ requestLoginCode(data: AuthLoginCodeRequest): Promise<AuthLoginCodeSent200Response | ErrorResponse>; /** * Renew user/device access and refresh token. When you register a license or login with * user's credentials, a pair of Token and RefreshToken is sent to a client. The client * needs to send the matching pair to exchange it with a new pair. The old pair will not * be valid after calling this endpoint. RefreshToken is one-time use. * * Endpoint Action ID = 2304 */ renew(data: AuthRenewTokenRequest, tokenType: 'device' | 'user'): Promise<AuthRenewToken200Response | ErrorResponse>; /** * Generates a general token. * * Endpoint Action ID = 2305 */ generateToken(data: AuthGenerateTokenRequest): Promise<AuthGenerateToken200Response | ErrorResponse>; /** * Returns organization client credentials. * * Endpoint Action ID = 2306 */ getOrgClientCredentials(orgId: string): Promise<AuthGetOrgClientCredentials200Response | ErrorResponse>; /** * Validates a token passed as a authentication header and returns the decoded token with permissions. * * Endpoint Action ID = unknown at this time */ authenticate(): Promise<AuthAuthenticate200Response | ErrorResponse>; /** * Validates a token passed as a authentication header and returns the decoded token with permissions. * * Endpoint Action ID = unknown at this time */ validate(): Promise<AuthValidate200Response | ErrorResponse>; /** * Exchange Cognito code for Cognito Access token and Refresh token * * Endpoint Action ID = unknown at this time */ ssoToken(data: AuthSSOTokenRequest): Promise<AuthSSOToken200Response | ErrorResponse>; } type DeviceTypeIDStrings = keyof typeof DeviceTypeID; /** * Status response */ interface OrgRegisterLicenseRequest { /** * IPHONE = All iPhone devices * * IPAD = All generations of iPad devices * * DARWIN = Desktop MacOS based systems * * ANDROID_PHONE = All Android based phone devices * * WINDOWS = Desktop Windows64 based systems * * WIN32 = Desktop Windows32 based systems * * WINDOWS_TABLET = Windows-based tablet devices * * LINUX = Linux based devices * * DEBIAN = Debian based devices */ DeviceTypeID: DeviceTypeIDStrings; /** License key */ Key: string; Name: string; Identifier: string; Version: string; TokenExpiresIn?: number; TokenSubject?: string; } interface OrgUsersRequest { /** filter by user's Status. */ statusId: string | null; /** filter by user's email */ userName: string | null; /** filter by user's Role. */ roleId: string | null; /** filter by user's gender. */ gender: string | null; /** Account creation start date in the format YYYY-MM-DD */ date: string | null; /** Account creation end date in the format YYYY-MM-DD. */ endDate: string | null; /** default limit: 25 */ limit: string | null; /** default offset: 0 */ offset: string | null; } interface OrgMeasurementsRequest { /** filter by measurement Status ID. */ statusId: string | null; /** filter by a Profile ID. */ userProfileID: string | null; /** filter by a Profile name */ userProfileName: string | null; /** filter by studyID */ studyID: string | null; /** filter by user email. */ userName: string | null; /** The date to return measurements for yyyy-mm-dd. */ date: string | null; /** End date for range of measurements to receive. */ endDate: string | null; /** default limit: 50 */ limit: string | null; /** default offset: 0 */ offset: string | null; /** filter by a Device ID. */ deviceID: string | null; /** filter by a partner ID. */ partnerId: string | null; /** filter by mode. */ mode: string | null; sortBy: string | null; sortOrder: string | null; region: string | null; } interface OrgListProfileRequest { /** filter by profile StatusID. */ statusId?: string; /** Profile owner's email to filter by. Example: john@doe.com. */ ownerUser?: string; /** Profile's name to filter by. Example: john@doe.com */ userProfileName?: string; /** filter by creation date. */ created?: string; /** filter by date. */ date?: string; /** filter by end date */ endDate?: string; /** default limit: 25 */ limit?: string; /** default offset: 0 */ offset?: string; } interface OrgCreateUserRequest { FirstName: string; LastName: string; Email: string; Gender: string; DateOfBirth: string; RoleID: string; Password: string; organizationConfigLinkID?: string; expireAt?: string; } interface OrgUpdateUserRequest { FirstName: string; LastName: string; Gender: string; DateOfBirth: string; HeightCm: string; WeightKg: string; } interface OrgUpdateProfileRequest { Name: string; Email: string; Status: string; } interface OrgLoginRequest { Email: string; Password: string; Identifier: string; MFAToken?: number; TokenExpiresIn?: number; RefreshTokenExpiresIn?: number; } interface OrgContactUserRequest { Email: string; Type: string; } /** * Device type */ interface DeviceType { ID: string; Name: string; Description: string; IsMobile: boolean; IsTablet: boolean; IsDesktop: boolean; } /** @noInheritDoc */ interface DeviceTypes200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Device type response */ body: DeviceType[]; } /** * Device retrieve */ interface DeviceRetrieve { Name: string; DeviceTypeID: DeviceTypeIDStrings; StatusID: string; Identifier: string; Version: string; Created: number; Updated: number; count: string; Region: string; } /** @noInheritDoc */ interface DeviceRetrieve200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Device retrieve response */ body: DeviceRetrieve; } /** * Device created */ interface DeviceCreated { ID: string; } /** @noInheritDoc */ interface DeviceCreated200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Device created response */ body: DeviceCreated; } /** @noInheritDoc */ interface DeviceUpdated200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** @noInheritDoc */ interface DeviceDeleted200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** * Device list */ interface Device { ID: string; Name: string; DeviceTypeID: DeviceTypeIDStrings; StatusID: string; Identifier: string; Version: string; Measurements: number; LicenseID: string; Region: string; Created: number; Updated: number; TotalCount: number; } /** @noInheritDoc */ interface DeviceList200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * List of existing devices in an organization */ body: Device[]; } /** @noInheritDoc */ interface DeviceDeleteMeasurements200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** * Device license */ interface DeviceLicense { ID: string; LicenseType: string; StatusID: string; Expiration: number; MaxDevices: number; } /** @noInheritDoc */ interface DeviceRetrieveLicenseId200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Device retrieve license ID response */ body: DeviceLicense; } /** * Device create request */ interface DeviceCreateRequest { Name: string; DeviceTypeID: DeviceTypeIDStrings; Identifier: string; Version: string; } /** * Device update request */ interface DeviceUpdateRequest { Name: string; DeviceTypeID: DeviceTypeIDStrings; Status: string; Identifier: string; Version: string; } /** * Device list request */ interface DeviceListRequest { statusId: string | null; unique: string | null; deviceTypeID: DeviceTypeIDStrings | null; name: string | null; version: string | null; date: string | null; endDate: string | null; limit: string | null; offset: string | null; licenseID: string | null; } /** * Devices end points * * Devices can be used to record the platform by which a measurement * captured was conducted on. The DeviceTypeID references a pre-defined * set of devices with the following chart. New Device Types cannot be * created by organizations and are managed by the API specifically. * Devices types can be retrieved from a dedicated endpoint returning * all their values and meanings. */ declare class Devices extends Main { /** * Retrieves a list of allowed device types. * * Endpoint Action ID = 900 */ types(): Promise<DeviceTypes200Response | ErrorResponse>; /** * Retrieves a single reference to a device. The body response includes details * about the device and the number of measurements that have been associated with it. * * Endpoint Action ID = 902 */ retrieve(id: string): Promise<DeviceRetrieve200Response | ErrorResponse>; /** * Creates a new device reference to associate with measurements. * Each device is mapped to a device type ID. * * Endpoint Action ID = 903 */ create(data: DeviceCreateRequest): Promise<DeviceCreated200Response | ErrorResponse>; /** * Updates a device reference via the UUID supplied. * * Endpoint Action ID = 904 */ update(id: string, data: DeviceUpdateRequest): Promise<DeviceUpdated200Response | ErrorResponse>; /** * Deletes a device from the dataset. * * Endpoint Action ID = 905 */ remove(id: string): Promise<DeviceDeleted200Response | ErrorResponse>; /** * Retrieves a list of existing devices in an organization. * * Endpoint Action ID = 906 */ list(data?: DeviceListRequest): Promise<DeviceList200Response | ErrorResponse>; /** * Only DFX_ORG_ADMIN has permission to delete all measurements of a * specific device for their own organization. * * Endpoint Action ID = 907 */ deleteDeviceMeasurement(id: string): Promise<DeviceDeleteMeasurements200Response | ErrorResponse>; /** * We want to extend the EP to use deviceID (instead of {ID}) in the device token * to extract license information and return to client. * * Endpoint Action ID = 908 */ retrieveLicenseId(): Promise<DeviceRetrieveLicenseId200Response | ErrorResponse>; } interface ConsentObj { description: string; data_controller: { company: string; contact: string; email: string; }; purposes: { authorized: boolean; purpose: string; description: string; }[]; policy_url: string; policy_version: string; collection_mode: string; } /** * Enum for possible Status ID codes * @readonly * @enum {string} */ declare enum StatusID { ACTIVE = "ACTIVE", MAINTENANCE = "MAINTENANCE", ERROR = "ERROR", LATENCY = "LATENCY" } type GeneralStatusIDStrings = keyof typeof StatusID; /** * Server Status response */ interface GeneralServerStatus { /** * ACTIVE = Online and fully operational * * MAINTENANCE = Offline for maintenance * * ERROR = Offline due to an error * * LATENCY = API is experience latency or a general slowdown */ StatusID: GeneralStatusIDStrings; /** API version */ Version: string; /** the location of the API by cluster */ Region: string; /** when false means that user login (and thus a user token) is required for making measurements. */ AllowAnonymous: boolean; } /** * Mime type */ interface GeneralMIMEType { /** GUID */ ID: string; Mime: string; Name: string; } interface GeneralVerifyToken { ActiveLicense: boolean; DeviceID: string; ID: string; OrganizationID: string; Region: string; RemainingMeasurement: number | null; RoleID: string; SessionGen: number; Type: string; exp: number; iat: number; iss: string; } interface GeneralRegions { 'as-east': 'AS East'; 'as-hk': 'AS Hong Kong'; 'cn-north': 'cn-north-1'; 'cn-west': 'cn-northwest-1'; 'eu-central': 'EU Central'; 'na-east': 'NA East'; 'sa-east': 'SA East'; } /** * Available Status */ interface GeneralStatus { Description: string; ID: string; Name: string; } /** * Available Roles */ interface GeneralRoles { Description: string; ID: string; Name: string; } /** @noInheritDoc */ interface GeneralServerStatus200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Server Status */ body: GeneralServerStatus; } /** @noInheritDoc */ interface GeneralListAcceptedMIMETypes200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * List accepted Mime types */ body: GeneralMIMEType[]; } /** @noInheritDoc */ interface GeneralVerifyToken200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Verify token */ body: GeneralVerifyToken; } /** @noInheritDoc */ interface GeneralRegions200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Regions */ body: GeneralRegions; } /** @noInheritDoc */ interface GeneralListAvailableStatuses200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * List Available Statuses */ body: GeneralStatus[]; } /** @noInheritDoc */ interface GeneralListAvailableRoles200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * List Available roles */ body: GeneralRoles[]; } interface RolesInteractionTree { rolesKeysArray: string[]; roleNames: object; rolesNamesAsSelectInput: Array<{ id: string; name: string; }>; rolesCanChangeSelfRole: Record<string, string[]>; rolesCanCreate: Record<string, string[]>; rolesCanDelete: Record<string, string[]>; rolesCanInterchangeOtherRoles: Record<string, string[]>; rolesCanList: Record<string, string[]>; rolesCanRead: Record<string, string[]>; rolesCanUpdate: Record<string, string[]>; } /** @noInheritDoc */ interface GetRolesInteractionTree200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: RolesInteractionTree; } interface Prescription { config: string; } /** @noInheritDoc */ interface GetPrescription200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: Prescription; } interface RetrieveConsent200Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: ConsentObj; } interface CreateConsent { success: true; } interface CreateConsent200Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: CreateConsent; } interface UpdateConsent { success: true; } interface UpdateConsent200Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: UpdateConsent; } /** * General end points */ declare class General extends Main { /** * An endpoint that propagates the current API health status and * other information. This can be used during an apps initial boot * process to determine the accessibility of the API and propagate * a general status message to users. * * Endpoint Action ID = 100 */ status(): Promise<GeneralServerStatus200Response | ErrorResponse>; /** * Returns a list of system-wide accepted Mime types and their IDs. * * Endpoint Action ID = 101 */ listAcceptedMimeTypes(): Promise<GeneralListAcceptedMIMETypes200Response | ErrorResponse>; /** * Retrieves a list of available User Roles. * * Endpoint Action ID = 102 */ listAvailableUserRoles(): Promise<GeneralListAvailableRoles200Response | ErrorResponse>; /** * Retrieves a list of available status codes that can be used throughout * the application to update the StatusID field of various resources. * * Endpoint Action ID = 104 */ listAvailableStatuses(): Promise<GeneralListAvailableStatuses200Response | ErrorResponse>; /** * Checks validity of your Token and returns its encoded info. * * Endpoint Action ID = 107 */ verifyToken(token: string): Promise<GeneralVerifyToken200Response | ErrorResponse>; /** * Return the list of regions available for clusters. * * Endpoint Action ID = 108 */ regions(): Promise<GeneralRegions200Response | ErrorResponse>; /** * Retrieve consent. * * Endpoint Action ID = 109 */ retrieveConsent(): Promise<RetrieveConsent200Response | ErrorResponse>; /** * Create consent. * * Endpoint Action ID = 110 */ createConsent(data: ConsentObj): Promise<CreateConsent200Response | ErrorResponse>; /** * Update consent. * * Endpoint Action ID = 111 */ updateConsent(data: ConsentObj): Promise<UpdateConsent200Response | ErrorResponse>; /** * Return the list of regions available for clusters. * * Endpoint Action ID = 113 */ getRolesInteractionTree(): Promise<GetRolesInteractionTree200Response | ErrorResponse>; /** * Retrieve a user Prescription * * Endpoint Action ID = 114 */ getPrescription(prescriptionId: string): Promise<GetPrescription200Response | ErrorResponse>; } /** * License */ interface License { Created: number | null; ID: string | null; StatusID: string | null; Expiration: string | null; MaxDevices: number | null; OrganizationID: string | null; DeviceRegistrations: number | null; LicenseTypeID: string | null; LicenseType: string | null; SDKPlatforms: string[]; Username: string | null; TotalCount?: number | null; } /** @noInheritDoc */ interface LicensesListLicenses200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: License[]; } interface OrgLicenses { ID: string; LicenseType: string; StatusID: string; Expiration: number; Key: string; MaxDevices: number; Created: number; DeviceRegistrations: number; TotalCount: number; } /** @noInheritDoc */ interface LicensesListOrgLicenses200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * List of available licenses response */ body: OrgLicenses[]; } interface LicensesUpdateLicense { success: boolean; } /** @noInheritDoc */ interface LicensesUpdateLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: LicensesUpdateLicense; } interface LicensesRemoveLicense { success: boolean; } /** @noInheritDoc */ interface LicensesRemoveLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: LicensesRemoveLicense; } interface LicensesCreateLicense { ID: string; } /** @noInheritDoc */ interface LicensesCreateLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: LicensesCreateLicense; } interface RetrieveOrgLicense { Created: number | null; ID: string | null; StatusID: string | null; Expiration: string | null; Key: string | null; MaxDevices: number | null; LicenseType: string | null; LicenseTypeID: string | null; DeviceRegistrations: number | null; SDKPlatforms: string[] | null; } /** @noInheritDoc */ interface LicensesRetrieveOrgLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: RetrieveOrgLicense; } /** @noInheritDoc */ interface LicensesRetrieveLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: License; } interface LicenseType { ID: string; RoleID: string; } /** @noInheritDoc */ interface LicensesListLicenseTypes200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; body: LicenseType[]; } interface LicensesUpdateLicenseRequest { StatusID: string | null; LicenseTypeID: string | null; MaxDevices: number | null; Expiration: string | null; SDKPlatforms: string[] | null; } interface LicensesCreateLicenseRequest { OrganizationID: string | null; LicenseType: string | null; MaxDevices: number | null; Expiration: string | null; SDKPlatforms: string[] | null; } interface LicensesListOrgLicensesRequest { limit?: number; offset?: number; date?: string; endDate?: string; sortBy?: string; sortOrder?: 'ASC' | 'DESC'; licenseType?: string; statusId?: string; } interface LicensesListRequest { date?: string; endDate?: string; licenseType?: string; limit?: number; offset?: number; orgId?: string; sortBy?: string; sortOrder?: 'ASC' | 'DESC'; statusId?: string; userName?: string; } /** * Licenses end points * * These endpoints allow you to list the Licenses available to * your User/Organization. */ declare class Licenses extends Main { /** * Retrieve License * * Endpoint Action ID = 1404 */ retrieveLicense(id: string): Promise<LicensesRetrieveLicense200Response | ErrorResponse>; /** * List licenses * * Endpoint Action ID = 1405 * */ listLicenses(data?: LicensesListRequest): Promise<LicensesListLicenses200Response | ErrorResponse>; /** * List org licenses * * Endpoint Action ID = 1406 * */ listOrgLicenses(data?: LicensesListOrgLicensesRequest): Promise<LicensesListOrgLicenses200Response | ErrorResponse>; /** * Create License * * Endpoint Action ID = 1407 */ createLicense(data: LicensesCreateLicenseRequest): Promise<LicensesCreateLicense200Response | ErrorResponse>; /** * Update License * * Endpoint Action ID = 1408 */ updateLicense(licenseId: string, data: LicensesUpdateLicenseRequest): Promise<LicensesUpdateLicense200Response | ErrorResponse>; /** * Remove License * * Endpoint Action ID = 1409 */ removeLicense(licenseId: string): Promise<LicensesRemoveLicense200Response | ErrorResponse>; /** * Retrieve Org License * * Endpoint Action ID = 1411 */ retrieveOrgLicense(id: string): Promise<LicensesRetrieveOrgLicense200Response | ErrorResponse>; /** * List License Types * * Endpoint Action ID = 1412 */ listLicenseTypes(): Promise<LicensesListLicenseTypes200Response | ErrorResponse>; } /** * Measurement Created */ interface MeasurementCreated { ID: string; } /** @noInheritDoc */ interface MeasurementCreated200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Measurement Created response */ body: MeasurementCreated; } /** * Measurement retrieve */ interface MeasurementRetrieve { Created: number; Updated: number; ID: string; OrganizationID: string; StatusID: string; UserID: string; UserProfileID: string; DeviceID: string; StudyID: string; Resolution: number; DeviceVersion: string; Comments: object; Mode: string; City: string; State: string; Country: string; Region: string; PartnerID: string; Results: object; SignalNames: object; SignalDescriptions: object; SignalConfig: object; SignalUnits: object; DataSizeBytes: number; } /** @noInheritDoc */ interface MeasurementRetrieved200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Measurement retrieved response */ body: MeasurementRetrieve; } /** * Measurement list */ interface MeasurementList { ID: string; UserID: string; UserProfileID: string | null; UserProfileName: string | null; DeviceID: string | null; StudyID: string; StatusID: string; DeviceVersion: string | null; Mode: string; Created: number; Updated: number; TotalCount: number; } /** @noInheritDoc */ interface MeasurementList200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Measurement retrieved response */ body: MeasurementList[]; } /** * Measurement add data */ interface MeasurementAddData { ID: string; ChunkOrder: number; } /** @noInheritDoc */ interface MeasurementAddData200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Measurement add data response */ body: MeasurementAddData; } /** @noInheritDoc */ interface MeasurementDelete200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** * Measurement create request */ interface MeasurementCreateRequest { StudyID: string; Resolution: number; /** User Profile ID (optional) */ UserProfileID?: string; /** Optional or mandatory depending on license policy */ PartnerID?: string; } /** * Measurement add data request */ interface MeasurementAddDataRequest { Action: string; /** base64-encoded payload */ Payload: string; } /** * Measurement list request */ interface MeasurementListRequest { statusId: string | null; userProfileId: string | null; userProfileName: string | null; studyId: string | null; partnerId: string | null; date: string | null; endDate: string | null; limit: string | null; offset: string | null; deviceID: string | null; userName?: string | null; sortBy: string | null; sortOrder: string | null; mode?: string | null; } /** * Measurements end points * * Measurements are individual one-time captures of blood flow data. * A single measurement record could represent multiple models of data analysis, * hence this data structure supports lookup parameters to filter them. * * Note: A valid License is required in order to create Measurements and submit * data chunks for processing. Please make sure to call Register License endpoint * first to receive a Device Token that grants access to these functions. * Next, in order to have your user information associated with the measurements, * you can use the User Login endpoint to obtain a User Token, which can be used to take * measurements as well. * * Important: If your License Type is SDK_DEVICE, you must login and obtain a User Token * as this License Type only allows you to perform a login operation. */ declare class Measurements extends Main { /** * Returns the results of a measurement request specified by * the UUID in the endpoint request. This payload will change * according to the different requested signals. * * Endpoint Action ID = 500 */ retrieve(id: string, tokenType: 'user' | 'device'): Promise<MeasurementRetrieved200Response | ErrorResponse>; /** * Provides a historical list of measurements captured by the API store. The results * of the measurements are captured and only displayed for the current application * providers token designator. Each record has a status representing its cycle in the system: * * Status Message | Description * * CAPTURING | A new record was created and results are being received. * * PROCESSING | Capture is complete and the record is processing. * * COMPLETE | The analysis is complete and ready for consumption. * * ERROR | An error occurred during processing. * * INCOMPLETE | Capturing process returned as incomplete/not enough data. * * Endpoint Action ID = 501 */ list(data?: MeasurementListRequest): Promise<MeasurementList200Response | ErrorResponse>; /** * Begins a new data capture session and returns a measurement ID * property, which should be referenced for adding data chunks and * retreiving results. * * Resolution: currently can be either 0 or 100. (default is 100) * * * 100 means the result set will have 100% of the original size * * * 0 returns 1 value per signal * * PartnerID is mandatory or optional (based on License policy). * * Endpoint Action ID = 504 */ create(data: MeasurementCreateRequest): Promise<MeasurementCreated200Response | ErrorResponse>; /** * Adds collected blood-flow data to a specific measurement. Upon submitting a * chunk of data, the API will return a MeasurementDataID value representing * the received chunk. Data must be sent to the server in the order produced by * the DFX SDK. If a chunk it sent out of order, the server will return an error. * Please ensure that new chunks are only sent after the server responds with a * MeasurementDataID. * * Submitting measurements has three stages: * * a) starting, * * b) measurement body, * * c) closing a measurement. * * Each of these phases have the same payload structure however a different Action * flag is to be sent with each request and must follow the CHUNK::ACTION format. * * Measurement Actions | Description * * FIRST::PROCESS | Start a new measurement (drop any existing), Process results * * FIRST::IGNORE | Start a new measurement (drop any existing), Do not process * * CHUNK::PROCESS | Arbitrary block of TOI data and process results * * CHUNK::IGNORE | Arbitrary block of TOI data and do not process results * * LAST::PROCESS | Finish a measurement cycle and process results * * LAST::IGNORE | Finish a measurement cycle and do not process * * `Payload` is binary data that can currently only be obtained by using our SDK. * The Payload (binary content) field must be `base64-encoded`. * * Note: This endpoint is a subject to request throttling, you must not submit more * data than can be obtained in real time. i.e., do not send more than five seconds * of chunk data over the course of five seconds of real time. * * Response Error Codes Explanation: * * * "RATE_LIMIT": You have sent too many chunks in a given time period. See the Note above. * * "MEASUREMENT_CLOSED": Requested Measurement is already finished. You need to create a new Measurement. * * "MISALIGNED_CHUNK": Chunk Order was mismatched. i.e., ChunkOrder 2 was sent before ChunkOrder 1. * * "INVALID_MEASUREMENT": Requested Measurement ID was not found. * * "UNPACKER_RPC_ERROR": Payload validation has been failed. Reason(s) will be provided in error message. * * Endpoint Action ID = 506 */ data(id: string, data: MeasurementAddDataRequest): Promise<MeasurementAddData200Response | ErrorResponse>; /** * Only DFX_ORG_ADMIN has permission to delete a specific measurment by * measurement ID for its own organization. * * Endpoint Action ID = 507 */ delete(id: string): Promise<MeasurementDelete200Response | ErrorResponse>; } /** * Organization retrieve information */ interface OrgRetrieveInformation { ID: string; Name: string; Identifier: string; StatusID: string; Contact: string; Email: string; PasswordMinLength: number; AdminPasswordMinLength: number; PasswordRequireCharacterClasses: number; PasswordRequireUppercase: boolean; PasswordRequireLowercase: boolean; PasswordRequireDigits: boolean; PasswordRequireSpecial: boolean; PasswordRotateDays: number; RequireUniquePasswordsCount: number; SessionMaxDurationSeconds: number; SessionIdleDurationSeconds: number; OrgAddresses: any[]; LivenessConfig: { VisageLiveness: boolean; FakeDetection: boolean; SNRThresholding: boolean; }; Created: number; Updated: number; } /** @noInheritDoc */ interface OrgRetrieveInformation200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization retrieve information response */ body: OrgRetrieveInformation; } /** * Organization measurement info */ interface OrgMeasurementInfo { ID: string; OrganizationID: string; StatusID: string; UserID: string; UserProfileID: string | null; DeviceID: string; StudyID: string; Resolution: number; DeviceVersion: string | null; Comments: object; Mode: string; City: string; State: string; Country: string; Region: string; PartnerID: string | null; Results: object; SignalNames: object; SignalDescriptions: object; SignalConfig: object; SignalUnits: object; DataSizeBytes: number; Created: number; Updated: number; } /** @noInheritDoc */ interface OrgRetrieveMeasurement200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization retrieve measurement info response */ body: OrgMeasurementInfo; } /** * Organization registered license */ interface OrgRegisteredLicense { DeviceID: string; Token: string; RefreshToken: string; /** Role associated with your License */ RoleID: string; /** User account associated with your License */ UserID: string; } /** @noInheritDoc */ interface OrgRegisterLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization register license response */ body: OrgRegisteredLicense; } /** @noInheritDoc */ interface OrgUnregisterLicense200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** * Organization logo */ interface OrgLogo { data: string; } /** @noInheritDoc */ interface OrgLogo200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization logo */ body: OrgLogo; } /** * Organization profile */ interface OrgProfile { ID: string; Name: string; Email: string; Status: string; MeasurementCount: string; OwnerUser: string | null; Created: number; Updated: number; TotalCount: number; } /** @noInheritDoc */ interface OrgListProfiles200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization list profiles */ body: OrgProfile[]; } /** * Organization user profile */ interface OrgUserProfile { ID: string; Name: string; Email: string; Status: string; MeasurementCount: number; Created: number; Updated: number; } /** @noInheritDoc */ interface OrgRetrieveProfile200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization retrieve user profile */ body: OrgUserProfile; } /** * Organization user */ interface OrgUser { Gender: string; DateOfBirth: string | null; Created: number; Updated: number; ID: string; OrganizationID: string; RoleID: string; StatusID: string; Email: string; Password: string; FirstName: string | null; LastName: string | null; ResetToken: string | null; ResetTokenDate: string | null; AvatarURI: string | null; IsVerified: boolean; VerificationCode: string; PhoneNumber: string | null; DeviceID: string; HeightCm: number | null; WeightKg: number | null; LoginMethod: string; SSOID: string | null; Region: string; } /** @noInheritDoc */ interface OrgRetrieveUser200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization retrieve user */ body: OrgUser; } /** * Organization create user */ interface OrgCreateUser { ID: string; ResetToken: string; } /** @noInheritDoc */ interface OrgCreateUser200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization create user response */ body: OrgCreateUser; } /** * Organization update user */ interface OrgUpdateUser { success: boolean; } /** @noInheritDoc */ interface OrgUpdateUser200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization update user response */ body: OrgUpdateUser; } /** * Organization delete user */ interface OrgDeleteUser { success: boolean; } /** @noInheritDoc */ interface OrgDeleteUser200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization delete user response */ body: OrgDeleteUser; } /** @noInheritDoc */ interface OrgUpdateProfile200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } interface OrgLogin { Token: string; RefreshToken: string; } /** @noInheritDoc */ interface OrgLogin200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization login response */ body: OrgLogin; } /** @noInheritDoc */ interface OrgDeleteSelfMeasurements200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } /** @noInheritDoc */ interface OrgDeletePartnerMeasurements200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; } interface OrgPasswordPolicy { PasswordMinLength: number; AdminPasswordMinLength: number; PasswordMaxLength: number; PasswordRequireUppercase: boolean; PasswordRequireLowercase: boolean; PasswordRequireDigits: boolean; PasswordRequireSpecial: boolean; PasswordSpecialCharacters: string; PasswordRotateDays: number; RequireUniquePasswordsCount: number; LimitLoginAttemptsCountPerWindow: number; LimitLoginAttemptsWindowDurationSeconds: number; LoginAttemptsLockoutDurationSeconds: number; SessionMaxDurationSeconds: number; SessionIdleDurationSeconds: number; LimitVerificationAttemptsCountPerWindow: number; LimitVerificationAttemptsWindowDurationSeconds: number; } /** @noInheritDoc */ interface OrgPasswordPolicy200Response extends Response { status: HttpSuccessfulResponseStatusCodes | HttpRedirectionResponseStatusCodes; /** * Organization password policy response */ body: OrgPasswordPolicy; } interface OrgContactUser { success: boolean; } /** @noInheritDoc */ interface OrgContactUser200Response extends Response { status: HttpSuccessfulRespon