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

@rimiti/keldoc-js-sdk

v2.12.1

Published

Keldoc Javascript SDK

Downloads

9

Readme

keldoc-js-sdk

Dependencies Coverage Build Status MIT License PRs Welcome

Description

This module provides an Keldoc API implementation.

Install

$ npm install @rimiti/keldoc-js-sdk --save

Features

  • Agendas
  • Appointments
  • Availabilities
  • Available slots
  • Config
  • ConfigWebhooks
  • Motives
  • Patients
  • Specialities

Documentation

Examples

Create your keldoc sdk by requiring it, making it's initial configuration and instantiating it.

From import

import * as sdk from '@rimiti/keldoc-js-sdk'

sdk.configure({
  credentials: {
    clientAccessKeyId: 'CLIENT_ACCESS_KEY_ID',
    secretAccessKeyId: 'SECRET_ACCESS_KEY_ID',
  },
  host: 'http://www.example.com'
});

const keldoc = sdk.create()

From require

const sdk = require('@rimiti/keldoc-js-sdk');

sdk.configure({
  credentials: {
    clientAccessKeyId: 'CLIENT_ACCESS_KEY_ID',
    secretAccessKeyId: 'SECRET_ACCESS_KEY_ID',
  },
  host: 'http://www.example.com',
  routes: {
    agendas: '/agendas.json',
    appointments: '/appointments',
    availabilities: '/availabilities',
    availableSlots: '/available_slots',
    motives: '/motives.json',
    patients: '/patients',
    specialties: '/specialties',
    config: '/config',
    configWebhooks: '/config/webhooks' },
});

const keldoc = sdk.create();

API Methods

Agenda

  • Fetch all agendas.

    Function

    const response = await keldoc.agendas.get();

Appointments

  • Create a new appointment

    Arguments

    start_at                  {Datetime} start date (required).
    agenda_id                 {Integer} Agenda ID (required).
    state                     {String} 'confirmed' or 'canceled' (required).
    duration                  {Integer} duration in seconds.
    no_show                   {Boolean} patient hasn ' t come.
    patient_arrived           {Boolean} patient is waiting in the waiting room.
    no_show_excused           {Boolean} patient hasn ' t come but he excused.
    motive_id                 {Integer} motive id.
    skip_sms_confirmation     {Boolean} disable sms confirmation for consultation.
    skip_email_confirmation   {Boolean} disable email confirmation for consultation.
    skip_sms_reminder         {Boolean} disable sms reminder for consultation.
    skip_email_reminder       {Boolean} disable email reminder for consultation.
    patient_id                {Integer} patient ID.
    patient.first_name        {String} patient firstname.
    patient.last_name         {String} patient lastname.
    patient.maiden_name       {String} patient maiden name.
    patient.gender            {Char} 'm' or 'f'.
    patient.phone             {String} patient phone number.
    patient.phone2            {String} patient alternative phone number.
    patient.email             {String} patient email address.
    patient.street            {String} patient street number & streetnames.
    patient.city              {String} patient city name.
    patient.zipcode           {String} patient city zipcode.
    const response = await keldoc.appointments.create({start_at: '2001-09-23', agenda_id: '2135', state: 'confirmed'});
  • Update an existing appointment

    Arguments

    id                        {Integer} KelDoc internal ID for appointment to update.
    start_at                  {Datetime} start date (required).
    agenda_id                 {Integer} Agenda ID (required).
    state                     {String} 'confirmed' or 'canceled' (required).
    duration                  {Integer} duration in seconds.
    no_show                   {Boolean} patient hasn ' t come.
    patient_arrived           {Boolean} patient is waiting in the waiting room.
    no_show_excused           {Boolean} patient hasn ' t come but he excused.
    motive_id                 {Integer} motive id.
    skip_sms_confirmation     {Boolean} disable sms confirmation for consultation.
    skip_email_confirmation   {Boolean} disable email confirmation for consultation.
    skip_sms_reminder         {Boolean} disable sms reminder for consultation.
    skip_email_reminder       {Boolean} disable email reminder for consultation.
    patient_id                {Integer} patient ID.
    patient.first_name        {String} patient firstname.
    patient.last_name         {String} patient lastname.
    patient.maiden_name       {String} patient maiden name.
    patient.gender            {Char} 'm' or 'f'.
    patient.phone             {String} patient phone number.
    patient.phone2            {String} patient alternative phone number.
    patient.email             {String} patient email address.
    patient.street            {String} patient street number & streetnames.
    patient.city              {String} patient city name.
    patient.zipcode           {String} patient city zipcode.
    const response = await keldoc.appointments.update(21354, {start_at: '2001-09-23', agenda_id: '2135', state: 'confirmed'});
  • Delete an appointment

    Arguments

    id {Integer} KelDoc internal ID for appointment to remove.
    const response = await keldoc.appointments.remove(21321);

