1.0.3 • Published 10 years ago

generic-note v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

Generic Note Sdk

NodeJs通用云笔记数据访问SDK, 为云笔记提供一个统一数据访问接口, 支持印象笔记(国际版、中国版)、有道云笔记等常用云笔记。目前暂时只支持印象笔记。

数据结构

note

FieldType
uidstring
titlestring
authorstring
sourceURLstring
lengthint
createdTimeTimestamp
updatedTimeTimestamp
contentstring

notebook

FieldType
uidstring
namestring
createdTimeTimestamp
updatedTimeTimestamp

user

FieldType
idstring
namestring
createdTimeTimestamp
updatedTimeTimestamp

安装

$ npm install generic-note

使用

var OAClient = GenericNote.OAuthClient(consumerKey, consumerSecret, 'evernote');
var genNote = GenericNote(accessToken, 'evernote');

API

OAClient.getRequestToken(callbackUrl, callback(error, obj))

获取oauthToken,oauthTokenSecret

OAClient.getAuthorizeUrl(oauthToken)

返回authorize url

OAClient.getAccessToken(oauthToken, oauthTokenSecret, oauthVerifier,callback(error, obj))

获取oauthAccessToken

genNote.getUser(callback(err, user))

获取当前user信息。

genNote.getNote(uid ,opts, callback(err, note))

根据uid获取一篇笔记内容。 其中opts为可选参数,可传的值有:

  • opts.withContent
  • opts.withResourcesData
  • opts.withResourcesRecognition
  • opts.withResourcesAlternateData

genNote.listNoteUidsFromBook(bookUid, offset, maxSize, callback(err, noteUidsList))

根据bookUid获取其下所有note uid列表。offset为起始偏移量,maxSize为返回最大数量。

genNote.listAllBooks(callback(err, booklist))

获取所有notebook列表。

genNote.findNoteCounts(bookUid, callback(err, counts))

根据bookUid获取当前book下note总数。

genNote.listNotesMetadataFromBook(bookUid, offset, maxSize, callback(err, notelist))

根据bookUid获取其下note的metadata列表信息。offset为起始偏移量,maxSize为返回最大数量。

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago

0.1.0

10 years ago