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

@555platform/555-calendar-sdk

v1.0.1

Published

Calendar SDK for 555 Platform

Downloads

13

Readme

Calendar

Overview

Calendar Library provides API'S to create calendar,events and reminders. A calendar is a container for events. These events can be single instance or repeating events. Repeating events will have ending time. Multiple calendars can be created per domain, for example, work and personal calendars. Events are associated with calendar type. Events can have reminders set on them.

Installation

npm install @555platform/555-calendar-sdk

Calendar API's

Calendar Library provides API's to Create,Read,Update and delete calendar for user.

Init :

init API is used to initialize server URL. init accepts a config parameter. config is of type object, which should have a property config.URL

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.init("config")

Create Calendar :

createCalendar API is used to create calendar for user. we need to pass username and calendarname as parameters.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.createCalendar("username", "calendarname")

Handling Response

createCalendar API returns a promise. Response will have calendar deatils if call is successful otherwise error JSON with code and reason for error.

Calendar.createCalendar("Rahul","home").then(response => {
      console.log(" Calendarlist Data ::",response)
    }).catch(error => {
      console.log("get calendarlist failed ::", error);
    });
}
  

Get Calendar :

getCalendar API is used to get calendar details for user. we need to pass username as parameter.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.getCalendar("username")

Handling Response

getCalendar API returns a promise. Response will have calendar deatils if call is successful otherwise error JSON with code and reason for error.

Calendar.getCalendar("Rahul").then(response => {
      console.log(" Calendarlist Data ::",response)
    }).catch(error => {
      console.log("get calendarlist failed ::", error);
    });
}
  

Update Calendar :

updateCalendar API is used to update calendar details for user. we need to pass calendarId and calendarName as parameters.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.updateCalendar("calendarid","calendarname")

Handling Response

updateCalendar API returns a promise. Response will have calendar deatils if call is successful otherwise error JSON with code and reason for error.

Calendar.updateCalendar("1ea1f9d3b4a927b264c83c07", "home").then(response => {
      console.log(" Calendarlist updateds ::",response)
    }).catch(error => {
      console.log("get calendarlist failed ::", error);
    });
}
  

Delete Calendar :

deleteCalendar API is used to delete calendar of user. we need to pass calendarId as parameter.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.deleteCalendar("calendarid")

Handling Response

deleteCalendar API returns a promise. Response will have calendar deatils if call is successful otherwise error JSON with code and reason for error.

Calendar.deleteCalendar("1ea1f9d3b4a927b264c83c07").then(response => {
      console.log(" Calendarlist updateds ::",response)
    }).catch(error => {
      console.log("get calendarlist failed ::", error);
    });
}
  

Event API's

Calendar Library provides API's to create,update,cancel and delete events in calendar for user.

Create Event :

createEvent API is used to create event in calendar for user. we need to pass eventData as parameter.

Below is the eventdata need to be passed as parameter to createEvent API.

| Property | Type | Description | |-------------------|--------|-----------------------| | calendar_id | string | Unique calendar id| | subject | string | title of event | body | json | contentType - type of contentcontent - description of event | | start | json | start date and time of event date_time - date and time | | end | json | end date and time of event date_time - date and time | participants | array[Objects] | Event OrganizerRequired participantsOptional participants| | location | string | location of event or meeting link| | recurrence | Object | Defines the type of event| | allow_new_time_proposals | bool | allow time to change | | show_as | string | state of user |

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.createEvent({eventData})

Handling Response

createCalendar API returns a promise. Response will have event deatils if call is successful otherwise error JSON with code and reason for error.

  let eventData = {
      "calendar_id": "8fa1f9d3b4a927b264c83c00",
      "subject": "Let's chat about chat",
      "body": {
          "contentType": "HTML",
          "content": "Talk about all things chat..."
      },
      "start": {
          "date_time": "2020-04-28T17:30:00Z"
      },
      "end": {
          "date_time": "2020-04-28T18:00:00Z"
      },
      "location": {
          "display_name": "Rob's desk"
      },
      "participants": [
          {
              "user_id": "7E163156-7762-4BEB-A1C6-729EA81755A7",
              "type": "organizer"
          },
          {
              "user_id": "7E163156-7762-4BEB-A1C6-729EA81755B8",
              "type": "required"
          }
      ],
      "recurrence": {
          "pattern": {
              "type": "weekly",
              "interval": 1,
              "days_of_week": [
                  "Tuesday"
              ]
          },
          "range": {
              "type": "endDate",
              "start_date": "2020-04-28T00:00:00Z",
              "end_date": "2020-06-28T00:00:00Z"
          }
      },
      "allow_new_time_proposals": true,
      "show_as": "busy"
  }

  Calendar.createEvent(eventData).then((response) => {
      console.log("create event response ::",response)

  })
  .catch(error => {
      console.log(error);
  })
  

Update Event :

updateEvent API is used to update event for user. we need to pass userid,eventid and update event info as parameter.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.updateEvent(userid,eventid,updatedEventInfo)

Handling Response

updateEvent API returns a promise. Response will have event deatils if call is successful otherwise error JSON with code and reason for error.

  Calendar.updateEvent(userid,eventid,updatedEventInfo).then((response) => {
      console.log("create event response ::",response)

  })
  .catch(error => {
      console.log(error);
  })
  

Cancel Event :

cancelEvent API is used to cancel event for user. we need to pass userid,eventid as parameter.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.cancelEvent(userid,eventid)

Handling Response

cancelEvent API returns a promise. Response will have event deatils if call is successful otherwise error JSON with code and reason for error.

  Calendar.cancelEvent(userid,eventid).then((response) => {
      console.log("create event response ::",response)

  })
  .catch(error => {
      console.log(error);
  })
  

Delete Event :

deleteEvent API is used to delete event for user. we need to pass userid,eventid as parameter.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.deleteEvent(userid,eventid)

Handling Response

deleteEvent API returns a promise. Response will have event deatils if call is successful otherwise error JSON with code and reason for error.

  Calendar.deleteEvent(userid,eventid).then((response) => {
      console.log("create event response ::",response)

  })
  .catch(error => {
      console.log(error);
  })
  

List Events :

listEvents API is used to list events for user. We need to pass userId, calendarId, startDate and endDate as parameters. startDate and endDate are dates for which user wants to fetch the events.

import {Calendar} from '@555platform/555-calendar-sdk';
Calendar.listEvents(userId, calendarId, startDate, endDate)

Handling Response

listEvents API returns a promise. Response will have event details if call is successful otherwise error JSON with code and reason for error.

  const userId = '7E163156-7762-4BEB-A1C6-729EA81755A7';
  const calendarId = '8fa1f9d3b4a927b264c83c00';
  const startDate = '2021-06-18T00:00:00Z';
  const endDate = '2021-06-22T00:00:00Z';

  Calendar.listEvents('userId','calendarId','startDate','endDate')
  .then((response) => {
      console.log("list event response ::",response)
  })
  .catch(error => {
      console.log(" error"+error.message);
  })