From 4015f5b4983c8a4590aa71776880d8bc42c7918d Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Tue, 10 Jul 2018 14:32:26 +0200 Subject: js: documentation -- * Fixed errors: - src/Message.js post(): Set chunksize to defined default value instead of hardcoded - src/Keys.js: added getHasSecret() to refreshKey operation. * Reviewed and updated the documentation * non-documentation changes which do not affect functionality: - src/Errors: disabled a console.warn that is only useful for debugging - helpers.js: renamed "string" to "value" in isFingerprint and isLongId to avoid confusion - src/Keyring: prepare_sync, search are both explicitly set to false by default --- lang/js/src/permittedOperations.js | 43 ++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'lang/js/src/permittedOperations.js') diff --git a/lang/js/src/permittedOperations.js b/lang/js/src/permittedOperations.js index e7f53965..0b9c891f 100644 --- a/lang/js/src/permittedOperations.js +++ b/lang/js/src/permittedOperations.js @@ -22,27 +22,30 @@ */ /** - * Definition of the possible interactions with gpgme-json. - * operation: - required: Array - name The name of the property - allowed: Array of allowed types. Currently accepted values: - ['number', 'string', 'boolean', 'Uint8Array'] - array_allowed: Boolean. If the value can be an array of the above - allowed_data: If present, restricts to the given value - optional: Array - see 'required', with these parameters not being mandatory for a - complete message - pinentry: boolean If a pinentry dialog is expected, and a timeout of - 5000 ms would be too short - answer: - type: - the properties expected and their type, eg: {'data':'string'} - } - } -*/ + * @typedef {Object} messageProperty + * A message Property is defined by it's key. + * @property {Array} allowed Array of allowed types. + * Currently accepted values are 'number', 'string', 'boolean'. + * @property {Boolean} array_allowed If the value can be an array of types + * defined in allowed + * @property {} allowed_data (optional) restricts to the given values + */ +/** + * Definition of the possible interactions with gpgme-json. + * @param {Object} operation Each operation is named by a key and contains + * the following properties: + * @property {messageProperty} required An object with all required parameters + * @property {messageProperty} optional An object with all optional parameters + * @property {Boolean} pinentry (optional) If true, a password dialog is + * expected, thus a connection tuimeout is not advisable + * @property {Object} answer The definition on what to expect as answer, if the + * answer is not an error + * @property {Array} answer.type the type(s) as reported by gpgme-json. + * @property {Object} answer.data key-value combinations of expected properties + * of an answer and their type ('boolean', 'string', object) + @const +*/ export const permittedOperations = { encrypt: { pinentry: true, //TODO only with signing_keys -- cgit v1.2.3