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

@vhiweb/flexben-client-js

v1.0.0

Published

This library contains core functionalities needed for Flexben Product.

Downloads

3

Readme

Flexben Product Client Js

This library contains core functionalities needed for Flexben Product.

Getting Started

  1. Install flexben-client-js.
  2. Run npm i flexben-client-js or yarn add flexben-client-js to install the library.
  3. Import the library

Installing

First, you need to import this library into your application.

import Flexben from 'flexben-client-js';

const flexben = new Flexben();

Init using AppId

Then, you need to initializing this library using appid, i'll recommend you to setup your .env first to init this library

  • Setup .env file

Create .env file on code editor similar to .env.example or copy the code below : (see official docs)

VITE_API_URL=
VITE_AUTH_CLIENT_ID=
VITE_AUTH_CLIENT_SECRET=
VITE_ENCRYPTOR_KEY=
VITE_GRANT_TYPE=
VITE_PROJECT_KEY=
  • Init this library
flexben.init({
  clientId: config.api.VITE_AUTH_CLIENT_ID,
  clientSecret: config.api.VITE_AUTH_CLIENT_SECRET,
  grantType: config.api.VITE_GRANT_TYPE,
})

Mutations

  • Auth Login
flexben.authLogin({
  username: '',
  password: '',
}).then(({ data: { accessToken: { access_token } } }) => {
  flexben.setToken({ token: access_token })
});
  • Auth Register
flexben.authRegister({
  name: '',
  email: '',
  phone: '',
  username: '',
  password: '',
}).then(({ data: { accessToken: { access_token } } }) => {
  flexben.setToken({ token: access_token })
});
  • Auth Forgot Password
flexben.authForgotPassword({
  email: '',
  url: '',
});
  • Auth Reset Password
flexben.authResetPassword({
  code: '',
  password: '',
});
  • Auth Change Password
flexben.authResetPassword({
  current_password: '',
  password: '',
  password_confirmation: '',
});
  • Update User
flexben.authUpdateUser({
  name: '',
  email: '',
  phone: '',
  password: '',
  password_confirmation: '',
  gender: '',
  birth_at: '',
  avatar: '',
});
  • Create Enrollment
flexben.createEnrollment({
  id: '',
  period_id: '',
  is_submitted: '',
  benefit_items_ids: []
});
  • Create Claim
flexben.createClaim({
  name: '',
  merchant_name: '',
  description: '',
  amount: '',
  period_id: '',
  category_id: '',
  transaction_at: '',
  receipt: '',
  documents: '',
});
  • Update Claim
flexben.updateClaim({
  id: '',
  name: '',
  merchant_name: '',
  description: '',
  amount: '',
  period_id: '',
  category_id: '',
  transaction_at: '',
  receipt: '',
  documents: '',
});
  • Delete Claim
flexben.deleteClaim({
  id: '',
});

Queries

  • Get All Faq
flexben.getFaq();
  • Get All Periods
flexben.getPeriods();
  • Get Current Period
flexben.getCurrentPeriod();
  • Get Upcoming Period
flexben.getUpcomingPeriod();
  • Get All Benefits
flexben.getAllBenefits();
  • Get Benefit Based on Period
flexben.getPeriodBenefits({
  id: '',
});
  • Get All Enrollments
flexben.getEnrollments();
  • Get Detail Enrollment
flexben.getDetailEnrollment({
  id: '',
});
  • Get All Claims
flexben.getClaims({
  period_id: '',
  first: '',
  page: '',
});
  • Get Detail Claim
flexben.getDetailClaim({
  id: '',
});
  • Get Claim Categories
flexben.getDetailClaim({
  parent_id: '',
  isParent: bool,
});
  • Get User
flexben.getUser();
  • Get getPoint
flexben.getPoint();

Tools

  • @apollo/client : ^3.7.9 [https://www.apollographql.com/docs/react/)
  • apollo-boost : ^0.4.9 [https://www.npmjs.com/package/apollo-boost)
  • graphql : ^15.8.0 [https://graphql.org/)