npm.io
0.21.0 • Published 6 years ago

@docket/docket.js

Licence
MIT
Version
0.21.0
Deps
2
Size
304 kB
Vulns
0
Weekly
0

docket.js

DocketJs - JavaScript client for docket.js Docket API This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install docket.js --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your docket.js from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build
git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save
For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var DocketJs = require('docket.js');


var api = new DocketJs.DocsApi()
api.getDocs().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to http://localhost:3001/v1

Class Method HTTP request Description
DocketJs.DocsApi getDocs GET /docs Get the OpenAPI 3.x spec
DocketJs.EventsApi createMyEvent POST /my/events Create a new event for the current user
DocketJs.EventsApi deleteMyEventById DELETE /my/events/{eventId} Delete an event for the current user by it's ID
DocketJs.EventsApi getMyEventById GET /my/events/{eventId} Get an event for the current user by it's ID
DocketJs.EventsApi importMyEvents POST /my/events/import Bulk import events for the current user
DocketJs.EventsApi listMyEvents GET /my/events List the current user's events
DocketJs.EventsApi updateMyEventById PATCH /my/events/{eventId} Update an event for the current user by it's ID
DocketJs.GoogleApi getGoogleOAuthUrl GET /google/oauth-url Get the OAuth2 URL for Google services
DocketJs.GoogleApi googleGetAccessTokens GET /google/tokens Get Google access tokens
DocketJs.GoogleApi googleListCalendarLists GET /google/calendars-lists List calendar lists
DocketJs.GoogleApi googleListEventInstances GET /google/calendars/{calendarId}/events/{eventId}/instances Get event instances by ID
DocketJs.GoogleApi googleListEventsByCalendarId GET /google/calendars/{calendarId}/events List events by calendar ID
DocketJs.GoogleApi googleShowCalendarById GET /google/calendars/{calendarId} Get calendar by ID
DocketJs.GoogleApi googleShowCalendarListById GET /google/calendars-lists/{calendarListId} Get a Google calendar list by ID
DocketJs.GoogleApi googleShowEventById GET /google/calendars/{calendarId}/events/{eventId} Get event by ID
DocketJs.GoogleApi googleWatchCalendarLists POST /google/calendars-lists/watch Watch calendar lists
DocketJs.GoogleApi googleWatchEvents POST /google/calendars/{calendarId}/events/watch Watch events
DocketJs.HealthCheckApi listHealthCheck GET /health-check Health check
DocketJs.LocalesApi listLocales GET /locales List locales
DocketJs.MicrosoftApi getMicrosoftOAuthUrl GET /microsoft/oauth-url Get Microsoft OAuth URL
DocketJs.MicrosoftApi microsoftGetAccessTokens GET /microsoft/tokens Get Microsoft access tokens
DocketJs.MicrosoftApi microsoftListCalendars GET /microsoft/calendars List Microsoft calendars
DocketJs.MicrosoftApi microsoftListEventsByCalendarId GET /microsoft/calendars/{calendarId}/events List Microsoft events by calendar ID
DocketJs.SearchApi listSearchResults GET /search Perform a search
DocketJs.SessionsApi createSession POST /sessions Create a new session
DocketJs.TranslationsApi listTranslationsByLocale GET /locales/{localeCode}/translations List translations by locale code
DocketJs.UsersApi confirmRegistration POST /users/confirm-registration Confirm a new user's registration
DocketJs.UsersApi createUser POST /users Create a new user
DocketJs.UsersApi destroyMyProfile DELETE /my/profile Delete the current user
DocketJs.UsersApi forgotPassword POST /users/forgot-password Facilitates a user to reset their password
DocketJs.UsersApi getMyProfile GET /my/profile Return the current user's profile
DocketJs.UsersApi resetPassword POST /users/reset-password Reset a user's password
DocketJs.UsersApi showMyMembership GET /my/membership Get the current user's membership status
DocketJs.UsersApi updateMyMembership PATCH /my/membership Update the current user's membership status
DocketJs.UsersApi updateMyProfile PATCH /my/profile Update the current user's profile

Documentation for Models

Documentation for Authorization

bearerAuth
  • Type: Bearer authentication (JWT)