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

evosphere-router

v0.1.20

Published

Routing Container for Evosphere API.

Downloads

15

Readme

Evosphere JS Router v0.1.20

Le router Evosphere est un outil Javascript contenant les liens vers les différentes entrées de l'API Evosphere. Elle donne un libellé à chaque route.

Attention : le routeur ne réalise aucune requête HTTP. Son rôle est purement de distribuer les routes et de permettre de les générer lorsque celles-ci demandent des paramètres.

Utilisation

L'objet Router est en réalité une Usine. Elle ne représente pas le routeur lui-même mais permet d'en créer.

Afin de récupérer une route, il suffit de récupérer son libellé dans l'objet routes.

import Router from 'evosphere-router';


const router = Router();
const getApikeyRoute = router.routes.apikey();

Si une route nécessite des paramètres d'URL, il suffit d'envoyer en paramètre de la route un objet contenant le nom du paramètre à renseigner.


const getUserRoute = router.routes.user.getUser({
  id: 2164
});

Routes disponibles

const routes = (domain, version) => ({
  activity: {
    getStats: createRoute(getVersionURL("/users/{id}/activities", domain, version)),
    getActivities: createRoute(getVersionURL("/activities", domain, version)),
    getActivity: createRoute(getVersionURL("/activities/{id}", domain, version)),
    createActivity: createRoute(getVersionURL("/activities", domain, version)),

    getCategories: createRoute(getVersionURL("/activities/categories", domain, version)),
    getCategory: createRoute(getVersionURL("/activities/categories/{id}", domain, version)),

    addActivityToPracticeList: createRoute(getVersionURL("/activities/practice", domain, version)),
    removeActivityFromPracticeList: createRoute(getVersionURL("/activities/{id}/practice", domain, version)),

    getSessions: createRoute(getVersionURL("/sessions", domain, version)),
    createSession: createRoute(getVersionURL("/sessions", domain, version)),

    getSession: createRoute(getVersionURL("/sessions/{id}", domain, version)),
    patchSession: createRoute(getVersionURL("/sessions/{id}", domain, version)),
    finishSession: createRoute(getVersionURL("/sessions/{id}/finish", domain, version)),
    deleteSession: createRoute(getVersionURL("/sessions/{id}", domain, version)),

    likeSession: createRoute(getVersionURL("/sessions/{id}/likes", domain, version)),
    unlikeSession: createRoute(getVersionURL("/sessions/{id}/likes", domain, version)),
    getSessionLikes: createRoute(getVersionURL("/sessions/{id}/likes", domain, version)),

    getSessionComments: createRoute(getVersionURL("/sessions/{id}/comments", domain, version)),
    createSessionComment: createRoute(getVersionURL("/sessions/{id}/comments", domain, version)),

    subscribeToSession: createRoute(getVersionURL("/sessions/{id}/subscribes", domain, version)),
    unsubscribeToSession: createRoute(getVersionURL("/sessions/{id}/subscribes", domain, version)),
    isSubscribedToSession: createRoute(getVersionURL("/sessions/{id}/subscribes/isSubscribed", domain, version)),

    practice: {
      get: createRoute(getVersionURL("/sessions/practice", domain, version)),
      start: createRoute(getVersionURL("/sessions/practice", domain, version)),
      update: createRoute(getVersionURL("/sessions/practice", domain, version)),
      finish: createRoute(getVersionURL("/sessions/practice/finish", domain, version)),
      revive: createRoute(getVersionURL("/sessions/practice/{id}/revive", domain, version)),
    }
  },
  apikey: createRoute(getStandardURL("apikey", domain)),
  notification:{
    getNotifications: createRoute(getVersionURL("/notifications", domain, version)),

    patchNotification: createRoute(getVersionURL("/notifications/{id}", domain, version)),
    getNotification: createRoute(getVersionURL("/notifications/{id}", domain, version)),
  },
  relation:{
    getFollowers: createRoute(getVersionURL("/users/{id}/followers", domain, version)),
    follow: createRoute(getVersionURL("/users/{id}/followers", domain, version)),
    unfollow: createRoute(getVersionURL("/users/{id}/followers", domain, version)),
    getFollowing: createRoute(getVersionURL("/users/{id}/followers", domain, version)),

    getFriends: createRoute(getVersionURL("/users/{id}/friends", domain, version)),

    getFriendship: createRoute(getVersionURL("/users/{id}/friendship", domain, version)),
    sendFriendRequest: createRoute(getVersionURL("/users/{id}/friendship", domain, version)),
    acceptOrDeclineFriendRequest: createRoute(getVersionURL("/users/{id}/friendship", domain, version)),
    removeFromFriends: createRoute(getVersionURL("/users/{id}/friendship", domain, version)),
  },
  social: {
    getPosts: createRoute(getVersionURL("/posts", domain, version)),
    postPost: createRoute(getVersionURL("/posts", domain, version)),

    getPost: createRoute(getVersionURL("/posts/{id}", domain, version)),
    patchPost: createRoute(getVersionURL("/posts/{id}", domain, version)),
    deletePost: createRoute(getVersionURL("/posts/{id}", domain, version)),

    likePost: createRoute(getVersionURL("/posts/{id}/likes", domain, version)),
    unlikePost: createRoute(getVersionURL("/posts/{id}/likes", domain, version)),
    getPostLikes: createRoute(getVersionURL("/posts/{id}/likes", domain, version)),

    subscribeToPost: createRoute(getVersionURL("/posts/{id}/subscribes", domain, version)),
    unsubscribeToPost: createRoute(getVersionURL("/posts/{id}/subscribes", domain, version)),
    getPostSubscribers: createRoute(getVersionURL("/posts/{id}/subscribes", domain, version)),

    commentPost: createRoute(getVersionURL("/posts/{id}/comments", domain, version)),
    getPostComments: createRoute(getVersionURL("/posts/{id}/comments", domain, version)),

    getComment: createRoute(getVersionURL("/comments/{id}", domain, version)),
    getAnswerComments: createRoute(getVersionURL("/comments/{id}", domain, version)),
    answerTo: createRoute(getVersionURL("/comments/{id}", domain, version)),
    patchComment: createRoute(getVersionURL("/comments/{id}", domain, version)),
    deleteComment: createRoute(getVersionURL("/comments/{id}", domain, version)),

    likeComment: createRoute(getVersionURL("/comments/{id}/likes", domain, version)),
    unlikeComment: createRoute(getVersionURL("/comments/{id}/likes", domain, version)),
    getCommentLikes: createRoute(getVersionURL("/comments/{id}/likes", domain, version)),

    subscribeToComment: createRoute(getVersionURL("/comments/{id}/subscribes", domain, version)),
    unsubscribeToComment: createRoute(getVersionURL("/comments/{id}/subscribes", domain, version)),
    getCommentSubscribers: createRoute(getVersionURL("/comments/{id}/subscribes", domain, version))
  },
  user: {
    getUser: createRoute(getVersionURL("/users/{id}", domain, version)),
    getUsers: createRoute(getVersionURL("/users", domain, version)),
    getUserStatus: createRoute(getVersionURL("/users/{id}/status", domain, version)),
    sendPasswordResetRequest: createRoute(getVersionURL("/users/{id}/password/retrieve", domain, version)),
    confirmPasswordResetRequest: createRoute(getVersionURL("/users/{id}/password/retrieve/confirm", domain, version)),
    updateProfile: createRoute(getVersionURL("/profile", domain, version)),
    register: createRoute(getVersionURL("/register", domain, version)),
    preregister: createRoute(getVersionURL("/preregistration", domain, version))
  }
});