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

viewpoint

v0.2.0

Published

the exchange email API for nodejs module

Downloads

4

Readme

node-viewpoint

NPM version Build Status Dependency Status Coverage Status

the exchange API for nodejs module

Install

$ npm install --save viewpoint

Usage

var EWSClient = require('viewpoint');
var client = new EWSClient(username, password, ewsUrl, config);
client.syncFolders().then(function(res) {
  console.log('sync folders successfully!');
});

More examples can refer to examples/ in the source repo.

API

Many API function return the Promise object. For simplicity, I will use Promise(ObjectType) to represent the Promise object that return the ObjectType object. e.g. for function foo that return Promise(Number), you can invoke it with foo().then(number) {}.

EWSClient

Methods

  • constructor: function(username, password, url, options). Constructor function

  • getFolder: function(folderId, opts). Get the specific folder by folderId

    • folderId: String or Object. The folderId can be like or {id: , changeKey: }. If you need distinguished id, then you should make folderId like {id: , type: 'distinguished'}

    • return: Promise(Folder). The Folder object

  • getFolders: function(folderIds, opts). Get folders by folderIds array

    • folderIds Array. The array of folderId used to get a list of folder

    • return: Promise(Array). Each item is Folder.

  • findFolders: function(opts). Get the folders by the opts

    • return: Promise(RootFolder)
  • createFolders: function(names, opts). Create the folders by the names

    • return: Promise(Array). Each item is Folder.
  • moveFolders: function(folderIds, opts). Move the folders that the id is in the folderIds.

    • return: Promise(Array). Each item is Folder.
  • syncFolders: function(opts). Synchronize the folders

    • opts: Object.

      • syncState: String. It represent the folders synchronization state.

      • folderShape: Object. The option represent what to return from server. It can like {baseShape: 'Default', additionalProperties: 'item:ParentFolderId'.

    • return: Promise(EWSSyncResponse).

  • syncFoldersWithParent: function(syncState). Synchronize the folders just like syncFolders but also the parentFolderId variable will return.

    • return: Promise(EWSSyncResponse).
  • getItem: function(itemId, opts). Get the message by the itemId.

    • itemId: String or Object. The item id is like {id: <id>} or <id>.

    • return: Promise(Item) or Promise(Message).

  • getItems: function(itemIds). Get the messages by itemIds.

    • itemIds: Array. Each item is String or Object.

    • return: Promise(Array). Each item is Message.

  • findItems: function(opts). Get the information of items that match the opts.

  • deleteItems: function(items). Delete the specific items.

  • moveItems: function(items, folder). Move the items to the destination folder.

    • folder: String or Object. The destination folder id.
  • copyItems: function(items, folder). Copy the items to the destination folder.

  • saveItems: function(opts). Save items in the specific folder.

  • sendItems: function(opts). Send items to destination mailbox.

  • sendAndSaveItems: function(opts). Send items to destination mailbox and save to the specific folder.

  • markRead: function(items). Mark the items to have read.

    • items: Array or Object. The Array of itemid or itemid.

Folder

Methods

  • totalCount: function(). The total count of items

    • return: Number
  • childFolderCount: function(). The count of child folders

    • return: Number
  • unreadCount: function(). The count of unread items

    • return: Number
  • folderClass: function(). The folder class such as 'IPF'

    • return: String
  • displayName: function(). The display name

    • return: String
  • folderId: function(). Get folder id object

    • return: Object
  • parentFolderId: function(). Get parent folder id object

    • return: Object

RootFolder

Methods

  • totalItemsInView: function(). Get the count of return items.

    • return: Number.
  • includesLastItemInRange: function(). Get whether or not the last item is included.

    • return: Bool
  • items: function(). Get the items of folder.

    • return: Array. The Array of Message.
  • folders: function(). Get the child folders of this folder.

    • return: Array. The Array of Folder.

EWSSyncResponse

Methods

  • syncState: function(). Get the current synchronization state.

    • return: String.
  • includesLastItemInRange: function(). Get whether the items include the last item.

    • return: Bool
  • creates: function(). Get the created items.

    • return: Array. Each item is Message.
  • updates: function(). Get the updated items.

    • return: Array. Each item is Message.
  • deletes: function(). Get the deleted items.

    • return: Array. Each item is Message that be deleted.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.

License

Copyright (c) 2015 liuxiong. Licensed under the MIT license.