diff --git a/evernote/evernote-tests.ts b/evernote/evernote-tests.ts new file mode 100644 index 000000000..ce84750fa --- /dev/null +++ b/evernote/evernote-tests.ts @@ -0,0 +1,5 @@ +/// + +import { Evernote } from "evernote"; + +var client = new Evernote.Client({ token: "abcdef", sandbox: true }); diff --git a/evernote/evernote.d.ts b/evernote/evernote.d.ts new file mode 100644 index 000000000..75aa724ea --- /dev/null +++ b/evernote/evernote.d.ts @@ -0,0 +1,6322 @@ +// Type definitions for evernote v 1.25.8 +// Project: https://www.npmjs.com/package/evernote +// Definitions by: Zachary Collins +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare module "evernote" { + import { Thrift } from "thrift"; + + module Evernote { + interface Callback { + (err: EDAMUserException|EDAMSystemException|EDAMNotFoundException, v: T): void + } + + interface ClientConfig { + consumerKey?: string + consumerSecret?: string + sandbox?: boolean + token?: string + serviceHost?: string + additionalHeaders?: { [k: string]: string } + secret?: string + } + + class Client { + static "new": (config: ClientConfig) => Client + constructor(config: ClientConfig); + getNoteStore(): NoteStoreClient; + getUserStore(): UserStoreClient; + } + + + /** + * Numeric codes indicating the type of error that occurred on the + * service. + *
+ *
UNKNOWN
+ *
No information available about the error
+ *
BAD_DATA_FORMAT
+ *
The format of the request data was incorrect
+ *
PERMISSION_DENIED
+ *
Not permitted to perform action
+ *
INTERNAL_ERROR
+ *
Unexpected problem with the service
+ *
DATA_REQUIRED
+ *
A required parameter/field was absent
+ *
LIMIT_REACHED
+ *
Operation denied due to data model limit
+ *
QUOTA_REACHED
+ *
Operation denied due to user storage limit
+ *
INVALID_AUTH
+ *
Username and/or password incorrect
+ *
AUTH_EXPIRED
+ *
Authentication token expired
+ *
DATA_CONFLICT
+ *
Change denied due to data model conflict
+ *
ENML_VALIDATION
+ *
Content of submitted note was malformed
+ *
SHARD_UNAVAILABLE
+ *
Service shard with account data is temporarily down
+ *
LEN_TOO_SHORT
+ *
Operation denied due to data model limit, where something such + * as a string length was too short
+ *
LEN_TOO_LONG
+ *
Operation denied due to data model limit, where something such + * as a string length was too long
+ *
TOO_FEW
+ *
Operation denied due to data model limit, where there were + * too few of something.
+ *
TOO_MANY
+ *
Operation denied due to data model limit, where there were + * too many of something.
+ *
UNSUPPORTED_OPERATION
+ *
Operation denied because it is currently unsupported.
+ *
TAKEN_DOWN
+ *
Operation denied because access to the corresponding object is + * prohibited in response to a take-down notice.
+ *
RATE_LIMIT_REACHED
+ *
Operation denied because the calling application has reached + * its hourly API call limit for this user.
+ *
+ */ + enum EDAMErrorCode { + 'UNKNOWN' = 1, + 'BAD_DATA_FORMAT' = 2, + 'PERMISSION_DENIED' = 3, + 'INTERNAL_ERROR' = 4, + 'DATA_REQUIRED' = 5, + 'LIMIT_REACHED' = 6, + 'QUOTA_REACHED' = 7, + 'INVALID_AUTH' = 8, + 'AUTH_EXPIRED' = 9, + 'DATA_CONFLICT' = 10, + 'ENML_VALIDATION' = 11, + 'SHARD_UNAVAILABLE' = 12, + 'LEN_TOO_SHORT' = 13, + 'LEN_TOO_LONG' = 14, + 'TOO_FEW' = 15, + 'TOO_MANY' = 16, + 'UNSUPPORTED_OPERATION' = 17, + 'TAKEN_DOWN' = 18, + 'RATE_LIMIT_REACHED' = 19, + } + + /** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem that a caller may be able to resolve. For example, if the user + * attempts to add a note to their account which would exceed their storage + * quota, this type of exception may be thrown to indicate the source of the + * error so that they can choose an alternate action. + * + * This exception would not be used for internal system errors that do not + * reflect user actions, but rather reflect a problem within the service that + * the user cannot resolve. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * parameter: If the error applied to a particular input parameter, this will + * indicate which parameter. + */ + class EDAMUserException extends Thrift.TException { + errorCode: EDAMErrorCode; + parameter: string; + + constructor(args?: { errorCode: EDAMErrorCode; parameter?: string; }); + } + + /** + * This exception is thrown by EDAM procedures when a call fails as a result of + * a problem in the service that could not be changed through caller action. + * + * errorCode: The numeric code indicating the type of error that occurred. + * must be one of the values of EDAMErrorCode. + * + * message: This may contain additional information about the error + * + * rateLimitDuration: Indicates the minimum number of seconds that an application should + * expect subsequent API calls for this user to fail. The application should not retry + * API requests for the user until at least this many seconds have passed. Present only + * when errorCode is RATE_LIMIT_REACHED, + */ + class EDAMSystemException extends Thrift.TException { + errorCode: EDAMErrorCode; + message: string; + rateLimitDuration: number; + + constructor(args?: { errorCode: EDAMErrorCode; message?: string; rateLimitDuration?: number; }); + } + + /** + * This exception is thrown by EDAM procedures when a caller asks to perform + * an operation on an object that does not exist. This may be thrown based on an invalid + * primary identifier (e.g. a bad GUID), or when the caller refers to an object + * by another unique identifier (e.g. a User's email address). + * + * identifier: A description of the object that was not found on the server. + * For example, "Note.notebookGuid" when a caller attempts to create a note in a + * notebook that does not exist in the user's account. + * + * key: The value passed from the client in the identifier, which was not + * found. For example, the GUID that was not found. + */ + class EDAMNotFoundException extends Thrift.TException { + identifier: string; + key: string; + + constructor(args?: { identifier?: string; key?: string; }); + } + /** + * Minimum length of any string-based attribute, in Unicode chars + */ + var EDAM_ATTRIBUTE_LEN_MIN: number; + + /** + * Maximum length of any string-based attribute, in Unicode chars + */ + var EDAM_ATTRIBUTE_LEN_MAX: number; + + /** + * Any string-based attribute must match the provided regular expression. + * This excludes all Unicode line endings and control characters. + */ + var EDAM_ATTRIBUTE_REGEX: string; + + /** + * The maximum number of values that can be stored in a list-based attribute + * (e.g. see UserAttributes.recentMailedAddresses) + */ + var EDAM_ATTRIBUTE_LIST_MAX: number; + + /** + * The maximum number of entries that can be stored in a map-based attribute + * such as applicationData fields in Resources and Notes. + */ + var EDAM_ATTRIBUTE_MAP_MAX: number; + + /** + * The minimum length of a GUID generated by the Evernote service + */ + var EDAM_GUID_LEN_MIN: number; + + /** + * The maximum length of a GUID generated by the Evernote service + */ + var EDAM_GUID_LEN_MAX: number; + + /** + * GUIDs generated by the Evernote service will match the provided pattern + */ + var EDAM_GUID_REGEX: string; + + /** + * The minimum length of any email address + */ + var EDAM_EMAIL_LEN_MIN: number; + + /** + * The maximum length of any email address + */ + var EDAM_EMAIL_LEN_MAX: number; + + /** + * A regular expression that matches the part of an email address before + * the '@' symbol. + */ + var EDAM_EMAIL_LOCAL_REGEX: string; + + /** + * A regular expression that matches the part of an email address after + * the '@' symbol. + */ + var EDAM_EMAIL_DOMAIN_REGEX: string; + + /** + * A regular expression that must match any email address given to Evernote. + * Email addresses must comply with RFC 2821 and 2822. + */ + var EDAM_EMAIL_REGEX: string; + + /** + * A regular expression that must match any VAT ID given to Evernote. + * ref http://en.wikipedia.org/wiki/VAT_identification_number + * ref http://my.safaribooksonline.com/book/programming/regular-expressions/9780596802837/4dot-validation-and-formatting/id2995136 + */ + var EDAM_VAT_REGEX: string; + + /** + * The minimum length of a timezone specification string + */ + var EDAM_TIMEZONE_LEN_MIN: number; + + /** + * The maximum length of a timezone specification string + */ + var EDAM_TIMEZONE_LEN_MAX: number; + + /** + * Any timezone string given to Evernote must match the provided pattern. + * This permits either a locale-based standard timezone or a GMT offset. + * E.g.:
    + *
  • America/Los_Angeles
  • + *
  • GMT+08:00
  • + *
+ */ + var EDAM_TIMEZONE_REGEX: string; + + /** + * The minimum length of any MIME type string given to Evernote + */ + var EDAM_MIME_LEN_MIN: number; + + /** + * The maximum length of any MIME type string given to Evernote + */ + var EDAM_MIME_LEN_MAX: number; + + /** + * Any MIME type string given to Evernote must match the provided pattern. + * E.g.: image/gif + */ + var EDAM_MIME_REGEX: string; + + /** + * Canonical MIME type string for GIF image resources + */ + var EDAM_MIME_TYPE_GIF: string; + + /** + * Canonical MIME type string for JPEG image resources + */ + var EDAM_MIME_TYPE_JPEG: string; + + /** + * Canonical MIME type string for PNG image resources + */ + var EDAM_MIME_TYPE_PNG: string; + + /** + * Canonical MIME type string for WAV audio resources + */ + var EDAM_MIME_TYPE_WAV: string; + + /** + * Canonical MIME type string for MP3 audio resources + */ + var EDAM_MIME_TYPE_MP3: string; + + /** + * Canonical MIME type string for AMR audio resources + */ + var EDAM_MIME_TYPE_AMR: string; + + /** + * Canonical MIME type string for AAC audio resources + */ + var EDAM_MIME_TYPE_AAC: string; + + /** + * Canonical MIME type string for MP4 audio resources + */ + var EDAM_MIME_TYPE_M4A: string; + + /** + * Canonical MIME type string for MP4 video resources + */ + var EDAM_MIME_TYPE_MP4_VIDEO: string; + + /** + * Canonical MIME type string for Evernote Ink resources + */ + var EDAM_MIME_TYPE_INK: string; + + /** + * Canonical MIME type string for PDF resources + */ + var EDAM_MIME_TYPE_PDF: string; + + /** + * MIME type used for attachments of an unspecified type + */ + var EDAM_MIME_TYPE_DEFAULT: string; + + /** + * The set of resource MIME types that are expected to be handled + * correctly by all of the major Evernote client applications. + */ + var EDAM_MIME_TYPES: string[]; + + /** + * The set of MIME types that Evernote will parse and index for + * searching. With exception of images, and PDFs, which are + * handled in a different way. + */ + var EDAM_INDEXABLE_RESOURCE_MIME_TYPES: string[]; + + /** + * The minimum length of a user search query string in Unicode chars + */ + var EDAM_SEARCH_QUERY_LEN_MIN: number; + + /** + * The maximum length of a user search query string in Unicode chars + */ + var EDAM_SEARCH_QUERY_LEN_MAX: number; + + /** + * Search queries must match the provided pattern. This is used for + * both ad-hoc queries and SavedSearch.query fields. + * This excludes all control characters and line/paragraph separators. + */ + var EDAM_SEARCH_QUERY_REGEX: string; + + /** + * The exact length of a MD5 hash checksum, in binary bytes. + * This is the exact length that must be matched for any binary hash + * value. + */ + var EDAM_HASH_LEN: number; + + /** + * The minimum length of an Evernote username + */ + var EDAM_USER_USERNAME_LEN_MIN: number; + + /** + * The maximum length of an Evernote username + */ + var EDAM_USER_USERNAME_LEN_MAX: number; + + /** + * Any Evernote User.username field must match this pattern. This + * restricts usernames to a format that could permit use as a domain + * name component. E.g. "username.whatever.evernote.com" + */ + var EDAM_USER_USERNAME_REGEX: string; + + /** + * Minimum length of the User.name field + */ + var EDAM_USER_NAME_LEN_MIN: number; + + /** + * Maximum length of the User.name field + */ + var EDAM_USER_NAME_LEN_MAX: number; + + /** + * The User.name field must match this pattern, which excludes line + * endings and control characters. + */ + var EDAM_USER_NAME_REGEX: string; + + /** + * The minimum length of a Tag.name, in Unicode characters + */ + var EDAM_TAG_NAME_LEN_MIN: number; + + /** + * The maximum length of a Tag.name, in Unicode characters + */ + var EDAM_TAG_NAME_LEN_MAX: number; + + /** + * All Tag.name fields must match this pattern. + * This excludes control chars, commas or line/paragraph separators. + * The string may not begin or end with whitespace. + */ + var EDAM_TAG_NAME_REGEX: string; + + /** + * The minimum length of a Note.title, in Unicode characters + */ + var EDAM_NOTE_TITLE_LEN_MIN: number; + + /** + * The maximum length of a Note.title, in Unicode characters + */ + var EDAM_NOTE_TITLE_LEN_MAX: number; + + /** + * All Note.title fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ + var EDAM_NOTE_TITLE_REGEX: string; + + /** + * Minimum length of a Note.content field. + * Note.content fields must comply with the ENML DTD. + */ + var EDAM_NOTE_CONTENT_LEN_MIN: number; + + /** + * Maximum length of a Note.content field + * Note.content fields must comply with the ENML DTD. + */ + var EDAM_NOTE_CONTENT_LEN_MAX: number; + + /** + * Minimum length of an application name, which is the key in an + * applicationData LazyMap found in entities such as Resources and + * Notes. + */ + var EDAM_APPLICATIONDATA_NAME_LEN_MIN: number; + + /** + * Maximum length of an application name, which is the key in an + * applicationData LazyMap found in entities such as Resources and + * Notes. + */ + var EDAM_APPLICATIONDATA_NAME_LEN_MAX: number; + + /** + * Minimum length of an applicationData value in a LazyMap, found + * in entities such as Resources and Notes. + */ + var EDAM_APPLICATIONDATA_VALUE_LEN_MIN: number; + + /** + * Maximum length of an applicationData value in a LazyMap, found + * in entities such as Resources and Notes. Note, however, that + * the sum of the size of hte key and value is constrained by + * EDAM_APPLICATIONDATA_ENTRY_LEN_MAX, so the maximum length, in + * practice, depends upon the key value being used. + */ + var EDAM_APPLICATIONDATA_VALUE_LEN_MAX: number; + + /** + * The total length of an entry in an applicationData LazyMap, which + * is the sum of the length of the key and the value for the entry. + */ + var EDAM_APPLICATIONDATA_ENTRY_LEN_MAX: number; + + /** + * An application name must match this regex. An application + * name is the key portion of an entry in an applicationData + * map as found in entities such as Resources and Notes. + * Note that even if both the name and value regexes match, + * it is still necessary to check the sum of the lengths + * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. + */ + var EDAM_APPLICATIONDATA_NAME_REGEX: string; + + /** + * An applicationData map value must match this regex. + * Note that even if both the name and value regexes match, + * it is still necessary to check the sum of the lengths + * against EDAM_APPLICATIONDATA_ENTRY_LEN_MAX. + */ + var EDAM_APPLICATIONDATA_VALUE_REGEX: string; + + /** + * The minimum length of a Notebook.name, in Unicode characters + */ + var EDAM_NOTEBOOK_NAME_LEN_MIN: number; + + /** + * The maximum length of a Notebook.name, in Unicode characters + */ + var EDAM_NOTEBOOK_NAME_LEN_MAX: number; + + /** + * All Notebook.name fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ + var EDAM_NOTEBOOK_NAME_REGEX: string; + + /** + * The minimum length of a Notebook.stack, in Unicode characters + */ + var EDAM_NOTEBOOK_STACK_LEN_MIN: number; + + /** + * The maximum length of a Notebook.stack, in Unicode characters + */ + var EDAM_NOTEBOOK_STACK_LEN_MAX: number; + + /** + * All Notebook.stack fields must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ + var EDAM_NOTEBOOK_STACK_REGEX: string; + + /** + * The minimum length of a public notebook URI component + */ + var EDAM_PUBLISHING_URI_LEN_MIN: number; + + /** + * The maximum length of a public notebook URI component + */ + var EDAM_PUBLISHING_URI_LEN_MAX: number; + + /** + * A public notebook URI component must match the provided pattern + */ + var EDAM_PUBLISHING_URI_REGEX: string; + + /** + * The set of strings that may not be used as a publishing URI + */ + var EDAM_PUBLISHING_URI_PROHIBITED: string[]; + + /** + * The minimum length of a Publishing.publicDescription field. + */ + var EDAM_PUBLISHING_DESCRIPTION_LEN_MIN: number; + + /** + * The maximum length of a Publishing.publicDescription field. + */ + var EDAM_PUBLISHING_DESCRIPTION_LEN_MAX: number; + + /** + * Any public notebook's Publishing.publicDescription field must match + * this pattern. + * No control chars or line/paragraph separators, and can't start or + * end with whitespace. + */ + var EDAM_PUBLISHING_DESCRIPTION_REGEX: string; + + /** + * The minimum length of a SavedSearch.name field + */ + var EDAM_SAVED_SEARCH_NAME_LEN_MIN: number; + + /** + * The maximum length of a SavedSearch.name field + */ + var EDAM_SAVED_SEARCH_NAME_LEN_MAX: number; + + /** + * SavedSearch.name fields must match this pattern. + * No control chars or line/paragraph separators, and can't start or + * end with whitespace. + */ + var EDAM_SAVED_SEARCH_NAME_REGEX: string; + + /** + * The minimum length of an Evernote user password + */ + var EDAM_USER_PASSWORD_LEN_MIN: number; + + /** + * The maximum length of an Evernote user password + */ + var EDAM_USER_PASSWORD_LEN_MAX: number; + + /** + * Evernote user passwords must match this regular expression + */ + var EDAM_USER_PASSWORD_REGEX: string; + + /** + * The maximum length of an Evernote Business URI + */ + var EDAM_BUSINESS_URI_LEN_MAX: number; + + /** + * The maximum number of Tags per Note + */ + var EDAM_NOTE_TAGS_MAX: number; + + /** + * The maximum number of Resources per Note + */ + var EDAM_NOTE_RESOURCES_MAX: number; + + /** + * Maximum number of Tags per account + */ + var EDAM_USER_TAGS_MAX: number; + + /** + * Maximum number of Tags per business account. + */ + var EDAM_BUSINESS_TAGS_MAX: number; + + /** + * Maximum number of SavedSearches per account + */ + var EDAM_USER_SAVED_SEARCHES_MAX: number; + + /** + * Maximum number of Notes per user + */ + var EDAM_USER_NOTES_MAX: number; + + /** + * Maximum number of Notes per business account + */ + var EDAM_BUSINESS_NOTES_MAX: number; + + /** + * Maximum number of Notebooks per user + */ + var EDAM_USER_NOTEBOOKS_MAX: number; + + /** + * Maximum number of Notebooks in a business account + */ + var EDAM_BUSINESS_NOTEBOOKS_MAX: number; + + /** + * Maximum number of recent email addresses that are maintained + * (see UserAttributes.recentMailedAddresses) + */ + var EDAM_USER_RECENT_MAILED_ADDRESSES_MAX: number; + + /** + * The number of emails of any type that can be sent by a user with a Free + * account from the service per day. If an email is sent to two different + * recipients, this counts as two emails. + */ + var EDAM_USER_MAIL_LIMIT_DAILY_FREE: number; + + /** + * The number of emails of any type that can be sent by a user with a Premium + * account from the service per day. If an email is sent to two different + * recipients, this counts as two emails. + */ + var EDAM_USER_MAIL_LIMIT_DAILY_PREMIUM: number; + + /** + * The number of bytes of new data that may be uploaded to a Free user's + * account each month. + */ + var EDAM_USER_UPLOAD_LIMIT_FREE: number; + + /** + * The number of bytes of new data that may be uploaded to a Premium user's + * account each month. + */ + var EDAM_USER_UPLOAD_LIMIT_PREMIUM: number; + + /** + * The number of bytes of new data that may be uploaded to a Business user's + * personal account each month. Note that content uploaded into the Business + * notebooks by the user does not count against this limit. + */ + var EDAM_USER_UPLOAD_LIMIT_BUSINESS: number; + + /** + * Maximum total size of a Note that can be added to a Free account. + * The size of a note is calculated as: + * ENML content length (in Unicode characters) plus the sum of all resource + * sizes (in bytes). + */ + var EDAM_NOTE_SIZE_MAX_FREE: number; + + /** + * Maximum total size of a Note that can be added to a Premium account. + * The size of a note is calculated as: + * ENML content length (in Unicode characters) plus the sum of all resource + * sizes (in bytes). + */ + var EDAM_NOTE_SIZE_MAX_PREMIUM: number; + + /** + * Maximum size of a resource, in bytes, for Free accounts + */ + var EDAM_RESOURCE_SIZE_MAX_FREE: number; + + /** + * Maximum size of a resource, in bytes, for Premium accounts + */ + var EDAM_RESOURCE_SIZE_MAX_PREMIUM: number; + + /** + * Maximum number of linked notebooks per account, for a free + * account. + */ + var EDAM_USER_LINKED_NOTEBOOK_MAX: number; + + /** + * Maximum number of linked notebooks per account, for a premium + * account. Users who are part of an active business are also + * covered under "premium". + */ + var EDAM_USER_LINKED_NOTEBOOK_MAX_PREMIUM: number; + + /** + * Maximum number of shared notebooks per notebook + */ + var EDAM_NOTEBOOK_SHARED_NOTEBOOK_MAX: number; + + /** + * The minimum length of the content class attribute of a note. + */ + var EDAM_NOTE_CONTENT_CLASS_LEN_MIN: number; + + /** + * The maximum length of the content class attribute of a note. + */ + var EDAM_NOTE_CONTENT_CLASS_LEN_MAX: number; + + /** + * The regular expression that the content class of a note must match + * to be valid. + */ + var EDAM_NOTE_CONTENT_CLASS_REGEX: string; + + /** + * The content class prefix used for all notes created by Evernote Hello. + * This prefix can be used to assemble individual content class strings, + * or can be used to create a wildcard search to get all notes created by + * Hello. When performing a wildcard search via filtered sync chunks or + * search strings, the * character must be appended to this constant. + */ + var EDAM_HELLO_APP_CONTENT_CLASS_PREFIX: string; + + /** + * The content class prefix used for all notes created by Evernote Food. + * This prefix can be used to assemble individual content class strings, + * or can be used to create a wildcard search to get all notes created by + * Food. When performing a wildcard search via filtered sync chunks or + * search strings, the * character must be appended to this constant. + */ + var EDAM_FOOD_APP_CONTENT_CLASS_PREFIX: string; + + /** + * The content class prefix used for structured notes created by Evernote + * Hello that represents an encounter with a person. When performing a + * wildcard search via filtered sync chunks or search strings, the * + * character must be appended to this constant. + */ + var EDAM_CONTENT_CLASS_HELLO_ENCOUNTER: string; + + /** + * The content class prefix used for structured notes created by Evernote + * Hello that represents the user's profile. When performing a + * wildcard search via filtered sync chunks or search strings, the * + * character must be appended to this constant. + */ + var EDAM_CONTENT_CLASS_HELLO_PROFILE: string; + + /** + * The content class prefix used for structured notes created by + * Evernote Food that captures the experience of a particular meal. + * When performing a wildcard search via filtered sync chunks or search + * strings, the * character must be appended to this constant. + */ + var EDAM_CONTENT_CLASS_FOOD_MEAL: string; + + /** + * The content class prefix used for structured notes created by Evernote + * Skitch. When performing a wildcard search via filtered sync chunks + * or search strings, the * character must be appended to this constant. + */ + var EDAM_CONTENT_CLASS_SKITCH_PREFIX: string; + + /** + * The content class value used for structured image notes created by Evernote + * Skitch. + */ + var EDAM_CONTENT_CLASS_SKITCH: string; + + /** + * The content class value used for structured PDF notes created by Evernote + * Skitch. + */ + var EDAM_CONTENT_CLASS_SKITCH_PDF: string; + + /** + * The content class prefix used for structured notes created by Evernote + * Penultimate. When performing a wildcard search via filtered sync chunks + * or search strings, the * character must be appended to this constant. + */ + var EDAM_CONTENT_CLASS_PENULTIMATE_PREFIX: string; + + /** + * The content class value used for structured notes created by Evernote + * Penultimate that represents a Penultimate notebook. + */ + var EDAM_CONTENT_CLASS_PENULTIMATE_NOTEBOOK: string; + + /** + * The minimum length of the plain text in a findRelated query, assuming that + * plaintext is being provided. + */ + var EDAM_RELATED_PLAINTEXT_LEN_MIN: number; + + /** + * The maximum length of the plain text in a findRelated query, assuming that + * plaintext is being provided. + */ + var EDAM_RELATED_PLAINTEXT_LEN_MAX: number; + + /** + * The maximum number of notes that will be returned from a findRelated() + * query. + */ + var EDAM_RELATED_MAX_NOTES: number; + + /** + * The maximum number of notebooks that will be returned from a findRelated() + * query. + */ + var EDAM_RELATED_MAX_NOTEBOOKS: number; + + /** + * The maximum number of tags that will be returned from a findRelated() query. + */ + var EDAM_RELATED_MAX_TAGS: number; + + /** + * The minimum length, in Unicode characters, of a description for a business + * notebook. + */ + var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN: number; + + /** + * The maximum length, in Unicode characters, of a description for a business + * notebook. + */ + var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX: number; + + /** + * All business notebook descriptions must match this pattern. + * This excludes control chars or line/paragraph separators. + * The string may not begin or end with whitespace. + */ + var EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX: string; + + /** + * The maximum length of a business phone number. + */ + var EDAM_BUSINESS_PHONE_NUMBER_LEN_MAX: number; + + /** + * Minimum length of a preference name + */ + var EDAM_PREFERENCE_NAME_LEN_MIN: number; + + /** + * Maximum length of a preference name + */ + var EDAM_PREFERENCE_NAME_LEN_MAX: number; + + /** + * Minimum length of a preference value + */ + var EDAM_PREFERENCE_VALUE_LEN_MIN: number; + + /** + * Maximum length of a preference value + */ + var EDAM_PREFERENCE_VALUE_LEN_MAX: number; + + /** + * Maximum number of name/value pairs allowed + */ + var EDAM_MAX_PREFERENCES: number; + + /** + * Maximum number of values per preference name + */ + var EDAM_MAX_VALUES_PER_PREFERENCE: number; + + /** + * A preference name must match this regex. + */ + var EDAM_PREFERENCE_NAME_REGEX: string; + + /** + * A preference value must match this regex. + */ + var EDAM_PREFERENCE_VALUE_REGEX: string; + + /** + * The name of the preferences entry that contains shortcuts. + */ + var EDAM_PREFERENCE_SHORTCUTS: string; + + /** + * The maximum number of shortcuts that a user may have. + */ + var EDAM_PREFERENCE_SHORTCUTS_MAX_VALUES: number; + + /** + * Maximum length of the device identifier string associated with long sessions. + */ + var EDAM_DEVICE_ID_LEN_MAX: number; + + /** + * Regular expression for device identifier strings associated with long sessions. + */ + var EDAM_DEVICE_ID_REGEX: string; + + /** + * Maximum length of the device description string associated with long sessions. + */ + var EDAM_DEVICE_DESCRIPTION_LEN_MAX: number; + + /** + * Regular expression for device description strings associated with long sessions. + */ + var EDAM_DEVICE_DESCRIPTION_REGEX: string; + + /** + * Maximum number of search suggestions that can be returned + */ + var EDAM_SEARCH_SUGGESTIONS_MAX: number; + + /** + * Maximum length of the search suggestion prefix + */ + var EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MAX: number; + + /** + * Minimum length of the search suggestion prefix + */ + var EDAM_SEARCH_SUGGESTIONS_PREFIX_LEN_MIN: number; + class NoteStoreClient { + seqid: number; + + /** + * Asks the NoteStore to provide information about the status of the user + * account corresponding to the provided authentication token. + */ + getSyncState(cb: Callback): void; + + /** + * Asks the NoteStore to provide information about the status of the user + * account corresponding to the provided authentication token. + * This version of 'getSyncState' allows the client to upload coarse- + * grained usage metrics to the service. + * + * @param clientMetrics see the documentation of the ClientUsageMetrics + * structure for an explanation of the fields that clients can pass to + * the service. + */ + getSyncStateWithMetrics(clientMetrics: ClientUsageMetrics, cb: Callback): void; + + /** + * Asks the NoteStore to provide the state of the account in order of + * last modification. This request retrieves one block of the server's + * state so that a client can make several small requests against a large + * account rather than getting the entire state in one big message. + * This call gives fine-grained control of the data that will + * be received by a client by omitting data elements that a client doesn't + * need. This may reduce network traffic and sync times. + * + * @param afterUSN + * The client can pass this value to ask only for objects that + * have been updated after a certain point. This allows the client to + * receive updates after its last checkpoint rather than doing a full + * synchronization on every pass. The default value of "0" indicates + * that the client wants to get objects from the start of the account. + * + * @param maxEntries + * The maximum number of modified objects that should be + * returned in the result SyncChunk. This can be used to limit the size + * of each individual message to be friendly for network transfer. + * + * @param filter + * The caller must set some of the flags in this structure to specify which + * data types should be returned during the synchronization. See + * the SyncChunkFilter structure for information on each flag. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "afterUSN" - if negative + *
  • + *
  • BAD_DATA_FORMAT "maxEntries" - if less than 1 + *
  • + *
+ */ + getFilteredSyncChunk(afterUSN: number, maxEntries: number, filter: SyncChunkFilter, cb: Callback): void; + + /** + * Asks the NoteStore to provide information about the status of a linked + * notebook that has been shared with the caller, or that is public to the + * world. + * This will return a result that is similar to getSyncState, but may omit + * SyncState.uploaded if the caller doesn't have permission to write to + * the linked notebook. + * + * This function must be called on the shard that owns the referenced + * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the + * same as LinkedNotebook.shardId.) + * + * @param authenticationToken + * This should be an authenticationToken for the guest who has received + * the invitation to the share. (I.e. this should not be the result of + * NoteStore.authenticateToSharedNotebook) + * + * @param linkedNotebook + * This structure should contain identifying information and permissions + * to access the notebook in question. + */ + getLinkedNotebookSyncState(linkedNotebook: LinkedNotebook, cb: Callback): void; + + /** + * Asks the NoteStore to provide information about the contents of a linked + * notebook that has been shared with the caller, or that is public to the + * world. + * This will return a result that is similar to getSyncChunk, but will only + * contain entries that are visible to the caller. I.e. only that particular + * Notebook will be visible, along with its Notes, and Tags on those Notes. + * + * This function must be called on the shard that owns the referenced + * notebook. (I.e. the shardId in /shard/shardId/edam/note must be the + * same as LinkedNotebook.shardId.) + * + * @param authenticationToken + * This should be an authenticationToken for the guest who has received + * the invitation to the share. (I.e. this should not be the result of + * NoteStore.authenticateToSharedNotebook) + * + * @param linkedNotebook + * This structure should contain identifying information and permissions + * to access the notebook in question. This must contain the valid fields + * for either a shared notebook (e.g. shareKey) + * or a public notebook (e.g. username, uri) + * + * @param afterUSN + * The client can pass this value to ask only for objects that + * have been updated after a certain point. This allows the client to + * receive updates after its last checkpoint rather than doing a full + * synchronization on every pass. The default value of "0" indicates + * that the client wants to get objects from the start of the account. + * + * @param maxEntries + * The maximum number of modified objects that should be + * returned in the result SyncChunk. This can be used to limit the size + * of each individual message to be friendly for network transfer. + * Applications should not request more than 256 objects at a time, + * and must handle the case where the service returns less than the + * requested number of objects in a given request even though more + * objects are available on the service. + * + * @param fullSyncOnly + * If true, then the client only wants initial data for a full sync. + * In this case, the service will not return any expunged objects, + * and will not return any Resources, since these are also provided + * in their corresponding Notes. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "afterUSN" - if negative + *
  • + *
  • BAD_DATA_FORMAT "maxEntries" - if less than 1 + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "LinkedNotebook" - if the provided information doesn't match any + * valid notebook + *
  • + *
  • "LinkedNotebook.uri" - if the provided public URI doesn't match any + * valid notebook + *
  • + *
  • "SharedNotebook.id" - if the provided information indicates a + * shared notebook that no longer exists + *
  • + *
+ */ + getLinkedNotebookSyncChunk(linkedNotebook: LinkedNotebook, afterUSN: number, maxEntries: number, fullSyncOnly: boolean, cb: Callback): void; + + /** + * Returns a list of all of the notebooks in the account. + */ + listNotebooks(cb: Callback): void; + + /** + * Returns the current state of the notebook with the provided GUID. + * The notebook may be active or deleted (but not expunged). + * + * @param guid + * The GUID of the notebook to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - tag not found, by GUID + *
  • + *
+ */ + getNotebook(guid: string, cb: Callback): void; + + /** + * Returns the notebook that should be used to store new notes in the + * user's account when no other notebooks are specified. + */ + getDefaultNotebook(cb: Callback): void; + + /** + * Asks the service to make a notebook with the provided name. + * + * @param notebook + * The desired fields for the notebook must be provided on this + * object. The name of the notebook must be set, and either the 'active' + * or 'defaultNotebook' fields may be set by the client at creation. + * If a notebook exists in the account with the same name (via + * case-insensitive compare), this will throw an EDAMUserException. + * + * @return + * The newly created Notebook. The server-side GUID will be + * saved in this object's 'guid' field. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri + *
  • + *
  • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long + *
  • + *
  • DATA_CONFLICT "Notebook.name" - name already in use + *
  • + *
  • DATA_CONFLICT "Publishing.uri" - if URI already in use + *
  • + *
  • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing + *
  • + *
  • LIMIT_REACHED "Notebook" - at max number of notebooks + *
  • + *
+ */ + createNotebook(notebook: Notebook, cb: Callback): void; + + /** + * Submits notebook changes to the service. The provided data must include + * the notebook's guid field for identification. + * + * @param notebook + * The notebook object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Notebook.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Notebook.stack" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Publishing.uri" - if publishing set but bad uri + *
  • + *
  • BAD_DATA_FORMAT "Publishing.publicDescription" - if too long + *
  • + *
  • DATA_CONFLICT "Notebook.name" - name already in use + *
  • + *
  • DATA_CONFLICT "Publishing.uri" - if URI already in use + *
  • + *
  • DATA_REQUIRED "Publishing.uri" - if publishing set but uri missing + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - not found, by GUID + *
  • + *
+ */ + updateNotebook(notebook: Notebook, cb: Callback): void; + + /** + * Permanently removes the notebook from the user's account. + * After this action, the notebook is no longer available for undeletion, etc. + * If the notebook contains any Notes, they will be moved to the current + * default notebook and moved into the trash (i.e. Note.active=false). + *

+ * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The GUID of the notebook to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException

    + *
  • BAD_DATA_FORMAT "Notebook.guid" - if the parameter is missing + *
  • + *
  • LIMIT_REACHED "Notebook" - trying to expunge the last Notebook + *
  • + *
  • PERMISSION_DENIED "Notebook" - private notebook, user doesn't own + *
  • + *
+ */ + expungeNotebook(guid: string, cb: Callback): void; + + /** + * Returns a list of the tags in the account. Evernote does not support + * the undeletion of tags, so this will only include active tags. + */ + listTags(cb: Callback): void; + + /** + * Returns a list of the tags that are applied to at least one note within + * the provided notebook. If the notebook is public, the authenticationToken + * may be ignored. + * + * @param notebookGuid + * the GUID of the notebook to use to find tags + * + * @throws EDAMNotFoundException
    + *
  • "Notebook.guid" - notebook not found by GUID + *
  • + *
+ */ + listTagsByNotebook(notebookGuid: string, cb: Callback): void; + + /** + * Returns the current state of the Tag with the provided GUID. + * + * @param guid + * The GUID of the tag to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - private Tag, user doesn't own + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + getTag(guid: string, cb: Callback): void; + + /** + * Asks the service to make a tag with a set of information. + * + * @param tag + * The desired list of fields for the tag are specified in this + * object. The caller must specify the tag name, and may provide + * the parentGUID. + * + * @return + * The newly created Tag. The server-side GUID will be + * saved in this object. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID + *
  • + *
  • DATA_CONFLICT "Tag.name" - name already in use + *
  • + *
  • LIMIT_REACHED "Tag" - at max number of tags + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.parentGuid" - not found, by GUID + *
  • + *
+ */ + createTag(tag: Tag, cb: Callback): void; + + /** + * Submits tag changes to the service. The provided data must include + * the tag's guid field for identification. The service will apply + * updates to the following tag fields: name, parentGuid + * + * @param tag + * The tag object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.name" - invalid length or pattern + *
  • + *
  • BAD_DATA_FORMAT "Tag.parentGuid" - malformed GUID + *
  • + *
  • DATA_CONFLICT "Tag.name" - name already in use + *
  • + *
  • DATA_CONFLICT "Tag.parentGuid" - can't set parent: circular + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
  • "Tag.parentGuid" - parent not found, by GUID + *
  • + *
+ */ + updateTag(tag: Tag, cb: Callback): void; + + /** + * Removes the provided tag from every note that is currently tagged with + * this tag. If this operation is successful, the tag will still be in + * the account, but it will not be tagged on any notes. + * + * This function is not indended for use by full synchronizing clients, since + * it does not provide enough result information to the client to reconcile + * the local state without performing a follow-up sync from the service. This + * is intended for "thin clients" that need to efficiently support this as + * a UI operation. + * + * @param guid + * The GUID of the tag to remove from all notes. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + untagAll(guid: string, cb: Callback): void; + + /** + * Permanently deletes the tag with the provided GUID, if present. + *

+ * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The GUID of the tag to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException

    + *
  • BAD_DATA_FORMAT "Tag.guid" - if the guid parameter is missing + *
  • + *
  • PERMISSION_DENIED "Tag" - user doesn't own tag + *
  • + *
+ * + * @throws EDAMNotFoundException
    + *
  • "Tag.guid" - tag not found, by GUID + *
  • + *
+ */ + expungeTag(guid: string, cb: Callback): void; + + /** + * Returns a list of the searches in the account. Evernote does not support + * the undeletion of searches, so this will only include active searches. + */ + listSearches(cb: Callback): void; + + /** + * Returns the current state of the search with the provided GUID. + * + * @param guid + * The GUID of the search to be retrieved. + * + * @throws EDAMUserException
    + *
  • BAD_DATA_FORMAT "SavedSearch.guid" - if the parameter is missing + *
  • + *
  • PERMISSION_DENIED "SavedSearch" - private Tag, user doesn't own + *
  • + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + getSearch(guid: string, cb: Callback): void; + + /** + * Asks the service to make a saved search with a set of information. + * + * @param search + * The desired list of fields for the search are specified in this + * object. The caller must specify the name and query for the + * search, and may optionally specify a search scope. + * The SavedSearch.format field is ignored by the service. + * + * @return + * The newly created SavedSearch. The server-side GUID will be + * saved in this object. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern + *
    • + *
    • BAD_DATA_FORMAT "SavedSearch.query" - invalid length + *
    • + *
    • DATA_CONFLICT "SavedSearch.name" - name already in use + *
    • + *
    • LIMIT_REACHED "SavedSearch" - at max number of searches + *
    • + *
    + */ + createSearch(search: SavedSearch, cb: Callback): void; + + /** + * Submits search changes to the service. The provided data must include + * the search's guid field for identification. The service will apply + * updates to the following search fields: name, query, and scope. + * + * @param search + * The search object containing the requested changes. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "SavedSearch.name" - invalid length or pattern + *
    • + *
    • BAD_DATA_FORMAT "SavedSearch.query" - invalid length + *
    • + *
    • DATA_CONFLICT "SavedSearch.name" - name already in use + *
    • + *
    • PERMISSION_DENIED "SavedSearch" - user doesn't own tag + *
    • + *
    + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + updateSearch(search: SavedSearch, cb: Callback): number; + + /** + * Permanently deletes the saved search with the provided GUID, if present. + *

    + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The GUID of the search to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException

      + *
    • BAD_DATA_FORMAT "SavedSearch.guid" - if the guid parameter is empty + *
    • + *
    • PERMISSION_DENIED "SavedSearch" - user doesn't own + *
    • + *
    + * + * @throws EDAMNotFoundException
      + *
    • "SavedSearch.guid" - not found, by GUID + *
    • + *
    + */ + expungeSearch(guid: string, cb: Callback): void; + + /** + * DEPRECATED. Use findNotesMetadata. + */ + findNotes(filter: NoteFilter, offset: number, maxNotes: number, cb: Callback): void; + + /** + * Finds the position of a note within a sorted subset of all of the user's + * notes. This may be useful for thin clients that are displaying a paginated + * listing of a large account, which need to know where a particular note + * sits in the list without retrieving all notes first. + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The list of criteria that will constrain the notes to be returned. + * + * @param guid + * The GUID of the note to be retrieved. + * + * @return + * If the note with the provided GUID is found within the matching note + * list, this will return the offset of that note within that list (where + * the first offset is 0). If the note is not found within the set of + * notes, this will return -1. + * + * @throws EDAMUserException
      + *
    • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX + *
    • + *
    • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
    • + *
    • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
    • + * + * @throws EDAMNotFoundException
        + *
      • "Notebook.guid" - not found, by GUID + *
      • + *
      • "Note.guid" - not found, by GUID + *
      • + *
      + */ + findNoteOffset(filter: NoteFilter, guid: string, cb: Callback): void; + + /** + * Used to find the high-level information about a set of the notes from a + * user's account based on various criteria specified via a NoteFilter object. + *

      + * Web applications that wish to periodically check for new content in a user's + * Evernote account should consider using webhooks instead of polling this API. + * See http://dev.evernote.com/documentation/cloud/chapters/polling_notification.php + * for more information. + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The list of criteria that will constrain the notes to be returned. + * + * @param offset + * The numeric index of the first note to show within the sorted + * results. The numbering scheme starts with "0". This can be used for + * pagination. + * + * @param maxNotes + * The mximum notes to return in this query. The service will return a set + * of notes that is no larger than this number, but may return fewer notes + * if needed. The NoteList.totalNotes field in the return value will + * indicate whether there are more values available after the returned set. + * + * @param resultSpec + * This specifies which information should be returned for each matching + * Note. The fields on this structure can be used to eliminate data that + * the client doesn't need, which will reduce the time and bandwidth + * to receive and process the reply. + * + * @return + * The list of notes that match the criteria. + * + * @throws EDAMUserException

        + *
      • BAD_DATA_FORMAT "offset" - not between 0 and EDAM_USER_NOTES_MAX + *
      • + *
      • BAD_DATA_FORMAT "maxNotes" - not between 0 and EDAM_USER_NOTES_MAX + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
      • + *
      + * + * @throws EDAMNotFoundException
        + *
      • "Notebook.guid" - not found, by GUID + *
      • + *
      + */ + findNotesMetadata(filter: NoteFilter, offset: number, maxNotes: number, resultSpec: NotesMetadataResultSpec, cb: Callback): void; + + /** + * This function is used to determine how many notes are found for each + * notebook and tag in the user's account, given a current set of filter + * parameters that determine the current selection. This function will + * return a structure that gives the note count for each notebook and tag + * that has at least one note under the requested filter. Any notebook or + * tag that has zero notes in the filtered set will not be listed in the + * reply to this function (so they can be assumed to be 0). + * + * @param authenticationToken + * Must be a valid token for the user's account unless the NoteFilter + * 'notebookGuid' is the GUID of a public notebook. + * + * @param filter + * The note selection filter that is currently being applied. The note + * counts are to be calculated with this filter applied to the total set + * of notes in the user's account. + * + * @param withTrash + * If true, then the NoteCollectionCounts.trashCount will be calculated + * and supplied in the reply. Otherwise, the trash value will be omitted. + * + * @throws EDAMUserException
        + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuids" - if any are malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
      • + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - not found, by GUID + *
        • + *
        + */ + findNoteCounts(filter: NoteFilter, withTrash: boolean, cb: Callback): void; + + /** + * Returns the current state of the note in the service with the provided + * GUID. The ENML contents of the note will only be provided if the + * 'withContent' parameter is true. The service will include the meta-data + * for each resource in the note, but the binary contents of the resources + * and their recognition data will be omitted. + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). The applicationData + * fields are returned as keysOnly. + * + * @param guid + * The GUID of the note to be retrieved. + * + * @param withContent + * If true, the note will include the ENML contents of its + * 'content' field. + * + * @param withResourcesData + * If true, any Resource elements in this Note will include the binary + * contents of their 'data' field's body. + * + * @param withResourcesRecognition + * If true, any Resource elements will include the binary contents of the + * 'recognition' field's body if recognition data is present. + * + * @param withResourcesAlternateData + * If true, any Resource elements in this Note will include the binary + * contents of their 'alternateData' fields' body, if an alternate form + * is present. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + getNote(guid: string, withContent: boolean, withResourcesData: boolean, withResourcesRecognition: boolean, withResourcesAlternateData: boolean, cb: Callback): void; + + /** + * Get all of the application data for the note identified by GUID, + * with values returned within the LazyMap fullMap field. + * If there are no applicationData entries, then a LazyMap + * with an empty fullMap will be returned. If your application + * only needs to fetch its own applicationData entry, use + * getNoteApplicationDataEntry instead. + */ + getNoteApplicationData(guid: string, cb: Callback): void; + + /** + * Get the value of a single entry in the applicationData map + * for the note identified by GUID. + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - note not found, by GUID
        • + *
        • "NoteAttributes.applicationData.key" - note not found, by key
        • + *
        + */ + getNoteApplicationDataEntry(guid: string, key: string, cb: Callback): void; + + /** + * Update, or create, an entry in the applicationData map for + * the note identified by guid. + */ + setNoteApplicationDataEntry(guid: string, key: string, value: string, cb: Callback): void; + + /** + * Remove an entry identified by 'key' from the applicationData map for + * the note identified by 'guid'. Silently ignores an unset of a + * non-existing key. + */ + unsetNoteApplicationDataEntry(guid: string, key: string, cb: Callback): void; + + /** + * Returns XHTML contents of the note with the provided GUID. + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the note to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + getNoteContent(guid: string, cb: Callback): void; + + /** + * Returns a block of the extracted plain text contents of the note with the + * provided GUID. This text can be indexed for search purposes by a light + * client that doesn't have capabilities to extract all of the searchable + * text content from the note and its resources. + * + * If the Note is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the note to be retrieved. + * + * @param noteOnly + * If true, this will only return the text extracted from the ENML contents + * of the note itself. If false, this will also include the extracted text + * from any text-bearing resources (PDF, recognized images) + * + * @param tokenizeForIndexing + * If true, this will break the text into cleanly separated and sanitized + * tokens. If false, this will return the more raw text extraction, with + * its original punctuation, capitalization, spacing, etc. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + getNoteSearchText(guid: string, noteOnly: boolean, tokenizeForIndexing: boolean, cb: Callback): void; + + /** + * Returns a block of the extracted plain text contents of the resource with + * the provided GUID. This text can be indexed for search purposes by a light + * client that doesn't have capability to extract all of the searchable + * text content from a resource. + * + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + getResourceSearchText(guid: string, cb: Callback): void; + + /** + * Returns a list of the names of the tags for the note with the provided + * guid. This can be used with authentication to get the tags for a + * user's own note, or can be used without valid authentication to retrieve + * the names of the tags for a note in a public notebook. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + getNoteTagNames(guid: string, cb: Callback): void; + + /** + * Asks the service to make a note with the provided set of information. + * + * @param note + * A Note object containing the desired fields to be populated on + * the service. + * + * @return + * The newly created Note from the service. The server-side + * GUIDs for the Note and any Resources will be saved in this object. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.title" - invalid length or pattern + *
        • + *
        • BAD_DATA_FORMAT "Note.content" - invalid length for ENML content + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • DATA_CONFLICT "Note.deleted" - deleted time set on active note + *
        • + *
        • DATA_REQUIRED "Resource.data" - resource data body missing + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • LIMIT_REACHED "Note" - at max number per account + *
        • + *
        • LIMIT_REACHED "Note.size" - total note size too large + *
        • + *
        • LIMIT_REACHED "Note.resources" - too many resources on Note + *
        • + *
        • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note + *
        • + *
        • LIMIT_REACHED "Resource.data.size" - resource too large + *
        • + *
        • LIMIT_REACHED "NoteAttribute.*" - attribute string too long + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Note.notebookGuid" - NB not owned by user + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one + * of the specified tags had an invalid length or pattern + *
        • + *
        • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required + * new tags would exceed the maximum number per account + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.notebookGuid" - not found, by GUID + *
        • + *
        + */ + createNote(note: Note, cb: Callback): void; + + /** + * Submit a set of changes to a note to the service. The provided data + * must include the note's guid field for identification. The note's + * title must also be set. + * + * @param note + * A Note object containing the desired fields to be populated on + * the service. With the exception of the note's title and guid, fields + * that are not being changed do not need to be set. If the content is not + * being modified, note.content should be left unset. If the list of + * resources is not being modified, note.resources should be left unset. + * + * @return + * The metadata (no contents) for the Note on the server after the update + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.title" - invalid length or pattern + *
        • + *
        • BAD_DATA_FORMAT "Note.content" - invalid length for ENML body + *
        • + *
        • BAD_DATA_FORMAT "NoteAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • DATA_CONFLICT "Note.deleted" - deleted time set on active note + *
        • + *
        • DATA_REQUIRED "Resource.data" - resource data body missing + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • LIMIT_REACHED "Note.tagGuids" - too many Tags on Note + *
        • + *
        • LIMIT_REACHED "Note.resources" - too many resources on Note + *
        • + *
        • LIMIT_REACHED "Note.size" - total note size too large + *
        • + *
        • LIMIT_REACHED "Resource.data.size" - resource too large + *
        • + *
        • LIMIT_REACHED "NoteAttribute.*" - attribute string too long + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        • PERMISSION_DENIED "Note.notebookGuid" - user doesn't own destination + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        • BAD_DATA_FORMAT "Tag.name" - Note.tagNames was provided, and one + * of the specified tags had an invalid length or pattern + *
        • + *
        • LIMIT_REACHED "Tag" - Note.tagNames was provided, and the required + * new tags would exceed the maximum number per account + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - note not found, by GUID + *
        • + *
        • "Note.notebookGuid" - if notebookGuid provided, but not found + *
        • + *
        + */ + updateNote(note: Note, cb: Callback): void; + + /** + * Moves the note into the trash. The note may still be undeleted, unless it + * is expunged. This is equivalent to calling updateNote() after setting + * Note.active = false + * + * @param guid + * The GUID of the note to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "Note" - user doesn't have permission to + * update the note. + *
        • + *
        + * + * @throws EDAMUserException
          + *
        • DATA_CONFLICT "Note.guid" - the note is already deleted + *
        • + *
        + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + deleteNote(guid: string, cb: Callback): void; + + /** + * Permanently removes a Note, and all of its Resources, + * from the service. + *

        + * NOTE: This function is not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The GUID of the note to delete. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException

          + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + expungeNote(guid: string, cb: Callback): void; + + /** + * Permanently removes a list of Notes, and all of their Resources, from + * the service. This should be invoked with a small number of Note GUIDs + * (e.g. 100 or less) on each call. To expunge a larger number of notes, + * call this method multiple times. This should also be used to reduce the + * number of Notes in a notebook before calling expungeNotebook() or + * in the trash before calling expungeInactiveNotes(), since these calls may + * be prohibitively slow if there are more than a few hundred notes. + * If an exception is thrown for any of the GUIDs, then none of the notes + * will be deleted. I.e. this call can be treated as an atomic transaction. + *

        + * NOTE: This function is not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param noteGuids + * The list of GUIDs for the Notes to remove. + * + * @return + * The account's updateCount at the end of this operation + * + * @throws EDAMUserException

          + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + expungeNotes(noteGuids: string[], cb: Callback): void; + + /** + * Permanently removes all of the Notes that are currently marked as + * inactive. This is equivalent to "emptying the trash", and these Notes + * will be gone permanently. + *

        + * This operation may be relatively slow if the account contains a large + * number of inactive Notes. + *

        + * NOTE: This function is not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @return + * The number of notes that were expunged. + */ + expungeInactiveNotes(cb: Callback): void; + + /** + * Performs a deep copy of the Note with the provided GUID 'noteGuid' into + * the Notebook with the provided GUID 'toNotebookGuid'. + * The caller must be the owner of both the Note and the Notebook. + * This creates a new Note in the destination Notebook with new content and + * Resources that match all of the content and Resources from the original + * Note, but with new GUID identifiers. + * The original Note is not modified by this operation. + * The copied note is considered as an "upload" for the purpose of upload + * transfer limit calculation, so its size is added to the upload count for + * the owner. + * + * @param noteGuid + * The GUID of the Note to copy. + * + * @param toNotebookGuid + * The GUID of the Notebook that should receive the new Note. + * + * @return + * The metadata for the new Note that was created. This will include the + * new GUID for this Note (and any copied Resources), but will not include + * the content body or the binary bodies of any Resources. + * + * @throws EDAMUserException

          + *
        • LIMIT_REACHED "Note" - at max number per account + *
        • + *
        • PERMISSION_DENIED "Notebook.guid" - destination not owned by user + *
        • + *
        • PERMISSION_DENIED "Note" - user doesn't own + *
        • + *
        • QUOTA_REACHED "Accounting.uploadLimit" - note exceeds upload quota + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - not found, by GUID + *
        • + *
        + */ + copyNote(noteGuid: string, toNotebookGuid: string, cb: Callback): void; + + /** + * Returns a list of the prior versions of a particular note that are + * saved within the service. These prior versions are stored to provide a + * recovery from unintentional removal of content from a note. The identifiers + * that are returned by this call can be used with getNoteVersion to retrieve + * the previous note. + * The identifiers will be listed from the most recent versions to the oldest. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + listNoteVersions(noteGuid: string, cb: Callback): void; + + /** + * This can be used to retrieve a previous version of a Note after it has been + * updated within the service. The caller must identify the note (via its + * guid) and the version (via the updateSequenceNumber of that version). + * to find a listing of the stored version USNs for a note, call + * listNoteVersions. + * This call is only available for notes in Premium accounts. (I.e. access + * to past versions of Notes is a Premium-only feature.) + * + * @param noteGuid + * The GUID of the note to be retrieved. + * + * @param updateSequenceNum + * The USN of the version of the note that is being retrieved + * + * @param withResourcesData + * If true, any Resource elements in this Note will include the binary + * contents of their 'data' field's body. + * + * @param withResourcesRecognition + * If true, any Resource elements will include the binary contents of the + * 'recognition' field's body if recognition data is present. + * + * @param withResourcesAlternateData + * If true, any Resource elements in this Note will include the binary + * contents of their 'alternateData' fields' body, if an alternate form + * is present. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        • PERMISSION_DENIED "updateSequenceNum" - + * The account isn't permitted to access previous versions of notes. + * (i.e. this is a Free account.) + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        • "Note.updateSequenceNumber" - the Note doesn't have a version with + * the corresponding USN. + *
        • + *
        + */ + getNoteVersion(noteGuid: string, updateSequenceNum: number, withResourcesData: boolean, withResourcesRecognition: boolean, withResourcesAlternateData: boolean, cb: Callback): void; + + /** + * Returns the current state of the resource in the service with the + * provided GUID. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). Only the + * keys for the applicationData will be returned. + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @param withData + * If true, the Resource will include the binary contents of the + * 'data' field's body. + * + * @param withRecognition + * If true, the Resource will include the binary contents of the + * 'recognition' field's body if recognition data is present. + * + * @param withAttributes + * If true, the Resource will include the attributes + * + * @param withAlternateData + * If true, the Resource will include the binary contents of the + * 'alternateData' field's body, if an alternate form is present. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + getResource(guid: string, withData: boolean, withRecognition: boolean, withAttributes: boolean, withAlternateData: boolean, cb: Callback): void; + + /** + * Get all of the application data for the Resource identified by GUID, + * with values returned within the LazyMap fullMap field. + * If there are no applicationData entries, then a LazyMap + * with an empty fullMap will be returned. If your application + * only needs to fetch its own applicationData entry, use + * getResourceApplicationDataEntry instead. + */ + getResourceApplicationData(guid: string, cb: Callback): void; + + /** + * Get the value of a single entry in the applicationData map + * for the Resource identified by GUID. + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - Resource not found, by GUID
        • + *
        • "ResourceAttributes.applicationData.key" - Resource not found, by key
        • + *
        + */ + getResourceApplicationDataEntry(guid: string, key: string, cb: Callback): void; + + /** + * Update, or create, an entry in the applicationData map for + * the Resource identified by guid. + */ + setResourceApplicationDataEntry(guid: string, key: string, value: string, cb: Callback): void; + + /** + * Remove an entry identified by 'key' from the applicationData map for + * the Resource identified by 'guid'. + */ + unsetResourceApplicationDataEntry(guid: string, key: string, cb: Callback): void; + + /** + * Submit a set of changes to a resource to the service. This can be used + * to update the meta-data about the resource, but cannot be used to change + * the binary contents of the resource (including the length and hash). These + * cannot be changed directly without creating a new resource and removing the + * old one via updateNote. + * + * @param resource + * A Resource object containing the desired fields to be populated on + * the service. The service will attempt to update the resource with the + * following fields from the client: + *
          + *
        • guid: must be provided to identify the resource + *
        • + *
        • mime + *
        • + *
        • width + *
        • + *
        • height + *
        • + *
        • duration + *
        • + *
        • attributes: optional. if present, the set of attributes will + * be replaced. + *
        • + *
        + * + * @return + * The Update Sequence Number of the resource after the changes have been + * applied. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • BAD_DATA_FORMAT "Resource.mime" - invalid resource MIME type + *
        • + *
        • BAD_DATA_FORMAT "ResourceAttributes.*" - bad resource string + *
        • + *
        • LIMIT_REACHED "ResourceAttribute.*" - attribute string too long + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + updateResource(resource: Resource, cb: Callback): void; + + /** + * Returns binary data of the resource with the provided GUID. For + * example, if this were an image resource, this would contain the + * raw bits of the image. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource to be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + getResourceData(guid: string, cb: Callback): void; + + /** + * Returns the current state of a resource, referenced by containing + * note GUID and resource content hash. + * + * @param noteGuid + * The GUID of the note that holds the resource to be retrieved. + * + * @param contentHash + * The MD5 checksum of the resource within that note. Note that + * this is the binary checksum, for example from Resource.data.bodyHash, + * and not the hex-encoded checksum that is used within an en-media + * tag in a note body. + * + * @param withData + * If true, the Resource will include the binary contents of the + * 'data' field's body. + * + * @param withRecognition + * If true, the Resource will include the binary contents of the + * 'recognition' field's body. + * + * @param withAlternateData + * If true, the Resource will include the binary contents of the + * 'alternateData' field's body, if an alternate form is present. + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "Note.guid" - noteGuid param missing + *
        • + *
        • DATA_REQUIRED "Note.contentHash" - contentHash param missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note" - not found, by guid + *
        • + *
        • "Resource" - not found, by hash + *
        • + *
        + */ + getResourceByHash(noteGuid: string, contentHash: string, withData: boolean, withRecognition: boolean, withAlternateData: boolean, cb: Callback): void; + + /** + * Returns the binary contents of the recognition index for the resource + * with the provided GUID. If the caller asks about a resource that has + * no recognition data, this will throw EDAMNotFoundException. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource whose recognition data should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        • "Resource.recognition" - resource has no recognition + *
        • + *
        + */ + getResourceRecognition(guid: string, cb: Callback): void; + + /** + * If the Resource with the provided GUID has an alternate data representation + * (indicated via the Resource.alternateData field), then this request can + * be used to retrieve the binary contents of that alternate data file. + * If the caller asks about a resource that has no alternate data form, this + * will throw EDAMNotFoundException. + * + * @param guid + * The GUID of the resource whose recognition data should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        • "Resource.alternateData" - resource has no recognition + *
        • + *
        + */ + getResourceAlternateData(guid: string, cb: Callback): void; + + /** + * Returns the set of attributes for the Resource with the provided GUID. + * If the Resource is found in a public notebook, the authenticationToken + * will be ignored (so it could be an empty string). + * + * @param guid + * The GUID of the resource whose attributes should be retrieved. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Resource.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Resource" - private resource, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Resource.guid" - not found, by GUID + *
        • + *
        + */ + getResourceAttributes(guid: string, cb: Callback): void; + + /** + *

        + * Looks for a user account with the provided userId on this NoteStore + * shard and determines whether that account contains a public notebook + * with the given URI. If the account is not found, or no public notebook + * exists with this URI, this will throw an EDAMNotFoundException, + * otherwise this will return the information for that Notebook. + *

        + *

        + * If a notebook is visible on the web with a full URL like + * http://www.evernote.com/pub/sethdemo/api + * Then 'sethdemo' is the username that can be used to look up the userId, + * and 'api' is the publicUri. + *

        + * + * @param userId + * The numeric identifier for the user who owns the public notebook. + * To find this value based on a username string, you can invoke + * UserStore.getPublicUserInfo + * + * @param publicUri + * The uri string for the public notebook, from Notebook.publishing.uri. + * + * @throws EDAMNotFoundException
          + *
        • "Publishing.uri" - not found, by URI
        • + *
        + * + * @throws EDAMSystemException
          + *
        • TAKEN_DOWN "PublicNotebook" - The specified public notebook is + * taken down (for all requesters).
        • + *
        • TAKEN_DOWN "Country" - The specified public notebook is taken + * down for the requester because of an IP-based country lookup.
        • + *
        + */ + getPublicNotebook(userId: number, publicUri: string, cb: Callback): void; + + /** + * Used to construct a shared notebook object. The constructed notebook will + * contain a "share key" which serve as a unique identifer and access token + * for a user to access the notebook of the shared notebook owner. + * + * @param sharedNotebook + * A shared notebook object populated with the email address of the share + * recipient, the notebook guid and the access permissions. All other + * attributes of the shared object are ignored. The SharedNotebook.allowPreview + * field must be explicitly set with either a true or false value. + * + * @return + * The fully populated SharedNotebook object including the server assigned + * share id and shareKey which can both be used to uniquely identify the + * SharedNotebook. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "SharedNotebook.email" - if the email was not valid
        • + *
        • BAD_DATA_FORMAT "requireLogin" - if the SharedNotebook.allowPreview field was + * not set, and the SharedNotebook.requireLogin was also not set or was set to + * false.
        • + *
        • PERMISSION_DENIED "SharedNotebook.recipientSettings" - if + * recipientSettings is set in the sharedNotebook. Only the recipient + * can set these values via the setSharedNotebookRecipientSettings + * method. + *
        • + *
        + * @throws EDAMNotFoundException
          + *
        • Notebook.guid - if the notebookGuid is not a valid GUID for the user. + *
        • + *
        + */ + createSharedNotebook(sharedNotebook: SharedNotebook, cb: Callback): void; + + /** + * Update a SharedNotebook object. + * + * @param authenticationToken + * Must be an authentication token from the owner or a shared notebook + * authentication token or business authentication token with sufficient + * permissions to change invitations for a notebook. + * + * @param sharedNotebook + * The SharedNotebook object containing the requested changes. + * The "id" of the shared notebook must be set to allow the service + * to identify the SharedNotebook to be updated. In addition, you MUST set + * the email, permission, and allowPreview fields to the desired values. + * All other fields will be ignored if set. + * + * @return + * The Update Serial Number for this change within the account. + * + * @throws EDAMUserException
          + *
        • UNSUPPORTED_OPERATION "updateSharedNotebook" - if this service instance does not support shared notebooks.
        • + *
        • BAD_DATA_FORMAT "SharedNotebook.email" - if the email was not valid.
        • + *
        • DATA_REQUIRED "SharedNotebook.id" - if the id field was not set.
        • + *
        • DATA_REQUIRED "SharedNotebook.privilege" - if the privilege field was not set.
        • + *
        • DATA_REQUIRED "SharedNotebook.allowPreview" - if the allowPreview field was not set.
        • + *
        + * @throws EDAMNotFoundException
          + *
        • SharedNotebook.id - if no shared notebook with the specified ID was found. + *
        + */ + updateSharedNotebook(sharedNotebook: SharedNotebook, cb: Callback): void; + + /** + * Set values for the recipient settings associated with a shared notebook. Having + * update rights to the shared notebook record itself has no effect on this call; + * only the recipient of the shared notebook can can the recipient settings. + * + * If you do not wish to, or cannot, change one of the reminderNotifyEmail or + * reminderNotifyInApp fields, you must leave that field unset in recipientSettings. + * This method will skip that field for updates and leave the existing state as + * it is. + * + * @return The update sequence number of the account to which the shared notebook + * belongs, which is the account from which we are sharing a notebook. + * + * @throws EDAMNotFoundException "sharedNotebookId" - Thrown if the service does not + * have a shared notebook record for the sharedNotebookId on the given shard. If you + * receive this exception, it is probable that the shared notebook record has + * been revoked or expired, or that you accessed the wrong shard. + * + * @throws EDAMUserException
          + *
        • PEMISSION_DENIED "authenticationToken" - If you do not have permission to set + * the recipient settings for the shared notebook. Only the recipient has + * permission to do this. + *
        • DATA_CONFLICT "recipientSettings.reminderNotifyEmail" - Setting whether + * or not you want to receive reminder e-mail notifications is possible on + * a business notebook in the business to which the user belongs. All + * others can safely unset the reminderNotifyEmail field from the + * recipientSettings parameter. + *
        + */ + setSharedNotebookRecipientSettings(sharedNotebookId: number, recipientSettings: SharedNotebookRecipientSettings, cb: Callback): void; + + /** + * Send a reminder message to some or all of the email addresses that a notebook has been + * shared with. The message includes the current link to view the notebook. + * @param authenticationToken + * The auth token of the user with permissions to share the notebook + * @param notebookGuid + * The guid of the shared notebook + * @param messageText + * User provided text to include in the email + * @param recipients + * The email addresses of the recipients. If this list is empty then all of the + * users that the notebook has been shared with are emailed. + * If an email address doesn't correspond to share invite members then that address + * is ignored. + * @return + * The number of messages sent + * @throws EDAMUserException
          + *
        • LIMIT_REACHED "(recipients)" - + * The email can't be sent because this would exceed the user's daily + * email limit. + *
        • + *
        • PERMISSION_DENIED "Notebook.guid" - The user doesn't have permission to + * send a message for the specified notebook. + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Notebook.guid" - not found, by GUID + *
        • + *
        + */ + sendMessageToSharedNotebookMembers(notebookGuid: string, messageText: string, recipients: string[], cb: Callback): void; + + /** + * Lists the collection of shared notebooks for all notebooks in the + * users account. + * + * @return + * The list of all SharedNotebooks for the user + */ + listSharedNotebooks(cb: Callback): void; + + /** + * Expunges the SharedNotebooks in the user's account using the + * SharedNotebook.id as the identifier. + *

        + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param + * sharedNotebookIds - a list of ShardNotebook.id longs identifying the + * objects to delete permanently. + * + * @return + * The account's update sequence number. + */ + expungeSharedNotebooks(sharedNotebookIds: number[], cb: Callback): void; + + /** + * Asks the service to make a linked notebook with the provided name, username + * of the owner and identifiers provided. A linked notebook can be either a + * link to a public notebook or to a private shared notebook. + * + * @param linkedNotebook + * The desired fields for the linked notebook must be provided on this + * object. The name of the linked notebook must be set. Either a username + * uri or a shard id and share key must be provided otherwise a + * EDAMUserException is thrown. + * + * @return + * The newly created LinkedNotebook. The server-side id will be + * saved in this object's 'id' field. + * + * @throws EDAMUserException

          + *
        • BAD_DATA_FORMAT "LinkedNotebook.name" - invalid length or pattern + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.username" - bad username format + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.uri" - + * if public notebook set but bad uri + *
        • + *
        • BAD_DATA_FORMAT "LinkedNotebook.shareKey" - + * if private notebook set but bad shareKey + *
        • + *
        • DATA_REQUIRED "LinkedNotebook.shardId" - + * if private notebook but shard id not provided + *
        • + *
        + */ + createLinkedNotebook(linkedNotebook: LinkedNotebook, cb: Callback): void; + + /** + * @param linkedNotebook + * Updates the name of a linked notebook. + * + * @return + * The Update Sequence Number for this change within the account. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "LinkedNotebook.name" - invalid length or pattern + *
        • + *
        + */ + updateLinkedNotebook(linkedNotebook: LinkedNotebook, cb: Callback): void; + + /** + * Returns a list of linked notebooks + */ + listLinkedNotebooks(cb: Callback): void; + + /** + * Permanently expunges the linked notebook from the account. + *

        + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param guid + * The LinkedNotebook.guid field of the LinkedNotebook to permanently remove + * from the account. + */ + expungeLinkedNotebook(guid: string, cb: Callback): void; + + /** + * Asks the service to produce an authentication token that can be used to + * access the contents of a shared notebook from someone else's account. + * This authenticationToken can be used with the various other NoteStore + * calls to find and retrieve notes, and if the permissions in the shared + * notebook are sufficient, to make changes to the contents of the notebook. + * + * @param shareKey + * The 'shareKey' identifier from the SharedNotebook that was granted to + * some recipient. This string internally encodes the notebook identifier + * and a security signature. + * + * @param authenticationToken + * If a non-empty string is provided, this is the full user-based + * authentication token that identifies the user who is currently logged in + * and trying to access the shared notebook. This may be required if the + * notebook was created with 'requireLogin'. + * If this string is empty, the service will attempt to authenticate to the + * shared notebook without any logged in user. + * + * @throws EDAMSystemException

          + *
        • BAD_DATA_FORMAT "shareKey" - invalid shareKey string + *
        • + *
        • INVALID_AUTH "shareKey" - bad signature on shareKey string + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "SharedNotebook.id" - the shared notebook no longer exists + *
        • + *
        + * + * @throws EDAMUserException
          + *
        • DATA_REQUIRED "authenticationToken" - the share requires login, and + * no valid authentication token was provided. + *
        • + *
        • PERMISSION_DENIED "SharedNotebook.username" - share requires login, + * and another username has already been bound to this notebook. + *
        • + *
        + */ + authenticateToSharedNotebook(shareKey: string, cb: Callback): void; + + /** + * This function is used to retrieve extended information about a shared + * notebook by a guest who has already authenticated to access that notebook. + * This requires an 'authenticationToken' parameter which should be the + * resut of a call to authenticateToSharedNotebook(...). + * I.e. this is the token that gives access to the particular shared notebook + * in someone else's account -- it's not the authenticationToken for the + * owner of the notebook itself. + * + * @param authenticationToken + * Should be the authentication token retrieved from the reply of + * authenticateToSharedNotebook(), proving access to a particular shared + * notebook. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "authenticationToken" - + * authentication token doesn't correspond to a valid shared notebook + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "SharedNotebook.id" - the shared notebook no longer exists + *
        • + *
        + */ + getSharedNotebookByAuth(cb: Callback): void; + + /** + * Attempts to send a single note to one or more email recipients. + *

        + * NOTE: This function is generally not available to third party applications. + * Calls will result in an EDAMUserException with the error code + * PERMISSION_DENIED. + * + * @param authenticationToken + * The note will be sent as the user logged in via this token, using that + * user's registered email address. If the authenticated user doesn't + * have permission to read that note, the emailing will fail. + * + * @param parameters + * The note must be specified either by GUID (in which case it will be + * sent using the existing data in the service), or else the full Note + * must be passed to this call. This also specifies the additional + * email fields that will be used in the email. + * + * @throws EDAMUserException

          + *
        • LIMIT_REACHED "NoteEmailParameters.toAddresses" - + * The email can't be sent because this would exceed the user's daily + * email limit. + *
        • + *
        • BAD_DATA_FORMAT "(email address)" - + * email address malformed + *
        • + *
        • DATA_REQUIRED "NoteEmailParameters.toAddresses" - + * if there are no To: or Cc: addresses provided. + *
        • + *
        • DATA_REQUIRED "Note.title" - + * if the caller provides a Note parameter with no title + *
        • + *
        • DATA_REQUIRED "Note.content" - + * if the caller provides a Note parameter with no content + *
        • + *
        • ENML_VALIDATION "*" - note content doesn't validate against DTD + *
        • + *
        • DATA_REQUIRED "NoteEmailParameters.note" - + * if no guid or note provided + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + emailNote(parameters: NoteEmailParameters, cb: Callback): void; + + /** + * If this note is not already shared (via its own direct URL), then this + * will start sharing that note. + * This will return the secret "Note Key" for this note that + * can currently be used in conjunction with the Note's GUID to gain direct + * read-only access to the Note. + * If the note is already shared, then this won't make any changes to the + * note, and the existing "Note Key" will be returned. The only way to change + * the Note Key for an existing note is to stopSharingNote first, and then + * call this function. + * + * @param guid + * The GUID of the note to be shared. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + shareNote(guid: string, cb: Callback): void; + + /** + * If this note is not already shared then this will stop sharing that note + * and invalidate its "Note Key", so any existing URLs to access that Note + * will stop working. + * If the Note is not shared, then this function will do nothing. + * + * @param guid + * The GUID of the note to be un-shared. + * + * @throws EDAMUserException
          + *
        • BAD_DATA_FORMAT "Note.guid" - if the parameter is missing + *
        • + *
        • PERMISSION_DENIED "Note" - private note, user doesn't own + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "Note.guid" - not found, by GUID + *
        • + *
        + */ + stopSharingNote(guid: string, cb: Callback): void; + + /** + * Asks the service to produce an authentication token that can be used to + * access the contents of a single Note which was individually shared + * from someone's account. + * This authenticationToken can be used with the various other NoteStore + * calls to find and retrieve the Note and its directly-referenced children. + * + * @param guid + * The GUID identifying this Note on this shard. + * + * @param noteKey + * The 'noteKey' identifier from the Note that was originally created via + * a call to shareNote() and then given to a recipient to access. + * + * @param authenticationToken + * An optional authenticationToken that identifies the user accessing the + * shared note. This parameter may be required to access some shared notes. + * + * @throws EDAMUserException
          + *
        • PERMISSION_DENIED "Note" - the Note with that GUID is either not + * shared, or the noteKey doesn't match the current key for this note + *
        • + *
        • PERMISSION_DENIED "authenticationToken" - an authentication token is + * required to access this Note, but either no authentication token or a + * "non-owner" authentication token was provided. + *
        • + *
        + * + * @throws EDAMNotFoundException
          + *
        • "guid" - the note with that GUID is not found + *
        • + *
        + * + * @throws EDAMSystemException
          + *
        • TAKEN_DOWN "Note" - The specified shared note is taken down (for + * all requesters). + *
        • + *
        • TAKEN_DOWN "Country" - The specified shared note is taken down + * for the requester because of an IP-based country lookup. + *
        + *
      + */ + authenticateToSharedNote(guid: string, noteKey: string, cb: Callback): void; + + /** + * Identify related entities on the service, such as notes, + * notebooks, and tags related to notes or content. + * + * @param query + * The information about which we are finding related entities. + * + * @param resultSpec + * Allows the client to indicate the type and quantity of + * information to be returned, allowing a saving of time and + * bandwidth. + * + * @return + * The result of the query, with information considered + * to likely be relevantly related to the information + * described by the query. + * + * @throws EDAMUserException
        + *
      • BAD_DATA_FORMAT "RelatedQuery.plainText" - If you provided a + * a zero-length plain text value. + *
      • + *
      • BAD_DATA_FORMAT "RelatedQuery.noteGuid" - If you provided an + * invalid Note GUID, that is, one that does not match the constraints + * defined by EDAM_GUID_LEN_MIN, EDAM_GUID_LEN_MAX, EDAM_GUID_REGEX. + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.notebookGuid" - if malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.tagGuids" - if any are malformed + *
      • + *
      • BAD_DATA_FORMAT "NoteFilter.words" - if search string too long + *
      • + *
      • PERMISSION_DENIED "Note" - If the caller does not have access to + * the note identified by RelatedQuery.noteGuid. + *
      • + *
      • DATA_REQUIRED "RelatedResultSpec" - If you did not not set any values + * in the result spec. + *
      • + *
      + * + * @throws EDAMNotFoundException
        + *
      • "RelatedQuery.noteGuid" - the note with that GUID is not + * found, if that field has been set in the query. + *
      • + *
      + */ + findRelated(query: RelatedQuery, resultSpec: RelatedResultSpec, cb: Callback): void; + } + /** + * This structure encapsulates the information about the state of the + * user's account for the purpose of "state based" synchronization. + *
      + *
      currentTime
      + *
      + * The server's current date and time. + *
      + * + *
      fullSyncBefore
      + *
      + * The cutoff date and time for client caches to be + * updated via incremental synchronization. Any clients that were last + * synched with the server before this date/time must do a full resync of all + * objects. This cutoff point will change over time as archival data is + * deleted or special circumstances on the service require resynchronization. + *
      + * + *
      updateCount
      + *
      + * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
      + * + *
      uploaded
      + *
      + * The total number of bytes that have been uploaded to + * this account in the current monthly period. This can be compared against + * Accounting.uploadLimit (from the UserStore) to determine how close the user + * is to their monthly upload limit. + * This value may not be present if the SyncState has been retrieved by + * a caller that only has read access to the account. + *
      + *
      + */ + class SyncState { + currentTime: number; + fullSyncBefore: number; + updateCount: number; + uploaded: number; + + constructor(args?: { currentTime: number; fullSyncBefore: number; updateCount: number; uploaded?: number; }); + } + + /** + * This structure is given out by the NoteStore when a client asks to + * receive the current state of an account. The client asks for the server's + * state one chunk at a time in order to allow clients to retrieve the state + * of a large account without needing to transfer the entire account in + * a single message. + * + * The server always gives SyncChunks using an ascending series of Update + * Sequence Numbers (USNs). + * + *
      + *
      currentTime
      + *
      + * The server's current date and time. + *
      + * + *
      chunkHighUSN
      + *
      + * The highest USN for any of the data objects represented + * in this sync chunk. If there are no objects in the chunk, this will not be + * set. + *
      + * + *
      updateCount
      + *
      + * The total number of updates that have been performed in + * the service for this account. This is equal to the highest USN within the + * account at the point that this SyncChunk was generated. If updateCount + * and chunkHighUSN are identical, that means that this is the last chunk + * in the account ... there is no more recent information. + *
      + * + *
      notes
      + *
      + * If present, this is a list of non-expunged notes that + * have a USN in this chunk. This will include notes that are "deleted" + * but not expunged (i.e. in the trash). The notes will include their list + * of tags and resources, but the note content, resource content, resource + * recognition data and resource alternate data will not be supplied. + *
      + * + *
      notebooks
      + *
      + * If present, this is a list of non-expunged notebooks that + * have a USN in this chunk. This will include notebooks that are "deleted" + * but not expunged (i.e. in the trash). + *
      + * + *
      tags
      + *
      + * If present, this is a list of the non-expunged tags that have a + * USN in this chunk. + *
      + * + *
      searches
      + *
      + * If present, this is a list of non-expunged searches that + * have a USN in this chunk. + *
      + * + *
      resources
      + *
      + * If present, this is a list of the non-expunged resources + * that have a USN in this chunk. This will include the metadata for each + * resource, but not its binary contents or recognition data, which must be + * retrieved separately. + *
      + * + *
      expungedNotes
      + *
      + * If present, the GUIDs of all of the notes that were + * permanently expunged in this chunk. + *
      + * + *
      expungedNotebooks
      + *
      + * If present, the GUIDs of all of the notebooks that + * were permanently expunged in this chunk. When a notebook is expunged, + * this implies that all of its child notes (and their resources) were + * also expunged. + *
      + * + *
      expungedTags
      + *
      + * If present, the GUIDs of all of the tags that were + * permanently expunged in this chunk. + *
      + * + *
      expungedSearches
      + *
      + * If present, the GUIDs of all of the saved searches + * that were permanently expunged in this chunk. + *
      + * + *
      linkedNotebooks
      + *
      + * If present, this is a list of non-expunged LinkedNotebooks that + * have a USN in this chunk. + *
      + * + *
      expungedLinkedNotebooks
      + *
      + * If present, the GUIDs of all of the LinkedNotebooks + * that were permanently expunged in this chunk. + *
      + *
      + */ + class SyncChunk { + currentTime: number; + chunkHighUSN: number; + updateCount: number; + notes: Note[]; + notebooks: Notebook[]; + tags: Tag[]; + searches: SavedSearch[]; + resources: Resource[]; + expungedNotes: string[]; + expungedNotebooks: string[]; + expungedTags: string[]; + expungedSearches: string[]; + linkedNotebooks: LinkedNotebook[]; + expungedLinkedNotebooks: string[]; + + constructor(args?: { currentTime: number; chunkHighUSN?: number; updateCount: number; notes?: Note[]; notebooks?: Notebook[]; tags?: Tag[]; searches?: SavedSearch[]; resources?: Resource[]; expungedNotes?: string[]; expungedNotebooks?: string[]; expungedTags?: string[]; expungedSearches?: string[]; linkedNotebooks?: LinkedNotebook[]; expungedLinkedNotebooks?: string[]; }); + } + + /** + * This structure is used with the 'getFilteredSyncChunk' call to provide + * fine-grained control over the data that's returned when a client needs + * to synchronize with the service. Each flag in this structure specifies + * whether to include one class of data in the results of that call. + * + *
      + *
      includeNotes
      + *
      + * If true, then the server will include the SyncChunks.notes field + *
      + * + *
      includeNoteResources
      + *
      + * If true, then the server will include the 'resources' field on all of + * the Notes that are in SyncChunk.notes. + * If 'includeNotes' is false, then this will have no effect. + *
      + * + *
      includeNoteAttributes
      + *
      + * If true, then the server will include the 'attributes' field on all of + * the Notes that are in SyncChunks.notes. + * If 'includeNotes' is false, then this will have no effect. + *
      + * + *
      includeNotebooks
      + *
      + * If true, then the server will include the SyncChunks.notebooks field + *
      + * + *
      includeTags
      + *
      + * If true, then the server will include the SyncChunks.tags field + *
      + * + *
      includeSearches
      + *
      + * If true, then the server will include the SyncChunks.searches field + *
      + * + *
      includeResources
      + *
      + * If true, then the server will include the SyncChunks.resources field. + * Since the Resources are also provided with their Note + * (in the Notes.resources list), this is primarily useful for clients that + * want to watch for changes to individual Resources due to recognition data + * being added. + *
      + * + *
      includeLinkedNotebooks
      + *
      + * If true, then the server will include the SyncChunks.linkedNotebooks field. + *
      + * + *
      includeExpunged
      + *
      + * If true, then the server will include the 'expunged' data for any type + * of included data. For example, if 'includeTags' and 'includeExpunged' + * are both true, then the SyncChunks.expungedTags field will be set with + * the GUIDs of tags that have been expunged from the server. + *
      + * + *
      includeNoteApplicationDataFullMap
      + *
      + * If true, then the values for the applicationData map will be filled + * in, assuming notes and note attributes are being returned. Otherwise, + * only the keysOnly field will be filled in. + *
      + * + *
      includeResourceApplicationDataFullMap
      + *
      + * If true, then the fullMap values for the applicationData map will be + * filled in, assuming resources and resource attributes are being returned + * (includeResources is true). Otherwise, only the keysOnly field will be + * filled in. + *
      + * + *
      includeNoteResourceApplicationDataFullMap
      + *
      + * If true, then the fullMap values for the applicationData map will be + * filled in for resources found inside of notes, assuming resources are + * being returned in notes (includeNoteResources is true). Otherwise, + * only the keysOnly field will be filled in. + *
      + * + *
      requireNoteContentClass
      + *
      + * If set, then only send notes whose content class matches this value. + * The value can be a literal match or, if the last character is an + * asterisk, a prefix match. + *
      + *
      + */ + class SyncChunkFilter { + includeNotes: boolean; + includeNoteResources: boolean; + includeNoteAttributes: boolean; + includeNotebooks: boolean; + includeTags: boolean; + includeSearches: boolean; + includeResources: boolean; + includeLinkedNotebooks: boolean; + includeExpunged: boolean; + includeNoteApplicationDataFullMap: boolean; + includeResourceApplicationDataFullMap: boolean; + includeNoteResourceApplicationDataFullMap: boolean; + requireNoteContentClass: string; + + constructor(args?: { includeNotes?: boolean; includeNoteResources?: boolean; includeNoteAttributes?: boolean; includeNotebooks?: boolean; includeTags?: boolean; includeSearches?: boolean; includeResources?: boolean; includeLinkedNotebooks?: boolean; includeExpunged?: boolean; includeNoteApplicationDataFullMap?: boolean; includeResourceApplicationDataFullMap?: boolean; includeNoteResourceApplicationDataFullMap?: boolean; requireNoteContentClass?: string; }); + } + + /** + * A list of criteria that are used to indicate which notes are desired from + * the account. This is used in queries to the NoteStore to determine + * which notes should be retrieved. + * + *
      + *
      order
      + *
      + * The NoteSortOrder value indicating what criterion should be + * used to sort the results of the filter. + *
      + * + *
      ascending
      + *
      + * If true, the results will be ascending in the requested + * sort order. If false, the results will be descending. + *
      + * + *
      words
      + *
      + * If present, a search query string that will filter the set of notes to be returned. + * Accepts the full search grammar documented in the Evernote API Overview. + *
      + * + *
      notebookGuid
      + *
      + * If present, the Guid of the notebook that must contain + * the notes. + *
      + * + *
      tagGuids
      + *
      + * If present, the list of tags (by GUID) that must be present + * on the notes. + *
      + * + *
      timeZone
      + *
      + * The zone ID for the user, which will be used to interpret + * any dates or times in the queries that do not include their desired zone + * information. + * For example, if a query requests notes created "yesterday", this + * will be evaluated from the provided time zone, if provided. + * The format must be encoded as a standard zone ID such as + * "America/Los_Angeles". + *
      + * + *
      inactive
      + *
      + * If true, then only notes that are not active (i.e. notes in + * the Trash) will be returned. Otherwise, only active notes will be returned. + * There is no way to find both active and inactive notes in a single query. + *
      + * + *
      emphasized
      + *
      + * If present, a search query string that may or may not influence the notes + * to be returned, both in terms of coverage as well as of order. Think of it + * as a wish list, not a requirement. + * Accepts the full search grammar documented in the Evernote API Overview. + *
      + *
      + */ + class NoteFilter { + order: number; + ascending: boolean; + words: string; + notebookGuid: string; + tagGuids: string[]; + timeZone: string; + inactive: boolean; + emphasized: string; + + constructor(args?: { order?: number; ascending?: boolean; words?: string; notebookGuid?: string; tagGuids?: string[]; timeZone?: string; inactive?: boolean; emphasized?: string; }); + } + + /** + * A small structure for returning a list of notes out of a larger set. + * + *
      + *
      startIndex
      + *
      + * The starting index within the overall set of notes. This + * is also the number of notes that are "before" this list in the set. + *
      + * + *
      totalNotes
      + *
      + * The number of notes in the larger set. This can be used + * to calculate how many notes are "after" this note in the set. + * (I.e. remaining = totalNotes - (startIndex + notes.length) ) + *
      + * + *
      notes
      + *
      + * The list of notes from this range. The Notes will include all + * metadata (attributes, resources, etc.), but will not include the ENML + * content of the note or the binary contents of any resources. + *
      + * + *
      stoppedWords
      + *
      + * If the NoteList was produced using a text based search + * query that included words that are not indexed or searched by the service, + * this will include a list of those ignored words. + *
      + * + *
      searchedWords
      + *
      + * If the NoteList was produced using a text based search + * query that included viable search words or quoted expressions, this will + * include a list of those words. Any stopped words will not be included + * in this list. + *
      + * + *
      updateCount
      + *
      + * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
      + *
      + */ + class NoteList { + startIndex: number; + totalNotes: number; + notes: Note[]; + stoppedWords: string[]; + searchedWords: string[]; + updateCount: number; + + constructor(args?: { startIndex: number; totalNotes: number; notes: Note[]; stoppedWords?: string[]; searchedWords?: string[]; updateCount?: number; }); + } + + /** + * This structure is used in the set of results returned by the + * findNotesMetadata function. It represents the high-level information about + * a single Note, without some of the larger deep structure. This allows + * for the information about a list of Notes to be returned relatively quickly + * with less marshalling and data transfer to remote clients. + * Most fields in this structure are identical to the corresponding field in + * the Note structure, with the exception of: + * + *
      + *
      largestResourceMime
      + *
      If set, then this will contain the MIME type of the largest Resource + * (in bytes) within the Note. This may be useful, for example, to choose + * an appropriate icon or thumbnail to represent the Note. + *
      + * + *
      largestResourceSize
      + *
      If set, this will contain the size of the largest Resource file, in + * bytes, within the Note. This may be useful, for example, to decide whether + * to ask the server for a thumbnail to represent the Note. + *
      + *
      + */ + class NoteMetadata { + guid: string; + title: string; + contentLength: number; + created: number; + updated: number; + deleted: number; + updateSequenceNum: number; + notebookGuid: string; + tagGuids: string[]; + attributes: NoteAttributes; + largestResourceMime: string; + largestResourceSize: number; + + constructor(args?: { guid: string; title?: string; contentLength?: number; created?: number; updated?: number; deleted?: number; updateSequenceNum?: number; notebookGuid?: string; tagGuids?: string[]; attributes?: NoteAttributes; largestResourceMime?: string; largestResourceSize?: number; }); + } + + /** + * This structure is returned from calls to the findNotesMetadata function to + * give the high-level metadata about a subset of Notes that are found to + * match a specified NoteFilter in a search. + * + *
      + *
      startIndex
      + *
      + * The starting index within the overall set of notes. This + * is also the number of notes that are "before" this list in the set. + *
      + * + *
      totalNotes
      + *
      + * The number of notes in the larger set. This can be used + * to calculate how many notes are "after" this note in the set. + * (I.e. remaining = totalNotes - (startIndex + notes.length) ) + *
      + * + *
      notes
      + *
      + * The list of metadata for Notes in this range. The set of optional fields + * that are set in each metadata structure will depend on the + * NotesMetadataResultSpec provided by the caller when the search was + * performed. Only the 'guid' field will be guaranteed to be set in each + * Note. + *
      + * + *
      stoppedWords
      + *
      + * If the NoteList was produced using a text based search + * query that included words that are not indexed or searched by the service, + * this will include a list of those ignored words. + *
      + * + *
      searchedWords
      + *
      + * If the NoteList was produced using a text based search + * query that included viable search words or quoted expressions, this will + * include a list of those words. Any stopped words will not be included + * in this list. + *
      + * + *
      updateCount
      + *
      + * Indicates the total number of transactions that have + * been committed within the account. This reflects (for example) the + * number of discrete additions or modifications that have been made to + * the data in this account (tags, notes, resources, etc.). + * This number is the "high water mark" for Update Sequence Numbers (USN) + * within the account. + *
      + *
      + */ + class NotesMetadataList { + startIndex: number; + totalNotes: number; + notes: NoteMetadata[]; + stoppedWords: string[]; + searchedWords: string[]; + updateCount: number; + + constructor(args?: { startIndex: number; totalNotes: number; notes: NoteMetadata[]; stoppedWords?: string[]; searchedWords?: string[]; updateCount?: number; }); + } + + /** + * This structure is provided to the findNotesMetadata function to specify + * the subset of fields that should be included in each NoteMetadata element + * that is returned in the NotesMetadataList. + * Each field on this structure is a boolean flag that indicates whether the + * corresponding field should be included in the NoteMetadata structure when + * it is returned. For example, if the 'includeTitle' field is set on this + * structure when calling findNotesMetadata, then each NoteMetadata in the + * list should have its 'title' field set. + * If one of the fields in this spec is not set, then it will be treated as + * 'false' by the server, so the default behavior is to include nothing in + * replies (but the mandatory GUID) + */ + class NotesMetadataResultSpec { + includeTitle: boolean; + includeContentLength: boolean; + includeCreated: boolean; + includeUpdated: boolean; + includeDeleted: boolean; + includeUpdateSequenceNum: boolean; + includeNotebookGuid: boolean; + includeTagGuids: boolean; + includeAttributes: boolean; + includeLargestResourceMime: boolean; + includeLargestResourceSize: boolean; + + constructor(args?: { includeTitle?: boolean; includeContentLength?: boolean; includeCreated?: boolean; includeUpdated?: boolean; includeDeleted?: boolean; includeUpdateSequenceNum?: boolean; includeNotebookGuid?: boolean; includeTagGuids?: boolean; includeAttributes?: boolean; includeLargestResourceMime?: boolean; includeLargestResourceSize?: boolean; }); + } + + /** + * A data structure representing the number of notes for each notebook + * and tag with a non-zero set of applicable notes. + * + *
      + *
      notebookCounts
      + *
      + * A mapping from the Notebook GUID to the number of + * notes (from some selection) that are in the corresponding notebook. + *
      + * + *
      tagCounts
      + *
      + * A mapping from the Tag GUID to the number of notes (from some + * selection) that have the corresponding tag. + *
      + * + *
      trashCount
      + *
      + * If this is set, then this is the number of notes that are in the trash. + * If this is not set, then the number of notes in the trash hasn't been + * reported. (I.e. if there are no notes in the trash, this will be set + * to 0.) + *
      + *
      + */ + class NoteCollectionCounts { + notebookCounts: { [k: string]: number; }; + tagCounts: { [k: string]: number; }; + trashCount: number; + + constructor(args?: { notebookCounts?: { [k: string]: number; }; tagCounts?: { [k: string]: number; }; trashCount?: number; }); + } + + /** + * Parameters that must be given to the NoteStore emailNote call. These allow + * the caller to specify the note to send, the recipient addresses, etc. + * + *
      + *
      guid
      + *
      + * If set, this must be the GUID of a note within the user's account that + * should be retrieved from the service and sent as email. If not set, + * the 'note' field must be provided instead. + *
      + * + *
      note
      + *
      + * If the 'guid' field is not set, this field must be provided, including + * the full contents of the note note (and all of its Resources) to send. + * This can be used for a Note that as not been created in the service, + * for example by a local client with local notes. + *
      + * + *
      toAddresses
      + *
      + * If provided, this should contain a list of the SMTP email addresses + * that should be included in the "To:" line of the email. + * Callers must specify at least one "to" or "cc" email address. + *
      + * + *
      ccAddresses
      + *
      + * If provided, this should contain a list of the SMTP email addresses + * that should be included in the "Cc:" line of the email. + * Callers must specify at least one "to" or "cc" email address. + *
      + * + *
      subject
      + *
      + * If provided, this should contain the subject line of the email that + * will be sent. If not provided, the title of the note will be used + * as the subject of the email. + *
      + * + *
      message
      + *
      + * If provided, this is additional personal text that should be included + * into the email as a message from the owner to the recipient(s). + *
      + *
      + */ + class NoteEmailParameters { + guid: string; + note: Note; + toAddresses: string[]; + ccAddresses: string[]; + subject: string; + message: string; + + constructor(args?: { guid?: string; note?: Note; toAddresses?: string[]; ccAddresses?: string[]; subject?: string; message?: string; }); + } + + /** + * Identifying information about previous versions of a note that are backed up + * within Evernote's servers. Used in the return value of the listNoteVersions + * call. + * + *
      + *
      updateSequenceNum
      + *
      + * The update sequence number for the Note when it last had this content. + * This serves to uniquely identify each version of the note, since USN + * values are unique within an account for each update. + *
      + *
      updated
      + *
      + * The 'updated' time that was set on the Note when it had this version + * of the content. This is the user-modifiable modification time on the + * note, so it's not reliable for guaranteeing the order of various + * versions. (E.g. if someone modifies the note, then changes this time + * manually into the past and then updates the note again.) + *
      + *
      saved
      + *
      + * A timestamp that holds the date and time when this version of the note + * was backed up by Evernote's servers. This + *
      + *
      title
      + *
      + * The title of the note when this particular version was saved. (The + * current title of the note may differ from this value.) + *
      + *
      + */ + class NoteVersionId { + updateSequenceNum: number; + updated: number; + saved: number; + title: string; + + constructor(args?: { updateSequenceNum: number; updated: number; saved: number; title: string; }); + } + + /** + * This structure is passed from clients to the Evernote service when they wish + * to relay coarse-grained usage metrics to the service to help improve + * products. + * + *
      + *
      sessions
      + *
      + * This field contains a count of the number of usage "sessions" that have + * occurred with this client which have not previously been reported to + * the service. + * A "session" is defined as one of the 96 fifteen-minute intervals of the + * day when someone used Evernote's interface at least once. + * So if a user interacts with an Evernote client at 12:18, 12:24, and 12:36, + * and then the client synchronizes at 12:39, it would report that there were + * two previously-unreported sessions (one session for the 12:15-12:30 time + * period, and one for the 12:30-12:45 period). + * If the user used Evernote again at 12:41 and synchronized at 12:43, it + * would not report any new sessions, because the 12:30-12:45 session had + * already been reported. + *
      + *
      + */ + class ClientUsageMetrics { + sessions: number; + + constructor(args?: { sessions?: number; }); + } + + /** + * A description of the thing for which we are searching for related + * entities. + * + * You must specify either noteGuid or plainText, but + * not both. filter and referenceUri are optional. + * + *
      + *
      noteGuid
      + *
      The GUID of an existing note in your account for which related + * entities will be found.
      + * + *
      plainText
      + *
      A string of plain text for which to find related entities. + * You should provide a text block with a number of characters between + * EDAM_RELATED_PLAINTEXT_LEN_MIN and EDAM_RELATED_PLAINTEXT_LEN_MAX. + *
      + * + *
      filter
      + *
      The list of criteria that will constrain the notes being considered + * related. + * Please note that some of the parameters may be ignored, such as + * order and ascending. + *
      + * + *
      referenceUri
      + *
      A URI string specifying a reference entity, around which "relatedness" + * should be based. This can be an URL pointing to a web page, for example. + *
      + *
      + */ + class RelatedQuery { + noteGuid: string; + plainText: string; + filter: NoteFilter; + referenceUri: string; + + constructor(args?: { noteGuid?: string; plainText?: string; filter?: NoteFilter; referenceUri?: string; }); + } + + /** + * The result of calling findRelated(). The contents of the notes, + * notebooks, and tags fields will be in decreasing order of expected + * relevance. It is possible that fewer results than requested will be + * returned even if there are enough distinct entities in the account + * in cases where the relevance is estimated to be low. + * + *
      + *
      notes
      + *
      If notes have been requested to be included, this will be the + * list of notes.
      + * + *
      notebooks
      + *
      If notebooks have been requested to be included, this will be the + * list of notebooks.
      + * + *
      tags
      + *
      If tags have been requested to be included, this will be the list + * of tags.
      + *
      + * + *
      containingNotebooks
      + *
      If includeContainingNotebooks is set to true + * in the RelatedResultSpec, return the list of notebooks to + * to which the returned related notes belong. The notebooks in this + * list will occur once per notebook GUID and are represented as + * NotebookDescriptor objects.
      + * + * + */ + class RelatedResult { + notes: Note[]; + notebooks: Notebook[]; + tags: Tag[]; + containingNotebooks: NotebookDescriptor[]; + + constructor(args?: { notes?: Note[]; notebooks?: Notebook[]; tags?: Tag[]; containingNotebooks?: NotebookDescriptor[]; }); + } + + /** + * A description of the thing for which the service will find related + * entities, via findRelated(), together with a description of what + * type of entities and how many you are seeking in the + * RelatedResult. + * + *
      + *
      maxNotes
      + *
      Return notes that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_NOTES + * will be silently capped. If you do not set this field, then + * no notes will be returned.
      + * + *
      maxNotebooks
      + *
      Return notebooks that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_NOTEBOOKS + * will be silently capped. If you do not set this field, then + * no notebooks will be returned.
      + * + *
      maxTags
      + *
      Return tags that are related to the query, but no more than + * this many. Any value greater than EDAM_RELATED_MAX_TAGS + * will be silently capped. If you do not set this field, then + * no tags will be returned.
      + *
      + * + *
      writableNotebooksOnly
      + *
      Require that all returned related notebooks are writable. + * The user will be able to create notes in all returned notebooks. + * However, individual notes returned may still belong to notebooks + * in which the user lacks the ability to create notes.
      + * + * + *
      includeContainingNotebooks
      + *
      If set to true, return the containingNotebooks field + * in the RelatedResult, which will contain the list of notebooks to + * to which the returned related notes belong.
      + * + * + */ + class RelatedResultSpec { + maxNotes: number; + maxNotebooks: number; + maxTags: number; + writableNotebooksOnly: boolean; + includeContainingNotebooks: boolean; + + constructor(args?: { maxNotes?: number; maxNotebooks?: number; maxTags?: number; writableNotebooksOnly?: boolean; includeContainingNotebooks?: boolean; }); + } + /** + * This enumeration defines the possible permission levels for a user. + * Free accounts will have a level of NORMAL and paid Premium accounts + * will have a level of PREMIUM. + */ + enum PrivilegeLevel { + 'NORMAL' = 1, + 'PREMIUM' = 3, + 'VIP' = 5, + 'MANAGER' = 7, + 'SUPPORT' = 8, + 'ADMIN' = 9, + } + + /** + * Every search query is specified as a sequence of characters. + * Currently, only the USER query format is supported. + */ + enum QueryFormat { + 'USER' = 1, + 'SEXP' = 2, + } + + /** + * This enumeration defines the possible sort ordering for notes when + * they are returned from a search result. + */ + enum NoteSortOrder { + 'CREATED' = 1, + 'UPDATED' = 2, + 'RELEVANCE' = 3, + 'UPDATE_SEQUENCE_NUMBER' = 4, + 'TITLE' = 5, + } + + /** + * This enumeration defines the possible states of a premium account + * + * NONE: the user has never attempted to become a premium subscriber + * + * PENDING: the user has requested a premium account but their charge has not + * been confirmed + * + * ACTIVE: the user has been charged and their premium account is in good + * standing + * + * FAILED: the system attempted to charge the was denied. Their premium + * privileges have been revoked. We will periodically attempt to re-validate + * their order. + * + * CANCELLATION_PENDING: the user has requested that no further charges be made + * but the current account is still active. + * + * CANCELED: the premium account was canceled either because of failure to pay + * or user cancelation. No more attempts will be made to activate the account. + */ + enum PremiumOrderStatus { + 'NONE' = 0, + 'PENDING' = 1, + 'ACTIVE' = 2, + 'FAILED' = 3, + 'CANCELLATION_PENDING' = 4, + 'CANCELED' = 5, + } + + /** + * Privilege levels for accessing shared notebooks. + * + * READ_NOTEBOOK: Recipient is able to read the contents of the shared notebook + * but does to have access to information about other recipients of the + * notebook or the activity stream information. + * + * MODIFY_NOTEBOOK_PLUS_ACTIVITY: Recipient has rights to read and modify the contents + * of the shared notebook, including the right to move notes to the trash and to create + * notes in the notebook. The recipient can also access information about other + * recipients and the activity stream. + * + * READ_NOTEBOOK_PLUS_ACTIVITY: Recipient has READ_NOTEBOOK rights and can also + * access information about other recipients and the activity stream. + * + * GROUP: If the user belongs to a group, such as a Business, that has a defined + * privilege level, use the privilege level of the group as the privilege for + * the individual. + * + * FULL_ACCESS: Recipient has full rights to the shared notebook and recipient lists, + * including privilege to revoke and create invitations and to change privilege + * levels on invitations for individuals. This privilege level is primarily intended + * for use by individual shares. + * + * BUSINESS_FULL_ACCESS: Intended for use with Business Notebooks, a + * BUSINESS_FULL_ACCESS level is FULL_ACCESS with the additional rights to + * change how the notebook will appear in the business library, including the + * rights to publish and unpublish the notebook from the library. + */ + enum SharedNotebookPrivilegeLevel { + 'READ_NOTEBOOK' = 0, + 'MODIFY_NOTEBOOK_PLUS_ACTIVITY' = 1, + 'READ_NOTEBOOK_PLUS_ACTIVITY' = 2, + 'GROUP' = 3, + 'FULL_ACCESS' = 4, + 'BUSINESS_FULL_ACCESS' = 5, + } + + /** + * Enumeration of the roles that a User can have within a sponsored group. + * + * GROUP_MEMBER: The user is a member of the group with no special privileges. + * + * GROUP_ADMIN: The user is an administrator within the group. + * + * GROUP_OWNER: The user is the owner of the group. + */ + enum SponsoredGroupRole { + 'GROUP_MEMBER' = 1, + 'GROUP_ADMIN' = 2, + 'GROUP_OWNER' = 3, + } + + /** + * Enumeration of the roles that a User can have within an Evernote Business account. + * + * ADMIN: The user is an administrator of the Evernote Business account. + * + * NORMAL: The user is a regular user within the Evernote Business account. + */ + enum BusinessUserRole { + 'ADMIN' = 1, + 'NORMAL' = 2, + } + + /** + * An enumeration describing restrictions on the domain of shared notebook + * instances that are valid for a given operation, as used, for example, in + * NotebookRestrictions. + * + * ONLY_JOINED_OR_PREVIEW: The domain consists of shared notebooks that + * "belong" to the recipient or still available for preview by any recipient. + * Shared notebooks that the recipient has joined (the username has already been + * assigned to our user) are in the domain. Additionally, shared notebooks + * that allow preview and have not yet been joined are in the domain. + * + * NO_SHARED_NOTEBOOKS: No shared notebooks are applicable to the operation. + */ + enum SharedNotebookInstanceRestrictions { + 'ONLY_JOINED_OR_PREVIEW' = 1, + 'NO_SHARED_NOTEBOOKS' = 2, + } + + /** + * An enumeration describing the configuration state related to receiving + * reminder e-mails from the service. Reminder e-mails summarize notes + * based on their Note.attributes.reminderTime values. + * + * DO_NOT_SEND: The user has selected to not receive reminder e-mail. + * + * SEND_DAILY_EMAIL: The user has selected to receive reminder e-mail for those + * days when there is a reminder. + */ + enum ReminderEmailConfig { + 'DO_NOT_SEND' = 1, + 'SEND_DAILY_EMAIL' = 2, + } + + /** + * In several places, EDAM exchanges blocks of bytes of data for a component + * which may be relatively large. For example: the contents of a clipped + * HTML note, the bytes of an embedded image, or the recognition XML for + * a large image. This structure is used in the protocol to represent + * any of those large blocks of data when they are transmitted or when + * they are only referenced their metadata. + * + *
      + *
      bodyHash
      + *
      This field carries a one-way hash of the contents of the + * data body, in binary form. The hash function is MD5
      + * Length: EDAM_HASH_LEN (exactly) + *
      + * + *
      size
      + *
      The length, in bytes, of the data body. + *
      + * + *
      body
      + *
      This field is set to contain the binary contents of the data + * whenever the resource is being transferred. If only metadata is + * being exchanged, this field will be empty. For example, a client could + * notify the service about the change to an attribute for a resource + * without transmitting the binary resource contents. + *
      + *
      + */ + class Data { + bodyHash: string; + size: number; + body: string; + + constructor(args?: { bodyHash?: string; size?: number; body?: string; }); + } + + /** + * A structure holding the optional attributes that can be stored + * on a User. These are generally less critical than the core User fields. + * + *
      + *
      defaultLocationName
      + *
      the location string that should be associated + * with the user in order to determine where notes are taken if not otherwise + * specified.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      defaultLatitude
      + *
      if set, this is the latitude that should be + * assigned to any notes that have no other latitude information. + *
      + * + *
      defaultLongitude
      + *
      if set, this is the longitude that should be + * assigned to any notes that have no other longitude information. + *
      + * + *
      preactivation
      + *
      if set, the user account is not yet confirmed for + * login. I.e. the account has been created, but we are still waiting for + * the user to complete the activation step. + *
      + * + *
      viewedPromotions
      + *
      a list of promotions the user has seen. + * This list may occasionally be modified by the system when promotions are + * no longer available.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      incomingEmailAddress
      + *
      if set, this is the email address that the + * user may send email to in order to add an email note directly into the + * account via the SMTP email gateway. This is the part of the email + * address before the '@' symbol ... our domain is not included. + * If this is not set, the user may not add notes via the gateway.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      recentMailedAddresses
      + *
      if set, this will contain a list of email + * addresses that have recently been used as recipients + * of outbound emails by the user. This can be used to pre-populate a + * list of possible destinations when a user wishes to send a note via + * email.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX each
      + * Max: EDAM_USER_RECENT_MAILED_ADDRESSES_MAX entries + *
      + * + *
      comments
      + *
      Free-form text field that may hold general support + * information, etc.
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      dateAgreedToTermsOfService
      + *
      The date/time when the user agreed to + * the terms of service. This can be used as the effective "start date" + * for the account. + *
      + * + *
      maxReferrals
      + *
      The number of referrals that the user is permitted + * to make. + *
      + * + *
      referralCount
      + *
      The number of referrals sent from this account. + *
      + * + *
      refererCode
      + *
      A code indicating where the user was sent from. AKA + * promotion code + *
      + * + *
      sentEmailDate
      + *
      The most recent date when the user sent outbound + * emails from the service. Used with sentEmailCount to limit the number + * of emails that can be sent per day. + *
      + * + *
      sentEmailCount
      + *
      The number of emails that were sent from the user + * via the service on sentEmailDate. Used to enforce a limit on the number + * of emails per user per day to prevent spamming. + *
      + * + *
      dailyEmailLimit
      + *
      If set, this is the maximum number of emails that + * may be sent in a given day from this account. If unset, the server will + * use the configured default limit. + *
      + * + *
      emailOptOutDate
      + *
      If set, this is the date when the user asked + * to be excluded from offers and promotions sent by Evernote. If not set, + * then the user currently agrees to receive these messages. + *
      + * + *
      partnerEmailOptInDate
      + *
      If set, this is the date when the user asked + * to be included in offers and promotions sent by Evernote's partners. + * If not sent, then the user currently does not agree to receive these + * emails. + *
      + * + *
      preferredLanguage
      + *
      a 2 character language codes based on: + * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt used for + * localization purposes to determine what language to use for the web + * interface and for other direct communication (e.g. emails). + *
      + * + *
      preferredCountry
      + *
      Preferred country code based on ISO 3166-1-alpha-2 indicating the + * users preferred country
      + * + *
      clipFullPage
      + *
      Boolean flag set to true if the user wants to clip full pages by + * default when they use the web clipper without a selection.
      + * + *
      twitterUserName
      + *
      The username of the account of someone who has chosen to enable + * Twittering into Evernote. This value is subject to change, since users + * may change their Twitter user name.
      + * + *
      twitterId
      + *
      The unique identifier of the user's Twitter account if that user + * has chosen to enable Twittering into Evernote.
      + * + *
      groupName
      + *
      A name identifier used to identify a particular set of branding and + * light customization.
      + * + *
      recognitionLanguage
      + *
      a 2 character language codes based on: + * http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt + * If set, this is used to determine the language that should be used + * when processing images and PDF files to find text. + * If not set, then the 'preferredLanguage' will be used. + *
      + * + *
      educationalInstitution
      + *
      a flag indicating that the user is part of an educational institution which + * makes them eligible for discounts on bulk purchases + *
      + * + *
      businessAddress
      + *
      A string recording the business address of a Sponsored Account user who has requested invoicing. + *
      + * + *
      hideSponsorBilling
      + *
      A flag indicating whether to hide the billing information on a sponsored + * account owner's settings page + *
      + * + *
      taxExempt
      + *
      A flag indicating the user's sponsored group is exempt from sale tax + *
      + * + *
      useEmailAutoFiling
      + *
      A flag indicating whether the user chooses to allow Evernote to automatically + * file and tag emailed notes + *
      + * + *
      reminderEmailConfig
      + *
      Configuration state for whether or not the user wishes to receive + * reminder e-mail. This setting applies to both the reminder e-mail sent + * for personal reminder notes and for the reminder e-mail sent for reminder + * notes in the user's business notebooks that the user has configured for + * e-mail notifications. + *
      + *
      + */ + class UserAttributes { + defaultLocationName: string; + defaultLatitude: number; + defaultLongitude: number; + preactivation: boolean; + viewedPromotions: string[]; + incomingEmailAddress: string; + recentMailedAddresses: string[]; + comments: string; + dateAgreedToTermsOfService: number; + maxReferrals: number; + referralCount: number; + refererCode: string; + sentEmailDate: number; + sentEmailCount: number; + dailyEmailLimit: number; + emailOptOutDate: number; + partnerEmailOptInDate: number; + preferredLanguage: string; + preferredCountry: string; + clipFullPage: boolean; + twitterUserName: string; + twitterId: string; + groupName: string; + recognitionLanguage: string; + referralProof: string; + educationalDiscount: boolean; + businessAddress: string; + hideSponsorBilling: boolean; + taxExempt: boolean; + useEmailAutoFiling: boolean; + reminderEmailConfig: ReminderEmailConfig; + + constructor(args?: { defaultLocationName?: string; defaultLatitude?: number; defaultLongitude?: number; preactivation?: boolean; viewedPromotions?: string[]; incomingEmailAddress?: string; recentMailedAddresses?: string[]; comments?: string; dateAgreedToTermsOfService?: number; maxReferrals?: number; referralCount?: number; refererCode?: string; sentEmailDate?: number; sentEmailCount?: number; dailyEmailLimit?: number; emailOptOutDate?: number; partnerEmailOptInDate?: number; preferredLanguage?: string; preferredCountry?: string; clipFullPage?: boolean; twitterUserName?: string; twitterId?: string; groupName?: string; recognitionLanguage?: string; referralProof?: string; educationalDiscount?: boolean; businessAddress?: string; hideSponsorBilling?: boolean; taxExempt?: boolean; useEmailAutoFiling?: boolean; reminderEmailConfig?: ReminderEmailConfig; }); + } + + /** + * This represents the bookkeeping information for the user's subscription. + * + *
      + *
      uploadLimit
      + *
      The number of bytes that can be uploaded to the account + * in the current month. For new notes that are created, this is the length + * of the note content (in Unicode characters) plus the size of each resource + * (in bytes). For edited notes, this is the the difference between the old + * length and the new length (if this is greater than 0) plus the size of + * each new resource. + *
      + *
      uploadLimitEnd
      + *
      The date and time when the current upload limit + * expires. At this time, the monthly upload count reverts to 0 and a new + * limit is imposed. This date and time is exclusive, so this is effectively + * the start of the new month. + *
      + *
      uploadLimitNextMonth
      + *
      When uploadLimitEnd is reached, the service + * will change uploadLimit to uploadLimitNextMonth. If a premium account is + * canceled, this mechanism will reset the quota appropriately. + *
      + *
      premiumServiceStatus
      + *
      Indicates the phases of a premium account + * during the billing process. + *
      + *
      premiumOrderNumber
      + *
      The order number used by the commerce system to + * process recurring payments + *
      + *
      premiumServiceStart
      + *
      The start date when this premium promotion + * began (this number will get overwritten if a premium service is canceled + * and then re-activated). + *
      + *
      premiumCommerceService
      + *
      The commerce system used (paypal, Google + * checkout, etc) + *
      + *
      premiumServiceSKU
      + *
      The code associated with the purchase eg. monthly + * or annual purchase. Clients should interpret this value and localize it. + *
      + *
      lastSuccessfulCharge
      + *
      Date the last time the user was charged. + * Null if never charged. + *
      + *
      lastFailedCharge
      + *
      Date the last time a charge was attempted and + * failed. + *
      + *
      lastFailedChargeReason
      + *
      Reason provided for the charge failure + *
      + *
      nextPaymentDue
      + *
      The end of the billing cycle. This could be in the + * past if there are failed charges. + *
      + *
      premiumLockUntil
      + *
      An internal variable to manage locking operations + * on the commerce variables. + *
      + *
      updated
      + *
      The date any modification where made to this record. + *
      + *
      premiumSubscriptionNumber
      + *
      The number number identifying the + * recurring subscription used to make the recurring charges. + *
      + *
      lastRequestedCharge
      + *
      Date charge last attempted
      + *
      currency
      + *
      ISO 4217 currency code
      + *
      unitPrice
      + *
      charge in the smallest unit of the currency (e.g. cents for USD)
      + *
      businessId
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      businessName
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      businessRole
      + *
      DEPRECATED:See BusinessUserInfo.
      + *
      unitDiscount
      + *
      discount per seat in negative amount and smallest unit of the currency (e.g. cents for USD)
      + *
      nextChargeDate
      + *
      The next time the user will be charged, may or may not be the same as nextPaymentDue
      + *
      + */ + class Accounting { + uploadLimit: number; + uploadLimitEnd: number; + uploadLimitNextMonth: number; + premiumServiceStatus: PremiumOrderStatus; + premiumOrderNumber: string; + premiumCommerceService: string; + premiumServiceStart: number; + premiumServiceSKU: string; + lastSuccessfulCharge: number; + lastFailedCharge: number; + lastFailedChargeReason: string; + nextPaymentDue: number; + premiumLockUntil: number; + updated: number; + premiumSubscriptionNumber: string; + lastRequestedCharge: number; + currency: string; + unitPrice: number; + businessId: number; + businessName: string; + businessRole: BusinessUserRole; + unitDiscount: number; + nextChargeDate: number; + + constructor(args?: { uploadLimit?: number; uploadLimitEnd?: number; uploadLimitNextMonth?: number; premiumServiceStatus?: PremiumOrderStatus; premiumOrderNumber?: string; premiumCommerceService?: string; premiumServiceStart?: number; premiumServiceSKU?: string; lastSuccessfulCharge?: number; lastFailedCharge?: number; lastFailedChargeReason?: string; nextPaymentDue?: number; premiumLockUntil?: number; updated?: number; premiumSubscriptionNumber?: string; lastRequestedCharge?: number; currency?: string; unitPrice?: number; businessId?: number; businessName?: string; businessRole?: BusinessUserRole; unitDiscount?: number; nextChargeDate?: number; }); + } + + /** + * This structure is used to provide information about an Evernote Business + * membership, for members who are part of a business. + * + *
      + *
      businessId
      + *
      The ID of the Evernote Business account that the user is a member of. + *
      businessName
      + *
      The human-readable name of the Evernote Business account that the user + * is a member of.
      + *
      role
      + *
      The role of the user within the Evernote Business account that + * they are a member of.
      + *
      email
      + *
      An e-mail address that will be used by the service in the context of your + * Evernote Business activities. For example, this e-mail address will be used + * when you e-mail a business note, when you update notes in the account of + * your business, etc. The business e-mail cannot be used for identification + * purposes such as for logging into the service. + *
      + *
      + */ + class BusinessUserInfo { + businessId: number; + businessName: string; + role: BusinessUserRole; + email: string; + + constructor(args?: { businessId?: number; businessName?: string; role?: BusinessUserRole; email?: string; }); + } + + /** + * This structure is used to provide information about a user's Premium account. + *
      + *
      currentTime
      + *
      + * The server-side date and time when this data was generated. + *
      + *
      premium
      + *
      + * True if the user's account is Premium. + *
      + *
      premiumRecurring
      + *
      + * True if the user's account is Premium and has a recurring payment method. + *
      + *
      premiumExpirationDate
      + *
      + * The date when the user's Premium account expires, or the date when the + * user's account is due for payment if it has a recurring payment method. + *
      + *
      premiumExtendable
      + *
      + * True if the user is eligible for purchasing Premium account extensions. + *
      + *
      premiumPending
      + *
      + * True if the user's Premium account is pending payment confirmation + *
      + *
      premiumCancellationPending
      + *
      + * True if the user has requested that no further charges to be made; the + * Premium account will remain active until it expires. + *
      + *
      canPurchaseUploadAllowance
      + *
      + * True if the user is eligible for purchasing additional upload allowance. + *
      + *
      sponsoredGroupName
      + *
      + * The name of the sponsored group that the user is part of. + *
      + *
      sponsoredGroupRole
      + *
      + * DEPRECATED - will be removed in a future update. + *
      + *
      premiumUpgradable
      + *
      + * True if the user is eligible for purchasing Premium account upgrade. + *
      + *
      + */ + class PremiumInfo { + currentTime: number; + premium: boolean; + premiumRecurring: boolean; + premiumExpirationDate: number; + premiumExtendable: boolean; + premiumPending: boolean; + premiumCancellationPending: boolean; + canPurchaseUploadAllowance: boolean; + sponsoredGroupName: string; + sponsoredGroupRole: SponsoredGroupRole; + premiumUpgradable: boolean; + + constructor(args?: { currentTime: number; premium: boolean; premiumRecurring: boolean; premiumExpirationDate?: number; premiumExtendable: boolean; premiumPending: boolean; premiumCancellationPending: boolean; canPurchaseUploadAllowance: boolean; sponsoredGroupName?: string; sponsoredGroupRole?: SponsoredGroupRole; premiumUpgradable?: boolean; }); + } + + /** + * This represents the information about a single user account. + *
      + *
      id
      + *
      The unique numeric identifier for the account, which will not + * change for the lifetime of the account. + *
      + * + *
      username
      + *
      The name that uniquely identifies a single user account. This name + * may be presented by the user, along with their password, to log into + * their account. + * May only contain a-z, 0-9, or '-', and may not start or end with the '-' + *
      + * Length: EDAM_USER_USERNAME_LEN_MIN - EDAM_USER_USERNAME_LEN_MAX + *
      + * Regex: EDAM_USER_USERNAME_REGEX + *
      + * + *
      email
      + *
      The email address registered for the user. Must comply with + * RFC 2821 and RFC 2822.
      + * Third party applications that authenticate using OAuth do not have + * access to this field. + * Length: EDAM_EMAIL_LEN_MIN - EDAM_EMAIL_LEN_MAX + *
      + * Regex: EDAM_EMAIL_REGEX + *
      + * + *
      name
      + *
      The printable name of the user, which may be a combination + * of given and family names. This is used instead of separate "first" + * and "last" names due to variations in international name format/order. + * May not start or end with a whitespace character. May contain any + * character but carriage return or newline (Unicode classes Zl and Zp). + *
      + * Length: EDAM_USER_NAME_LEN_MIN - EDAM_USER_NAME_LEN_MAX + *
      + * Regex: EDAM_USER_NAME_REGEX + *
      + * + *
      timezone
      + *
      The zone ID for the user's default location. If present, + * this may be used to localize the display of any timestamp for which no + * other timezone is available. + * The format must be encoded as a standard zone ID such as + * "America/Los_Angeles" or "GMT+08:00" + *
      + * Length: EDAM_TIMEZONE_LEN_MIN - EDAM_TIMEZONE_LEN_MAX + *
      + * Regex: EDAM_TIMEZONE_REGEX + *
      + * + *
      privilege
      + *
      The level of access permitted for the user. + *
      + * + *
      created
      + *
      The date and time when this user account was created in the + * service. + *
      + * + *
      updated
      + *
      The date and time when this user account was last modified + * in the service. + *
      + * + *
      deleted
      + *
      If the account has been deleted from the system (e.g. as + * the result of a legal request by the user), the date and time of the + * deletion will be represented here. If not, this value will not be set. + *
      + * + *
      active
      + *
      If the user account is available for login and + * synchronization, this flag will be set to true. + *
      + * + *
      shardId
      + *
      DEPRECATED - Client applications should have no need to use this field. + *
      + * + *
      attributes
      + *
      If present, this will contain a list of the attributes + * for this user account. + *
      + * + *
      accounting
      + *
      Bookkeeping information for the user's subscription. + *
      + * + *
      premiumInfo
      + *
      If present, this will contain a set of commerce information + * relating to the user's premium service level. + *
      + * + *
      businessUserInfo
      + *
      If present, this will contain a set of business information + * relating to the user's business membership. If not present, the + * user is not currently part of a business. + *
      + *
      + */ + class User { + id: number; + username: string; + email: string; + name: string; + timezone: string; + privilege: PrivilegeLevel; + created: number; + updated: number; + deleted: number; + active: boolean; + shardId: string; + attributes: UserAttributes; + accounting: Accounting; + premiumInfo: PremiumInfo; + businessUserInfo: BusinessUserInfo; + + constructor(args?: { id?: number; username?: string; email?: string; name?: string; timezone?: string; privilege?: PrivilegeLevel; created?: number; updated?: number; deleted?: number; active?: boolean; shardId?: string; attributes?: UserAttributes; accounting?: Accounting; premiumInfo?: PremiumInfo; businessUserInfo?: BusinessUserInfo; }); + } + + /** + * A tag within a user's account is a unique name which may be organized + * a simple hierarchy. + *
      + *
      guid
      + *
      The unique identifier of this tag. Will be set by the service, + * so may be omitted by the client when creating the Tag. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      name
      + *
      A sequence of characters representing the tag's identifier. + * Case is preserved, but is ignored for comparisons. + * This means that an account may only have one tag with a given name, via + * case-insensitive comparison, so an account may not have both "food" and + * "Food" tags. + * May not contain a comma (','), and may not begin or end with a space. + *
      + * Length: EDAM_TAG_NAME_LEN_MIN - EDAM_TAG_NAME_LEN_MAX + *
      + * Regex: EDAM_TAG_NAME_REGEX + *
      + * + *
      parentGuid
      + *
      If this is set, then this is the GUID of the tag that + * holds this tag within the tag organizational hierarchy. If this is + * not set, then the tag has no parent and it is a "top level" tag. + * Cycles are not allowed (e.g. a->parent->parent == a) and will be + * rejected by the service. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + *
      + */ + class Tag { + guid: string; + name: string; + parentGuid: string; + updateSequenceNum: number; + + constructor(args?: { guid?: string; name?: string; parentGuid?: string; updateSequenceNum?: number; }); + } + + /** + * A structure that wraps a map of name/value pairs whose values are not + * always present in the structure in order to reduce space when obtaining + * batches of entities that contain the map. + * + * When the server provides the client with a LazyMap, it will fill in either + * the keysOnly field or the fullMap field, but never both, based on the API + * and parameters. + * + * When a client provides a LazyMap to the server as part of an update to + * an object, the server will only update the LazyMap if the fullMap field is + * set. If the fullMap field is not set, the server will not make any changes + * to the map. + * + * Check the API documentation of the individual calls involving the LazyMap + * for full details including the constraints of the names and values of the + * map. + * + *
      + *
      keysOnly
      + *
      The set of keys for the map. This field is ignored by the + * server when set. + *
      + * + *
      fullMap
      + *
      The complete map, including all keys and values. + *
      + *
      + */ + class LazyMap { + keysOnly: string[]; + fullMap: { [k: string]: string; }; + + constructor(args?: { keysOnly?: string[]; fullMap?: { [k: string]: string; }; }); + } + + /** + * Structure holding the optional attributes of a Resource + *
      + *
      sourceURL
      + *
      the original location where the resource was hosted + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      timestamp
      + *
      the date and time that is associated with this resource + * (e.g. the time embedded in an image from a digital camera with a clock) + *
      + * + *
      latitude
      + *
      the latitude where the resource was captured + *
      + * + *
      longitude
      + *
      the longitude where the resource was captured + *
      + * + *
      altitude
      + *
      the altitude where the resource was captured + *
      + * + *
      cameraMake
      + *
      information about an image's camera, e.g. as embedded in + * the image's EXIF data + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      cameraModel
      + *
      information about an image's camera, e.g. as embedded + * in the image's EXIF data + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      clientWillIndex
      + *
      if true, then the original client that submitted + * the resource plans to submit the recognition index for this resource at a + * later time. + *
      + * + *
      recoType
      + *
      DEPRECATED - this field is no longer set by the service, so should + * be ignored. + *
      + * + *
      fileName
      + *
      if the resource came from a source that provided an + * explicit file name, the original name will be stored here. Many resources + * come from unnamed sources, so this will not always be set. + *
      + * + *
      attachment
      + *
      this will be true if the resource should be displayed as an attachment, + * or false if the resource should be displayed inline (if possible). + *
      + * + *
      applicationData
      + *
      Provides a location for applications to store a relatively small + * (4kb) blob of data associated with a Resource that is not visible to the user + * and that is opaque to the Evernote service. A single application may use at most + * one entry in this map, using its API consumer key as the map key. See the + * documentation for LazyMap for a description of when the actual map values + * are returned by the service. + *

      To safely add or modify your application's entry in the map, use + * NoteStore.setResourceApplicationDataEntry. To safely remove your application's + * entry from the map, use NoteStore.unsetResourceApplicationDataEntry.

      + * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN + *
      + * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX + *
      + * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX + *
      + * + *
      + */ + class ResourceAttributes { + sourceURL: string; + timestamp: number; + latitude: number; + longitude: number; + altitude: number; + cameraMake: string; + cameraModel: string; + clientWillIndex: boolean; + recoType: string; + fileName: string; + attachment: boolean; + applicationData: LazyMap; + + constructor(args?: { sourceURL?: string; timestamp?: number; latitude?: number; longitude?: number; altitude?: number; cameraMake?: string; cameraModel?: string; clientWillIndex?: boolean; recoType?: string; fileName?: string; attachment?: boolean; applicationData?: LazyMap; }); + } + + /** + * Every media file that is embedded or attached to a note is represented + * through a Resource entry. + *
      + *
      guid
      + *
      The unique identifier of this resource. Will be set whenever + * a resource is retrieved from the service, but may be null when a client + * is creating a resource. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      noteGuid
      + *
      The unique identifier of the Note that holds this + * Resource. Will be set whenever the resource is retrieved from the service, + * but may be null when a client is creating a resource. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      data
      + *
      The contents of the resource. + * Maximum length: The data.body is limited to EDAM_RESOURCE_SIZE_MAX_FREE + * for free accounts and EDAM_RESOURCE_SIZE_MAX_PREMIUM for premium accounts. + *
      + * + *
      mime
      + *
      The MIME type for the embedded resource. E.g. "image/gif" + *
      + * Length: EDAM_MIME_LEN_MIN - EDAM_MIME_LEN_MAX + *
      + * Regex: EDAM_MIME_REGEX + *
      + * + *
      width
      + *
      If set, this contains the display width of this resource, in + * pixels. + *
      + * + *
      height
      + *
      If set, this contains the display height of this resource, + * in pixels. + *
      + * + *
      duration
      + *
      DEPRECATED: ignored. + *
      + * + *
      active
      + *
      DEPRECATED: ignored. + *
      + * + *
      recognition
      + *
      If set, this will hold the encoded data that provides + * information on search and recognition within this resource. + *
      + * + *
      attributes
      + *
      A list of the attributes for this resource. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      alternateData
      + *
      Some Resources may be assigned an alternate data format by the service + * which may be more appropriate for indexing or rendering than the original + * data provided by the user. In these cases, the alternate data form will + * be available via this Data element. If a Resource has no alternate form, + * this field will be unset.
      + *
      + */ + class Resource { + guid: string; + noteGuid: string; + data: Data; + mime: string; + width: number; + height: number; + duration: number; + active: boolean; + recognition: Data; + attributes: ResourceAttributes; + updateSequenceNum: number; + alternateData: Data; + + constructor(args?: { guid?: string; noteGuid?: string; data?: Data; mime?: string; width?: number; height?: number; duration?: number; active?: boolean; recognition?: Data; attributes?: ResourceAttributes; updateSequenceNum?: number; alternateData?: Data; }); + } + + /** + * The list of optional attributes that can be stored on a note. + *
      + *
      subjectDate
      + *
      time that the note refers to + *
      + * + *
      latitude
      + *
      the latitude where the note was taken + *
      + * + *
      longitude
      + *
      the longitude where the note was taken + *
      + * + *
      altitude
      + *
      the altitude where the note was taken + *
      + * + *
      author
      + *
      the author of the content of the note + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      source
      + *
      the method that the note was added to the account, if the + * note wasn't directly authored in an Evernote desktop client. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      sourceURL
      + *
      the original location where the resource was hosted. For web clips, + * this will be the URL of the page that was clipped. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      sourceApplication
      + *
      an identifying string for the application that + * created this note. This string does not have a guaranteed syntax or + * structure -- it is intended for human inspection and tracking. + *
      + * Length: EDAM_ATTRIBUTE_LEN_MIN - EDAM_ATTRIBUTE_LEN_MAX + *
      + * + *
      shareDate
      + *
      The date and time when this note was directly shared via its own URL. + * This is only set on notes that were individually shared - it is independent + * of any notebook-level sharing of the containing notebook. This field + * is treated as "read-only" for clients; the server will ignore changes + * to this field from an external client. + *
      + * + *
      reminderOrder
      + *
      The set of notes with this parameter set are considered + * "reminders" and are to be treated specially by clients to give them + * higher UI prominence within a notebook. The value is used to sort + * the reminder notes within the notebook with higher values + * representing greater prominence. Outside of the context of a + * notebook, the value of this parameter is undefined. The value is + * not intended to be compared to the values of reminder notes in + * other notebooks. In order to allow clients to place a note at a + * higher precedence than other notes, you should never set a value + * greater than the current time (as defined for a Timetstamp). To + * place a note at higher precedence than existing notes, set the + * value to the current time as defined for a timestamp (milliseconds + * since the epoch). Synchronizing clients must remember the time when + * the update was performed, using the local clock on the client, + * and use that value when they later upload the note to the service. + * Clients must not set the reminderOrder to the reminderTime as the + * reminderTime could be in the future. Those two fields are never + * intended to be related. The correct value for reminderOrder field + * for new notes is the "current" time when the user indicated that + * the note is a reminder. Clients may implement a separate + * "sort by date" feature to show notes ordered by reminderTime. + * Whenever a reminderDoneTime or reminderTime is set but a + * reminderOrder is not set, the server will fill in the current + * server time for the reminderOrder field.
      + * + *
      reminderDoneTime
      + *
      The date and time when a user dismissed/"marked done" the reminder + * on the note. Users typically do not manually set this value directly + * as it is set to the time when the user dismissed/"marked done" the + * reminder.
      + * + *
      reminderTime
      + *
      The date and time a user has selected to be reminded of the note. + * A note with this value set is known as a "reminder" and the user can + * be reminded, via e-mail or client-specific notifications, of the note + * when the time is reached or about to be reached. When a user sets + * a reminder time on a note that has a reminder done time, and that + * reminder time is in the future, then the reminder done time should be + * cleared. This should happen regardless of any existing reminder time + * that may have previously existed on the note.
      + * + *
      placeName
      + *
      Allows the user to assign a human-readable location name associated + * with a note. Users may assign values like 'Home' and 'Work'. Place + * names may also be populated with values from geonames database + * (e.g., a restaurant name). Applications are encouraged to normalize values + * so that grouping values by place name provides a useful result. Applications + * MUST NOT automatically add place name values based on geolocation without + * confirmation from the user; that is, the value in this field should be + * more useful than a simple automated lookup based on the note's latitude + * and longitude.
      + * + *
      contentClass
      + *
      The class (or type) of note. This field is used to indicate to + * clients that special structured information is represented within + * the note such that special rules apply when making + * modifications. If contentClass is set and the client + * application does not specifically support the specified class, + * the client MUST treat the note as read-only. In this case, the + * client MAY modify the note's notebook and tags via the + * Note.notebookGuid and Note.tagGuids fields. The client MAY also + * modify the reminderOrder field as well as the reminderTime and + * reminderDoneTime fields. + *

      Applications should set contentClass only when they are creating notes + * that contain structured information that needs to be maintained in order + * for the user to be able to use the note within that application. + * Setting contentClass makes a note read-only in other applications, so + * there is a trade-off when an application chooses to use contentClass. + * Applications that set contentClass when creating notes must use a contentClass + * string of the form CompanyName.ApplicationName to ensure uniqueness.

      + * Length restrictions: EDAM_NOTE_CONTENT_CLASS_LEN_MIN, EDAM_NOTE_CONTENT_CLASS_LEN_MAX + *
      + * Regex: EDAM_NOTE_CONTENT_CLASS_REGEX + *
      + * + *
      applicationData
      + *
      Provides a location for applications to store a relatively small + * (4kb) blob of data that is not meant to be visible to the user and + * that is opaque to the Evernote service. A single application may use at most + * one entry in this map, using its API consumer key as the map key. See the + * documentation for LazyMap for a description of when the actual map values + * are returned by the service. + *

      To safely add or modify your application's entry in the map, use + * NoteStore.setNoteApplicationDataEntry. To safely remove your application's + * entry from the map, use NoteStore.unsetNoteApplicationDataEntry.

      + * Minimum length of a name (key): EDAM_APPLICATIONDATA_NAME_LEN_MIN + *
      + * Sum max size of key and value: EDAM_APPLICATIONDATA_ENTRY_LEN_MAX + *
      + * Syntax regex for name (key): EDAM_APPLICATIONDATA_NAME_REGEX + *
      + * + *
      creatorId
      + *
      The numeric user ID of the user who originally created the note.
      + * + *
      lastEditedBy
      + *
      An indication of who made the last change to the note. If you are + * accessing the note via a shared notebook to which you have modification + * rights, or if you are the owner of the notebook to which the note belongs, + * then you have access to the value. In this case, the value will be + * unset if the owner of the notebook containing the note was the last to + * make the modification, else it will be a string describing the + * guest who made the last edit. If you do not have access to this value, + * it will be left unset. This field is read-only by clients. The server + * will ignore all values set by clients into this field.
      + * + *
      lastEditorId
      + *
      The numeric user ID of the user described in lastEditedBy.
      + * + *
      classifications
      + *
      A map of classifications applied to the note by clients or by the + * Evernote service. The key is the string name of the classification type, + * and the value is a constant that begins with CLASSIFICATION_.
      + * + *
      + */ + class NoteAttributes { + subjectDate: number; + latitude: number; + longitude: number; + altitude: number; + author: string; + source: string; + sourceURL: string; + sourceApplication: string; + shareDate: number; + reminderOrder: number; + reminderDoneTime: number; + reminderTime: number; + placeName: string; + contentClass: string; + applicationData: LazyMap; + lastEditedBy: string; + classifications: { [k: string]: string; }; + creatorId: number; + lastEditorId: number; + + constructor(args?: { subjectDate?: number; latitude?: number; longitude?: number; altitude?: number; author?: string; source?: string; sourceURL?: string; sourceApplication?: string; shareDate?: number; reminderOrder?: number; reminderDoneTime?: number; reminderTime?: number; placeName?: string; contentClass?: string; applicationData?: LazyMap; lastEditedBy?: string; classifications?: { [k: string]: string; }; creatorId?: number; lastEditorId?: number; }); + } + + /** + * Represents a single note in the user's account. + * + *
      + *
      guid
      + *
      The unique identifier of this note. Will be set by the + * server, but will be omitted by clients calling NoteStore.createNote() + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      title
      + *
      The subject of the note. Can't begin or end with a space. + *
      + * Length: EDAM_NOTE_TITLE_LEN_MIN - EDAM_NOTE_TITLE_LEN_MAX + *
      + * Regex: EDAM_NOTE_TITLE_REGEX + *
      + * + *
      content
      + *
      The XHTML block that makes up the note. This is + * the canonical form of the note's contents, so will include abstract + * Evernote tags for internal resource references. A client may create + * a separate transformed version of this content for internal presentation, + * but the same canonical bytes should be used for transmission and + * comparison unless the user chooses to modify their content. + *
      + * Length: EDAM_NOTE_CONTENT_LEN_MIN - EDAM_NOTE_CONTENT_LEN_MAX + *
      + * + *
      contentHash
      + *
      The binary MD5 checksum of the UTF-8 encoded content + * body. This will always be set by the server, but clients may choose to omit + * this when they submit a note with content. + *
      + * Length: EDAM_HASH_LEN (exactly) + *
      + * + *
      contentLength
      + *
      The number of Unicode characters in the content of + * the note. This will always be set by the service, but clients may choose + * to omit this value when they submit a Note. + *
      + * + *
      created
      + *
      The date and time when the note was created in one of the + * clients. In most cases, this will match the user's sense of when + * the note was created, and ordering between notes will be based on + * ordering of this field. However, this is not a "reliable" timestamp + * if a client has an incorrect clock, so it cannot provide a true absolute + * ordering between notes. Notes created directly through the service + * (e.g. via the web GUI) will have an absolutely ordered "created" value. + *
      + * + *
      updated
      + *
      The date and time when the note was last modified in one of + * the clients. In most cases, this will match the user's sense of when + * the note was modified, but this field may not be absolutely reliable + * due to the possibility of client clock errors. + *
      + * + *
      deleted
      + *
      If present, the note is considered "deleted", and this + * stores the date and time when the note was deleted by one of the clients. + * In most cases, this will match the user's sense of when the note was + * deleted, but this field may be unreliable due to the possibility of + * client clock errors. + *
      + * + *
      active
      + *
      If the note is available for normal actions and viewing, + * this flag will be set to true. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this note (including changes to the note's attributes + * or resources). The USN values are sequential within an account, + * and can be used to compare the order of modifications within the service. + *
      + * + *
      notebookGuid
      + *
      The unique identifier of the notebook that contains + * this note. If no notebookGuid is provided on a call to createNote(), the + * default notebook will be used instead. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      tagGuids
      + *
      A list of the GUID identifiers for tags that are applied to this note. + * This may be provided in a call to createNote() to unambiguously + * the tags that should be assigned to the new note. Alternately, clients + * may pass the names of desired tags via the 'tagNames' field during + * note creation. + * If the list of tags are omitted on a call to createNote(), then + * the server will assume that no changes have been made to the resources. + * Maximum: EDAM_NOTE_TAGS_MAX tags per note + *
      + * + *
      resources
      + *
      The list of resources that are embedded within this note. + * If the list of resources are omitted on a call to updateNote(), then + * the server will assume that no changes have been made to the resources. + * The binary contents of the resources must be provided when the resource + * is first sent to the service, but it will be omitted by the service when + * the Note is returned in the future. + * Maximum: EDAM_NOTE_RESOURCES_MAX resources per note + *
      + * + *
      attributes
      + *
      A list of the attributes for this note. + * If the list of attributes are omitted on a call to updateNote(), then + * the server will assume that no changes have been made to the resources. + *
      + * + *
      tagNames
      + *
      May be provided by clients during calls to createNote() as an + * alternative to providing the tagGuids of existing tags. If any tagNames + * are provided during createNote(), these will be found, or created if they + * don't already exist. Created tags will have no parent (they will be at + * the top level of the tag panel). + *
      + *
      + */ + class Note { + guid: string; + title: string; + content: string; + contentHash: string; + contentLength: number; + created: number; + updated: number; + deleted: number; + active: boolean; + updateSequenceNum: number; + notebookGuid: string; + tagGuids: string[]; + resources: Resource[]; + attributes: NoteAttributes; + tagNames: string[]; + + constructor(args?: { guid?: string; title?: string; content?: string; contentHash?: string; contentLength?: number; created?: number; updated?: number; deleted?: number; active?: boolean; updateSequenceNum?: number; notebookGuid?: string; tagGuids?: string[]; resources?: Resource[]; attributes?: NoteAttributes; tagNames?: string[]; }); + } + + /** + * If a Notebook has been opened to the public, the Notebook will have a + * reference to one of these structures, which gives the location and optional + * description of the externally-visible public Notebook. + *
      + *
      uri
      + *
      If this field is present, then the notebook is published for + * mass consumption on the Internet under the provided URI, which is + * relative to a defined base publishing URI defined by the service. + * This field can only be modified via the web service GUI ... publishing + * cannot be modified via an offline client. + *
      + * Length: EDAM_PUBLISHING_URI_LEN_MIN - EDAM_PUBLISHING_URI_LEN_MAX + *
      + * Regex: EDAM_PUBLISHING_URI_REGEX + *
      + * + *
      order
      + *
      When the notes are publicly displayed, they will be sorted + * based on the requested criteria. + *
      + * + *
      ascending
      + *
      If this is set to true, then the public notes will be + * displayed in ascending order (e.g. from oldest to newest). Otherwise, + * the notes will be displayed in descending order (e.g. newest to oldest). + *
      + * + *
      publicDescription
      + *
      This field may be used to provide a short + * description of the notebook, which may be displayed when (e.g.) the + * notebook is shown in a public view. Can't begin or end with a space. + *
      + * Length: EDAM_PUBLISHING_DESCRIPTION_LEN_MIN - + * EDAM_PUBLISHING_DESCRIPTION_LEN_MAX + *
      + * Regex: EDAM_PUBLISHING_DESCRIPTION_REGEX + *
      + * + *
      + */ + class Publishing { + uri: string; + order: NoteSortOrder; + ascending: boolean; + publicDescription: string; + + constructor(args?: { uri?: string; order?: NoteSortOrder; ascending?: boolean; publicDescription?: string; }); + } + + /** + * If a Notebook contained in an Evernote Business account has been published + * the to business library, the Notebook will have a reference to one of these + * structures, which specifies how the Notebook will be represented in the + * library. + * + *
      + *
      notebookDescription
      + *
      A short description of the notebook's content that will be displayed + * in the business library user interface. The description may not begin + * or end with whitespace. + *
      + * Length: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MIN - + * EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_LEN_MAX + *
      + * Regex: EDAM_BUSINESS_NOTEBOOK_DESCRIPTION_REGEX + *
      + * + *
      privilege
      + *
      The privileges that will be granted to users who join the notebook through + * the business library. + *
      + * + *
      recommended
      + *
      Whether the notebook should be "recommended" when displayed in the business + * library user interface. + *
      + *
      + */ + class BusinessNotebook { + notebookDescription: string; + privilege: SharedNotebookPrivilegeLevel; + recommended: boolean; + + constructor(args?: { notebookDescription?: string; privilege?: SharedNotebookPrivilegeLevel; recommended?: boolean; }); + } + + /** + * A structure defining the scope of a SavedSearch. + * + *
      + *
      includeAccount
      + *
      The search should include notes from the account that contains the SavedSearch.
      + * + *
      includePersonalLinkedNotebooks
      + *
      The search should include notes within those shared notebooks + * that the user has joined that are NOT business notebooks.
      + * + *
      includeBusinessLinkedNotebooks
      + *
      The search should include notes within those shared notebooks + * that the user has joined that are business notebooks in the business that + * the user is currently a member of.
      + *
      + */ + class SavedSearchScope { + includeAccount: boolean; + includePersonalLinkedNotebooks: boolean; + includeBusinessLinkedNotebooks: boolean; + + constructor(args?: { includeAccount?: boolean; includePersonalLinkedNotebooks?: boolean; includeBusinessLinkedNotebooks?: boolean; }); + } + + /** + * A named search associated with the account that can be quickly re-used. + *
      + *
      guid
      + *
      The unique identifier of this search. Will be set by the + * service, so may be omitted by the client when creating. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      name
      + *
      The name of the saved search to display in the GUI. The + * account may only contain one search with a given name (case-insensitive + * compare). Can't begin or end with a space. + *
      + * Length: EDAM_SAVED_SEARCH_NAME_LEN_MIN - EDAM_SAVED_SEARCH_NAME_LEN_MAX + *
      + * Regex: EDAM_SAVED_SEARCH_NAME_REGEX + *
      + * + *
      query
      + *
      A string expressing the search to be performed. + *
      + * Length: EDAM_SAVED_SEARCH_QUERY_LEN_MIN - EDAM_SAVED_SEARCH_QUERY_LEN_MAX + *
      + * + *
      format
      + *
      The format of the query string, to determine how to parse + * and process it. + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      scope
      + *

      Specifies the set of notes that should be included in the search, if + * possible.

      + *

      Clients are expected to search as much of the desired scope as possible, + * with the understanding that a given client may not be able to cover the full + * specified scope. For example, when executing a search that includes notes in both + * the owner's account and business notebooks, a mobile client may choose to only + * search within the user's account because it is not capable of searching both + * scopes simultaneously. When a search across multiple scopes is not possible, + * a client may choose which scope to search based on the current application + * context. If a client cannot search any of the desired scopes, it should refuse + * to execute the search.

      + *
      + *
      + */ + class SavedSearch { + guid: string; + name: string; + query: string; + format: QueryFormat; + updateSequenceNum: number; + scope: SavedSearchScope; + + constructor(args?: { guid?: string; name?: string; query?: string; format?: QueryFormat; updateSequenceNum?: number; scope?: SavedSearchScope; }); + } + + /** + * Settings meant for the recipient of a shared notebook, such as + * for indicating which types of notifications the recipient wishes + * for reminders, etc. + * + * The reminderNotifyEmail and reminderNotifyInApp fields have a + * 3-state read value but a 2-state write value. On read, it is + * possible to observe "unset", true, or false. The initial state is + * "unset". When you choose to set a value, you may set it to either + * true or false, but you cannot unset the value. Once one of these + * members has a true/false value, it will always have a true/false + * value. + * + *
      + *
      reminderNotifyEmail
      + *
      Indicates that the user wishes to receive daily e-mail notifications + * for reminders associated with the shared notebook. This may be + * true only for business notebooks that belong to the business of + * which the user is a member. You may only set this value on a + * notebook in your business.
      + *
      reminderNotifyInApp
      + *
      Indicates that the user wishes to receive notifications for + * reminders by applications that support providing such + * notifications. The exact nature of the notification is defined + * by the individual applications.
      + *
      + * + */ + class SharedNotebookRecipientSettings { + reminderNotifyEmail: boolean; + reminderNotifyInApp: boolean; + + constructor(args?: { reminderNotifyEmail?: boolean; reminderNotifyInApp?: boolean; }); + } + + /** + * Shared notebooks represent a relationship between a notebook and a single + * share invitation recipient. + *
      + *
      id
      + *
      the primary identifier of the share
      + * + *
      userId
      + *
      the user id of the owner of the notebook
      + * + *
      notebookGuid
      + *
      the GUID of the associated notebook shared.
      + * + *
      email
      + *
      the email address of the recipient - used by the notebook + * owner to identify who they shared with.
      + * + *
      notebookModifiable
      + *
      (DEPRECATED) a flag indicating the share is read/write -otherwise it's read + * only. This field is deprecated in favor of the new "privilege" field.
      + * + *
      requireLogin
      + *
      (DEPRECATED) indicates that a user must login to access the share. This + * field is deprecated and will be "true" for all new shared notebooks. It + * is read-only and ignored when creating or modifying a shared notebook, + * except that a shared notebook can be modified to require login. + * See "allowPreview" for information on privileges and shared notebooks.
      + * + *
      serviceCreated
      + *
      the date the owner first created the share with the specific email + * address
      + * + *
      serviceUpdated
      + *
      the date the shared notebook was last updated on the service. This + * will be updated when authenticateToSharedNotebook is called the first + * time with a shared notebook requiring login (i.e. when the username is + * bound to that shared notebook).
      + * + *
      username
      + *
      the username of the user who can access this share. + * Once it's assigned it cannot be changed.
      + * + *
      privilege
      + *
      The privilege level granted to the notebook, activity stream, and + * invitations. See the corresponding enumeration for details.
      + * + *
      allowPreview
      + *
      Whether or not to grant "READ_NOTEBOOK" privilege without an + * authentication token, for authenticateToSharedNotebook(...). With + * the change to "requireLogin" always being true for new shared + * notebooks, this is the only way to access a shared notebook without + * an authorization token. This setting expires after the first use + * of authenticateToSharedNotebook(...) with a valid authentication + * token.
      + * + *
      recipientSettings
      + *
      Settings intended for use only by the recipient of this shared + * notebook. You should skip setting this value unless you want + * to change the value contained inside the structure, and only if + * you are the recipient.
      + *
      + */ + class SharedNotebook { + id: number; + userId: number; + notebookGuid: string; + email: string; + notebookModifiable: boolean; + requireLogin: boolean; + serviceCreated: number; + serviceUpdated: number; + shareKey: string; + username: string; + privilege: SharedNotebookPrivilegeLevel; + allowPreview: boolean; + recipientSettings: SharedNotebookRecipientSettings; + + constructor(args?: { id?: number; userId?: number; notebookGuid?: string; email?: string; notebookModifiable?: boolean; requireLogin?: boolean; serviceCreated?: number; serviceUpdated?: number; shareKey?: string; username?: string; privilege?: SharedNotebookPrivilegeLevel; allowPreview?: boolean; recipientSettings?: SharedNotebookRecipientSettings; }); + } + + /** + * This structure captures information about the types of operations + * that cannot be performed on a given notebook with a type of + * authenticated access and credentials. The values filled into this + * structure are based on then-current values in the server database + * for shared notebooks and notebook publishing records, as well as + * information related to the authentication token. Information from + * the authentication token includes the application that is accessing + * the server, as defined by the permissions granted by consumer (api) + * key, and the method used to obtain the token, for example via + * authenticateToSharedNotebook, authenticateToBusiness, etc. Note + * that changes to values in this structure that are the result of + * shared notebook or publishing record changes are communicated to + * the client via a change in the notebook USN during sync. It is + * important to use the same access method, parameters, and consumer + * key in order obtain correct results from the sync engine. + * + * The server has the final say on what is allowed as values may + * change between calls to obtain NotebookRestrictions instances + * and to operate on data on the service. + * + * If the following are set and true, then the given restriction is + * in effect, as accessed by the same authentication token from which + * the values were obtained. + * + *
      noReadNotes
      + *
      The client is not able to read notes from the service and + * the notebook is write-only. + *
      + *
      noCreateNotes
      + *
      The client may not create new notes in the notebook. + *
      + *
      noUpdateNotes
      + *
      The client may not update notes currently in the notebook. + *
      + *
      noExpungeNotes
      + *
      The client may not expunge notes currently in the notebook. + *
      + *
      noShareNotes
      + *
      The client may not share notes in the notebook via the + * shareNote method. + *
      + *
      noEmailNotes
      + *
      The client may not e-mail notes via the Evernote service by + * using the emailNote method. + *
      + *
      noSendMessageToRecipients
      + *
      The client may not send messages to the share recipients of + * the notebook. + *
      + *
      noUpdateNotebook
      + *
      The client may not update the Notebook object itself, for + * example, via the updateNotebook method. + *
      + *
      noExpungeNotebook
      + *
      The client may not expunge the Notebook object itself, for + * example, via the expungeNotebook method. + *
      + *
      noSetDefaultNotebook
      + *
      The client may not set this notebook to be the default notebook. + * The caller should leave Notebook.defaultNotebook unset. + *
      + *
      noSetNotebookStack
      + *
      If the client is able to update the Notebook, the Notebook.stack + * value may not be set. + *
      + *
      noPublishToPublic
      + *
      The client may not change the publish the notebook to the public. + * For example, business notebooks may not be shared publicly. + *
      + *
      noPublishToBusinessLibrary
      + *
      The client may not publish the notebook to the business library. + *
      + *
      noCreateTags
      + *
      The client may not complete an operation that results in a new tag + * being created in the owner's account. + *
      + *
      noUpdateTags
      + *
      The client may not update tags in the owner's account. + *
      + *
      noExpungeTags
      + *
      The client may not expunge tags in the owner's account. + *
      + *
      noSetParentTag
      + *
      If the client is able to create or update tags in the owner's account, + * then they will not be able to set the parent tag. Leave the value unset. + *
      + *
      noCreateSharedNotebooks
      + *
      The client is unable to create shared notebooks for the notebook. + *
      + *
      updateWhichSharedNotebookRestrictions
      + *
      Restrictions on which shared notebook instances can be updated. If the + * value is not set or null, then the client can update any of the shared notebooks + * associated with the notebook on which the NotebookRestrictions are defined. + * See the enumeration for further details. + *
      + *
      expungeWhichSharedNotebookRestrictions
      + *
      Restrictions on which shared notebook instances can be expunged. If the + * value is not set or null, then the client can expunge any of the shared notebooks + * associated with the notebook on which the NotebookRestrictions are defined. + * See the enumeration for further details. + *
      + */ + class NotebookRestrictions { + noReadNotes: boolean; + noCreateNotes: boolean; + noUpdateNotes: boolean; + noExpungeNotes: boolean; + noShareNotes: boolean; + noEmailNotes: boolean; + noSendMessageToRecipients: boolean; + noUpdateNotebook: boolean; + noExpungeNotebook: boolean; + noSetDefaultNotebook: boolean; + noSetNotebookStack: boolean; + noPublishToPublic: boolean; + noPublishToBusinessLibrary: boolean; + noCreateTags: boolean; + noUpdateTags: boolean; + noExpungeTags: boolean; + noSetParentTag: boolean; + noCreateSharedNotebooks: boolean; + updateWhichSharedNotebookRestrictions: SharedNotebookInstanceRestrictions; + expungeWhichSharedNotebookRestrictions: SharedNotebookInstanceRestrictions; + + constructor(args?: { noReadNotes?: boolean; noCreateNotes?: boolean; noUpdateNotes?: boolean; noExpungeNotes?: boolean; noShareNotes?: boolean; noEmailNotes?: boolean; noSendMessageToRecipients?: boolean; noUpdateNotebook?: boolean; noExpungeNotebook?: boolean; noSetDefaultNotebook?: boolean; noSetNotebookStack?: boolean; noPublishToPublic?: boolean; noPublishToBusinessLibrary?: boolean; noCreateTags?: boolean; noUpdateTags?: boolean; noExpungeTags?: boolean; noSetParentTag?: boolean; noCreateSharedNotebooks?: boolean; updateWhichSharedNotebookRestrictions?: SharedNotebookInstanceRestrictions; expungeWhichSharedNotebookRestrictions?: SharedNotebookInstanceRestrictions; }); + } + + /** + * A unique container for a set of notes. + *
      + *
      guid
      + *
      The unique identifier of this notebook. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      name
      + *
      A sequence of characters representing the name of the + * notebook. May be changed by clients, but the account may not contain two + * notebooks with names that are equal via a case-insensitive comparison. + * Can't begin or end with a space. + *
      + * Length: EDAM_NOTEBOOK_NAME_LEN_MIN - EDAM_NOTEBOOK_NAME_LEN_MAX + *
      + * Regex: EDAM_NOTEBOOK_NAME_REGEX + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      defaultNotebook
      + *
      If true, this notebook should be used for new notes + * whenever the user has not (or cannot) specify a desired target notebook. + * For example, if a note is submitted via SMTP email. + * The service will maintain at most one defaultNotebook per account. + * If a second notebook is created or updated with defaultNotebook set to + * true, the service will automatically update the prior notebook's + * defaultNotebook field to false. If the default notebook is deleted + * (i.e. "active" set to false), the "defaultNotebook" field will be + * set to false by the service. If the account has no default notebook + * set, the service will use the most recent notebook as the default. + *
      + * + *
      serviceCreated
      + *
      The time when this notebook was created on the + * service. This will be set on the service during creation, and the service + * will provide this value when it returns a Notebook to a client. + * The service will ignore this value if it is sent by clients. + *
      + * + *
      serviceUpdated
      + *
      The time when this notebook was last modified on the + * service. This will be set on the service during creation, and the service + * will provide this value when it returns a Notebook to a client. + * The service will ignore this value if it is sent by clients. + *
      + * + *
      publishing
      + *
      If the Notebook has been opened for public access, or + * business users shared with their business (i.e. if 'published' is + * set to true), then this will point to the set of publishing + * information for the Notebook (URI, description, etc.). A + * Notebook cannot be published without providing this information, + * but it will persist for later use if publishing is ever disabled + * on the Notebook. Clients that do not wish to change the + * publishing behavior of a Notebook should not set this value when + * calling NoteStore.updateNotebook(). + *
      + * + *
      published
      + *
      If this is set to true, then the Notebook will be + * accessible either to the public, or for business users to their business, + * via the 'publishing' specification, which must also be set. If this is set + * to false, the Notebook will not be available to the public (or business). + * Clients that do not wish to change the publishing behavior of a Notebook + * should not set this value when calling NoteStore.updateNotebook(). + *
      + * + *
      stack
      + *
      If this is set, then the notebook is visually contained within a stack + * of notebooks with this name. All notebooks in the same account with the + * same 'stack' field are considered to be in the same stack. + * Notebooks with no stack set are "top level" and not contained within a + * stack. + *
      + * + *
      sharedNotebookIds
      + *
      DEPRECATED - replaced by sharedNotebooks.
      + * + *
      sharedNotebooks
      + *
      The list of recipients to whom this notebook has been shared + * (one SharedNotebook object per recipient email address). This field will + * be unset if you do not have permission to access this data. If you are + * accessing the notebook as the owner or via a shared notebook that is + * modifiable, then you have access to this data and the value will be set. + * This field is read-only. Clients may not make changes to shared notebooks + * via this field. + *
      + * + *
      businessNotebook
      + *
      If the notebook is part of a business account and has been published to the + * business library, this will contain information for the library listing. + * The presence or absence of this field is not a reliable test of whether a given + * notebook is in fact a business notebook - the field is only used when a notebook is or + * has been published to the business library. + *
      + * + *
      contact
      + *
      Intended for use with Business accounts, this field identifies the user who + * has been designated as the "contact". For notebooks created in business + * accounts, the server will automatically set this value to the user who created + * the notebook unless Notebook.contact.username has been set, in which that value + * will be used. When updating a notebook, it is common to leave Notebook.contact + * field unset, indicating that no change to the value is being requested and that + * the existing value, if any, should be preserved. + *
      + * + *
      + */ + class Notebook { + guid: string; + name: string; + updateSequenceNum: number; + defaultNotebook: boolean; + serviceCreated: number; + serviceUpdated: number; + publishing: Publishing; + published: boolean; + stack: string; + sharedNotebookIds: number[]; + sharedNotebooks: SharedNotebook[]; + businessNotebook: BusinessNotebook; + contact: User; + restrictions: NotebookRestrictions; + + constructor(args?: { guid?: string; name?: string; updateSequenceNum?: number; defaultNotebook?: boolean; serviceCreated?: number; serviceUpdated?: number; publishing?: Publishing; published?: boolean; stack?: string; sharedNotebookIds?: number[]; sharedNotebooks?: SharedNotebook[]; businessNotebook?: BusinessNotebook; contact?: User; restrictions?: NotebookRestrictions; }); + } + + /** + * A link in an users account that refers them to a public or individual share in + * another user's account. + * + *
      + *
      shareName
      + *
      the display name of the shared notebook. + * The link owner can change this.
      + * + *
      username
      + *
      the username of the user who owns the shared or public notebook
      + * + *
      shardId
      + *
      the shard ID of the notebook if the notebook is not public + * + *
      shareKey
      + *
      the secret key that provides access to the shared notebook
      + * + *
      uri
      + *
      the identifier of the public notebook
      + * + *
      guid
      + *
      The unique identifier of this linked notebook. Will be set whenever + * a linked notebook is retrieved from the service, but may be null when a client + * is creating a linked notebook. + *
      + * Length: EDAM_GUID_LEN_MIN - EDAM_GUID_LEN_MAX + *
      + * Regex: EDAM_GUID_REGEX + *
      + * + *
      updateSequenceNum
      + *
      A number identifying the last transaction to + * modify the state of this object. The USN values are sequential within an + * account, and can be used to compare the order of modifications within the + * service. + *
      + * + *
      noteStoreUrl
      + *
      + * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that notebook's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
      + * + *
      webApiUrlPrefix:
      + *
      + * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
      + * + *
      stack
      + *
      If this is set, then the notebook is visually contained within a stack + * of notebooks with this name. All notebooks in the same account with the + * same 'stack' field are considered to be in the same stack. + * Notebooks with no stack set are "top level" and not contained within a + * stack. The link owner can change this and this field is for the benefit + * of the link owner. + *
      + * + *
      businessId
      + *
      If set, this will be the unique identifier for the business that owns + * the notebook to which the linked notebook refers. + * + *
      + */ + class LinkedNotebook { + shareName: string; + username: string; + shardId: string; + shareKey: string; + uri: string; + guid: string; + updateSequenceNum: number; + noteStoreUrl: string; + webApiUrlPrefix: string; + stack: string; + businessId: number; + + constructor(args?: { shareName?: string; username?: string; shardId?: string; shareKey?: string; uri?: string; guid?: string; updateSequenceNum?: number; noteStoreUrl?: string; webApiUrlPrefix?: string; stack?: string; businessId?: number; }); + } + + /** + * A structure that describes a notebook or a user's relationship with + * a notebook. NotebookDescriptor is expected to remain a lighter-weight + * structure when compared to Notebook. + *
      + *
      guid
      + *
      The unique identifier of the notebook. + *
      + * + *
      notebookDisplayName
      + *
      A sequence of characters representing the name of the + * notebook. + *
      + * + *
      contactName
      + *
      The User.name value of the notebook's "contact". + *
      + * + *
      hasSharedNotebook
      + *
      Whether a SharedNotebook record exists between the calling user and this + * notebook. + *
      + * + *
      joinedUserCount
      + *
      The number of users who have joined this notebook. + *
      + * + *
      + */ + class NotebookDescriptor { + guid: string; + notebookDisplayName: string; + contactName: string; + hasSharedNotebook: boolean; + joinedUserCount: number; + + constructor(args?: { guid?: string; notebookDisplayName?: string; contactName?: string; hasSharedNotebook?: boolean; joinedUserCount?: number; }); + } + + /** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the user has classified a note as being a non-recipe. + */ + var CLASSIFICATION_RECIPE_USER_NON_RECIPE: string; + + /** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the user has classified a note as being a recipe. + */ + var CLASSIFICATION_RECIPE_USER_RECIPE: string; + + /** + * A value for the "recipe" key in the "classifications" map in NoteAttributes + * that indicates the Evernote service has classified a note as being a recipe. + */ + var CLASSIFICATION_RECIPE_SERVICE_RECIPE: string; + + /** + * Standardized value for the 'source' NoteAttribute for notes that + * were clipped from the web in some manner. + */ + var EDAM_NOTE_SOURCE_WEB_CLIP: string; + + /** + * Standardized value for the 'source' NoteAttribute for notes that + * were clipped from an email message. + */ + var EDAM_NOTE_SOURCE_MAIL_CLIP: string; + + /** + * Standardized value for the 'source' NoteAttribute for notes that + * were created via email sent to Evernote's email interface. + */ + var EDAM_NOTE_SOURCE_MAIL_SMTP_GATEWAY: string; + /** + * Service: UserStore + *

      + * The UserStore service is primarily used by EDAM clients to establish + * authentication via username and password over a trusted connection (e.g. + * SSL). A client's first call to this interface should be checkVersion() to + * ensure that the client's software is up to date. + *

      + * All calls which require an authenticationToken may throw an + * EDAMUserException for the following reasons: + *
        + *
      • AUTH_EXPIRED "authenticationToken" - token has expired + *
      • BAD_DATA_FORMAT "authenticationToken" - token is malformed + *
      • DATA_REQUIRED "authenticationToken" - token is empty + *
      • INVALID_AUTH "authenticationToken" - token signature is invalid + *
      + */ + class UserStoreClient { + seqid: number; + + /** + * This should be the first call made by a client to the EDAM service. It + * tells the service what protocol version is used by the client. The + * service will then return true if the client is capable of talking to + * the service, and false if the client's protocol version is incompatible + * with the service, so the client must upgrade. If a client receives a + * false value, it should report the incompatibility to the user and not + * continue with any more EDAM requests (UserStore or NoteStore). + * + * @param clientName + * This string provides some information about the client for + * tracking/logging on the service. It should provide information about + * the client's software and platform. The structure should be: + * application/version; platform/version; [ device/version ] + * E.g. "Evernote Windows/3.0.1; Windows/XP SP3". + * + * @param edamVersionMajor + * This should be the major protocol version that was compiled by the + * client. This should be the current value of the EDAM_VERSION_MAJOR + * constant for the client. + * + * @param edamVersionMinor + * This should be the major protocol version that was compiled by the + * client. This should be the current value of the EDAM_VERSION_MINOR + * constant for the client. + */ + checkVersion(clientName: string, edamVersionMajor: number, edamVersionMinor: number, cb: Callback): void; + + /** + * This provides bootstrap information to the client. Various bootstrap + * profiles and settings may be used by the client to configure itself. + * + * @param locale + * The client's current locale, expressed in language[_country] + * format. E.g., "en_US". See ISO-639 and ISO-3166 for valid + * language and country codes. + * + * @return + * The bootstrap information suitable for this client. + */ + getBootstrapInfo(locale: string, cb: Callback): void; + + /** + * Revoke an existing long lived authentication token. This can be used to + * revoke OAuth tokens or tokens created by calling authenticateLongSession, + * and allows a user to effectively log out of Evernote from the perspective + * of the application that holds the token. The authentication token that is + * passed is immediately revoked and may not be used to call any authenticated + * EDAM function. + * + * @param authenticationToken the authentication token to revoke. + * + * @throws EDAMUserException
        + *
      • DATA_REQUIRED "authenticationToken" - no authentication token provided + *
      • BAD_DATA_FORMAT "authenticationToken" - the authentication token is not well formed + *
      • INVALID_AUTH "authenticationToken" - the authentication token is invalid + *
      • AUTH_EXPIRED "authenticationToken" - the authentication token is expired or + * is already revoked. + *
      + */ + revokeLongSession(cb: Callback): void; + + /** + * This is used to take an existing authentication token that grants access + * to an individual user account (returned from 'authenticate', + * 'authenticateLongSession' or an OAuth authorization) and obtain an additional + * authentication token that may be used to access business notebooks if the user + * is a member of an Evernote Business account. + * + * The resulting authentication token may be used to make NoteStore API calls + * against the business using the NoteStore URL returned in the result. + * + * @param authenticationToken + * The authentication token for the user. This may not be a shared authentication + * token (returned by NoteStore.authenticateToSharedNotebook or + * NoteStore.authenticateToSharedNote) or a business authentication token. + * + * @return + * The result of the authentication, with the token granting access to the + * business in the result's 'authenticationToken' field. The URL that must + * be used to access the business account NoteStore will be returned in the + * result's 'noteStoreUrl' field. The 'User' field will + * not be set in the result. + * + * @throws EDAMUserException
        + *
      • PERMISSION_DENIED "authenticationToken" - the provided authentication token + * is a shared or business authentication token.
      • + *
      • PERMISSION_DENIED "Business" - the user identified by the provided + * authentication token is not currently a member of a business.
      • + *
      • PERMISSION_DENIED "Business.status" - the business that the user is a + * member of is not currently in an active status.
      • + *
      + */ + authenticateToBusiness(cb: Callback): void; + + /** + * Returns the User corresponding to the provided authentication token, + * or throws an exception if this token is not valid. + * The level of detail provided in the returned User structure depends on + * the access level granted by the token, so a web service client may receive + * fewer fields than an integrated desktop client. + */ + getUser(cb: Callback): void; + + /** + * Asks the UserStore about the publicly available location information for + * a particular username. + * + * @throws EDAMUserException
        + *
      • DATA_REQUIRED "username" - username is empty + *
      + */ + getPublicUserInfo(username: string, cb: Callback): void; + + + /** + * Returns the URL that should be used to talk to the NoteStore for the + * account represented by the provided authenticationToken. + * This method isn't needed by most clients, who can retrieve the correct + * NoteStore URL from the AuthenticationResult returned from the authenticate + * or refreshAuthentication calls. This method is typically only needed + * to look up the correct URL for a long-lived session token (e.g. for an + * OAuth web service). + */ + getNoteStoreUrl(cb: Callback): void; + } + /** + * This structure is used to provide publicly-available user information + * about a particular account. + *
      + *
      userId:
      + *
      + * The unique numeric user identifier for the user account. + *
      + *
      shardId:
      + *
      + * DEPRECATED - Client applications should have no need to use this field. + *
      + *
      privilege:
      + *
      + * The privilege level of the account, to determine whether + * this is a Premium or Free account. + *
      + *
      noteStoreUrl:
      + *
      + * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that user's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
      + *
      webApiUrlPrefix:
      + *
      + * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
      + *
      + */ + class PublicUserInfo { + userId: number; + shardId: string; + privilege: PrivilegeLevel; + username: string; + noteStoreUrl: string; + webApiUrlPrefix: string; + + constructor(args?: { userId: number; shardId: string; privilege?: PrivilegeLevel; username?: string; noteStoreUrl?: string; webApiUrlPrefix?: string; }); + } + + /** + * When an authentication (or re-authentication) is performed, this structure + * provides the result to the client. + *
      + *
      currentTime:
      + *
      + * The server-side date and time when this result was + * generated. + *
      + *
      authenticationToken:
      + *
      + * Holds an opaque, ASCII-encoded token that can be + * used by the client to perform actions on a NoteStore. + *
      + *
      expiration:
      + *
      + * Holds the server-side date and time when the + * authentication token will expire. + * This time can be compared to "currentTime" to produce an expiration + * time that can be reconciled with the client's local clock. + *
      + *
      user:
      + *
      + * Holds the information about the account which was + * authenticated if this was a full authentication. May be absent if this + * particular authentication did not require user information. + *
      + *
      publicUserInfo:
      + *
      + * If this authentication result was achieved without full permissions to + * access the full User structure, this field may be set to give back + * a more limited public set of data. + *
      + *
      noteStoreUrl:
      + *
      + * This field will contain the full URL that clients should use to make + * NoteStore requests to the server shard that contains that user's data. + * I.e. this is the URL that should be used to create the Thrift HTTP client + * transport to send messages to the NoteStore service for the account. + *
      + *
      webApiUrlPrefix:
      + *
      + * This field will contain the initial part of the URLs that should be used + * to make requests to Evernote's thin client "web API", which provide + * optimized operations for clients that aren't capable of manipulating + * the full contents of accounts via the full Thrift data model. Clients + * should concatenate the relative path for the various servlets onto the + * end of this string to construct the full URL, as documented on our + * developer web site. + *
      + *
      secondFactorRequired:
      + *
      + * If set to true, this field indicates that the user has enabled two-factor + * authentication and must enter their second factor in order to complete + * authentication. In this case the value of authenticationResult will be + * a short-lived authentication token that may only be used to make a + * subsequent call to completeTwoFactorAuthentication. + *
      + *
      secondFactorDeliveryHint:
      + *
      + * When secondFactorRequired is set to true, this field may contain a string + * describing the second factor delivery method that the user has configured. + * This will typically be an obfuscated mobile device number, such as + * "(xxx) xxx-x095". This string can be displayed to the user to remind them + * how to obtain the required second factor. + * TODO do we need to differentiate between SMS and voice delivery? + *
      + *
      + */ + class AuthenticationResult { + currentTime: number; + authenticationToken: string; + expiration: number; + user: User; + publicUserInfo: PublicUserInfo; + noteStoreUrl: string; + webApiUrlPrefix: string; + secondFactorRequired: boolean; + secondFactorDeliveryHint: string; + + constructor(args?: { currentTime: number; authenticationToken: string; expiration: number; user?: User; publicUserInfo?: PublicUserInfo; noteStoreUrl?: string; webApiUrlPrefix?: string; secondFactorRequired?: boolean; secondFactorDeliveryHint?: string; }); + } + + /** + * This structure describes a collection of bootstrap settings. + *
      + *
      serviceHost:
      + *
      + * The hostname and optional port for composing Evernote web service URLs. + * This URL can be used to access the UserStore and related services, + * but must not be used to compose the NoteStore URL. Client applications + * must handle serviceHost values that include only the hostname + * (e.g. www.evernote.com) or both the hostname and port (e.g. www.evernote.com:8080). + * If no port is specified, or if port 443 is specified, client applications must + * use the scheme "https" when composing URLs. Otherwise, a client must use the + * scheme "http". + *
      + *
      marketingUrl:
      + *
      + * The URL stem for the Evernote corporate marketing website, e.g. http://www.evernote.com. + * This stem can be used to compose website URLs. For example, the URL of the Evernote + * Trunk is composed by appending "/about/trunk/" to the value of marketingUrl. + *
      + *
      supportUrl:
      + *
      + * The full URL for the Evernote customer support website, e.g. https://support.evernote.com. + *
      + *
      accountEmailDomain:
      + *
      + * The domain used for an Evernote user's incoming email address, which allows notes to + * be emailed into an account. E.g. m.evernote.com. + *
      + *
      enableFacebookSharing:
      + *
      + * Whether the client application should enable sharing of notes on Facebook. + *
      + *
      enableGiftSubscriptions:
      + *
      + * Whether the client application should enable gift subscriptions. + *
      + *
      enableSupportTickets:
      + *
      + * Whether the client application should enable in-client creation of support tickets. + *
      + *
      enableSharedNotebooks:
      + *
      + * Whether the client application should enable shared notebooks. + *
      + *
      enableSingleNoteSharing:
      + *
      + * Whether the client application should enable single note sharing. + *
      + *
      enableSponsoredAccounts:
      + *
      + * Whether the client application should enable sponsored accounts. + *
      + *
      enableTwitterSharing:
      + *
      + * Whether the client application should enable sharing of notes on Twitter. + *
      + *
      + */ + class BootstrapSettings { + serviceHost: string; + marketingUrl: string; + supportUrl: string; + accountEmailDomain: string; + enableFacebookSharing: boolean; + enableGiftSubscriptions: boolean; + enableSupportTickets: boolean; + enableSharedNotebooks: boolean; + enableSingleNoteSharing: boolean; + enableSponsoredAccounts: boolean; + enableTwitterSharing: boolean; + enableLinkedInSharing: boolean; + enablePublicNotebooks: boolean; + + constructor(args?: { serviceHost: string; marketingUrl: string; supportUrl: string; accountEmailDomain: string; enableFacebookSharing?: boolean; enableGiftSubscriptions?: boolean; enableSupportTickets?: boolean; enableSharedNotebooks?: boolean; enableSingleNoteSharing?: boolean; enableSponsoredAccounts?: boolean; enableTwitterSharing?: boolean; enableLinkedInSharing?: boolean; enablePublicNotebooks?: boolean; }); + } + + /** + * This structure describes a collection of bootstrap settings. + *
      + *
      name:
      + *
      + * The unique name of the profile, which is guaranteed to remain consistent across + * calls to getBootstrapInfo. + *
      + *
      settings:
      + *
      + * The settings for this profile. + *
      + *
      + */ + class BootstrapProfile { + name: string; + settings: BootstrapSettings; + + constructor(args?: { name: string; settings: BootstrapSettings; }); + } + + /** + * This structure describes a collection of bootstrap profiles. + *
      + *
      profiles:
      + *
      + * List of one or more bootstrap profiles, in descending + * preference order. + *
      + *
      + */ + class BootstrapInfo { + profiles: BootstrapProfile[]; + + constructor(args?: { profiles: BootstrapProfile[]; }); + } + + /** + * The major version number for the current revision of the EDAM protocol. + * Clients pass this to the service using UserStore.checkVersion at the + * beginning of a session to confirm that they are not out of date. + */ + var EDAM_VERSION_MAJOR: number; + + /** + * The minor version number for the current revision of the EDAM protocol. + * Clients pass this to the service using UserStore.checkVersion at the + * beginning of a session to confirm that they are not out of date. + */ + var EDAM_VERSION_MINOR: number; + + } +} diff --git a/thrift/thrift-tests.ts b/thrift/thrift-tests.ts new file mode 100644 index 000000000..abe39678a --- /dev/null +++ b/thrift/thrift-tests.ts @@ -0,0 +1,10 @@ +/// +/// + +// Currently, the thrift bindings are minimal just to support the thrift generated +// evernote bindings. Add more tests if you flesh out and plan to use the thrift +// bindings more deeply. + +import evernote = require("evernote"); + +1 + 1; diff --git a/thrift/thrift.d.ts b/thrift/thrift.d.ts new file mode 100644 index 000000000..d0232b40d --- /dev/null +++ b/thrift/thrift.d.ts @@ -0,0 +1,281 @@ +// Type definitions for thrift 0.9.2 +// Project: https://www.npmjs.com/package/thrift +// Definitions by: Zachary Collins +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +declare module "thrift" { + export module Thrift { + /** + * Thrift IDL type string to Id mapping. + * @property {number} STOP - End of a set of fields. + * @property {number} VOID - No value (only legal for return types). + * @property {number} BOOL - True/False integer. + * @property {number} BYTE - Signed 8 bit integer. + * @property {number} I08 - Signed 8 bit integer. + * @property {number} DOUBLE - 64 bit IEEE 854 floating point. + * @property {number} I16 - Signed 16 bit integer. + * @property {number} I32 - Signed 32 bit integer. + * @property {number} I64 - Signed 64 bit integer. + * @property {number} STRING - Array of bytes representing a string of characters. + * @property {number} UTF7 - Array of bytes representing a string of UTF7 encoded characters. + * @property {number} STRUCT - A multifield type. + * @property {number} MAP - A collection type (map/associative-array/dictionary). + * @property {number} SET - A collection type (unordered and without repeated values). + * @property {number} LIST - A collection type (unordered). + * @property {number} UTF8 - Array of bytes representing a string of UTF8 encoded characters. + * @property {number} UTF16 - Array of bytes representing a string of UTF16 encoded characters. + */ + interface Type { + 'STOP': number; + 'VOID': number; + 'BOOL': number; + 'BYTE': number; + 'I08': number; + 'DOUBLE': number; + 'I16': number; + 'I32': number; + 'I64': number; + 'STRING': number; + 'UTF7': number; + 'STRUCT': number; + 'MAP': number; + 'SET': number; + 'LIST': number; + 'UTF8': number; + 'UTF16': number; + } + var Type: Type; + + /** + * Thrift RPC message type string to Id mapping. + * @property {number} CALL - RPC call sent from client to server. + * @property {number} REPLY - RPC call normal response from server to client. + * @property {number} EXCEPTION - RPC call exception response from server to client. + * @property {number} ONEWAY - Oneway RPC call from client to server with no response. + */ + interface MessageType { + 'CALL': number; + 'REPLY': number; + 'EXCEPTION': number; + 'ONEWAY': number; + } + var MessageType: MessageType; + + /** + * Utility function returning the count of an object's own properties. + * @param {object} obj - Object to test. + * @returns {number} number of object's own properties + */ + function objectLength(obj: Object): number; + + /** + * Utility function to establish prototype inheritance. + * @param {function} constructor - Contstructor function to set as derived. + * @param {function} superConstructor - Contstructor function to set as base. + * @param {string} [name] - Type name to set as name property in derived prototype. + */ + function inherits(constructor: Function, superConstructor: Function, name?: string): void; + + /** + * TException is the base class for all Thrift exceptions types. + */ + class TException implements Error { + name: string; + message: string; + + /** + * Initializes a Thrift TException instance. + * @param {string} message - The TException message (distinct from the Error message). + */ + constructor(message: string); + + /** + * Returns the message set on the exception. + * @returns {string} exception message + */ + getMessage(): string; + } + + /** + * Thrift Application Exception type string to Id mapping. + * @property {number} UNKNOWN - Unknown/undefined. + * @property {number} UNKNOWN_METHOD - Client attempted to call a method unknown to the server. + * @property {number} INVALID_MESSAGE_TYPE - Client passed an unknown/unsupported MessageType. + * @property {number} WRONG_METHOD_NAME - Unused. + * @property {number} BAD_SEQUENCE_ID - Unused in Thrift RPC, used to flag proprietary sequence number errors. + * @property {number} MISSING_RESULT - Raised by a server processor if a handler fails to supply the required return result. + * @property {number} INTERNAL_ERROR - Something bad happened. + * @property {number} PROTOCOL_ERROR - The protocol layer failed to serialize or deserialize data. + * @property {number} INVALID_TRANSFORM - Unused. + * @property {number} INVALID_PROTOCOL - The protocol (or version) is not supported. + * @property {number} UNSUPPORTED_CLIENT_TYPE - Unused. + */ + interface TApplicationExceptionType { + 'UNKNOWN': number; + 'UNKNOWN_METHOD': number; + 'INVALID_MESSAGE_TYPE': number; + 'WRONG_METHOD_NAME': number; + 'BAD_SEQUENCE_ID': number; + 'MISSING_RESULT': number; + 'INTERNAL_ERROR': number; + 'PROTOCOL_ERROR': number; + 'INVALID_TRANSFORM': number; + 'INVALID_PROTOCOL': number; + 'UNSUPPORTED_CLIENT_TYPE': number; + } + var TApplicationExceptionType: TApplicationExceptionType; + + /** + * TApplicationException is the exception class used to propagate exceptions from an RPC server back to a calling client. + */ + class TApplicationException extends TException { + message: string; + code: number; + + /** + * Initializes a Thrift TApplicationException instance. + * @param {string} message - The TApplicationException message (distinct from the Error message). + * @param {Thrift.TApplicationExceptionType} [code] - The TApplicationExceptionType code. + */ + constructor(message: string, code?: number); + + /** + * Read a TApplicationException from the supplied protocol. + * @param {object} input - The input protocol to read from. + */ + read(input: Object): void; + + /** + * Write a TApplicationException to the supplied protocol. + * @param {object} output - The output protocol to write to. + */ + write(output: Object): void; + + /** + * Returns the application exception code set on the exception. + * @returns {Thrift.TApplicationExceptionType} exception code + */ + getCode(): number; + } + + /** + * The Apache Thrift Transport layer performs byte level I/O between RPC + * clients and servers. The JavaScript Transport object type uses Http[s]/XHR and is + * the sole browser based Thrift transport. Target servers must implement the http[s] + * transport (see: node.js example server). + */ + class TXHRTransport { + url: string; + wpos: number; + rpos: number; + useCORS: any; + send_buf: string; + recv_buf: string; + + /** + * If you do not specify a url then you must handle XHR operations on + * your own. This type can also be constructed using the Transport alias + * for backward compatibility. + * @param {string} [url] - The URL to connect to. + * @param {object} [options] - Options. + */ + constructor(url?: string, options?: Object); + + /** + * Gets the browser specific XmlHttpRequest Object. + * @returns {object} the browser XHR interface object + */ + getXmlHttpRequestObject(): Object; + + /** + * Sends the current XRH request if the transport was created with a URL and + * the async parameter if false. If the transport was not created with a URL + * or the async parameter is True or the URL is an empty string, the current + * send buffer is returned. + * @param {object} async - If true the current send buffer is returned. + * @param {function} callback - Optional async completion callback. + * @returns {undefined|string} Nothing or the current send buffer. + */ + flush(async: any, callback?: Function): string; + + /** + * Creates a jQuery XHR object to be used for a Thrift server call. + * @param {object} client - The Thrift Service client object generated by the IDL compiler. + * @param {object} postData - The message to send to the server. + * @param {function} args - The function to call if the request succeeds. + * @param {function} recv_method - The Thrift Service Client receive method for the call. + * @returns {object} A new jQuery XHR object. + */ + jqRequest(client: Object, postData: any, args: Function, recv_method: Function): Object; + + /** + * Sets the buffer to use when receiving server responses. + * @param {string} buf - The buffer to receive server responses. + */ + setRecvBuffer(buf: string): void; + + /** + * Returns true if the transport is open, in browser based JavaScript + * this function always returns true. + * @returns {boolean} Always True. + */ + isOpen(): boolean; + + /** + * Opens the transport connection, in browser based JavaScript + * this function is a nop. + */ + open(): void; + + /** + * Closes the transport connection, in browser based JavaScript + * this function is a nop. + */ + close(): void; + + /** + * Returns the specified number of characters from the response + * buffer. + * @param {number} len - The number of characters to return. + * @returns {string} Characters sent by the server. + */ + read(len: number): string; + + /** + * Returns the entire response buffer. + * @returns {string} Characters sent by the server. + */ + readAll(): string; + + /** + * Sets the send buffer to buf. + * @param {string} buf - The buffer to send. + */ + write(buf: string): void; + + /** + * Returns the send buffer. + * @returns {string} The send buffer. + */ + getSendBuffer(): string; + } + } +}