Availabilities

  • Fetch available slots for agendas. Maximum duration between start date and end date is 7 days.

    Arguments

    motive_id   {Integer} KelDoc internal ID (required).
    start_date  {Datetime} start date.
    end_date    {Datetime} end date.
    agenda_ids  {Array} IDs of agendas.
    const response = await keldoc.availabilities.get({
      agenda_ids: 112,
      end_date: '2017-09-17',
      start_date: '2017-09-18',
      motive_id: '366',
    });

Available slots

  • Fetch available slots for agendas. Maximum duration between start date and end date is 2 months (default is 2 months from now).
  • When motive_ids is [], it means the available slot is for all motives. Arguments
    agenda_id   {Array} ID of agenda.
    start_date  {Datetime} start date.
    end_date    {Datetime} end date.
    const response = await keldoc.availableSlots.get({
      agenda_id: 112,
      start_date: '2017-09-18',
      end_date: '2017-09-17',
    });

Config

  • Retrieves account configuration : agendas, motives, specialties
    const response = await keldoc.config.get();

Motives

Fetch all motives

    const response = await keldoc.motives.get();

Patients

  • Create a new patient

    Arguments

    first_name  {String} patient firstname.
    last_name   {String} patient lastname.
    maiden_name {String} patient maiden name.
    gender      {Char} 'm' or 'f'.
    phone       {String} patient phone number.
    email       {String} patient email address.
    street      {String} patient street number & streetnames.
    city        {String} patient city name.
    zipcode     {String} patient city zipcode.
    const response = await keldoc.patients.create({
      first_name: 'test',
      last_name: 'john',
      gender: 'm',
      email: '[email protected]'
    });
  • Update an existing patient

    Arguments

    id          {Integer} KelDoc internal ID for patient to update.
    first_name  {String} patient firstname.
    last_name   {String} patient lastname.
    maiden_name {String} patient maiden name.
    gender      {Char} 'm' or 'f'.
    phone       {String} patient phone number.
    email       {String} patient email address.
    street      {String} patient street number & streetnames.
    city        {String} patient city name.
    zipcode     {String} patient city zipcode.
   const response = await keldoc.patients.update(12026, {
      first_name: 'test',
      last_name: 'john',
      gender: 'm',
      email: '[email protected]'
    });

Specialties

  • Fetch all specialties
    const response = await keldoc.specialties.get();

ConfigWebhooks

  • Create account webhook

    Arguments

    url {String} Webhook url.
    const response = await keldoc.configWebhooks.create({url: 'http://test.webhook.com'});
  • Update account webhook

    Arguments

    url {String} Webhook url.
    const response = await keldoc.configWebhooks.update({url: 'http://test.webhook.com'});
  • Delete account webhook

    Arguments

    url {String} Webhook url.
    const response = await keldoc.configWebhooks();

Scripts

Run using npm run command.

clean - remove coverage data, Jest cache and transpiled files,
lint - lint source files and tests,
typecheck - check type annotations,
test - lint, typecheck and run tests with coverage,
test-only - run tests with coverage,
test:watch - interactive watch mode to automatically re-run tests,
build - compile source files,
build:watch - interactive watch mode, compile sources on change.

License

MIT © Dimitri DO BAIRRO