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

@mycure/auth

v5.0.2

Published

A Vue.js project

Downloads

10

Readme

js-semistandard-style

Mycure Vue Auth module

Installation and Usage

$ yarn add @mycure/auth
  • use as a vue plugin
import Vue from 'vue';
import McAuth from '@mycure/auth';

Vue.use(McAuth, opts: ServiceOpts)
  • above will do the ff:
    • describe side effects here
    • sample side effects:
      • attach a global method/attribute
      • attach an instance method/attribute
      • add components
      • sync a single and multi vuex store modules
  interface FailHandlerParams {
    user: User
    authService: AuthService
    next: (route) => void // available only in router, can be used to navigate as this will only proxy router.push
  }

  interface VerifierConfig {
    cache: boolean // if the last value of the verifier should be cached
    match: any | (val: any) => boolean // if fxn, matcher function to be used to determine if pass. else will be ==='d to the value
    onFail: (error: Error, params: FailHandlerParams) => boolean
  }

  interface Verifier {
    onAuthKey: string // key to use in checklist
    routeGuardKey: string // key to use in router
    failMessage: String // for logging
    verifier: (verifierConfig: boolean | string | VerifierConfig, user: User, authService: AuthService, sessionStore: SessionStore) => Promise<{
      formattedKey?: string, // mainly for logging
      value: any,            // current value of the verifier
      failHandler: Function, // to be executed when failed (from verifierConfig)
      passed: boolean        // flag if verifier has passed
    }>
  }

  interface RouterOpts = {
    firebaseApp,
    logoutURL?: string,
    authURL: string = '/login'
    verifiers: Verifier [] = ServiceOpts.verifiers
  }

  interface StoreOpts {
    moduleName: string = 'auth'
  }

  interface ServiceOpts {
    // will be used to auto-generate query functions
    firebaseApp?: firebase.App
    URL_ACCOUNTS: string = '/v3/accounts'
    URL_EMR_ACCESS: string = '/v3/access/emr/data'
    URL_CMS_ACCESS: string = '/v3/access/clinic-management'
    URL_ACCOUNT_ACCESS: string = '/v3/access/my-account'
    URL_SECRETARY_ACCESS: string = '/v3/access/secretary'
    verifiers: Verifier []
    // for registering router guards
    router: VueRouter
    routerOpts?: RouterOpts
    // for registering built-in store modules
    store: VuexStore
    storeOpts?: StoreOpts
    // and other valid SingleItemSyncService and MultiItemSyncService configs, see @topsi/services docus
  }

VuexStoreModules

AuthStoreModule

vuexModuleName = 'auth'
interface RegeisteredVuexModuleActions {
  signInWithEmailAndPassword: (email: string, password: string) => void
  signInWithCustomToken: (token: string) => void  
  // and the extraActions
}

interface RegisteredVuexModule extends RegisteredAuthStoreModule { 
  // see @topsi/services docus for its RegisteredAuthStoreModule
  actions: RegeisteredVuexModuleActions
}