npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@1uphealth-temp/api

v0.5.6

Published

description...

Downloads

40

Readme

@1uphealth/api

ApiSDK

API_URL_BASE

Type: string

getUsers

GET /user-management/v1/user

Get the list of all the users that exist inside your 1up Developer Application, with the option of filtering by specific users

Parameters

  • oneUpUserId OneUpUserId?
  • appUserId AppUserId?

Returns Promise<HttpClientResponse> An array of user objects

createUser

POST /user-management/v1/user

Will cause a user to be created with the attributes passed in the request body. \ The request won't fail if the user already exists but rather will return the user data but with

Parameters

  • appUserId AppUserId
  • userActive UserActive

Returns Promise<HttpClientResponse>

updateUser

PUT /user-management/v1/user

Can be used to modify an existing user object. It is possible to modify the app_user_id, but the oneup_user_id is assigned when the user is created and cannot be changed.

Parameters

  • appUserId AppUserId
  • oneUpUserId OneUpUserId
  • userActive UserActive

Returns Promise<HttpClientResponse> Will return the new user object

generateUserAuthCode

POST /user-management/v1/user/auth-code

A backend app can use this endpoint to get a new authorization code for a user. \ Note that this endpoint should not be called in a browser context because \ it would require exposing your app's secret key to users.

Parameters

  • appUserId AppUserId

Returns Promise<HttpClientResponse> Returns an access token and a refresh token, which can be used to authenticate requests made on behalf of the user.

getHealthSystemPickerIFrame

GET /connect/marketplace

A common pattern is to ask the user to connect data from their health system to the app. \ This endpoint returns a simple html page that can be used as a starting point for walking \ the user through the data connect flow. For more details, \ read about the https://1up.health/dev/doc/connect-health-data-iframe.

Returns Promise<HttpClientResponse> This endpoint returns an html page and inline css that, when rendered, results in a UI for \ selecting which health care system the user would like to connect. The most common use of \ this is to render this endpoint in an iframe within the developers own app.

searchConnectProvider

GET /connect/system/provider

Used to run a text search on health systems, often for the purpose of allowing the user \ to find their health system's authorization portal.

Parameters

  • query Query { query: string; } \ This is how you specify the text to search for. \ It can be a doctor's name, clinic, hospital, or address.

Returns Promise<HttpClientResponse> The result will return a bundle of FHIR Organizations which contain the 1upHealth \ health system id and an extension with the logo of that org or health system. \ You can use that to direct the patient to the correct connect api url so the patient \ can authorize sharing of their medical data. \ See the official hl7 FHIR docs (https://www.hl7.org/fhir/bundle.html) \ for more information on how a FHIR bundle is structured.

getDevices

GET /connect/system/device

Currently 1upHealth allows importing data from either Fitbit, GoogleFit or Withings.

Returns Promise<HttpClientResponse> Returns a list of device types that can be used as sources.

getSupportedHealthSystems

GET /connect/system/clinical

Use this endpoint to query the full list of supported health systems. \ If your use-case would benefit from full-text search of providers on fields \ like name, address, or clinician names, then we recommend \ using the Provider Search endpoint instead.

Returns Promise<HttpClientResponse>

getFHIRResources

GET /fhir/{fhirVersion}/{resourceType}

Returns all matching FHIR resources for a resource type \ See also: \ FHIR versions and resources supported by 1upHealth https://1up.health/dev/reference/fhir-resources \ The official HL7 FHIR docs https://www.hl7.org/fhir

This endpoint receives authentication in the form of a http bearer authenitcation header.

Parameters

  • fhirVersion FHIRVersion
  • resourceType (FHIR_DSTU2.ResourceTypeStr | FHIR_STU3.ResourceTypeStr)
  • queryParams QueryParams

Returns Promise<HttpClientResponse> A FHIR Bundle containing all the resources that match the query,

createFHIRResource

POST /fhir/{fhirVersion}/{resourceType}

Can be used to create a FHIR resource with a given type. \ See also: \ FHIR versions and resources supported by 1upHealth https://1up.health/dev/reference/fhir-resources \ The official HL7 FHIR docs https://www.hl7.org/fhir

Parameters

  • fhirVersion FHIRVersion
  • resourceType (FHIR_DSTU2.ResourceTypeStr | FHIR_STU3.ResourceTypeStr)
  • resource (FHIR_DSTU2.Resource | FHIR_STU3.Resource)

Returns Promise<HttpClientResponse> A FHIR Resource containing all the attributes that were posted.

queryFHIREverything

GET /fhir/{fhirVersion}/Patient/{patientId}/$everything

This endpoint returns a list of all known FHIR resources for a given patient. \ This is useful when transmitting batch data or getting the full patient history.

Parameters

  • patientId PatientId
  • fhirVersion FHIRVersion

Returns Promise<HttpClientResponse> A FHIR Bundle containing all the resources that match the query

grantPermissions

PUT /fhir/dstu2/Patient/patientid/_permission/{oneUpUserId}

When making a request to the 1upHealth FHIR API using a user's access_token, \ the resources returned will be scoped to only the resources that the user has \ permissions to view. However, sometimes when building an app you might want to \ support the ability for users to grant access to other users to see certain records. \ This endpoint allows you to grant access to resources to arbitrary users.

Parameters

  • oneUpUserId OneUpUserId
  • fhirVersion FHIRVersion

Returns Promise<HttpClientResponse>

revokePermissions

DELETE /fhir/dstu2/Patient/patientid/_permission/{oneUpUserId}

This endpoint allows you to remove permissions that have been granted to users to see \ other users' FHIR resources.

Parameters

  • oneUpUserId OneUpUserId
  • fhirVersion FHIRVersion

Returns Promise<HttpClientResponse>

generateOAuth2Token

POST https://api.1up.health/fhir/oauth2/token

grant_type=authorization_code

This method generates new access token for given auth_code

Parameters

Returns Promise<HttpClientResponse>

refreshOAuth2Token

POST https://api.1up.health/fhir/oauth2/token

grant_type=refresh_token

This method refresh access token for given refresh_token parameter

Parameters

Returns Promise<HttpClientResponse>

authenticate

This method generate access_token for given app_user_id. \ If there is no user with given app_user_id, it creates new one.

Parameters

  • appUserId AppUserId

Returns Promise<HttpClientResponse>

HttpClient

HttpClient is helper abstraction over the request library.

defaultOptions

Type: HttpClientOptions

get

Parameters

  • uri string
  • options HttpClientOptions?

Returns Promise<HttpClientResponse>

post

Parameters

  • uri string
  • options HttpClientOptions?

Returns Promise<HttpClientResponse>

patch

Parameters

  • uri string
  • options HttpClientOptions?

Returns Promise<HttpClientResponse>

put

Parameters

  • uri string
  • options HttpClientOptions?

Returns Promise<HttpClientResponse>

delete

Parameters

  • uri string
  • options HttpClientOptions?

Returns Promise<HttpClientResponse>

Validator

getUsersPayload

Parameters

  • oneUpUserId OneUpUserId?
  • appUserId AppUserId?

createUserPayload

Parameters

  • appUserId AppUserId
  • userActive UserActive

updateUserPayload

Parameters

  • appUserId AppUserId
  • oneUpUserId OneUpUserId
  • userActive UserActive

generateUserAuthCodePayload

Parameters

  • appUserId AppUserId

accessToken

Parameters

  • accessToken

clientKeys

Parameters

  • $0 Object
    • $0.clientId
    • $0.clientSecret